From 48e514a8d17a1fac67d5d2d492644da01f868ce0 Mon Sep 17 00:00:00 2001 From: llis <2227043858@qq.com> Date: Mon, 1 Jan 2024 11:40:09 +0800 Subject: [PATCH 1/2] Updated API save button logic and auto-close dialog --- .../users/apikey/apikey.controller.js | 18 +++++++++++++++++- .../views/users/apikey/apikey.model.html | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/myems-admin/app/controllers/users/apikey/apikey.controller.js b/myems-admin/app/controllers/users/apikey/apikey.controller.js index a957488ff0..9ac26e9e84 100644 --- a/myems-admin/app/controllers/users/apikey/apikey.controller.js +++ b/myems-admin/app/controllers/users/apikey/apikey.controller.js @@ -1,6 +1,7 @@ 'use strict'; app.controller('ApiKeyController', function ( $scope, + $rootScope, $window, $uibModal, ApiKeyService, @@ -49,6 +50,7 @@ app.controller('ApiKeyController', function ( }, function () { }); + $rootScope.modalInstance = modalInstance; }; $scope.editApiKey = function (apiKey) { @@ -87,6 +89,7 @@ app.controller('ApiKeyController', function ( }, function () { //do nothing; }); + $rootScope.modalInstance = modalInstance; }; $scope.deleteApiKey = function (apiKey) { @@ -127,10 +130,16 @@ app.controller('ApiKeyController', function ( }; $scope.getAllApiKeys(); - }); app.controller('ModalAddApiKeyCtrl', function ($scope, $uibModalInstance) { + $scope.isButtonDisabled = function() { + if ($scope.apiKey.name && $scope.apiKey.expires_datetime_utc > $scope.apiKey.created_datetime_utc) { + return false; + } else { + return true; + } + }; $scope.operation = "USER.ADD_API_KEY"; $scope.apiKey = { created_datetime_utc:moment(), @@ -162,6 +171,13 @@ app.controller('ModalAddApiKeyCtrl', function ($scope, $uibModalInstance) { app.controller('ModalEditApiKeyCtrl', function ($scope, $uibModalInstance, params) { + $scope.isButtonDisabled = function() { + if ($scope.apiKey.name && $scope.apiKey.expires_datetime_utc > $scope.apiKey.created_datetime_utc) { + return false; + } else { + return true; + } + }; $scope.operation = "USER.EDIT_API_KEY"; $scope.apiKey = params.apiKey; $scope.flag = false; diff --git a/myems-admin/views/users/apikey/apikey.model.html b/myems-admin/views/users/apikey/apikey.model.html index acad050b96..498dfb419c 100644 --- a/myems-admin/views/users/apikey/apikey.model.html +++ b/myems-admin/views/users/apikey/apikey.model.html @@ -43,6 +43,6 @@ \ No newline at end of file From 30f2c09e3a9ab0a9dc6cc5e1015e7deedfe0295e Mon Sep 17 00:00:00 2001 From: nengyuanzhang <13011132526@163.com> Date: Mon, 1 Jan 2024 14:15:11 +0800 Subject: [PATCH 2/2] fixed api key save button issue in myems-admin --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 035d78b62a..c00908cce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - fixed non-standard actions of microgrid in myems-api and myems-admin - fixed empty qrcode issue when creating objects in myems-admin - upgraded Font Awesome to v4.7.0 in myems-admin +- fixed api key save button issue in myems-admin ### Removed -