mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 09:08:26 +01:00
Updates for restriction timespan.
This commit is contained in:
parent
00c41c5860
commit
15c713f927
@ -20,9 +20,9 @@
|
||||
.module('harbor.log')
|
||||
.directive('advancedSearch', advancedSearch);
|
||||
|
||||
AdvancedSearchController.$inject = ['$scope', 'ListLogService'];
|
||||
AdvancedSearchController.$inject = ['$scope', 'ListLogService', '$filter', 'trFilter'];
|
||||
|
||||
function AdvancedSearchController($scope, ListLogService) {
|
||||
function AdvancedSearchController($scope, ListLogService, $filter, trFilter) {
|
||||
var vm = this;
|
||||
|
||||
vm.checkOperation = checkOperation;
|
||||
@ -121,8 +121,21 @@
|
||||
if(vm.opOthers && $.trim(vm.others) !== '') {
|
||||
e.op.push(vm.others);
|
||||
}
|
||||
if(vm.fromDate && vm.toDate && (getDateValue(vm.fromDate) > getDateValue(vm.toDate))) {
|
||||
$scope.$emit('modalTitle', $filter('tr')('error'));
|
||||
$scope.$emit('modalMessage', $filter('tr')('begin_date_is_later_than_end_date'));
|
||||
$scope.$emit('raiseError', true);
|
||||
return
|
||||
}
|
||||
vm.search(e);
|
||||
}
|
||||
|
||||
function getDateValue(date) {
|
||||
if(date) {
|
||||
return new Date(date);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
function advancedSearch(I18nService) {
|
||||
|
@ -105,6 +105,12 @@
|
||||
}
|
||||
|
||||
function refreshReplicationJob() {
|
||||
if(vm.fromDate && vm.toDate && (getDateValue(vm.fromDate) > getDateValue(vm.toDate))) {
|
||||
$scope.$emit('modalTitle', $filter('tr')('error'));
|
||||
$scope.$emit('modalMessage', $filter('tr')('begin_date_is_later_than_end_date'));
|
||||
$scope.$emit('raiseError', true);
|
||||
return;
|
||||
}
|
||||
if(vm.lastPolicyId !== -1) {
|
||||
vm.refreshJobTIP = true;
|
||||
vm.retrieveJob(vm.lastPolicyId, vm.page, vm.pageSize);
|
||||
@ -288,6 +294,13 @@
|
||||
return t.getTime() / 1000;
|
||||
}
|
||||
|
||||
function getDateValue(date) {
|
||||
if(date) {
|
||||
return new Date(date);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
listReplication.inject = ['$timeout', 'I18nService'];
|
||||
|
@ -282,5 +282,6 @@ var locale_messages = {
|
||||
'confirm_to_toggle_enabled_policy_title': 'Enable Policy',
|
||||
'confirm_to_toggle_enabled_policy': 'After enabling the replication policy, all repositories under the project will be replicated to the destination registry. Please confirm to continue.',
|
||||
'confirm_to_toggle_disabled_policy_title': 'Disable Policy',
|
||||
'confirm_to_toggle_disabled_policy': 'After disabling the policy, all unfinished replication jobs of this policy will be stopped and canceled. Please confirm to continue.'
|
||||
'confirm_to_toggle_disabled_policy': 'After disabling the policy, all unfinished replication jobs of this policy will be stopped and canceled. Please confirm to continue.',
|
||||
'begin_date_is_later_than_end_date': 'Begin date should not be later than end date.'
|
||||
};
|
||||
|
@ -284,5 +284,6 @@ var locale_messages = {
|
||||
'confirm_to_toggle_enabled_policy_title': '启用策略',
|
||||
'confirm_to_toggle_enabled_policy': '启用策略后,该项目下的所有镜像仓库将复制到目标实例。请确认继续。',
|
||||
'confirm_to_toggle_disabled_policy_title': '停用策略',
|
||||
'confirm_to_toggle_disabled_policy': '停用策略后,所有未完成的复制任务将被终止和取消。请确认继续。'
|
||||
'confirm_to_toggle_disabled_policy': '停用策略后,所有未完成的复制任务将被终止和取消。请确认继续。',
|
||||
'begin_date_is_later_than_end_date': '起始日期不能晚于结束日期。'
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user