updated Admin UI to make error messages more specific

pull/67/head
13621160019@163.com 2021-09-09 16:13:40 +08:00 committed by Caozhenhui
parent 1c14c0e75d
commit c5fe0b4a16
41 changed files with 248 additions and 408 deletions

View File

@ -46,8 +46,8 @@ app.controller('EmailMessageController', function($scope, $timeout,$translate,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.EMAIL_MESSAGE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.EMAIL_MESSAGE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});

View File

@ -52,8 +52,8 @@ app.controller('RuleController', function($scope, $uibModal, $translate, RuleSer
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY",{template: $translate.instant("FDD.RULE")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY",{template: $translate.instant("FDD.RULE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -91,8 +91,8 @@ app.controller('RuleController', function($scope, $uibModal, $translate, RuleSer
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("FDD.RULE")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("FDD.RULE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
@ -126,18 +126,11 @@ app.controller('RuleController', function($scope, $uibModal, $translate, RuleSer
showCloseButton: true,
});
$scope.getAllRules();
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.RULE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.RULE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -45,8 +45,8 @@ app.controller('TextMessageController', function($scope,$timeout,$translate,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.TEXT_MESSAGE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.TEXT_MESSAGE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -44,8 +44,8 @@ app.controller('WebMessageController', function($scope, $timeout, $translate, $u
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("FDD.WEB_MESSAGE")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("FDD.WEB_MESSAGE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
@ -82,8 +82,8 @@ app.controller('WebMessageController', function($scope, $timeout, $translate, $u
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.WEB_MESSAGE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.WEB_MESSAGE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});

View File

@ -44,8 +44,8 @@ app.controller('WechatMessageController', function($scope, $timeout,$translate,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.WECHAT_MESSAGE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("FDD.WECHAT_MESSAGE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -34,18 +34,11 @@ app.controller('LoginController', function (
$location.path('/settings/space');
$scope.cur_user = JSON.parse($window.localStorage.getItem("myems_admin_ui_current_user"));
} else if (angular.isDefined(response.status) && response.status === 400 || response.status === 404) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant('TOASTER.LOGIN_FAILURE'),
title: $translate.instant('TOASTER.LOGIN_FAILURE'),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -61,7 +54,7 @@ app.controller('LoginController', function (
toaster.pop({
type: "success",
title: $translate.instant("TOASTER.SUCCESS_TITLE"),
body: $translate.instant('TOASTER.LOGIN_SUCCESS'),
body: $translate.instant('TOASTER.LOGOUT_SUCCESS'),
showCloseButton: true,
});
$window.localStorage.removeItem("myems_admin_ui_current_user");
@ -69,7 +62,7 @@ app.controller('LoginController', function (
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
title: $translate.instant("TOASTER.LOGOUT_FAILURE"),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
@ -118,13 +111,12 @@ app.controller('LoginController', function (
body: $translate.instant("TOASTER.SUCCESS_UPDATE_BODY", { template: $translate.instant("TOASTER.USER_PASSWORD") }),
showCloseButton: true,
});
$scope.$emit('handleEmitLineChanged');
} else {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title) || $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant( response.data.description, { template: $translate.instant("TOASTER.USER_PASSWORD") }) || $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("TOASTER.USER_PASSWORD") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("TOASTER.USER_PASSWORD") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -41,8 +41,8 @@ app.controller('EnergyCategoryController', function($scope, $translate,$uibModal
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.CATEGORY")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.CATEGORY")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -82,8 +82,8 @@ app.controller('EnergyCategoryController', function($scope, $translate,$uibModal
}else{
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.CATEGORY")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.CATEGORY")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -119,8 +119,8 @@ app.controller('EnergyCategoryController', function($scope, $translate,$uibModal
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.CATEGORY")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.CATEGORY")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -50,8 +50,8 @@ app.controller('EnergyItemController', function($scope, $translate,$uibModal, Ca
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.ENERGY_ITEM")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.ENERGY_ITEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -90,8 +90,8 @@ app.controller('EnergyItemController', function($scope, $translate,$uibModal, Ca
}else{
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.ENERGY_ITEM")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.ENERGY_ITEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -126,8 +126,8 @@ app.controller('EnergyItemController', function($scope, $translate,$uibModal, Ca
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.ENERGY_ITEM")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.ENERGY_ITEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -49,8 +49,8 @@ app.controller('CombinedEquipmentController', function ($scope, $translate, $uib
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.COMBINED_EQUIPMENT") }),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.COMBINED_EQUIPMENT") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -90,8 +90,8 @@ app.controller('CombinedEquipmentController', function ($scope, $translate, $uib
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.COMBINED_EQUIPMENT") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.COMBINED_EQUIPMENT") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -128,8 +128,8 @@ app.controller('CombinedEquipmentController', function ($scope, $translate, $uib
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.COMBINED_EQUIPMENT") }),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.COMBINED_EQUIPMENT") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -74,8 +74,8 @@ app.controller('CombinedEquipmentParameterController', function ($scope, $uibMod
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMBINED_EQUIPMENT.PARAMETER") }),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMBINED_EQUIPMENT.PARAMETER") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -123,8 +123,8 @@ app.controller('CombinedEquipmentParameterController', function ($scope, $uibMod
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMBINED_EQUIPMENT.PARAMETER") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMBINED_EQUIPMENT.PARAMETER") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -157,18 +157,11 @@ app.controller('CombinedEquipmentParameterController', function ($scope, $uibMod
showCloseButton: true,
});
$scope.getParametersByCombinedEquipmentID($scope.currentCombinedEquipment.id);
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant(popBody, { template: $translate.instant("COMBINED_EQUIPMENT.PARAMETER") }),
title: $translate.instant(popBody, { template: $translate.instant("COMBINED_EQUIPMENT.PARAMETER") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -40,8 +40,8 @@ app.controller('ContactController', function($scope, $translate,$uibModal, Conta
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.CONTACT")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.CONTACT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -79,8 +79,8 @@ app.controller('ContactController', function($scope, $translate,$uibModal, Conta
}else{
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.CONTACT")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.CONTACT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -115,8 +115,8 @@ app.controller('ContactController', function($scope, $translate,$uibModal, Conta
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.CONTACT")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.CONTACT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -27,14 +27,13 @@ app.controller('CostCenterController', function($scope, $translate,$uibModal, Co
body: $translate.instant("TOASTER.SUCCESS_ADD_BODY", {template: $translate.instant("SETTING.COSTCENTER")}),
showCloseButton: true,
});
$scope.getAllCostCenters();
$scope.$emit('handleEmitCostCenterChanged');
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.COSTCENTER")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.COSTCENTER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -70,11 +69,11 @@ app.controller('CostCenterController', function($scope, $translate,$uibModal, Co
});
$scope.getAllCostCenters();
$scope.$emit('handleEmitCostCenterChanged');
}else{
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.COSTCENTER")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.COSTCENTER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -107,21 +106,14 @@ app.controller('CostCenterController', function($scope, $translate,$uibModal, Co
});
$scope.getAllCostCenters();
$scope.$emit('handleEmitCostCenterChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
} else {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.COSTCENTER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.COSTCENTER")}),
showCloseButton: true,
});
}
}
});
}
});

View File

@ -45,8 +45,8 @@ app.controller('CostFileController', function (
'error': function (file, xhr) {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -96,18 +96,11 @@ app.controller('CostFileController', function (
showCloseButton: true,
});
$scope.getAllCostFiles();
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("TOASTER.COST_FILE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("TOASTER.COST_FILE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -53,8 +53,8 @@ app.controller('DataSourceController', function($scope, $uibModal, $translate, D
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("DATA_SOURCE.DATA_SOURCE")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("DATA_SOURCE.DATA_SOURCE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -93,8 +93,8 @@ app.controller('DataSourceController', function($scope, $uibModal, $translate, D
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("DATA_SOURCE.DATA_SOURCE")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("DATA_SOURCE.DATA_SOURCE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -127,18 +127,11 @@ app.controller('DataSourceController', function($scope, $uibModal, $translate, D
showCloseButton: true,
});
$scope.$emit("handleEmitDataSourceChanged");
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("DATA_SOURCE.DATA_SOURCE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("DATA_SOURCE.DATA_SOURCE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -57,8 +57,8 @@ app.controller('PointController', function($scope, $uibModal, $translate, DataSo
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: "TOASTER.ERROR_ADD_BODY",
title: $translate.instant("TOASTER.ERROR_ADD_BODY",{template: $translate.instant( "SETTING.POINT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -99,8 +99,8 @@ app.controller('PointController', function($scope, $uibModal, $translate, DataSo
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.POINT")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.POINT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -133,18 +133,11 @@ app.controller('PointController', function($scope, $uibModal, $translate, DataSo
showCloseButton: true,
});
$scope.getPointsByDataSourceID($scope.currentDataSource);
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.POINT")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.POINT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -61,8 +61,8 @@ app.controller('DistributionCircuitController', function($scope, $translate, $ui
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_CIRCUIT")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_CIRCUIT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -101,8 +101,8 @@ app.controller('DistributionCircuitController', function($scope, $translate, $ui
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_CIRCUIT")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_CIRCUIT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -136,18 +136,11 @@ app.controller('DistributionCircuitController', function($scope, $translate, $ui
});
$scope.getDistributionCircuitsByDistributionSystemID($scope.currentDistributionSystem.id);
$scope.$emit('handleEmitDistributionCircuitChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_CIRCUIT")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_CIRCUIT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -32,8 +32,8 @@ app.controller('DistributionSystemController', function($scope, $translate, $uib
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_SYSTEM")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_SYSTEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -71,8 +71,8 @@ app.controller('DistributionSystemController', function($scope, $translate, $uib
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_SYSTEM")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_SYSTEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -108,8 +108,8 @@ app.controller('DistributionSystemController', function($scope, $translate, $uib
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_SYSTEM")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("DISTRIBUTION_SYSTEM.DISTRIBUTION_SYSTEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -40,8 +40,8 @@ app.controller('EmailServerController', function($scope, $translate,$uibModal, E
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.EMAIL_SERVER")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.EMAIL_SERVER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -79,8 +79,8 @@ app.controller('EmailServerController', function($scope, $translate,$uibModal, E
}else{
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.EMAIL_SERVER")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.EMAIL_SERVER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -115,8 +115,8 @@ app.controller('EmailServerController', function($scope, $translate,$uibModal, E
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.EMAIL_SERVER")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.EMAIL_SERVER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -32,8 +32,8 @@ app.controller('EnergyFlowDiagramController', function($scope, $translate, $uibM
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("COMMON.ENERGY_FLOW_DIAGRAM")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("COMMON.ENERGY_FLOW_DIAGRAM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -71,8 +71,8 @@ app.controller('EnergyFlowDiagramController', function($scope, $translate, $uibM
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.ENERGY_FLOW_DIAGRAM")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.ENERGY_FLOW_DIAGRAM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -108,8 +108,8 @@ app.controller('EnergyFlowDiagramController', function($scope, $translate, $uibM
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.ENERGY_FLOW_DIAGRAM")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.ENERGY_FLOW_DIAGRAM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -91,8 +91,8 @@ app.controller('EnergyFlowDiagramLinkController', function($scope,$uibModal, $tr
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.LINK")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.LINK")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -141,8 +141,8 @@ app.controller('EnergyFlowDiagramLinkController', function($scope,$uibModal, $tr
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.LINK")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.LINK")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -176,18 +176,11 @@ app.controller('EnergyFlowDiagramLinkController', function($scope,$uibModal, $tr
});
$scope.getLinksByEnergyFlowDiagramID($scope.currentEnergyFlowDiagram.id);
$scope.$emit('handleEmitEnergyFlowDiagramLinkChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.LINK")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.LINK")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -62,8 +62,8 @@ app.controller('EnergyFlowDiagramNodeController', function($scope, $translate, $
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.NODE")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.NODE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -101,8 +101,8 @@ app.controller('EnergyFlowDiagramNodeController', function($scope, $translate, $
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.NODE")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.NODE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -136,18 +136,11 @@ app.controller('EnergyFlowDiagramNodeController', function($scope, $translate, $
});
$scope.getNodesByEnergyFlowDiagramID($scope.currentEnergyFlowDiagram.id);
$scope.$emit('handleEmitEnergyFlowDiagramNodeChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.NODE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("ENERGY_FLOW_DIAGRAM.NODE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -49,8 +49,8 @@ app.controller('EquipmentController', function($scope, $translate, $uibModal, Eq
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("COMMON.EQUIPMENT")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("COMMON.EQUIPMENT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -90,8 +90,8 @@ app.controller('EquipmentController', function($scope, $translate, $uibModal, Eq
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.EQUIPMENT")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.EQUIPMENT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -127,8 +127,8 @@ app.controller('EquipmentController', function($scope, $translate, $uibModal, Eq
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.EQUIPMENT")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.EQUIPMENT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -74,8 +74,8 @@ app.controller('EquipmentParameterController', function($scope, $uibModal, $tran
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("EQUIPMENT.PARAMETER")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("EQUIPMENT.PARAMETER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -123,8 +123,8 @@ app.controller('EquipmentParameterController', function($scope, $uibModal, $tran
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("EQUIPMENT.PARAMETER")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("EQUIPMENT.PARAMETER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -157,18 +157,11 @@ app.controller('EquipmentParameterController', function($scope, $uibModal, $tran
showCloseButton: true,
});
$scope.getParametersByEquipmentID($scope.currentEquipment.id);
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("EQUIPMENT.PARAMETER")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("EQUIPMENT.PARAMETER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -40,8 +40,8 @@ app.controller('GatewayController', function($scope, $translate, $uibModal, Gat
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("GATEWAY.GATEWAY")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("GATEWAY.GATEWAY")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -80,8 +80,8 @@ app.controller('GatewayController', function($scope, $translate, $uibModal, Gat
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("GATEWAY.GATEWAY")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("GATEWAY.GATEWAY")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -115,18 +115,11 @@ app.controller('GatewayController', function($scope, $translate, $uibModal, Gat
});
$scope.getAllGateways();
$scope.$emit('handleEmitGatewayChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("GATEWAY.GATEWAY")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("GATEWAY.GATEWAY")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -39,8 +39,8 @@ app.controller('GSMModemController', function($scope, $translate,$uibModal, GSMM
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.GSM_MODEM")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.GSM_MODEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -78,8 +78,8 @@ app.controller('GSMModemController', function($scope, $translate,$uibModal, GSMM
}else{
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.GSM_MODEM")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.GSM_MODEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -114,8 +114,8 @@ app.controller('GSMModemController', function($scope, $translate,$uibModal, GSMM
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.GSM_MODEM")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.GSM_MODEM")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -45,8 +45,8 @@ app.controller('KnowledgeFileController', function (
'error': function (file, xhr) {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -95,18 +95,11 @@ app.controller('KnowledgeFileController', function (
showCloseButton: true,
});
$scope.getAllKnowledgeFiles();
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("SETTING.KNOWLEDGEFILE") }),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("SETTING.KNOWLEDGEFILE") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -116,8 +116,8 @@ app.controller('MenuController', function ($scope, $uibModal, MenuService, toast
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.MENU") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.MENU") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -155,8 +155,8 @@ app.controller('MeterController', function($scope, $translate, $uibModal, Meter
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.METER")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -211,8 +211,8 @@ app.controller('MeterController', function($scope, $translate, $uibModal, Meter
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.METER")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -246,18 +246,11 @@ app.controller('MeterController', function($scope, $translate, $uibModal, Meter
});
$scope.getAllMeters();
$scope.$emit('handleEmitMeterChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.METER")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -79,8 +79,8 @@ app.controller('OfflineMeterController', function($scope, $translate, $uibModal,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.OFFLINE_METER")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.OFFLINE_METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -129,8 +129,8 @@ app.controller('OfflineMeterController', function($scope, $translate, $uibModal,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.OFFLINE_METER")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.OFFLINE_METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -164,18 +164,11 @@ app.controller('OfflineMeterController', function($scope, $translate, $uibModal,
});
$scope.getAllOfflineMeters();
$scope.$emit('handleEmitOfflineMeterChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.OFFLINE_METER")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.OFFLINE_METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -46,8 +46,8 @@ app.controller('OfflineMeterFileController', function(
'error': function (file, xhr) {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: file.name}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -97,18 +97,11 @@ app.controller('OfflineMeterFileController', function(
showCloseButton: true,
});
$scope.getAllOfflineMeterFiles();
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.OFFLINE_METER_FILE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.OFFLINE_METER_FILE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -109,8 +109,8 @@ $scope.getAllEnergyItems = function() {
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.VIRTUAL_METER")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.VIRTUAL_METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -162,8 +162,8 @@ $scope.getAllEnergyItems = function() {
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.VIRTUAL_METER")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.VIRTUAL_METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -197,18 +197,11 @@ $scope.getAllEnergyItems = function() {
});
$scope.getAllVirtualMeters();
$scope.$emit('handleEmitVirtualMeterChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: popTit$translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.VIRTUAL_METER")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.VIRTUAL_METER")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -40,8 +40,8 @@ app.controller('SensorController', function($scope, $translate, $uibModal, Sens
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("COMMON.SENSOR")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("COMMON.SENSOR")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -80,8 +80,8 @@ app.controller('SensorController', function($scope, $translate, $uibModal, Sens
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.SENSOR")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.SENSOR")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -115,18 +115,11 @@ app.controller('SensorController', function($scope, $translate, $uibModal, Sens
});
$scope.getAllSensors();
$scope.$emit('handleEmitSensorChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.SENSOR")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.SENSOR")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -65,8 +65,8 @@ app.controller('ShopfloorController', function ($scope, $translate, $uibModal, C
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.SHOPFLOOR") }),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.SHOPFLOOR") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -110,8 +110,8 @@ app.controller('ShopfloorController', function ($scope, $translate, $uibModal, C
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.SHOPFLOOR") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.SHOPFLOOR") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -144,18 +144,11 @@ app.controller('ShopfloorController', function ($scope, $translate, $uibModal, C
showCloseButton: true,
});
$scope.$emit('handleEmitShopfloorChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.SHOPFLOOR") }),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.SHOPFLOOR") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -153,8 +153,8 @@ app.controller('SpaceController', function ($scope, $uibModal, SpaceService, Cos
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.SPACE") }),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.SPACE") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -206,8 +206,8 @@ app.controller('SpaceController', function ($scope, $uibModal, SpaceService, Cos
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.SPACE") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.SPACE") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -240,18 +240,11 @@ app.controller('SpaceController', function ($scope, $uibModal, SpaceService, Cos
showCloseButton: true,
});
$scope.$emit('handleEmitSpaceChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "success",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.SPACE") }),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.SPACE") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -76,8 +76,8 @@ $scope.getAllStoreTypes = function() {
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant(popBody,{"TOASTER.ERROR_ADD_BODY": $translate.instant("COMMON.STORE")}),
title: $translate.instant(popBody,{"TOASTER.ERROR_ADD_BODY": $translate.instant("COMMON.STORE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -123,8 +123,8 @@ $scope.getAllStoreTypes = function() {
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.STORE")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("COMMON.STORE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -156,18 +156,11 @@ $scope.getAllStoreTypes = function() {
showCloseButton: true,
});
$scope.$emit('handleEmitStoreChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.STORE")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("COMMON.STORE")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -40,8 +40,8 @@ app.controller('FlatController', function($scope,$uibModal,$translate, FlatServi
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("TOASTER.FLAT")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("TOASTER.FLAT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -79,8 +79,8 @@ app.controller('FlatController', function($scope,$uibModal,$translate, FlatServi
}else{
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("TOASTER.FLAT")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("TOASTER.FLAT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -115,8 +115,8 @@ app.controller('FlatController', function($scope,$uibModal,$translate, FlatServi
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("TOASTER.FLAT")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("TOASTER.FLAT")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -54,8 +54,8 @@ app.controller('TariffController', function($scope,$uibModal,$translate, TARIFF_
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.TARIFF")}),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", {template: $translate.instant("SETTING.TARIFF")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -94,8 +94,8 @@ app.controller('TariffController', function($scope,$uibModal,$translate, TARIFF_
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.TARIFF")}),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", {template: $translate.instant("SETTING.TARIFF")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -131,8 +131,8 @@ app.controller('TariffController', function($scope,$uibModal,$translate, TARIFF_
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.TARIFF")}),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", {template: $translate.instant("SETTING.TARIFF")}),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -82,8 +82,8 @@ app.controller('TenantController', function ($scope, $translate, $uibModal, Cost
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.TENANT") }),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("COMMON.TENANT") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -135,8 +135,8 @@ app.controller('TenantController', function ($scope, $translate, $uibModal, Cost
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.TENANT") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("COMMON.TENANT") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -169,18 +169,11 @@ app.controller('TenantController', function ($scope, $translate, $uibModal, Cost
showCloseButton: true,
});
$scope.$emit('handleEmitTenantChanged');
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.TENANT") }),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("COMMON.TENANT") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -43,8 +43,8 @@ app.controller('PrivilegeController', function ($scope,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("USER.PRIVILEGE") }),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("USER.PRIVILEGE") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -82,8 +82,8 @@ app.controller('PrivilegeController', function ($scope,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("USER.PRIVILEGE") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("USER.PRIVILEGE") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -116,18 +116,11 @@ app.controller('PrivilegeController', function ($scope,
showCloseButton: true,
});
$scope.getAllPrivileges();
} else if (angular.isDefined(response.status) && response.status === 400) {
toaster.pop({
type: "error",
title: $translate.instant(response.data.title),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("USER.PRIVILEGE") }),
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("USER.PRIVILEGE") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}

View File

@ -57,8 +57,8 @@ app.controller('UserController', function ($scope,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("SETTING.USER") }),
title: $translate.instant("TOASTER.ERROR_ADD_BODY", { template: $translate.instant("SETTING.USER") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -96,8 +96,8 @@ app.controller('UserController', function ($scope,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("SETTING.USER") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("SETTING.USER") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -140,8 +140,8 @@ app.controller('UserController', function ($scope,
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("SETTING.USER") }),
title: $translate.instant("TOASTER.ERROR_UPDATE_BODY", { template: $translate.instant("SETTING.USER") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
@ -163,28 +163,28 @@ app.controller('UserController', function ($scope,
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
UserService.deleteUser(user, function (response) {
if (angular.isDefined(response.status) && response.status === 204) {
toaster.pop({
type: "success",
title: $translate.instant("TOASTER.SUCCESS_TITLE"),
body: $translate.instant("TOASTER.SUCCESS_DELETE_BODY", { template: $translate.instant("SETTING.USER") }),
showCloseButton: true,
});
$scope.getAllUsers();
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.FAILURE_TITLE"),
body: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("SETTING.USER") }),
showCloseButton: true,
});
}
});
}
});
function (isConfirm) {
if (isConfirm) {
UserService.deleteUser(user, function (response) {
if (angular.isDefined(response.status) && response.status === 204) {
toaster.pop({
type: "success",
title: $translate.instant("TOASTER.SUCCESS_TITLE"),
body: $translate.instant("TOASTER.SUCCESS_DELETE_BODY", { template: $translate.instant("SETTING.USER") }),
showCloseButton: true,
});
$scope.getAllUsers();
} else {
toaster.pop({
type: "error",
title: $translate.instant("TOASTER.ERROR_DELETE_BODY", { template: $translate.instant("SETTING.USER") }),
body: $translate.instant(response.data.description),
showCloseButton: true,
});
}
});
}
});
};
$scope.getAllUsers();

View File

@ -552,10 +552,11 @@ function config($translateProvider) {
DELETE: 'Delete',
},
TOASTER: {
FAILURE_TITLE: 'Error',
SUCCESS_TITLE: 'Success',
LOGIN_SUCCESS: 'Login Success',
LOGIN_FAILURE: 'Login Failure',
LOGOUT_SUCCESS: 'Logout Success',
LOGOUT_FAILURE: 'Logout Failure',
SUCCESS_ADD_BODY: 'Add {{template}} Success',
SUCCESS_UPDATE_BODY: 'Update {{template}} Success',
@ -1538,10 +1539,11 @@ function config($translateProvider) {
DELETE: '删除',
},
TOASTER: {
FAILURE_TITLE: '错误',
SUCCESS_TITLE: '成功',
LOGIN_SUCCESS: '登录成功。',
LOGIN_FAILURE: '登录失败。',
LOGIN_SUCCESS: '登录成功',
LOGIN_FAILURE: '登录失败',
LOGOUT_SUCCESS: '退出成功',
LOGOUT_FAILURE: '退出失败',
SUCCESS_ADD_BODY: '添加 {{template}} 成功',
SUCCESS_UPDATE_BODY: '更新 {{template}} 成功',
@ -2525,10 +2527,11 @@ function config($translateProvider) {
DELETE: 'löschen',
},
TOASTER: {
FAILURE_TITLE: 'Error',
SUCCESS_TITLE: 'Erfolg',
LOGIN_SUCCESS: 'Anmeldung erfolgreich',
LOGIN_FAILURE: 'Login fehlgeschlagen',
LOGOUT_SUCCESS: 'Abmeldung erfolgreich',
LOGOUT_FAILURE: 'Abmeldefehler',
SUCCESS_ADD_BODY: 'Fügen Sie {{template}} erfolgreich hinzu',
SUCCESS_UPDATE_BODY: 'Update {{template}} erfolgreich',