You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by kb...@apache.org on 2020/06/03 07:30:15 UTC

[atlas] branch branch-2.0 updated (98e3d12 -> 445c383)

This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a change to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git.


    from 98e3d12  Revert "ATLAS-3758: support sort params in FreeTextSearchProcessor - #2"
     new cc6cac3  ATLAS-3604: Data Migration status display.
     new 66e0042  ATLAS-3705 : UI : Remove notification section from Server Statistics: migration page
     new 445c383  ATLAS-3761:- UI: Show progress bar for migration page

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 dashboardv2/gruntfile.js                           |   4 +-
 .../public/css/scss/migration-style.scss           |  16 +--
 dashboardv2/public/css/scss/stats.scss             |  59 ++++++++
 dashboardv2/public/js/migration.js                 | 159 +++++++++++++++++++++
 .../MigrationView_tmpl.html}                       |   4 +-
 .../public/js/templates/site/Statistics_tmpl.html  |  15 +-
 dashboardv2/public/js/utils/Helper.js              | 137 +++++++++---------
 .../public/js/utils/MigrationEnums.js              |  21 +--
 .../public/js/views/migration/MigrationView.js     |  68 +++++++++
 dashboardv2/public/js/views/site/Statistics.js     | 150 +++++++++++++++----
 dashboardv2/public/migration-status.html.tpl       |  61 ++++++++
 .../atlas/web/filters/ActiveServerFilter.java      |  25 ++++
 .../atlas/web/security/AtlasSecurityConfig.java    |   1 +
 13 files changed, 595 insertions(+), 125 deletions(-)
 copy dashboardv3/public/css/scss/style.scss => dashboardv2/public/css/scss/migration-style.scss (77%)
 create mode 100644 dashboardv2/public/js/migration.js
 copy dashboardv2/public/js/templates/{glossary/TermRelationAttributeLayoutView_tmpl.html => migration/MigrationView_tmpl.html} (93%)
 copy addons/kafka-bridge/src/main/java/org/apache/atlas/kafka/model/KafkaDataTypes.java => dashboardv2/public/js/utils/MigrationEnums.js (77%)
 create mode 100644 dashboardv2/public/js/views/migration/MigrationView.js
 create mode 100644 dashboardv2/public/migration-status.html.tpl


[atlas] 02/03: ATLAS-3705 : UI : Remove notification section from Server Statistics: migration page

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit 66e00427ad3d740243a84d8b905131a07fb74b0b
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Mon Mar 30 14:34:30 2020 +0530

    ATLAS-3705 : UI : Remove notification section from Server Statistics: migration page
    
    (cherry picked from commit e58e7d42b47326feb97779f4e4147c78cefc866c)
---
 dashboardv2/gruntfile.js                           |  1 +
 dashboardv2/public/css/scss/migration-style.scss   | 28 ++++++++++++++++++++++
 dashboardv2/public/css/scss/stats.scss             | 15 ++++++++++++
 .../public/js/templates/site/Statistics_tmpl.html  |  7 ++++--
 .../public/js/views/migration/MigrationView.js     |  2 +-
 dashboardv2/public/js/views/site/Statistics.js     | 22 +++++++++++++----
 dashboardv2/public/migration-status.html.tpl       | 17 +------------
 7 files changed, 69 insertions(+), 23 deletions(-)

diff --git a/dashboardv2/gruntfile.js b/dashboardv2/gruntfile.js
index efb1475..e4d4f5c 100644
--- a/dashboardv2/gruntfile.js
+++ b/dashboardv2/gruntfile.js
@@ -209,6 +209,7 @@ module.exports = function(grunt) {
             build: {
                 files: {
                     [distPath + '/css/style.css']: modulesPath + 'css/scss/style.scss',
+                    [distPath + '/css/migration-style.css']: modulesPath + 'css/scss/migration-style.scss',
                     [distPath + '/css/login.css']: modulesPath + 'css/scss/login.scss'
                 }
             }
diff --git a/dashboardv2/public/css/scss/migration-style.scss b/dashboardv2/public/css/scss/migration-style.scss
new file mode 100644
index 0000000..a54bcef
--- /dev/null
+++ b/dashboardv2/public/css/scss/migration-style.scss
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+@import "__mixin.scss";
+@import "__variable.scss";
+@import "common.scss";
+@import "table.scss";
+@import "form.scss";
+@import "panel.scss";
+@import "loader.scss";
+@import "theme.scss";
+@import "stats.scss";
+@import "override.scss";
\ No newline at end of file
diff --git a/dashboardv2/public/css/scss/stats.scss b/dashboardv2/public/css/scss/stats.scss
index 723b87d..2114117 100644
--- a/dashboardv2/public/css/scss/stats.scss
+++ b/dashboardv2/public/css/scss/stats.scss
@@ -111,4 +111,19 @@
 
         }
     }
+}
+
+.refresh-container {
+    background: white;
+    position: fixed;
+    z-index: 9999;
+    right: 23px;
+    top: 7px;
+    border-radius: 23px;
+
+    .btn {
+        margin: 0px;
+        border-radius: 23px;
+        padding: 10px 10px;
+    }
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/site/Statistics_tmpl.html b/dashboardv2/public/js/templates/site/Statistics_tmpl.html
index 5bf0a9c..ce4b9ee 100644
--- a/dashboardv2/public/js/templates/site/Statistics_tmpl.html
+++ b/dashboardv2/public/js/templates/site/Statistics_tmpl.html
@@ -14,7 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<div class="panel-group server-stats-container statsContainer hide" id="accordion">
+<div class="refresh-container statisticsRefresh hide" data-id="statisticsRefresh">
+    <button type="button" class="btn fa fa-refresh pull-right btn-sm btn-action" title="Refresh Data"></button>
+</div>
+<div class="panel-group server-stats-container statsContainer hide col-md-12" id="accordion">
     <div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="entity">
         <div class="panel-heading" data-toggle="collapse" href="#entityCountCollapse" aria-expanded="true">
             <h4 class="panel-title">
@@ -89,7 +92,7 @@
                     </div>
                 </div>
                 <div class="col-sm-12">
-                    <div class="card-container panel panel-primary">
+                    <div class="card-container panel panel-primary hide" data-id="notificationDetails">
                         <div class="panel-heading">Notification Details</div>
                         <div class="panel-body">
                             <table data-id="offset-card" class="table stat-table notification-table table-striped ">
diff --git a/dashboardv2/public/js/views/migration/MigrationView.js b/dashboardv2/public/js/views/migration/MigrationView.js
index 8f4b0b0..e7000f3 100644
--- a/dashboardv2/public/js/views/migration/MigrationView.js
+++ b/dashboardv2/public/js/views/migration/MigrationView.js
@@ -60,7 +60,7 @@ define(['require',
                     that.metricCollection = new VTagList();
                     that.metricCollection.url = UrlLinks.metricsApiUrl();
                     that.metricCollection.modelAttrName = "data";
-                    that.RStatisticsView.show(new Statistics({ hideModal: false, metricCollection: that.metricCollection }));
+                    that.RStatisticsView.show(new Statistics({ metricCollection: that.metricCollection, isMigrationView: true }));
                 })
             }
         });
diff --git a/dashboardv2/public/js/views/site/Statistics.js b/dashboardv2/public/js/views/site/Statistics.js
index d670ca7..73786d8 100644
--- a/dashboardv2/public/js/views/site/Statistics.js
+++ b/dashboardv2/public/js/views/site/Statistics.js
@@ -55,10 +55,20 @@ define(['require',
                 osCard: "[data-id='os-card']",
                 runtimeCard: "[data-id='runtime-card']",
                 memoryCard: "[data-id='memory-card']",
-                memoryPoolUsage: "[data-id='memory-pool-usage-card']"
+                memoryPoolUsage: "[data-id='memory-pool-usage-card']",
+                statisticsRefresh: "[data-id='statisticsRefresh']",
+                notificationDetails: "[data-id='notificationDetails']"
             },
             /** ui events hash */
-            events: function() {},
+            events: function() {
+                var events = {};
+                events["click " + this.ui.statisticsRefresh] = function(e) {
+                    this.$('.statsContainer,.statsNotificationContainer,.statisticsRefresh').addClass('hide');
+                    this.$('.statsLoader,.statsNotificationLoader').addClass('show');
+                    this.fetchMetricData();
+                };
+                return events;
+            },
             /**
              * intialize a new AboutAtlasView Layout
              * @constructs
@@ -67,7 +77,7 @@ define(['require',
                 _.extend(this, options);
                 var that = this;
                 this.DATA_MAX_LENGTH = 25;
-                if (this.hideModal !== false) {
+                if (this.isMigrationView !== true) {
                     var modal = new Modal({
                         title: 'Statistics',
                         content: this,
@@ -110,6 +120,9 @@ define(['require',
                         that.renderSystemDeatils({ data: data });
                         that.renderClassifications({ data: data });
                         that.$('.statsContainer,.statsNotificationContainer').removeClass('hide');
+                        if (that.isMigrationView) {
+                            that.$('.statisticsRefresh').removeClass('hide');
+                        }
                         that.$('.statsLoader,.statsNotificationLoader').removeClass('show');
                         if (options && options.update) {
                             if (that.modal) {
@@ -279,7 +292,7 @@ define(['require',
                         });
                         return tableBody;
                     };
-                if (data.Notification) {
+                if (!that.isMigrationView && data.Notification) {
                     var tableCol = [{
                                 label: "Total <br> (from " + (that.getValue({
                                     "value": data.Server["startTimeStamp"],
@@ -347,6 +360,7 @@ define(['require',
                             }
                         })
                     )
+                    that.ui.notificationDetails.removeClass('hide');
                 }
 
                 if (data.Server) {
diff --git a/dashboardv2/public/migration-status.html.tpl b/dashboardv2/public/migration-status.html.tpl
index 0048826..74d94d7 100644
--- a/dashboardv2/public/migration-status.html.tpl
+++ b/dashboardv2/public/migration-status.html.tpl
@@ -38,25 +38,10 @@
     <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
     <link rel="stylesheet" type="text/css" href="css/animate.min.css?bust=<%- bust %>" />
     <link rel="stylesheet" href="js/libs/backgrid/css/backgrid.css?bust=<%- bust %>" />
-    <link rel="stylesheet" href="js/libs/backgrid-filter/css/backgrid-filter.min.css?bust=<%- bust %>" />
-    <link rel="stylesheet" href="js/libs/backgrid-paginator/css/backgrid-paginator.css?bust=<%- bust %>" />
-    <link rel="stylesheet" href="js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css?bust=<%- bust %>" />
-    <link rel="stylesheet" href="js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css?bust=<%- bust %>" />
-    <link rel="stylesheet" href="js/external_lib/backgrid-columnmanager/css/Backgrid.ColumnManager.css?bust=<%- bust %>" />
-    <link rel="stylesheet" href="js/libs/select2/css/select2.min.css?bust=<%- bust %>" />
     <link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css?bust=<%- bust %>" />
-    <link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css?bust=<%- bust %>" />
     <link rel="stylesheet" href="css/googlefonts.css?bust=<%- bust %>" type="text/css" />
-    <link rel="stylesheet" type="text/css" href="js/external_lib/jquery-ui/jquery-ui.min.css?bust=<%- bust %>" />
-    <link href="css/bootstrap-sidebar.css?bust=<%- bust %>" rel="stylesheet" />
     <link href="js/libs/font-awesome/css/font-awesome.min.css?bust=<%- bust %>" rel="stylesheet" />
-    <link href="js/external_lib/pnotify/pnotify.custom.min.css?bust=<%- bust %>" rel="stylesheet" />
-    <link href="js/libs/jQueryQueryBuilder/css/query-builder.default.min.css?bust=<%- bust %>" rel="stylesheet" />
-    <link href="js/libs/bootstrap-daterangepicker/css/daterangepicker.css?bust=<%- bust %>" rel="stylesheet" />
-    <link rel="stylesheet" href="js/libs/nvd3/css/nv.d3.min.css?bust=<%- bust %>" />
-    <link href="js/libs/jstree/css/default/default-theme.min.css?bust=<%- bust %>" rel="stylesheet" />
-    <link href="js/libs/pretty-checkbox/css/pretty-checkbox.min.css?bust=<%- bust %>" rel="stylesheet" />
-    <link href="css/style.css?bust=<%- bust %>" rel="stylesheet" />
+    <link href="css/migration-style.css?bust=<%- bust %>" rel="stylesheet" />
 </head>
 
 <body>


[atlas] 01/03: ATLAS-3604: Data Migration status display.

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit cc6cac35686eb0c09c85f7c5d0f5e17c49516855
Author: Nikhil Bonte <ni...@freestoneinfotech.com>
AuthorDate: Thu Feb 13 15:34:11 2020 -0800

    ATLAS-3604: Data Migration status display.
    
    Signed-off-by: Ashutosh Mestry <am...@cloudera.com>
---
 dashboardv2/gruntfile.js                           |   3 +-
 dashboardv2/public/js/migration.js                 | 163 +++++++++++++++++++++
 .../js/templates/migration/MigrationView_tmpl.html |  17 +++
 .../public/js/views/migration/MigrationView.js     |  68 +++++++++
 dashboardv2/public/js/views/site/Statistics.js     |  50 ++++---
 dashboardv2/public/migration-status.html.tpl       |  80 ++++++++++
 .../atlas/web/filters/ActiveServerFilter.java      |  25 ++++
 .../atlas/web/security/AtlasSecurityConfig.java    |   1 +
 8 files changed, 383 insertions(+), 24 deletions(-)

diff --git a/dashboardv2/gruntfile.js b/dashboardv2/gruntfile.js
index f9c9579..efb1475 100644
--- a/dashboardv2/gruntfile.js
+++ b/dashboardv2/gruntfile.js
@@ -287,7 +287,8 @@ module.exports = function(grunt) {
                     }
                 },
                 files: {
-                    [distPath + '/index.html']: [modulesPath + 'index.html.tpl']
+                    [distPath + '/index.html']: [modulesPath + 'index.html.tpl'],
+                    [distPath + '/migration-status.html']: [modulesPath + 'migration-status.html.tpl']
                 }
             }
         }
diff --git a/dashboardv2/public/js/migration.js b/dashboardv2/public/js/migration.js
new file mode 100644
index 0000000..e49a69f
--- /dev/null
+++ b/dashboardv2/public/js/migration.js
@@ -0,0 +1,163 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+require.config({
+    /* starting point for application */
+    'hbs': {
+        'disableI18n': true, // This disables the i18n helper and doesn't require the json i18n files (e.g. en_us.json)
+        'helperPathCallback': // Callback to determine the path to look for helpers
+            function(name) { // ('/template/helpers/'+name by default)
+                return 'modules/Helpers';
+            },
+        'templateExtension': 'html', // Set the extension automatically appended to templates
+        'compileOptions': {} // options object which is passed to Handlebars compiler
+    },
+    'urlArgs': "bust=" + getBustValue(),
+    /**
+     * Requested as soon as the loader has processed the configuration. It does
+     * not block any other require() calls from starting their requests for
+     * modules, it is just a way to specify some modules to load asynchronously
+     * as part of a config block.
+     * @type {Array} An array of dependencies to load.
+     */
+    'deps': ['marionette'],
+
+    /**
+     * The number of seconds to wait before giving up on loading a script.
+     * @default 7 seconds
+     * @type {Number}
+     */
+    'waitSeconds': 30,
+
+    'shim': {
+        'backbone': {
+            'deps': ['underscore', 'jquery'],
+            'exports': 'Backbone'
+        },
+        'bootstrap': {
+            'deps': ['jquery'],
+            'exports': 'jquery'
+        },
+        'underscore': {
+            'exports': '_'
+        },
+        'marionette': {
+            'deps': ['backbone']
+        },
+        'hbs': {
+            'deps': ['underscore', 'handlebars']
+        },
+        'jquery-placeholder': {
+            'deps': ['jquery']
+        },
+        'jquery-ui': {
+            'deps': ['jquery']
+        },
+        'moment-timezone': {
+            'deps': ['moment']
+        },
+        'moment': {
+            'exports': ['moment']
+        },
+        'pnotify': {
+            'exports': ['pnotify']
+        },
+        'jstree': {
+            'deps': ['jquery']
+        },
+        'd3': {
+            'exports': ['d3']
+        }
+    },
+
+    paths: {
+        'jquery': 'libs/jquery/js/jquery.min',
+        'underscore': 'libs/underscore/underscore-min',
+        'bootstrap': 'libs/bootstrap/js/bootstrap.min',
+        'backbone': 'libs/backbone/backbone-min',
+        'backbone.babysitter': 'libs/backbone.babysitter/lib/backbone.babysitter.min',
+        'marionette': 'libs/backbone-marionette/backbone.marionette.min',
+        'backbone.paginator': 'libs/backbone-paginator/backbone.paginator.min',
+        'tmpl': 'templates',
+        'requirejs.text': 'libs/requirejs-text/text',
+        'handlebars': 'external_lib/require-handlebars-plugin/js/handlebars',
+        'hbs': 'external_lib/require-handlebars-plugin/js/hbs',
+        'i18nprecompile': 'external_lib/require-handlebars-plugin/js/i18nprecompile',
+        'jquery-placeholder': 'libs/jquery-placeholder/js/jquery.placeholder',
+        'platform': 'libs/platform/platform',
+        'pnotify': 'external_lib/pnotify/pnotify.custom.min',
+        'pnotify.buttons': 'external_lib/pnotify/pnotify.custom.min',
+        'pnotify.confirm': 'external_lib/pnotify/pnotify.custom.min',
+        'moment': 'libs/moment/js/moment.min',
+        'moment-timezone': 'libs/moment-timezone/moment-timezone-with-data.min',
+        'jquery-ui': 'external_lib/jquery-ui/jquery-ui.min',
+        'jstree': 'libs/jstree/jstree.min',
+        'd3': 'libs/d3/d3.min'
+    },
+
+    /**
+     * If set to true, an error will be thrown if a script loads that does not
+     * call define() or have a shim exports string value that can be checked.
+     * To get timely, correct error triggers in IE, force a define/shim export.
+     * @type {Boolean}
+     */
+    'enforceDefine': false
+});
+
+require([
+    'marionette',
+    'utils/Helper',
+    'bootstrap'
+], function(Marionette, Helper) {
+    var that = this;
+    var App = new Marionette.Application();
+
+    App.addRegions({
+        rContent: '.page-wrapper'
+    });
+
+    App.addInitializer(function() {
+        Backbone.history.start();
+    });
+    var Router = Backbone.Router.extend({
+        routes: {
+            // Define some URL routes
+            "": "defaultAction",
+            // Default
+            "*actions": "defaultAction"
+        },
+        initialize: function(options) {},
+        showRegions: function() {},
+        execute: function(callback, args) {
+            this.preRouteExecute();
+            if (callback) callback.apply(this, args);
+            this.postRouteExecute();
+        },
+        preRouteExecute: function() {},
+        postRouteExecute: function(name, args) {},
+        defaultAction: function() {
+            require(["views/migration/MigrationView"], function(MigrationView) {
+                App.rContent.show(new MigrationView());
+            });
+        }
+    });
+    App.appRouter = new Router({
+        entityDefCollection: this.entityDefCollection,
+    });
+    App.start();
+});
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/migration/MigrationView_tmpl.html b/dashboardv2/public/js/templates/migration/MigrationView_tmpl.html
new file mode 100644
index 0000000..41a665f
--- /dev/null
+++ b/dashboardv2/public/js/templates/migration/MigrationView_tmpl.html
@@ -0,0 +1,17 @@
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<div id="r_statisticsView" style="padding-top:30px;"></div>
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/migration/MigrationView.js b/dashboardv2/public/js/views/migration/MigrationView.js
new file mode 100644
index 0000000..8f4b0b0
--- /dev/null
+++ b/dashboardv2/public/js/views/migration/MigrationView.js
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+define(['require',
+    'backbone',
+    'hbs!tmpl/migration/MigrationView_tmpl'
+], function(require, Backbone, MigrationViewTmpl) {
+    'use strict';
+
+    var ProfileLayoutView = Backbone.Marionette.LayoutView.extend(
+        /** @lends ProfileLayoutView */
+        {
+            _viewName: 'MigrationView',
+
+            template: MigrationViewTmpl,
+
+            /** Layout sub regions */
+            regions: {
+                RStatisticsView: "#r_statisticsView",
+            },
+            /** ui selector cache */
+            ui: {},
+            /** ui events hash */
+            events: function() {},
+            /**
+             * intialize a new ProfileLayoutView Layout
+             * @constructs
+             */
+            initialize: function(options) {
+                this.apiBaseUrl = this.getBaseUrl(window.location.pathname);
+            },
+            bindEvents: function() {},
+            getBaseUrl: function(url) {
+                var path = url.replace(/\/[\w-]+.(jsp|html)|\/+$/ig, ''),
+                    splitPath = path.split("/");
+                if (splitPath && splitPath[splitPath.length - 1] === "n") {
+                    splitPath.pop();
+                    return splitPath.join("/");
+                }
+                return path;
+            },
+            onRender: function() {
+                var that = this;
+                require(["views/site/Statistics", "collection/VTagList", "utils/UrlLinks"], function(Statistics, VTagList, UrlLinks) {
+                    that.metricCollection = new VTagList();
+                    that.metricCollection.url = UrlLinks.metricsApiUrl();
+                    that.metricCollection.modelAttrName = "data";
+                    that.RStatisticsView.show(new Statistics({ hideModal: false, metricCollection: that.metricCollection }));
+                })
+            }
+        });
+    return ProfileLayoutView;
+});
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/site/Statistics.js b/dashboardv2/public/js/views/site/Statistics.js
index 75e11b0..d670ca7 100644
--- a/dashboardv2/public/js/views/site/Statistics.js
+++ b/dashboardv2/public/js/views/site/Statistics.js
@@ -67,28 +67,30 @@ define(['require',
                 _.extend(this, options);
                 var that = this;
                 this.DATA_MAX_LENGTH = 25;
-                var modal = new Modal({
-                    title: 'Statistics',
-                    content: this,
-                    okCloses: true,
-                    okText: "Close",
-                    showFooter: true,
-                    allowCancel: false,
-                    width: "60%",
-                    headerButtons: [{
-                        title: "Refresh Data",
-                        btnClass: "fa fa-refresh",
-                        onClick: function() {
-                            modal.$el.find('.header-button .fa-refresh').tooltip('hide').prop('disabled', true).addClass('fa-spin');
-                            that.fetchMetricData({ update: true });
-                        }
-                    }]
-                });
-                modal.on('closeModal', function() {
-                    modal.trigger('cancel');
-                });
-                this.modal = modal;
-                modal.open();
+                if (this.hideModal !== false) {
+                    var modal = new Modal({
+                        title: 'Statistics',
+                        content: this,
+                        okCloses: true,
+                        okText: "Close",
+                        showFooter: true,
+                        allowCancel: false,
+                        width: "60%",
+                        headerButtons: [{
+                            title: "Refresh Data",
+                            btnClass: "fa fa-refresh",
+                            onClick: function() {
+                                modal.$el.find('.header-button .fa-refresh').tooltip('hide').prop('disabled', true).addClass('fa-spin');
+                                that.fetchMetricData({ update: true });
+                            }
+                        }]
+                    }).open();
+
+                    modal.on('closeModal', function() {
+                        modal.trigger('cancel');
+                    });
+                    this.modal = modal;
+                }
             },
             bindEvents: function() {
                 var that = this;
@@ -110,7 +112,9 @@ define(['require',
                         that.$('.statsContainer,.statsNotificationContainer').removeClass('hide');
                         that.$('.statsLoader,.statsNotificationLoader').removeClass('show');
                         if (options && options.update) {
-                            that.modal.$el.find('.header-button .fa-refresh').prop('disabled', false).removeClass('fa-spin');
+                            if (that.modal) {
+                                that.modal.$el.find('.header-button .fa-refresh').prop('disabled', false).removeClass('fa-spin');
+                            }
                             Utils.notifySuccess({
                                 content: "Metric data is refreshed"
                             })
diff --git a/dashboardv2/public/migration-status.html.tpl b/dashboardv2/public/migration-status.html.tpl
new file mode 100644
index 0000000..0048826
--- /dev/null
+++ b/dashboardv2/public/migration-status.html.tpl
@@ -0,0 +1,80 @@
+<!DOCTYPE html>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 7]>
+    <script src="js/external_lib/es5-shim.min.js?bust=<%- bust %>"></script>
+    <script src="js/external_lib/respond.min.js?bust=<%- bust %>"></script>
+<![endif]-->
+<!--[if gt IE 8]><!-->
+<html class="no-js">
+<!--<![endif]-->
+
+<head>
+    <meta charset="utf-8" />
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8;" />
+    <title>Atlas</title>
+    <meta name="description" content="" />
+    <meta name="viewport" content="width=device-width" />
+    <link rel="shortcut icon" href="img/favicon.ico?bust=<%- bust %>" type="image/x-icon" />
+    <link rel="icon" href="img/favicon.ico?bust=<%- bust %>" type="image/x-icon" />
+    <!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
+    <link rel="stylesheet" type="text/css" href="css/animate.min.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/backgrid/css/backgrid.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/backgrid-filter/css/backgrid-filter.min.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/backgrid-paginator/css/backgrid-paginator.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/external_lib/backgrid-columnmanager/css/Backgrid.ColumnManager.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/select2/css/select2.min.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/bootstrap/css/bootstrap.min.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css?bust=<%- bust %>" />
+    <link rel="stylesheet" href="css/googlefonts.css?bust=<%- bust %>" type="text/css" />
+    <link rel="stylesheet" type="text/css" href="js/external_lib/jquery-ui/jquery-ui.min.css?bust=<%- bust %>" />
+    <link href="css/bootstrap-sidebar.css?bust=<%- bust %>" rel="stylesheet" />
+    <link href="js/libs/font-awesome/css/font-awesome.min.css?bust=<%- bust %>" rel="stylesheet" />
+    <link href="js/external_lib/pnotify/pnotify.custom.min.css?bust=<%- bust %>" rel="stylesheet" />
+    <link href="js/libs/jQueryQueryBuilder/css/query-builder.default.min.css?bust=<%- bust %>" rel="stylesheet" />
+    <link href="js/libs/bootstrap-daterangepicker/css/daterangepicker.css?bust=<%- bust %>" rel="stylesheet" />
+    <link rel="stylesheet" href="js/libs/nvd3/css/nv.d3.min.css?bust=<%- bust %>" />
+    <link href="js/libs/jstree/css/default/default-theme.min.css?bust=<%- bust %>" rel="stylesheet" />
+    <link href="js/libs/pretty-checkbox/css/pretty-checkbox.min.css?bust=<%- bust %>" rel="stylesheet" />
+    <link href="css/style.css?bust=<%- bust %>" rel="stylesheet" />
+</head>
+
+<body>
+    <div class="container-fluid">
+        <div class="col-sm-12">
+            <div class="page-wrapper">
+                <div class="initialLoading"></div>
+            </div>
+        </div>
+    </div>
+    <!-- build:js scripts/main.js -->
+    <script data-main="js/migration.js?bust=<%- bust %>" src="js/libs/requirejs/require.js?bust=<%- bust %>"></script>
+    <!-- endbuild -->
+    <script type="text/javascript">
+    var getBustValue = function() {
+        return "<%- bust %>";
+    };
+    </script>
+</body>
+
+</html>
\ No newline at end of file
diff --git a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java
index 4d452e4..2c28aaf 100644
--- a/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java
+++ b/webapp/src/main/java/org/apache/atlas/web/filters/ActiveServerFilter.java
@@ -50,6 +50,8 @@ import java.io.IOException;
 public class ActiveServerFilter implements Filter {
 
     private static final Logger LOG = LoggerFactory.getLogger(ActiveServerFilter.class);
+    private static final String MIGRATION_STATUS_STATIC_PAGE = "migration-status.html";
+
     private final ActiveInstanceState activeInstanceState;
     private ServiceState serviceState;
 
@@ -88,6 +90,9 @@ public class ActiveServerFilter implements Filter {
             LOG.error("Instance in transition. Service may not be ready to return a result");
             httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
         } else if (serviceState.isInstanceInMigration()) {
+            if (isRootURI(servletRequest)) {
+                handleMigrationRedirect(servletRequest, servletResponse);
+            }
             HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
             LOG.error("Instance in migration. Service may not be ready to return a result");
             httpServletResponse.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
@@ -123,10 +128,30 @@ public class ActiveServerFilter implements Filter {
         }
     }
 
+    private boolean isRootURI(ServletRequest servletRequest) {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
+        String requestURI = httpServletRequest.getRequestURI();
+        return requestURI.equals("/");
+    }
+
     boolean isInstanceActive() {
         return serviceState.getState() == ServiceState.ServiceStateValue.ACTIVE;
     }
 
+    private void handleMigrationRedirect(ServletRequest servletRequest, ServletResponse servletResponse) throws IOException {
+
+        HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
+        HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
+
+        String redirectLocation = httpServletRequest.getRequestURL() + MIGRATION_STATUS_STATIC_PAGE;
+        if (isUnsafeHttpMethod(httpServletRequest)) {
+            httpServletResponse.setHeader(HttpHeaders.LOCATION, redirectLocation);
+            httpServletResponse.setStatus(HttpServletResponse.SC_TEMPORARY_REDIRECT);
+        } else {
+            httpServletResponse.sendRedirect(redirectLocation);
+        }
+    }
+
     private void handleRedirect(HttpServletRequest servletRequest, HttpServletResponse httpServletResponse,
                                 String activeServerAddress) throws IOException {
         String requestURI = servletRequest.getRequestURI();
diff --git a/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java b/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
index 46b70ac..e74a9e9 100644
--- a/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
+++ b/webapp/src/main/java/org/apache/atlas/web/security/AtlasSecurityConfig.java
@@ -170,6 +170,7 @@ public class AtlasSecurityConfig extends WebSecurityConfigurerAdapter {
             "/js/**",
             "/n/js/**",
             "/ieerror.html",
+            "/migration-status.html",
             "/api/atlas/admin/status",
             "/api/atlas/admin/metrics"));
 


[atlas] 03/03: ATLAS-3761:- UI: Show progress bar for migration page

Posted by kb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kbhatt pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git

commit 445c38325b1d0a99dbcf48db107243916fa3985c
Author: kevalbhatt <kb...@apache.org>
AuthorDate: Tue Apr 28 22:30:24 2020 +0530

    ATLAS-3761:- UI: Show progress bar for migration page
    
    (cherry picked from commit b4246817251429ec986e9f4a37adca7cf334a2a4)
---
 dashboardv2/public/css/scss/migration-style.scss   |   6 +-
 dashboardv2/public/css/scss/stats.scss             |  62 ++++++++--
 dashboardv2/public/js/migration.js                 |   4 -
 .../js/templates/migration/MigrationView_tmpl.html |   2 +-
 .../public/js/templates/site/Statistics_tmpl.html  |  12 +-
 dashboardv2/public/js/utils/Helper.js              | 137 +++++++++++----------
 .../utils/MigrationEnums.js}                       |  26 ++--
 dashboardv2/public/js/views/site/Statistics.js     |  94 ++++++++++++--
 dashboardv2/public/migration-status.html.tpl       |   8 +-
 9 files changed, 239 insertions(+), 112 deletions(-)

diff --git a/dashboardv2/public/css/scss/migration-style.scss b/dashboardv2/public/css/scss/migration-style.scss
index a54bcef..60c9758 100644
--- a/dashboardv2/public/css/scss/migration-style.scss
+++ b/dashboardv2/public/css/scss/migration-style.scss
@@ -25,4 +25,8 @@
 @import "loader.scss";
 @import "theme.scss";
 @import "stats.scss";
-@import "override.scss";
\ No newline at end of file
+@import "override.scss";
+
+.initialLoading {
+    left: 0px !important;
+}
\ No newline at end of file
diff --git a/dashboardv2/public/css/scss/stats.scss b/dashboardv2/public/css/scss/stats.scss
index 2114117..7bf7581 100644
--- a/dashboardv2/public/css/scss/stats.scss
+++ b/dashboardv2/public/css/scss/stats.scss
@@ -61,6 +61,7 @@
     .panel {
         &.panel-default {
             padding: 5px;
+            margin: 5px;
         }
 
         .panel-body {
@@ -80,6 +81,12 @@
 
     .table {
         &.stat-table {
+            width: 100%;
+
+            td {
+                display: table-cell;
+            }
+
             &.notification-table {
                 &.table-striped>tbody>tr:nth-of-type(odd) {
                     background-color: $color_white_lilac_approx;
@@ -113,17 +120,54 @@
     }
 }
 
-.refresh-container {
-    background: white;
+.statistics-header {
+    height: 50px;
+    width: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
     position: fixed;
-    z-index: 9999;
-    right: 23px;
-    top: 7px;
-    border-radius: 23px;
+    z-index: 999;
+    top: 0px;
+    padding: 0px 15px;
+    background: #fff;
+    border-bottom: 1px #e8e9ee solid;
+    box-shadow: 0 2px 6px 0 rgba(0, 0, 0, .05);
+
+    &>div {
+        margin: 0px 5px;
+    }
 
-    .btn {
-        margin: 0px;
+    pre {
+        width: 100%;
+        padding: 5px 10px;
+        margin: 0px 10px;
+        color: $gray;
+
+        .color {
+            color: $color_jungle_green_approx;
+            font-weight: bold;
+        }
+    }
+
+    .progress {
+        width: 100%;
+        margin-top: 7px;
+        margin-bottom: 0px;
+
+        .progress-bar-success {
+            background-color: $color_jungle_green_approx;
+        }
+    }
+
+    .refresh-container {
+        background: white;
         border-radius: 23px;
-        padding: 10px 10px;
+
+        .btn {
+            margin: 0px;
+            border-radius: 23px;
+            padding: 10px 10px;
+        }
     }
 }
\ No newline at end of file
diff --git a/dashboardv2/public/js/migration.js b/dashboardv2/public/js/migration.js
index e49a69f..fca59ce 100644
--- a/dashboardv2/public/js/migration.js
+++ b/dashboardv2/public/js/migration.js
@@ -77,9 +77,6 @@ require.config({
         'pnotify': {
             'exports': ['pnotify']
         },
-        'jstree': {
-            'deps': ['jquery']
-        },
         'd3': {
             'exports': ['d3']
         }
@@ -106,7 +103,6 @@ require.config({
         'moment': 'libs/moment/js/moment.min',
         'moment-timezone': 'libs/moment-timezone/moment-timezone-with-data.min',
         'jquery-ui': 'external_lib/jquery-ui/jquery-ui.min',
-        'jstree': 'libs/jstree/jstree.min',
         'd3': 'libs/d3/d3.min'
     },
 
diff --git a/dashboardv2/public/js/templates/migration/MigrationView_tmpl.html b/dashboardv2/public/js/templates/migration/MigrationView_tmpl.html
index 41a665f..67572fa 100644
--- a/dashboardv2/public/js/templates/migration/MigrationView_tmpl.html
+++ b/dashboardv2/public/js/templates/migration/MigrationView_tmpl.html
@@ -14,4 +14,4 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<div id="r_statisticsView" style="padding-top:30px;"></div>
\ No newline at end of file
+<div id="r_statisticsView" style="padding-top:60px;"></div>
\ No newline at end of file
diff --git a/dashboardv2/public/js/templates/site/Statistics_tmpl.html b/dashboardv2/public/js/templates/site/Statistics_tmpl.html
index ce4b9ee..646e37f 100644
--- a/dashboardv2/public/js/templates/site/Statistics_tmpl.html
+++ b/dashboardv2/public/js/templates/site/Statistics_tmpl.html
@@ -14,8 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
 -->
-<div class="refresh-container statisticsRefresh hide" data-id="statisticsRefresh">
-    <button type="button" class="btn fa fa-refresh pull-right btn-sm btn-action" title="Refresh Data"></button>
+<div class="statistics-header col-md-12 hide">
+    <div class="progress hide">
+        <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuemin="0" aria-valuemax="100" data-id="migrationProgressBar">
+            <span data-id="migrationProgressBarValue"></span>
+        </div>
+    </div>
+    <pre class="successStatus hide">Migration is <span class="color">successful</span>. To exit form migration mode, please remove <span class="color">atlas.migration.data.filename</span> property and restart Atlas.</pre>
+    <div class="refresh-container statisticsRefresh" data-id="statisticsRefresh">
+        <button type="button" class="btn fa fa-refresh pull-right btn-sm btn-action" title="Refresh Data"></button>
+    </div>
 </div>
 <div class="panel-group server-stats-container statsContainer hide col-md-12" id="accordion">
     <div class="panel panel-default custom-panel expand_collapse_panel-icon" data-id="entity">
diff --git a/dashboardv2/public/js/utils/Helper.js b/dashboardv2/public/js/utils/Helper.js
index 88323c8..931c45d 100644
--- a/dashboardv2/public/js/utils/Helper.js
+++ b/dashboardv2/public/js/utils/Helper.js
@@ -127,83 +127,84 @@ define(['require',
     $("body").on('click', '.btn', function() {
         $(this).blur();
     });
-    $.fn.select2.amd.define("TagHideDeleteButtonAdapter", [
-            "select2/utils",
-            "select2/selection/multiple",
-            "select2/selection/placeholder",
-            "select2/selection/eventRelay",
-            "select2/selection/search",
-        ],
-        function(Utils, MultipleSelection, Placeholder, EventRelay, SelectionSearch) {
+    if ($.fn.select2) {
+        $.fn.select2.amd.define("TagHideDeleteButtonAdapter", [
+                "select2/utils",
+                "select2/selection/multiple",
+                "select2/selection/placeholder",
+                "select2/selection/eventRelay",
+                "select2/selection/search",
+            ],
+            function(Utils, MultipleSelection, Placeholder, EventRelay, SelectionSearch) {
 
-            // Decorates MultipleSelection with Placeholder
+                // Decorates MultipleSelection with Placeholder
+
+                var adapter = Utils.Decorate(MultipleSelection, Placeholder);
+                adapter = Utils.Decorate(adapter, SelectionSearch);
+                adapter = Utils.Decorate(adapter, EventRelay);
+
+                adapter.prototype.render = function() {
+                    // Use selection-box from SingleSelection adapter
+                    // This implementation overrides the default implementation
+                    var $search = $(
+                        '<li class="select2-search select2-search--inline">' +
+                        '<input class="select2-search__field" type="search" tabindex="-1"' +
+                        ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
+                        ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
+                        '</li>'
+                    );
 
-            var adapter = Utils.Decorate(MultipleSelection, Placeholder);
-            adapter = Utils.Decorate(adapter, SelectionSearch);
-            adapter = Utils.Decorate(adapter, EventRelay);
+                    this.$searchContainer = $search;
+                    this.$search = $search.find('input');
+                    var $selection = MultipleSelection.prototype.render.call(this);
+                    this._transferTabIndex();
+                    return $selection;
+                };
 
-            adapter.prototype.render = function() {
-                // Use selection-box from SingleSelection adapter
-                // This implementation overrides the default implementation
-                var $search = $(
-                    '<li class="select2-search select2-search--inline">' +
-                    '<input class="select2-search__field" type="search" tabindex="-1"' +
-                    ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
-                    ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
-                    '</li>'
-                );
+                adapter.prototype.update = function(data) {
+                    // copy and modify SingleSelection adapter
+                    var that = this;
+                    this.clear();
+                    if (data.length === 0) {
+                        this.$selection.find('.select2-selection__rendered')
+                            .append(this.$searchContainer);
+                        this.$search.attr('placeholder', this.options.get("placeholder"));
+                        return;
+                    }
+                    this.$search.attr('placeholder', '');
+                    var $rendered = this.$selection.find('.select2-selection__rendered'),
+                        $selectionContainer = [];
+                    if (data.length > 0) {
+                        _.each(data, function(obj) {
+                            var $container = $('<li class="select2-selection__choice"></li>'),
+                                formatted = that.display(obj, $rendered),
+                                $remove = $('<span class="select2-selection__choice__remove" role="presentation">&times;</span>'),
+                                allowRemoveAttr = $(obj.element).data("allowremove"),
+                                allowRemove = obj.allowRemove === undefined ? allowRemoveAttr : obj.allowRemove;
+                            if (allowRemove === undefined || allowRemove !== false) {
+                                $container.append($remove);
+                            }
+                            $container.data("data", obj);
+                            $container.append(formatted);
+                            $selectionContainer.push($container);
+                        });
+                        Utils.appendMany($rendered, $selectionContainer);
+                    }
 
-                this.$searchContainer = $search;
-                this.$search = $search.find('input');
-                var $selection = MultipleSelection.prototype.render.call(this);
-                this._transferTabIndex();
-                return $selection;
-            };
 
-            adapter.prototype.update = function(data) {
-                // copy and modify SingleSelection adapter
-                var that = this;
-                this.clear();
-                if (data.length === 0) {
+                    var searchHadFocus = this.$search[0] == document.activeElement;
+                    this.$search.attr('placeholder', '');
                     this.$selection.find('.select2-selection__rendered')
                         .append(this.$searchContainer);
-                    this.$search.attr('placeholder', this.options.get("placeholder"));
-                    return;
-                }
-                this.$search.attr('placeholder', '');
-                var $rendered = this.$selection.find('.select2-selection__rendered'),
-                    $selectionContainer = [];
-                if (data.length > 0) {
-                    _.each(data, function(obj) {
-                        var $container = $('<li class="select2-selection__choice"></li>'),
-                            formatted = that.display(obj, $rendered),
-                            $remove = $('<span class="select2-selection__choice__remove" role="presentation">&times;</span>'),
-                            allowRemoveAttr = $(obj.element).data("allowremove"),
-                            allowRemove = obj.allowRemove === undefined ? allowRemoveAttr : obj.allowRemove;
-                        if (allowRemove === undefined || allowRemove !== false) {
-                            $container.append($remove);
-                        }
-                        $container.data("data", obj);
-                        $container.append(formatted);
-                        $selectionContainer.push($container);
-                    });
-                    Utils.appendMany($rendered, $selectionContainer);
-                }
-
+                    this.resizeSearch();
+                    if (searchHadFocus) {
+                        this.$search.focus();
+                    }
+                };
+                return adapter;
+            });
 
-                var searchHadFocus = this.$search[0] == document.activeElement;
-                this.$search.attr('placeholder', '');
-                this.$selection.find('.select2-selection__rendered')
-                    .append(this.$searchContainer);
-                this.resizeSearch();
-                if (searchHadFocus) {
-                    this.$search.focus();
-                }
-            };
-            return adapter;
-        });
 
-    if ($.fn.select2) {
         $.fn.select2.amd.define("ServiceTypeFilterDropdownAdapter", [
                 "select2/utils",
                 "select2/dropdown",
diff --git a/dashboardv2/public/css/scss/migration-style.scss b/dashboardv2/public/js/utils/MigrationEnums.js
similarity index 76%
copy from dashboardv2/public/css/scss/migration-style.scss
copy to dashboardv2/public/js/utils/MigrationEnums.js
index a54bcef..c89b9da 100644
--- a/dashboardv2/public/css/scss/migration-style.scss
+++ b/dashboardv2/public/js/utils/MigrationEnums.js
@@ -1,4 +1,4 @@
-/*
+/**
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
  * distributed with this work for additional information
@@ -16,13 +16,17 @@
  * limitations under the License.
  */
 
-@import "__mixin.scss";
-@import "__variable.scss";
-@import "common.scss";
-@import "table.scss";
-@import "form.scss";
-@import "panel.scss";
-@import "loader.scss";
-@import "theme.scss";
-@import "stats.scss";
-@import "override.scss";
\ No newline at end of file
+define(['require'], function(require) {
+    'use strict';
+
+    var Enums = {};
+
+    Enums.migrationStatus = {
+        STARTED: "STARTED",
+        IN_PROGRESS: "IN_PROGRESS",
+        FAIL: "FAIL",
+        DONE: "DONE"
+    }
+
+    return Enums;
+});
\ No newline at end of file
diff --git a/dashboardv2/public/js/views/site/Statistics.js b/dashboardv2/public/js/views/site/Statistics.js
index 73786d8..868bd62 100644
--- a/dashboardv2/public/js/views/site/Statistics.js
+++ b/dashboardv2/public/js/views/site/Statistics.js
@@ -28,10 +28,11 @@ define(['require',
     'collection/VTagList',
     'utils/CommonViewFunction',
     'utils/Enums',
+    'utils/MigrationEnums',
     'moment',
     'utils/Utils',
     'moment-timezone'
-], function(require, Backbone, StatTmpl, StatsNotiTable, TopicOffsetTable, EntityTable, Modal, VCommon, UrlLinks, VTagList, CommonViewFunction, Enums, moment, Utils) {
+], function(require, Backbone, StatTmpl, StatsNotiTable, TopicOffsetTable, EntityTable, Modal, VCommon, UrlLinks, VTagList, CommonViewFunction, Enums, MigrationEnums, moment, Utils) {
     'use strict';
 
     var StatisticsView = Backbone.Marionette.LayoutView.extend(
@@ -57,15 +58,17 @@ define(['require',
                 memoryCard: "[data-id='memory-card']",
                 memoryPoolUsage: "[data-id='memory-pool-usage-card']",
                 statisticsRefresh: "[data-id='statisticsRefresh']",
-                notificationDetails: "[data-id='notificationDetails']"
+                notificationDetails: "[data-id='notificationDetails']",
+                migrationProgressBar: "[data-id='migrationProgressBar']",
+                migrationProgressBarValue: "[data-id='migrationProgressBarValue']"
             },
             /** ui events hash */
             events: function() {
                 var events = {};
                 events["click " + this.ui.statisticsRefresh] = function(e) {
-                    this.$('.statsContainer,.statsNotificationContainer,.statisticsRefresh').addClass('hide');
-                    this.$('.statsLoader,.statsNotificationLoader').addClass('show');
+                    this.showLoader();
                     this.fetchMetricData();
+                    this.fetchStatusData();
                 };
                 return events;
             },
@@ -77,7 +80,11 @@ define(['require',
                 _.extend(this, options);
                 var that = this;
                 this.DATA_MAX_LENGTH = 25;
-                if (this.isMigrationView !== true) {
+                this.loaderCount = 0;
+                if (this.isMigrationView) {
+                    this.migrationImportStatus = new VTagList();
+                    this.migrationImportStatus.url = UrlLinks.migrationStatusApiUrl();
+                } else {
                     var modal = new Modal({
                         title: 'Statistics',
                         content: this,
@@ -110,8 +117,54 @@ define(['require',
                     })
                 }
             },
+            fetchStatusData: function() {
+                var that = this;
+                ++this.loaderCount;
+                that.migrationImportStatus.fetch({
+                    success: function(data) {
+                        var data = _.first(data.toJSON()),
+                            migrationStatus = data.MigrationStatus || null,
+                            operationStatus = migrationStatus.operationStatus,
+                            showProgress = true,
+                            totalProgress = 0,
+                            progressMessage = "";
+                        if (migrationStatus) {
+                            if (MigrationEnums.migrationStatus[operationStatus] === "DONE") {
+                                showProgress = false;
+                            } else if (MigrationEnums.migrationStatus[operationStatus] === "IN_PROGRESS" || MigrationEnums.migrationStatus[operationStatus] === "STARTED") {
+                                var currentIndex = migrationStatus.currentIndex || 0,
+                                    totalCount = migrationStatus.totalCount || 0;
+                                totalProgress = Math.ceil((migrationStatus.currentIndex / migrationStatus.totalCount) * 100)
+                                progressMessage = totalProgress + "%";
+                                that.ui.migrationProgressBar.removeClass("progress-bar-danger");
+                                that.ui.migrationProgressBar.addClass("progress-bar-success");
+                            } else if (MigrationEnums.migrationStatus[operationStatus] === "FAIL") {
+                                totalProgress = "100";
+                                progressMessage = "Failed";
+                                that.ui.migrationProgressBar.addClass("progress-bar-danger");
+                                that.ui.migrationProgressBar.removeClass("progress-bar-success");
+                            }
+                            if (showProgress) {
+                                that.$el.find(".statistics-header>.progress").removeClass("hide");
+                                that.$el.find(".statistics-header>.successStatus").addClass("hide");
+                                that.ui.migrationProgressBar.css({ width: totalProgress + '%' });
+                                that.ui.migrationProgressBarValue.text(progressMessage);
+                            } else {
+                                that.$el.find(".statistics-header>.progress").addClass("hide");
+                                that.$el.find(".statistics-header>.successStatus").removeClass("hide");
+                            }
+                        }
+
+                    },
+                    complete: function() {
+                        --that.loaderCount;
+                        that.hideLoader();
+                    }
+                });
+            },
             fetchMetricData: function(options) {
                 var that = this;
+                ++this.loaderCount;
                 this.metricCollection.fetch({
                     success: function(data) {
                         var data = _.first(data.toJSON());
@@ -119,11 +172,6 @@ define(['require',
                         that.renderEntities({ data: data });
                         that.renderSystemDeatils({ data: data });
                         that.renderClassifications({ data: data });
-                        that.$('.statsContainer,.statsNotificationContainer').removeClass('hide');
-                        if (that.isMigrationView) {
-                            that.$('.statisticsRefresh').removeClass('hide');
-                        }
-                        that.$('.statsLoader,.statsNotificationLoader').removeClass('show');
                         if (options && options.update) {
                             if (that.modal) {
                                 that.modal.$el.find('.header-button .fa-refresh').prop('disabled', false).removeClass('fa-spin');
@@ -132,11 +180,37 @@ define(['require',
                                 content: "Metric data is refreshed"
                             })
                         }
+                    },
+                    complete: function() {
+                        --that.loaderCount;
+                        that.hideLoader()
                     }
                 });
             },
+            hideLoader: function() {
+                if (this.loaderCount === 0) {
+                    var className = ".statsContainer";
+                    if (this.isMigrationView) {
+                        className += ",.statistics-header";
+                    }
+                    this.$(className).removeClass('hide');
+                    this.$('.statsLoader').removeClass('show');
+                }
+            },
+            showLoader: function() {
+                var className = ".statsContainer";
+                if (this.isMigrationView) {
+                    className += ",.statistics-header";
+                }
+                this.$(className).addClass('hide');
+                this.$('.statsLoader').addClass('show');
+            },
             onRender: function() {
                 this.bindEvents();
+                if (this.isMigrationView) {
+                    this.showLoader();
+                    this.fetchStatusData();
+                }
                 this.fetchMetricData();
             },
             closePanel: function(options) {
diff --git a/dashboardv2/public/migration-status.html.tpl b/dashboardv2/public/migration-status.html.tpl
index 74d94d7..1e7c991 100644
--- a/dashboardv2/public/migration-status.html.tpl
+++ b/dashboardv2/public/migration-status.html.tpl
@@ -45,12 +45,8 @@
 </head>
 
 <body>
-    <div class="container-fluid">
-        <div class="col-sm-12">
-            <div class="page-wrapper">
-                <div class="initialLoading"></div>
-            </div>
-        </div>
+    <div class="page-wrapper">
+        <div class="initialLoading"></div>
     </div>
     <!-- build:js scripts/main.js -->
     <script data-main="js/migration.js?bust=<%- bust %>" src="js/libs/requirejs/require.js?bust=<%- bust %>"></script>