You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by bo...@apache.org on 2019/06/13 11:56:17 UTC

[kylin] branch master updated: KYLIN-4042 Fix too many posted messages on system page with same text

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

boblu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new b38fbca  KYLIN-4042 Fix too many posted messages on system page with same text
b38fbca is described below

commit b38fbcaf943a33a80e7400e21da60116266a5d62
Author: nichunen <ni...@apache.org>
AuthorDate: Thu Jun 13 19:11:33 2019 +0800

    KYLIN-4042 Fix too many posted messages on system page with same text
---
 webapp/app/js/controllers/admin.js | 4 ++--
 webapp/app/js/services/message.js  | 6 +++++-
 webapp/app/js/services/notify.js   | 6 +++---
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/webapp/app/js/controllers/admin.js b/webapp/app/js/controllers/admin.js
index 910e30e..fb0dac2 100644
--- a/webapp/app/js/controllers/admin.js
+++ b/webapp/app/js/controllers/admin.js
@@ -29,7 +29,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
   $scope.getEnv = function () {
     AdminService.env({}, function (env) {
       $scope.envStr = env.env;
-      MessageBox.successNotify('Server environment get successfully');
+      MessageBox.successNotify('Server environment get successfully', "server-env");
 //            SweetAlert.swal('Success!', 'Server environment get successfully', 'success');
     }, function (e) {
       if (e.data && e.data.exception) {
@@ -45,7 +45,7 @@ KylinApp.controller('AdminCtrl', function ($scope, AdminService, CacheService, T
   $scope.getConfig = function () {
     AdminService.config({}, function (config) {
       $scope.configStr = config.config;
-      MessageBox.successNotify('Server config get successfully');
+      MessageBox.successNotify('Server config get successfully', "server-config");
     }, function (e) {
       if (e.data && e.data.exception) {
         var message = e.data.exception;
diff --git a/webapp/app/js/services/message.js b/webapp/app/js/services/message.js
index 9bed2d5..18be896 100644
--- a/webapp/app/js/services/message.js
+++ b/webapp/app/js/services/message.js
@@ -18,7 +18,7 @@
 
 KylinApp.service('MessageService', ['config_ui_messenger', function (config_ui_messenger,$log) {
 
-  this.sendMsg = function (msg, type, actions, sticky, position) {
+  this.sendMsg = function (msg, type, actions, sticky, position, msgid) {
     var options = {
       'theme': config_ui_messenger.theme
     };
@@ -30,6 +30,10 @@ KylinApp.service('MessageService', ['config_ui_messenger', function (config_ui_m
       showCloseButton: true
     };
 
+    if (angular.isDefined(msgid)) {
+      data.id = msgid;
+    }
+
     // Whether sticky the message, otherwise it will hide after a period.
     if (angular.isDefined(sticky) && sticky === true) {
       data.hideAfter = false;
diff --git a/webapp/app/js/services/notify.js b/webapp/app/js/services/notify.js
index ce1fbd5..b56d200 100644
--- a/webapp/app/js/services/notify.js
+++ b/webapp/app/js/services/notify.js
@@ -17,8 +17,8 @@
 */
 
 KylinApp.service('MessageBox', function (SweetAlert, MessageService) {
-  this.successNotify = function(message) {
-    MessageService.sendMsg(message, 'success', {});
+  this.successNotify = function(message, msgid) {
+    MessageService.sendMsg(message, 'success', {}, null, null, msgid);
   }
 
   this.successAlert = function(message, callback) {
@@ -29,4 +29,4 @@ KylinApp.service('MessageBox', function (SweetAlert, MessageService) {
       type: "success"
     }, callback);
   }
-});
\ No newline at end of file
+});