added expiration datetimes to User in Admin UI

pull/67/head
13621160019@163.com 2021-09-22 11:28:33 +08:00 committed by Caozhenhui
parent 344d928ce9
commit ff501fdf2f
14 changed files with 129 additions and 81 deletions

View File

@ -390,7 +390,7 @@ app
deps: [ deps: [
'$ocLazyLoad', '$ocLazyLoad',
function ($ocLazyLoad) { function ($ocLazyLoad) {
return $ocLazyLoad.load(['ui.select', 'toaster']).then( return $ocLazyLoad.load(['ui.select', 'daterangepicker', 'toaster']).then(
function () { function () {
return $ocLazyLoad.load([{ return $ocLazyLoad.load([{
serie: true, serie: true,
@ -768,7 +768,7 @@ app
deps: [ deps: [
'$ocLazyLoad', '$ocLazyLoad',
function ($ocLazyLoad) { function ($ocLazyLoad) {
return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'toaster']).then( return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'daterangepicker', 'toaster']).then(
function () { function () {
return $ocLazyLoad.load([{ return $ocLazyLoad.load([{
serie: true, serie: true,
@ -781,9 +781,6 @@ app
}, { }, {
name: 'oitozero.ngSweetAlert', name: 'oitozero.ngSweetAlert',
files: ['js/plugins/sweetalert/angular-sweetalert.min.js'] files: ['js/plugins/sweetalert/angular-sweetalert.min.js']
}, {
name: 'daterangepicker',
files: ['js/daterangepicker/angular-daterangepicker.min.js']
}, { }, {
serie: true, serie: true,
files: [ files: [
@ -824,7 +821,7 @@ app
deps: [ deps: [
'$ocLazyLoad', '$ocLazyLoad',
function ($ocLazyLoad) { function ($ocLazyLoad) {
return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'toaster']).then( return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'daterangepicker', 'toaster']).then(
function () { function () {
return $ocLazyLoad.load([{ return $ocLazyLoad.load([{
serie: true, serie: true,
@ -837,9 +834,6 @@ app
}, { }, {
name: 'oitozero.ngSweetAlert', name: 'oitozero.ngSweetAlert',
files: ['js/plugins/sweetalert/angular-sweetalert.min.js'] files: ['js/plugins/sweetalert/angular-sweetalert.min.js']
}, {
name: 'daterangepicker',
files: ['js/daterangepicker/angular-daterangepicker.min.js']
}, { }, {
serie: true, serie: true,
files: [ files: [
@ -880,7 +874,7 @@ app
deps: [ deps: [
'$ocLazyLoad', '$ocLazyLoad',
function ($ocLazyLoad) { function ($ocLazyLoad) {
return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'toaster']).then( return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'daterangepicker', 'toaster']).then(
function () { function () {
return $ocLazyLoad.load([{ return $ocLazyLoad.load([{
serie: true, serie: true,
@ -893,9 +887,6 @@ app
}, { }, {
name: 'oitozero.ngSweetAlert', name: 'oitozero.ngSweetAlert',
files: ['js/plugins/sweetalert/angular-sweetalert.min.js'] files: ['js/plugins/sweetalert/angular-sweetalert.min.js']
}, {
name: 'daterangepicker',
files: ['js/daterangepicker/angular-daterangepicker.min.js']
}, { }, {
serie: true, serie: true,
files: [ files: [
@ -1171,9 +1162,15 @@ app
deps: [ deps: [
'$ocLazyLoad', '$ocLazyLoad',
function ($ocLazyLoad) { function ($ocLazyLoad) {
return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'toaster']).then( return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'daterangepicker','toaster']).then(
function () { function () {
return $ocLazyLoad.load([{ return $ocLazyLoad.load([{
serie: true,
files: ['js/daterangepicker/daterangepicker.min.js', 'js/daterangepicker/daterangepicker.min.css']
}, {
name: 'daterangepicker',
files: ['js/daterangepicker/angular-daterangepicker.min.js']
}, {
files: ['js/plugins/sweetalert/sweetalert.min.js', 'css/plugins/sweetalert/sweetalert.css'] files: ['js/plugins/sweetalert/sweetalert.min.js', 'css/plugins/sweetalert/sweetalert.css']
}, { }, {
name: 'oitozero.ngSweetAlert', name: 'oitozero.ngSweetAlert',

View File

@ -15,10 +15,10 @@ app.controller('EmailMessageOptionController', function($scope, $timeout,
autoApply: true, autoApply: true,
locale:{ locale:{
format: 'YYYY-MM-DD', format: 'YYYY-MM-DD',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
}, },
eventHandlers:{ eventHandlers:{
'apply.daterangepicker':function(ev,picker){ 'apply.daterangepicker':function(ev,picker){
//$scope.execute(); //$scope.execute();
@ -37,13 +37,13 @@ app.controller('EmailMessageOptionController', function($scope, $timeout,
load: true, load: true,
period:$scope.currentPeriod period:$scope.currentPeriod
}); });
EmailMessageAnalysisService.getAnalysisResult(query, function(response) { EmailMessageAnalysisService.getAnalysisResult(query, function(response) {
if (angular.isDefined(response.status) && response.status === 200) { if (angular.isDefined(response.status) && response.status === 200) {
$scope.$emit('handleEmitEmailMessageOptionChanged', response.data); $scope.$emit('handleEmitEmailMessageOptionChanged', response.data);
} }
}); });
}; };
$timeout(function() { $timeout(function() {
$scope.execute(); $scope.execute();

View File

@ -15,10 +15,10 @@ app.controller('TextMessageOptionController', function($scope, $timeout,
autoApply: true, autoApply: true,
locale:{ locale:{
format: 'YYYY-MM-DD', format: 'YYYY-MM-DD',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
}, },
eventHandlers:{ eventHandlers:{
'apply.daterangepicker':function(ev,picker){ 'apply.daterangepicker':function(ev,picker){
//$scope.execute(); //$scope.execute();
@ -37,13 +37,13 @@ app.controller('TextMessageOptionController', function($scope, $timeout,
load: true, load: true,
period:$scope.currentPeriod period:$scope.currentPeriod
}); });
TextMessageAnalysisService.getAnalysisResult(query, function (response) { TextMessageAnalysisService.getAnalysisResult(query, function (response) {
if (angular.isDefined(response.status) && response.status === 200) { if (angular.isDefined(response.status) && response.status === 200) {
$scope.$emit('handleEmitTextMessageOptionChanged', response.data); $scope.$emit('handleEmitTextMessageOptionChanged', response.data);
} }
}); });
}; };
$timeout(function() { $timeout(function() {
$scope.execute(); $scope.execute();

View File

@ -15,8 +15,8 @@ app.controller('WebMessageOptionController', function($scope, $timeout,
autoApply: true, autoApply: true,
locale:{ locale:{
format: 'YYYY-MM-DD', format: 'YYYY-MM-DD',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
}, },
eventHandlers:{ eventHandlers:{

View File

@ -15,8 +15,8 @@ app.controller('WechatMessageOptionController', function($scope, $timeout,
autoApply: true, autoApply: true,
locale:{ locale:{
format: 'YYYY-MM-DD', format: 'YYYY-MM-DD',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
}, },
eventHandlers:{ eventHandlers:{

View File

@ -158,9 +158,8 @@ app.controller('ModalAddTariffCtrl', function($scope, $timeout, $uibModalInstanc
$scope.dtOptions = { $scope.dtOptions = {
locale:{ locale:{
format: 'YYYY-MM-DD HH:mm:ss', format: 'YYYY-MM-DD HH:mm:ss',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
customRangeLabel: "自定义",
}, },
timePicker: true, timePicker: true,
timePicker24Hour: true, timePicker24Hour: true,
@ -240,9 +239,8 @@ app.controller('ModalEditTariffCtrl', function($scope, $timeout, $uibModalInstan
$scope.dtOptions = { $scope.dtOptions = {
locale:{ locale:{
format: 'YYYY-MM-DD HH:mm:ss', format: 'YYYY-MM-DD HH:mm:ss',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
customRangeLabel: "自定义",
}, },
timePicker: true, timePicker: true,
timePicker24Hour: true, timePicker24Hour: true,

View File

@ -203,9 +203,8 @@ app.controller('ModalAddTenantCtrl', function ($scope, $uibModalInstance, params
$scope.dtOptions = { $scope.dtOptions = {
locale: { locale: {
format: 'YYYY-MM-DD HH:mm:ss', format: 'YYYY-MM-DD HH:mm:ss',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
customRangeLabel: "自定义",
}, },
timePicker: true, timePicker: true,
timePicker24Hour: true, timePicker24Hour: true,
@ -232,9 +231,8 @@ app.controller('ModalEditTenantCtrl', function ($scope, $uibModalInstance, param
$scope.dtOptions = { $scope.dtOptions = {
locale: { locale: {
format: 'YYYY-MM-DD HH:mm:ss', format: 'YYYY-MM-DD HH:mm:ss',
applyLabel: "确定", applyLabel: "OK",
cancelLabel: "取消", cancelLabel: "Cancel",
customRangeLabel: "自定义",
}, },
timePicker: true, timePicker: true,
timePicker24Hour: true, timePicker24Hour: true,

View File

@ -1,12 +1,12 @@
'use strict'; 'use strict';
app.controller('UserController', function ($scope, app.controller('UserController', function ($scope,
$window, $window,
$uibModal, $uibModal,
UserService, UserService,
PrivilegeService, PrivilegeService,
toaster, toaster,
$translate, $translate,
SweetAlert) { SweetAlert) {
$scope.cur_user = JSON.parse($window.localStorage.getItem("myems_admin_ui_current_user")); $scope.cur_user = JSON.parse($window.localStorage.getItem("myems_admin_ui_current_user"));
@ -123,7 +123,7 @@ app.controller('UserController', function ($scope,
modalInstance.result.then(function (modifiedUser) { modalInstance.result.then(function (modifiedUser) {
let data = { let data = {
name: modifiedUser.name, name: modifiedUser.name,
password: modifiedUser.password }; password: modifiedUser.password };
let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token }; let headers = { "User-UUID": $scope.cur_user.uuid, "Token": $scope.cur_user.token };
@ -190,7 +190,6 @@ app.controller('UserController', function ($scope,
$scope.getAllUsers(); $scope.getAllUsers();
$scope.getAllPrivileges(); $scope.getAllPrivileges();
}); });
app.controller('ModalAddUserCtrl', function ($scope, $uibModalInstance, params) { app.controller('ModalAddUserCtrl', function ($scope, $uibModalInstance, params) {
@ -198,12 +197,27 @@ app.controller('ModalAddUserCtrl', function ($scope, $uibModalInstance, params)
$scope.operation = "USER.ADD_USER"; $scope.operation = "USER.ADD_USER";
$scope.privileges = params.privileges; $scope.privileges = params.privileges;
$scope.user = { $scope.user = {
is_admin: false is_admin: false,
account_expiration_datetime:moment(),
password_expiration_datetime:moment()
}; };
$scope.dtOptions = {
locale:{
format: 'YYYY-MM-DD HH:mm:ss',
applyLabel: "OK",
cancelLabel: "Cancel",
},
timePicker: true,
timePicker24Hour: true,
timePickerIncrement: 15,
singleDatePicker: true,
};
$scope.ok = function () { $scope.ok = function () {
if ($scope.user.is_admin) { if ($scope.user.is_admin) {
$scope.user.privilege_id = undefined; $scope.user.privilege_id = undefined;
} }
$scope.user.account_expiration_datetime = $scope.user.account_expiration_datetime.format().slice(0,19);
$scope.user.password_expiration_datetime = $scope.user.password_expiration_datetime.format().slice(0,19);
$uibModalInstance.close($scope.user); $uibModalInstance.close($scope.user);
}; };
@ -213,7 +227,7 @@ app.controller('ModalAddUserCtrl', function ($scope, $uibModalInstance, params)
}); });
app.controller('ModalEditUserCtrl', function ($scope, $uibModalInstance, params) { app.controller('ModalEditUserCtrl', function ($scope, $uibModalInstance, params) {
$scope.operation = "USER.EDIT_USER"; $scope.operation = "USER.EDIT_USER";
$scope.user = params.user; $scope.user = params.user;
$scope.privileges = params.privileges; $scope.privileges = params.privileges;
@ -222,11 +236,24 @@ app.controller('ModalEditUserCtrl', function ($scope, $uibModalInstance, params)
} else { } else {
$scope.user.privilege_id = undefined; $scope.user.privilege_id = undefined;
} }
$scope.dtOptions = {
locale: {
format: 'YYYY-MM-DD HH:mm:ss',
applyLabel: "OK",
cancelLabel: "Cancel",
},
timePicker: true,
timePicker24Hour: true,
timePickerIncrement: 15,
singleDatePicker: true,
};
$scope.ok = function () { $scope.ok = function () {
if ($scope.user.is_admin) { if ($scope.user.is_admin) {
$scope.user.privilege_id = undefined; $scope.user.privilege_id = undefined;
} }
$uibModalInstance.close($scope.user); $scope.user.account_expiration_datetime = moment($scope.user.account_expiration_datetime).format().slice(0,19);
$scope.user.password_expiration_datetime = moment($scope.user.password_expiration_datetime).format().slice(0,19);
$uibModalInstance.close($scope.user);
}; };
$scope.cancel = function () { $scope.cancel = function () {

View File

@ -544,6 +544,8 @@ function config($translateProvider) {
EMAIL: 'Email', EMAIL: 'Email',
INPUT_EMAIL: 'Please Input Email', INPUT_EMAIL: 'Please Input Email',
INVALID_EMAIL: 'Invalid Email Format(xxx@xxx.xx)', INVALID_EMAIL: 'Invalid Email Format(xxx@xxx.xx)',
ACCOUNT_EXPIRATION_DATETIME: 'Account Expiration Datetime',
PASSWORD_EXPIRATION_DATETIME: 'Password Expiration Datetime',
}, },
KNOWLEDGEFILE: { KNOWLEDGEFILE: {
KNOWLEDGE_FILE_LIST: 'Knowledge File List', KNOWLEDGE_FILE_LIST: 'Knowledge File List',
@ -669,8 +671,6 @@ function config($translateProvider) {
FAILED_TO_UPLOAD_OFFLINE_METER_FILE: 'Failed To Upload Offline Meter File', FAILED_TO_UPLOAD_OFFLINE_METER_FILE: 'Failed To Upload Offline Meter File',
GATEWAY_NAME_IS_ALREADY_IN_USE: 'Gateway Name Is Already In Use', GATEWAY_NAME_IS_ALREADY_IN_USE: 'Gateway Name Is Already In Use',
GATEWAY_NOT_FOUND: 'Gateway Not Found', GATEWAY_NOT_FOUND: 'Gateway Not Found',
GSM_MODEM_NOT_FOUND: 'Gsm Modem Not Found',
GSM_MODEM_SERIAL_PORT_IS_ALREADY_IN_USE: 'Gsm Modem Serial Port Is Already In Use',
INVALID_ADDRESS: 'Invalid Address', INVALID_ADDRESS: 'Invalid Address',
INVALID_ADDRESS_VALUE: 'Invalid Address Value', INVALID_ADDRESS_VALUE: 'Invalid Address Value',
INVALID_ADVANCED_REPORT_ID: 'Invalid Advanced Report ID', INVALID_ADVANCED_REPORT_ID: 'Invalid Advanced Report ID',
@ -736,7 +736,6 @@ function config($translateProvider) {
INVALID_FROM_ADDR: 'Invalid From Address', INVALID_FROM_ADDR: 'Invalid From Address',
INVALID_GATEWAY_ID: 'Invalid Gateway ID', INVALID_GATEWAY_ID: 'Invalid Gateway ID',
INVALID_GATEWAY_NAME: 'Invalid Gateway Name', INVALID_GATEWAY_NAME: 'Invalid Gateway Name',
INVALID_GSM_MODEM_ID: 'Invalid Gsm Modem ID',
INVALID_HOURLY_HIGH_LIMIT_VALUE: 'Invalid Hourly High Limit Value', INVALID_HOURLY_HIGH_LIMIT_VALUE: 'Invalid Hourly High Limit Value',
INVALID_HOURLY_LOW_LIMIT_VALUE: 'Invalid Hourly Low Limit Value', INVALID_HOURLY_LOW_LIMIT_VALUE: 'Invalid Hourly Low Limit Value',
INVALID_IS_ADMIN_VALUE: 'Invalid Is Admin Value', INVALID_IS_ADMIN_VALUE: 'Invalid Is Admin Value',
@ -981,8 +980,10 @@ function config($translateProvider) {
THIS_SPACE_CANNOT_BE_DELETED: 'This Space Cannot Be Deleted', THIS_SPACE_CANNOT_BE_DELETED: 'This Space Cannot Be Deleted',
TIMEZONE_NOT_FOUND: 'Timezone Not Found', TIMEZONE_NOT_FOUND: 'Timezone Not Found',
TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN: 'Token Not Found In Headers Please Login', TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN: 'Token Not Found In Headers Please Login',
USER_ACCOUNT_HAS_EXPIRED: 'User Account Has Expired',
USER_NAME_IS_ALREADY_IN_USE: 'User Name Is Already In Use', USER_NAME_IS_ALREADY_IN_USE: 'User Name Is Already In Use',
USER_NOT_FOUND: 'User Not Found', USER_NOT_FOUND: 'User Not Found',
USER_PASSWORD_HAS_EXPIRED: 'User Password Has Expired',
USER_PRIVILEGE_NOT_FOUND: 'User Privilege Not Found', USER_PRIVILEGE_NOT_FOUND: 'User Privilege Not Found',
USER_SESSION_NOT_FOUND: 'User Session Not Found', USER_SESSION_NOT_FOUND: 'User Session Not Found',
USER_SESSION_TIMEOUT: 'User Session Timeout', USER_SESSION_TIMEOUT: 'User Session Timeout',
@ -1539,6 +1540,8 @@ function config($translateProvider) {
EMAIL: '邮箱', EMAIL: '邮箱',
INPUT_EMAIL: '请输入邮箱', INPUT_EMAIL: '请输入邮箱',
INVALID_EMAIL: '邮箱格式不正确(xxx@xxx.xx)', INVALID_EMAIL: '邮箱格式不正确(xxx@xxx.xx)',
ACCOUNT_EXPIRATION_DATETIME: '账户失效时间',
PASSWORD_EXPIRATION_DATETIME: '密码失效时间',
}, },
KNOWLEDGEFILE: { KNOWLEDGEFILE: {
KNOWLEDGE_FILE_LIST: '知识文件列表', KNOWLEDGE_FILE_LIST: '知识文件列表',
@ -1666,8 +1669,6 @@ function config($translateProvider) {
FAILED_TO_UPLOAD_OFFLINE_METER_FILE: 'Failed To Upload Offline Meter File', FAILED_TO_UPLOAD_OFFLINE_METER_FILE: 'Failed To Upload Offline Meter File',
GATEWAY_NAME_IS_ALREADY_IN_USE: 'Gateway Name Is Already In Use', GATEWAY_NAME_IS_ALREADY_IN_USE: 'Gateway Name Is Already In Use',
GATEWAY_NOT_FOUND: 'Gateway Not Found', GATEWAY_NOT_FOUND: 'Gateway Not Found',
GSM_MODEM_NOT_FOUND: 'Gsm Modem Not Found',
GSM_MODEM_SERIAL_PORT_IS_ALREADY_IN_USE: 'Gsm Modem Serial Port Is Already In Use',
INVALID_ADDRESS: 'Invalid Address', INVALID_ADDRESS: 'Invalid Address',
INVALID_ADDRESS_VALUE: 'Invalid Address Value', INVALID_ADDRESS_VALUE: 'Invalid Address Value',
INVALID_ADVANCED_REPORT_ID: 'Invalid Advanced Report ID', INVALID_ADVANCED_REPORT_ID: 'Invalid Advanced Report ID',
@ -1733,7 +1734,6 @@ function config($translateProvider) {
INVALID_FROM_ADDR: 'Invalid From Address', INVALID_FROM_ADDR: 'Invalid From Address',
INVALID_GATEWAY_ID: 'Invalid Gateway ID', INVALID_GATEWAY_ID: 'Invalid Gateway ID',
INVALID_GATEWAY_NAME: 'Invalid Gateway Name', INVALID_GATEWAY_NAME: 'Invalid Gateway Name',
INVALID_GSM_MODEM_ID: 'Invalid Gsm Modem ID',
INVALID_HOURLY_HIGH_LIMIT_VALUE: 'Invalid Hourly High Limit Value', INVALID_HOURLY_HIGH_LIMIT_VALUE: 'Invalid Hourly High Limit Value',
INVALID_HOURLY_LOW_LIMIT_VALUE: 'Invalid Hourly Low Limit Value', INVALID_HOURLY_LOW_LIMIT_VALUE: 'Invalid Hourly Low Limit Value',
INVALID_IS_ADMIN_VALUE: 'Invalid Is Admin Value', INVALID_IS_ADMIN_VALUE: 'Invalid Is Admin Value',
@ -1978,8 +1978,10 @@ function config($translateProvider) {
THIS_SPACE_CANNOT_BE_DELETED: 'This Space Cannot Be Deleted', THIS_SPACE_CANNOT_BE_DELETED: 'This Space Cannot Be Deleted',
TIMEZONE_NOT_FOUND: 'Timezone Not Found', TIMEZONE_NOT_FOUND: 'Timezone Not Found',
TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN: 'Token Not Found In Headers Please Login', TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN: 'Token Not Found In Headers Please Login',
USER_ACCOUNT_HAS_EXPIRED: 'User Account Has Expired',
USER_NAME_IS_ALREADY_IN_USE: 'User Name Is Already In Use', USER_NAME_IS_ALREADY_IN_USE: 'User Name Is Already In Use',
USER_NOT_FOUND: 'User Not Found', USER_NOT_FOUND: 'User Not Found',
USER_PASSWORD_HAS_EXPIRED: 'User Password Has Expired',
USER_PRIVILEGE_NOT_FOUND: 'User Privilege Not Found', USER_PRIVILEGE_NOT_FOUND: 'User Privilege Not Found',
USER_SESSION_NOT_FOUND: 'User Session Not Found', USER_SESSION_NOT_FOUND: 'User Session Not Found',
USER_SESSION_TIMEOUT: 'User Session Timeout', USER_SESSION_TIMEOUT: 'User Session Timeout',
@ -2535,6 +2537,8 @@ function config($translateProvider) {
EMAIL: 'Briefkasten', EMAIL: 'Briefkasten',
INPUT_EMAIL: 'Bitte geben Sie Ihre E-Mail-Adresse ein', INPUT_EMAIL: 'Bitte geben Sie Ihre E-Mail-Adresse ein',
INVALID_EMAIL: 'Falsches E-Mail-Format (xxx@xxx.xx)', INVALID_EMAIL: 'Falsches E-Mail-Format (xxx@xxx.xx)',
ACCOUNT_EXPIRATION_DATETIME: 'Ablaufdatum des Kontos',
PASSWORD_EXPIRATION_DATETIME: 'Ablaufdatum des Passworts',
}, },
KNOWLEDGEFILE: { KNOWLEDGEFILE: {
KNOWLEDGE_FILE_LIST: 'Liste der Wissensdateien', KNOWLEDGE_FILE_LIST: 'Liste der Wissensdateien',
@ -2662,8 +2666,6 @@ function config($translateProvider) {
FAILED_TO_UPLOAD_OFFLINE_METER_FILE: 'Failed To Upload Offline Meter File', FAILED_TO_UPLOAD_OFFLINE_METER_FILE: 'Failed To Upload Offline Meter File',
GATEWAY_NAME_IS_ALREADY_IN_USE: 'Gateway Name Is Already In Use', GATEWAY_NAME_IS_ALREADY_IN_USE: 'Gateway Name Is Already In Use',
GATEWAY_NOT_FOUND: 'Gateway Not Found', GATEWAY_NOT_FOUND: 'Gateway Not Found',
GSM_MODEM_NOT_FOUND: 'Gsm Modem Not Found',
GSM_MODEM_SERIAL_PORT_IS_ALREADY_IN_USE: 'Gsm Modem Serial Port Is Already In Use',
INVALID_ADDRESS: 'Invalid Address', INVALID_ADDRESS: 'Invalid Address',
INVALID_ADDRESS_VALUE: 'Invalid Address Value', INVALID_ADDRESS_VALUE: 'Invalid Address Value',
INVALID_ADVANCED_REPORT_ID: 'Invalid Advanced Report ID', INVALID_ADVANCED_REPORT_ID: 'Invalid Advanced Report ID',
@ -2729,7 +2731,6 @@ function config($translateProvider) {
INVALID_FROM_ADDR: 'Invalid From Address', INVALID_FROM_ADDR: 'Invalid From Address',
INVALID_GATEWAY_ID: 'Invalid Gateway ID', INVALID_GATEWAY_ID: 'Invalid Gateway ID',
INVALID_GATEWAY_NAME: 'Invalid Gateway Name', INVALID_GATEWAY_NAME: 'Invalid Gateway Name',
INVALID_GSM_MODEM_ID: 'Invalid Gsm Modem ID',
INVALID_HOURLY_HIGH_LIMIT_VALUE: 'Invalid Hourly High Limit Value', INVALID_HOURLY_HIGH_LIMIT_VALUE: 'Invalid Hourly High Limit Value',
INVALID_HOURLY_LOW_LIMIT_VALUE: 'Invalid Hourly Low Limit Value', INVALID_HOURLY_LOW_LIMIT_VALUE: 'Invalid Hourly Low Limit Value',
INVALID_IS_ADMIN_VALUE: 'Invalid Is Admin Value', INVALID_IS_ADMIN_VALUE: 'Invalid Is Admin Value',
@ -2974,8 +2975,10 @@ function config($translateProvider) {
THIS_SPACE_CANNOT_BE_DELETED: 'This Space Cannot Be Deleted', THIS_SPACE_CANNOT_BE_DELETED: 'This Space Cannot Be Deleted',
TIMEZONE_NOT_FOUND: 'Timezone Not Found', TIMEZONE_NOT_FOUND: 'Timezone Not Found',
TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN: 'Token Not Found In Headers Please Login', TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN: 'Token Not Found In Headers Please Login',
USER_ACCOUNT_HAS_EXPIRED: 'User Account Has Expired',
USER_NAME_IS_ALREADY_IN_USE: 'User Name Is Already In Use', USER_NAME_IS_ALREADY_IN_USE: 'User Name Is Already In Use',
USER_NOT_FOUND: 'User Not Found', USER_NOT_FOUND: 'User Not Found',
USER_PASSWORD_HAS_EXPIRED: 'User Password Has Expired',
USER_PRIVILEGE_NOT_FOUND: 'User Privilege Not Found', USER_PRIVILEGE_NOT_FOUND: 'User Privilege Not Found',
USER_SESSION_NOT_FOUND: 'User Session Not Found', USER_SESSION_NOT_FOUND: 'User Session Not Found',
USER_SESSION_TIMEOUT: 'User Session Timeout', USER_SESSION_TIMEOUT: 'User Session Timeout',

View File

@ -19,7 +19,6 @@
<th class="text-center">{{'SETTING.START_DATETIME' | translate}}</th> <th class="text-center">{{'SETTING.START_DATETIME' | translate}}</th>
<th class="text-center">{{'SETTING.END_DATETIME' | translate}}</th> <th class="text-center">{{'SETTING.END_DATETIME' | translate}}</th>
<th class="text-center">{{'SETTING.ACTION' | translate}}</th> <th class="text-center">{{'SETTING.ACTION' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@ -17,8 +17,9 @@
<th class="text-center">{{'USER.EMAIL' | translate}}</th> <th class="text-center">{{'USER.EMAIL' | translate}}</th>
<th class="text-center">{{'USER.IS_ADMIN' | translate}}</th> <th class="text-center">{{'USER.IS_ADMIN' | translate}}</th>
<th class="text-center">{{'USER.PRIVILEGE' | translate}}</th> <th class="text-center">{{'USER.PRIVILEGE' | translate}}</th>
<th class="text-center">{{'USER.ACCOUNT_EXPIRATION_DATETIME' | translate}}</th>
<th class="text-center">{{'USER.PASSWORD_EXPIRATION_DATETIME' | translate}}</th>
<th class="text-center">{{'SETTING.ACTION' | translate}}</th> <th class="text-center">{{'SETTING.ACTION' | translate}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -27,8 +28,10 @@
<td class="text-center">{{ user.name }}</td> <td class="text-center">{{ user.name }}</td>
<td class="text-center">{{ user.display_name }}</td> <td class="text-center">{{ user.display_name }}</td>
<td class="text-center">{{ user.email }}</td> <td class="text-center">{{ user.email }}</td>
<td class="text-center">{{ user.is_admin==1?'是':'否' }}</td> <td class="text-center">{{ user.is_admin==1?'Y':'N' }}</td>
<td class="text-center">{{ user.privilege.name }}</td> <td class="text-center">{{ user.privilege.name }}</td>
<td class="text-center">{{ user.account_expiration_datetime }}</td>
<td class="text-center">{{ user.password_expiration_datetime }}</td>
<td class="text-center"> <td class="text-center">
<a class="btn btn-primary btn-rounded btn-xs" ng-click="editUser(user)" >{{'SETTING.EDIT' | translate}}</a> <a class="btn btn-primary btn-rounded btn-xs" ng-click="editUser(user)" >{{'SETTING.EDIT' | translate}}</a>
<a ng-hide="user.name=='administrator'" class="btn btn-info btn-rounded btn-xs" ng-click="resetPassword(user)" >{{'USER.RESET_PASSWORD' | translate}}</a> <a ng-hide="user.name=='administrator'" class="btn btn-info btn-rounded btn-xs" ng-click="resetPassword(user)" >{{'USER.RESET_PASSWORD' | translate}}</a>

View File

@ -59,7 +59,20 @@
</ui-select> </ui-select>
</div> </div>
</div> </div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-3 control-label">{{'USER.ACCOUNT_EXPIRATION_DATETIME' | translate}}</label>
<div class="col-sm-5">
<input date-range-picker class="form-control date-picker" type="text" ng-model="user.account_expiration_datetime" options="dtOptions"
placeholder="{{'SETTING.SELECT_DATE' | translate}}" readonly="" />
</div>
</div>
<div class="hr-line-dashed"></div>
<div class="form-group"><label class="col-sm-3 control-label">{{'USER.PASSWORD_EXPIRATION_DATETIME' | translate}}</label>
<div class="col-sm-5">
<input date-range-picker class="form-control date-picker" type="text" ng-model="user.password_expiration_datetime" options="dtOptions"
placeholder="{{'SETTING.SELECT_DATE' | translate}}" readonly="" />
</div>
</div>
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">

View File

@ -37,11 +37,17 @@ class UserCollection:
cursor.close() cursor.close()
cnx.disconnect() cnx.disconnect()
timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6])
if config.utc_offset[0] == '-':
timezone_offset = -timezone_offset
result = list() result = list()
if rows is not None and len(rows) > 0: if rows is not None and len(rows) > 0:
for row in rows: for row in rows:
account_expiration_datetime_utc = row[8].replace(tzinfo=timezone.utc) account_expiration_datetime_local = row[8].replace(tzinfo=timezone.utc) + \
password_expiration_datetime_utc = row[9].replace(tzinfo=timezone.utc) timedelta(minutes=timezone_offset)
password_expiration_datetime_local = row[9].replace(tzinfo=timezone.utc) + \
timedelta(minutes=timezone_offset)
meta_result = {"id": row[0], meta_result = {"id": row[0],
"name": row[1], "name": row[1],
"display_name": row[2], "display_name": row[2],
@ -51,8 +57,10 @@ class UserCollection:
"privilege": { "privilege": {
"id": row[6], "id": row[6],
"name": row[7]} if row[6] is not None else None, "name": row[7]} if row[6] is not None else None,
"account_expiration_datetime": account_expiration_datetime_utc.timestamp() * 1000, "account_expiration_datetime":
"password_expiration_datetime": password_expiration_datetime_utc.timestamp() * 1000} account_expiration_datetime_local.strftime('%Y-%m-%dT%H:%M:%S'),
"password_expiration_datetime":
password_expiration_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')}
result.append(meta_result) result.append(meta_result)
resp.body = json.dumps(result) resp.body = json.dumps(result)
@ -218,8 +226,13 @@ class UserItem:
if row is None: if row is None:
raise falcon.HTTPError(falcon.HTTP_404, title='API.NOT_FOUND', raise falcon.HTTPError(falcon.HTTP_404, title='API.NOT_FOUND',
description='API.USER_NOT_FOUND') description='API.USER_NOT_FOUND')
account_expiration_datetime_utc = row[8].replace(tzinfo=timezone.utc) timezone_offset = int(config.utc_offset[1:3]) * 60 + int(config.utc_offset[4:6])
password_expiration_datetime_utc = row[9].replace(tzinfo=timezone.utc) if config.utc_offset[0] == '-':
timezone_offset = -timezone_offset
account_expiration_datetime_local = row[8].replace(tzinfo=timezone.utc) + timedelta(minutes=timezone_offset)
password_expiration_datetime_local = row[9].replace(tzinfo=timezone.utc) + timedelta(minutes=timezone_offset)
result = {"id": row[0], result = {"id": row[0],
"name": row[1], "name": row[1],
"display_name": row[2], "display_name": row[2],
@ -229,8 +242,8 @@ class UserItem:
"privilege": { "privilege": {
"id": row[6], "id": row[6],
"name": row[7]} if row[6] is not None else None, "name": row[7]} if row[6] is not None else None,
"account_expiration_datetime": account_expiration_datetime_utc.timestamp() * 1000, "account_expiration_datetime": account_expiration_datetime_local.strftime('%Y-%m-%dT%H:%M:%S'),
"password_expiration_datetime": password_expiration_datetime_utc.timestamp() * 1000} "password_expiration_datetime": password_expiration_datetime_local.strftime('%Y-%m-%dT%H:%M:%S')}
resp.body = json.dumps(result) resp.body = json.dumps(result)
@staticmethod @staticmethod

View File

@ -429,8 +429,6 @@ const resources = {
"API.FAILED_TO_UPLOAD_OFFLINE_METER_FILE": "Failed to upload offline meter file", "API.FAILED_TO_UPLOAD_OFFLINE_METER_FILE": "Failed to upload offline meter file",
"API.GATEWAY_NAME_IS_ALREADY_IN_USE": "Gateway name is already in use", "API.GATEWAY_NAME_IS_ALREADY_IN_USE": "Gateway name is already in use",
"API.GATEWAY_NOT_FOUND": "Gateway not found", "API.GATEWAY_NOT_FOUND": "Gateway not found",
"API.GSM_MODEM_NOT_FOUND": "Gsm modem not found",
"API.GSM_MODEM_SERIAL_PORT_IS_ALREADY_IN_USE": "Gsm modem serial port is already in use",
"API.INVALID_": "Invalid ", "API.INVALID_": "Invalid ",
"API.INVALID_ADDRESS": "Invalid address", "API.INVALID_ADDRESS": "Invalid address",
"API.INVALID_ADDRESS_VALUE": "Invalid address value", "API.INVALID_ADDRESS_VALUE": "Invalid address value",
@ -498,7 +496,6 @@ const resources = {
"API.INVALID_FROM_ADDR": "Invalid from addr", "API.INVALID_FROM_ADDR": "Invalid from addr",
"API.INVALID_GATEWAY_ID": "Invalid gateway id", "API.INVALID_GATEWAY_ID": "Invalid gateway id",
"API.INVALID_GATEWAY_NAME": "Invalid gateway name", "API.INVALID_GATEWAY_NAME": "Invalid gateway name",
"API.INVALID_GSM_MODEM_ID": "Invalid gsm modem id",
"API.INVALID_HOURLY_HIGH_LIMIT_VALUE": "Invalid hourly high limit value", "API.INVALID_HOURLY_HIGH_LIMIT_VALUE": "Invalid hourly high limit value",
"API.INVALID_HOURLY_LOW_LIMIT_VALUE": "Invalid hourly low limit value", "API.INVALID_HOURLY_LOW_LIMIT_VALUE": "Invalid hourly low limit value",
"API.INVALID_IS_ADMIN_VALUE": "Invalid is admin value", "API.INVALID_IS_ADMIN_VALUE": "Invalid is admin value",
@ -744,8 +741,10 @@ const resources = {
"API.THIS_SPACE_CANNOT_BE_DELETED": "This space cannot be deleted", "API.THIS_SPACE_CANNOT_BE_DELETED": "This space cannot be deleted",
"API.TIMEZONE_NOT_FOUND": "Timezone not found", "API.TIMEZONE_NOT_FOUND": "Timezone not found",
"API.TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN": "Token not found in headers please login", "API.TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN": "Token not found in headers please login",
"API.USER_ACCOUNT_HAS_EXPIRED": "User Account Has Expired",
"API.USER_NAME_IS_ALREADY_IN_USE": "User name is already in use", "API.USER_NAME_IS_ALREADY_IN_USE": "User name is already in use",
"API.USER_NOT_FOUND": "User not found", "API.USER_NOT_FOUND": "User not found",
"API.USER_PASSWORD_HAS_EXPIRED": "User Password Has Expired",
"API.USER_PRIVILEGE_NOT_FOUND": "User privilege not found", "API.USER_PRIVILEGE_NOT_FOUND": "User privilege not found",
"API.USER_SESSION_NOT_FOUND": "User session not found", "API.USER_SESSION_NOT_FOUND": "User session not found",
"API.USER_SESSION_TIMEOUT": "User session timeout", "API.USER_SESSION_TIMEOUT": "User session timeout",
@ -1187,8 +1186,6 @@ const resources = {
"API.FAILED_TO_UPLOAD_OFFLINE_METER_FILE": "Failed to upload offline meter file", "API.FAILED_TO_UPLOAD_OFFLINE_METER_FILE": "Failed to upload offline meter file",
"API.GATEWAY_NAME_IS_ALREADY_IN_USE": "Gateway name is already in use", "API.GATEWAY_NAME_IS_ALREADY_IN_USE": "Gateway name is already in use",
"API.GATEWAY_NOT_FOUND": "Gateway not found", "API.GATEWAY_NOT_FOUND": "Gateway not found",
"API.GSM_MODEM_NOT_FOUND": "Gsm modem not found",
"API.GSM_MODEM_SERIAL_PORT_IS_ALREADY_IN_USE": "Gsm modem serial port is already in use",
"API.INVALID_": "Invalid ", "API.INVALID_": "Invalid ",
"API.INVALID_ADDRESS": "Invalid address", "API.INVALID_ADDRESS": "Invalid address",
"API.INVALID_ADDRESS_VALUE": "Invalid address value", "API.INVALID_ADDRESS_VALUE": "Invalid address value",
@ -1256,7 +1253,6 @@ const resources = {
"API.INVALID_FROM_ADDR": "Invalid from addr", "API.INVALID_FROM_ADDR": "Invalid from addr",
"API.INVALID_GATEWAY_ID": "Invalid gateway id", "API.INVALID_GATEWAY_ID": "Invalid gateway id",
"API.INVALID_GATEWAY_NAME": "Invalid gateway name", "API.INVALID_GATEWAY_NAME": "Invalid gateway name",
"API.INVALID_GSM_MODEM_ID": "Invalid gsm modem id",
"API.INVALID_HOURLY_HIGH_LIMIT_VALUE": "Invalid hourly high limit value", "API.INVALID_HOURLY_HIGH_LIMIT_VALUE": "Invalid hourly high limit value",
"API.INVALID_HOURLY_LOW_LIMIT_VALUE": "Invalid hourly low limit value", "API.INVALID_HOURLY_LOW_LIMIT_VALUE": "Invalid hourly low limit value",
"API.INVALID_IS_ADMIN_VALUE": "Invalid is admin value", "API.INVALID_IS_ADMIN_VALUE": "Invalid is admin value",
@ -1502,8 +1498,10 @@ const resources = {
"API.THIS_SPACE_CANNOT_BE_DELETED": "This space cannot be deleted", "API.THIS_SPACE_CANNOT_BE_DELETED": "This space cannot be deleted",
"API.TIMEZONE_NOT_FOUND": "Timezone not found", "API.TIMEZONE_NOT_FOUND": "Timezone not found",
"API.TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN": "Token not found in headers please login", "API.TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN": "Token not found in headers please login",
"API.USER_ACCOUNT_HAS_EXPIRED": "User Account Has Expired",
"API.USER_NAME_IS_ALREADY_IN_USE": "User name is already in use", "API.USER_NAME_IS_ALREADY_IN_USE": "User name is already in use",
"API.USER_NOT_FOUND": "User not found", "API.USER_NOT_FOUND": "User not found",
"API.USER_PASSWORD_HAS_EXPIRED": "User Password Has Expired",
"API.USER_PRIVILEGE_NOT_FOUND": "User privilege not found", "API.USER_PRIVILEGE_NOT_FOUND": "User privilege not found",
"API.USER_SESSION_NOT_FOUND": "User session not found", "API.USER_SESSION_NOT_FOUND": "User session not found",
"API.USER_SESSION_TIMEOUT": "User session timeout", "API.USER_SESSION_TIMEOUT": "User session timeout",
@ -1944,8 +1942,6 @@ const resources = {
"API.FAILED_TO_UPLOAD_OFFLINE_METER_FILE": "Failed to upload offline meter file", "API.FAILED_TO_UPLOAD_OFFLINE_METER_FILE": "Failed to upload offline meter file",
"API.GATEWAY_NAME_IS_ALREADY_IN_USE": "Gateway name is already in use", "API.GATEWAY_NAME_IS_ALREADY_IN_USE": "Gateway name is already in use",
"API.GATEWAY_NOT_FOUND": "Gateway not found", "API.GATEWAY_NOT_FOUND": "Gateway not found",
"API.GSM_MODEM_NOT_FOUND": "Gsm modem not found",
"API.GSM_MODEM_SERIAL_PORT_IS_ALREADY_IN_USE": "Gsm modem serial port is already in use",
"API.INVALID_": "Invalid ", "API.INVALID_": "Invalid ",
"API.INVALID_ADDRESS": "Invalid address", "API.INVALID_ADDRESS": "Invalid address",
"API.INVALID_ADDRESS_VALUE": "Invalid address value", "API.INVALID_ADDRESS_VALUE": "Invalid address value",
@ -2013,7 +2009,6 @@ const resources = {
"API.INVALID_FROM_ADDR": "Invalid from addr", "API.INVALID_FROM_ADDR": "Invalid from addr",
"API.INVALID_GATEWAY_ID": "Invalid gateway id", "API.INVALID_GATEWAY_ID": "Invalid gateway id",
"API.INVALID_GATEWAY_NAME": "Invalid gateway name", "API.INVALID_GATEWAY_NAME": "Invalid gateway name",
"API.INVALID_GSM_MODEM_ID": "Invalid gsm modem id",
"API.INVALID_HOURLY_HIGH_LIMIT_VALUE": "Invalid hourly high limit value", "API.INVALID_HOURLY_HIGH_LIMIT_VALUE": "Invalid hourly high limit value",
"API.INVALID_HOURLY_LOW_LIMIT_VALUE": "Invalid hourly low limit value", "API.INVALID_HOURLY_LOW_LIMIT_VALUE": "Invalid hourly low limit value",
"API.INVALID_IS_ADMIN_VALUE": "Invalid is admin value", "API.INVALID_IS_ADMIN_VALUE": "Invalid is admin value",
@ -2259,8 +2254,10 @@ const resources = {
"API.THIS_SPACE_CANNOT_BE_DELETED": "This space cannot be deleted", "API.THIS_SPACE_CANNOT_BE_DELETED": "This space cannot be deleted",
"API.TIMEZONE_NOT_FOUND": "Timezone not found", "API.TIMEZONE_NOT_FOUND": "Timezone not found",
"API.TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN": "Token not found in headers please login", "API.TOKEN_NOT_FOUND_IN_HEADERS_PLEASE_LOGIN": "Token not found in headers please login",
"API.USER_ACCOUNT_HAS_EXPIRED": "User Account Has Expired",
"API.USER_NAME_IS_ALREADY_IN_USE": "User name is already in use", "API.USER_NAME_IS_ALREADY_IN_USE": "User name is already in use",
"API.USER_NOT_FOUND": "User not found", "API.USER_NOT_FOUND": "User not found",
"API.USER_PASSWORD_HAS_EXPIRED": "User Password Has Expired",
"API.USER_PRIVILEGE_NOT_FOUND": "User privilege not found", "API.USER_PRIVILEGE_NOT_FOUND": "User privilege not found",
"API.USER_SESSION_NOT_FOUND": "User session not found", "API.USER_SESSION_NOT_FOUND": "User session not found",
"API.USER_SESSION_TIMEOUT": "User session timeout", "API.USER_SESSION_TIMEOUT": "User session timeout",