From e016b1df9bffd838b170dbd9adc00553f9443da5 Mon Sep 17 00:00:00 2001 From: "13621160019@163.com" <13621160019@163.com> Date: Sun, 22 Aug 2021 17:49:41 +0800 Subject: [PATCH] fixed toaster issues for uploading file in Admin UI --- .../controllers/settings/costcenter/costfile.controller.js | 4 ++-- .../settings/knowledgefile/knowledgefile.controller.js | 4 ++-- .../controllers/settings/meter/offlinemeterfile.controller.js | 2 +- admin/app/directives/directives.js | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/admin/app/controllers/settings/costcenter/costfile.controller.js b/admin/app/controllers/settings/costcenter/costfile.controller.js index 635f4c2e..b1896188 100644 --- a/admin/app/controllers/settings/costcenter/costfile.controller.js +++ b/admin/app/controllers/settings/costcenter/costfile.controller.js @@ -37,7 +37,7 @@ app.controller('CostFileController', function ( toaster.pop({ type: "success", title: $translate.instant("TOASTER.SUCCESS_TITLE"), - body: $translate.instant("TOASTER.SUCCESS_ADD_BODY".format(file.name)), + body: $translate.instant("TOASTER.SUCCESS_ADD_BODY", {template: file.name}), showCloseButton: true, }); $scope.getAllCostFiles(); @@ -46,7 +46,7 @@ app.controller('CostFileController', function ( toaster.pop({ type: "error", title: $translate.instant("TOASTER.FAILURE_TITLE"), - body: $translate.instant("TOASTER.ERROR_ADD_BODY".format(file.name)), + body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}), showCloseButton: true, }); } diff --git a/admin/app/controllers/settings/knowledgefile/knowledgefile.controller.js b/admin/app/controllers/settings/knowledgefile/knowledgefile.controller.js index 90a883bc..1d710015 100644 --- a/admin/app/controllers/settings/knowledgefile/knowledgefile.controller.js +++ b/admin/app/controllers/settings/knowledgefile/knowledgefile.controller.js @@ -37,7 +37,7 @@ app.controller('KnowledgeFileController', function ( toaster.pop({ type: "success", title: $translate.instant("TOASTER.SUCCESS_TITLE"), - body: $translate.instant("TOASTER.SUCCESS_ADD_BODY".format(file.name)), + body: $translate.instant("TOASTER.SUCCESS_ADD_BODY", {template: file.name}), showCloseButton: true, }); $scope.getAllKnowledgeFiles(); @@ -46,7 +46,7 @@ app.controller('KnowledgeFileController', function ( toaster.pop({ type: "error", title: $translate.instant("TOASTER.FAILURE_TITLE"), - body: $translate.instant("TOASTER.ERROR_ADD_BODY".format(file.name)), + body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}), showCloseButton: true, }); } diff --git a/admin/app/controllers/settings/meter/offlinemeterfile.controller.js b/admin/app/controllers/settings/meter/offlinemeterfile.controller.js index d27de61d..273d731e 100644 --- a/admin/app/controllers/settings/meter/offlinemeterfile.controller.js +++ b/admin/app/controllers/settings/meter/offlinemeterfile.controller.js @@ -38,7 +38,7 @@ app.controller('OfflineMeterFileController', function( toaster.pop({ type: "success", title: $translate.instant("TOASTER.SUCCESS_TITLE"), - body: $translate.instant("TOASTER.SUCCESS_ADD_BODY",{template: file.name}), + body: $translate.instant("TOASTER.SUCCESS_ADD_BODY", {template: file.name}), showCloseButton: true, }); $scope.getAllOfflineMeterFiles(); diff --git a/admin/app/directives/directives.js b/admin/app/directives/directives.js index 2a5642a8..d9fdb07c 100644 --- a/admin/app/directives/directives.js +++ b/admin/app/directives/directives.js @@ -342,7 +342,6 @@ function dropZone() { link: function(scope, element, attrs) { var config = { - url: 'http://localhost:8080/upload', maxFilesize: 100, paramName: "uploadfile", maxThumbnailFilesize: 10,