mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-30 06:03:45 +01:00
modify for grunt checking
This commit is contained in:
parent
0c5e6caa5e
commit
7ededc7fe2
@ -31,14 +31,14 @@
|
||||
|
||||
scope.close = function() {
|
||||
scope.toggleAlert = false;
|
||||
}
|
||||
};
|
||||
scope.$on('raiseAlert', function(e, val) {
|
||||
console.log('received raiseAlert:' + angular.toJson(val));
|
||||
if(val.show) {
|
||||
scope.message = val.message;
|
||||
scope.toggleAlert = true;
|
||||
}else{
|
||||
scope.message = ''
|
||||
scope.message = '';
|
||||
scope.toggleAlert = false;
|
||||
}
|
||||
});
|
||||
|
@ -36,10 +36,10 @@
|
||||
return {'h' : w.height()};
|
||||
};
|
||||
|
||||
if(!angular.isDefined(scope.subsHeight)) scope.subsHeight = 110;
|
||||
if(!angular.isDefined(scope.subsSection)) scope.subsSection = 32;
|
||||
if(!angular.isDefined(scope.subsSubPane)) scope.subsSubPane = 226;
|
||||
if(!angular.isDefined(scope.subsTblBody)) scope.subsTblBody = 40;
|
||||
if(!angular.isDefined(scope.subsHeight)) {scope.subsHeight = 110;}
|
||||
if(!angular.isDefined(scope.subsSection)) {scope.subsSection = 32;}
|
||||
if(!angular.isDefined(scope.subsSubPane)) {scope.subsSubPane = 226;}
|
||||
if(!angular.isDefined(scope.subsTblBody)) {scope.subsTblBody = 40;}
|
||||
|
||||
scope.$watch(scope.getDimension, function(current) {
|
||||
if(current) {
|
||||
|
@ -51,12 +51,12 @@
|
||||
if(current) {
|
||||
ctrl.contentType = current;
|
||||
}
|
||||
})
|
||||
});
|
||||
scope.$watch('confirmOnly', function(current) {
|
||||
if(current) {
|
||||
ctrl.confirmOnly = current;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
scope.$watch('vm.modalMessage', function(current) {
|
||||
if(current) {
|
||||
|
@ -71,7 +71,7 @@
|
||||
vm.hasError = true;
|
||||
vm.errorMessage = 'failed_to_add_member';
|
||||
}
|
||||
if(status === 409 && pm.username != '') {
|
||||
if(status === 409 && pm.username !== '') {
|
||||
vm.hasError = true;
|
||||
vm.errorMessage = 'username_already_exist';
|
||||
}
|
||||
|
@ -38,8 +38,7 @@
|
||||
|
||||
for(var i = 0; i < r.length; i++) {
|
||||
var role = r[i];
|
||||
if(query.key === 'roleName' && role.roleName === query.value
|
||||
|| query.key === 'roleId' && role.id === String(query.value)) {
|
||||
if(query.key === 'roleName' && role.roleName === query.value || query.key === 'roleId' && role.id === String(query.value)) {
|
||||
return role;
|
||||
}
|
||||
}
|
||||
|
@ -55,13 +55,13 @@
|
||||
|
||||
function addProjectFailed(data, status) {
|
||||
vm.hasError = true;
|
||||
if(status === 400 && vm0.projectName!= '' && vm0.projectName.length < 4) {
|
||||
if(status === 400 && vm0.projectName !== '' && vm0.projectName.length < 4) {
|
||||
vm.errorMessage = 'project_name_is_too_short';
|
||||
}
|
||||
if(status === 400 && vm0.projectName.length > 30) {
|
||||
vm.errorMessage = 'project_name_is_too_long';
|
||||
}
|
||||
if(status === 409 && vm0.projectName != '') {
|
||||
if(status === 409 && vm0.projectName !== '') {
|
||||
vm.errorMessage = 'project_already_exist';
|
||||
}
|
||||
console.log('Failed to add project:' + status);
|
||||
|
@ -256,7 +256,7 @@
|
||||
|
||||
vm0.name = replicationPolicy.name;
|
||||
vm0.description = replicationPolicy.description;
|
||||
vm0.enabled = (replicationPolicy.enabled == 1);
|
||||
vm0.enabled = (replicationPolicy.enabled === 1);
|
||||
|
||||
angular.forEach(vm.destinations, function(item) {
|
||||
if(item.id === vm.targetId) {
|
||||
|
@ -34,7 +34,7 @@
|
||||
{'key': 'finished', 'value':$filter('tr')('finished')},
|
||||
{'key': 'canceled', 'value': $filter('tr')('canceled')}
|
||||
];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
ListReplicationController.$inject = ['$scope', 'getParameterByName', '$location', 'ListReplicationPolicyService', 'ToggleReplicationPolicyService', 'ListReplicationJobService', '$window', '$filter', 'trFilter', 'jobStatus'];
|
||||
@ -134,6 +134,7 @@
|
||||
case 'operation':
|
||||
case 'status':
|
||||
item[key] = $filter('tr')(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -143,7 +144,7 @@
|
||||
$scope.$emit('raiseAlert', alertInfo);
|
||||
vm.searchJobTIP = false;
|
||||
vm.refreshJobTIP = false;
|
||||
}searchReplicationJob
|
||||
}
|
||||
|
||||
function listReplicationJobFailed(data, status) {
|
||||
console.log('Failed to list replication job:' + data);
|
||||
@ -186,7 +187,7 @@
|
||||
'contentType': 'text/html',
|
||||
'confirmOnly': false,
|
||||
'action': vm.togglePolicy
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$emit('raiseInfo', emitInfo);
|
||||
}
|
||||
|
@ -64,7 +64,7 @@
|
||||
|
||||
function getTagFailed(data) {
|
||||
$scope.$emit('modalTitle', $filter('tr')('error'));
|
||||
$scope.$emit('modalMessage', $filter('tr')('failed_to_get_tag') + response);
|
||||
$scope.$emit('modalMessage', $filter('tr')('failed_to_get_tag') + data);
|
||||
$scope.$emit('raiseError', true);
|
||||
console.log('Failed to get tag:' + data);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@
|
||||
'contentType': 'text/html',
|
||||
'confirmOnly': false,
|
||||
'action': vm.togglePolicy
|
||||
}
|
||||
};
|
||||
|
||||
$scope.$emit('raiseInfo', emitInfo);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
||||
.error(listIntegratedLogFailed);
|
||||
|
||||
function listIntegratedLogSuccess(data) {
|
||||
vm.integratedLogs = data || []
|
||||
vm.integratedLogs = data || [];
|
||||
}
|
||||
|
||||
function listIntegratedLogFailed(data, status) {
|
||||
|
@ -25,7 +25,7 @@
|
||||
function ToggleAdminController($scope, ToggleAdminService, $filter, trFilter) {
|
||||
var vm = this;
|
||||
|
||||
vm.isAdmin = (vm.hasAdminRole == 1) ? true : false;
|
||||
vm.isAdmin = (vm.hasAdminRole === 1) ? true : false;
|
||||
vm.enabled = vm.isAdmin ? 0 : 1;
|
||||
vm.toggle = toggle;
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
.module('harbor.validator')
|
||||
.directive('projectName', projectName);
|
||||
|
||||
projectName.$inject = ['PROJECT_REGEXP']
|
||||
projectName.$inject = ['PROJECT_REGEXP'];
|
||||
|
||||
function projectName(PROJECT_REGEXP) {
|
||||
var directive = {
|
||||
|
@ -106,7 +106,7 @@
|
||||
|
||||
function filter(input, pattern) {
|
||||
var d = new Date(input || '');
|
||||
if(d.getTime() <= 0) return '-';
|
||||
if(d.getTime() <= 0) {return '-';}
|
||||
return moment(d).format(pattern);
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@
|
||||
vm.action = function() {
|
||||
val.action();
|
||||
$scope.$broadcast('showDialog', false);
|
||||
}
|
||||
};
|
||||
vm.contentType = val.contentType;
|
||||
vm.confirmOnly = val.confirmOnly;
|
||||
|
||||
|
@ -95,7 +95,7 @@
|
||||
var message;
|
||||
$scope.$emit('modalTitle', $filter('tr')('error'));
|
||||
console.log('Failed to change password:' + data);
|
||||
if(data == 'old_password_is_not_correct') {
|
||||
if(data === 'old_password_is_not_correct') {
|
||||
message = $filter('tr')('old_password_is_incorrect');
|
||||
}else{
|
||||
message = $filter('tr')('failed_to_change_password');
|
||||
|
@ -60,7 +60,7 @@
|
||||
vm.action = function() {
|
||||
val.action();
|
||||
$scope.$broadcast('showDialog', false);
|
||||
}
|
||||
};
|
||||
vm.contentType = val.contentType;
|
||||
vm.confirmOnly = val.confirmOnly;
|
||||
|
||||
|
@ -92,7 +92,7 @@
|
||||
vm.action = function() {
|
||||
val.action();
|
||||
$scope.$broadcast('showDialog', false);
|
||||
}
|
||||
};
|
||||
vm.contentType = val.contentType;
|
||||
vm.confirmOnly = val.confirmOnly;
|
||||
|
||||
|
@ -35,4 +35,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
})()
|
||||
})();
|
||||
|
@ -34,4 +34,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
})()
|
||||
})();
|
||||
|
@ -35,7 +35,7 @@
|
||||
'description': policy.description,
|
||||
'cron_str': policy.cronStr,
|
||||
'start_time': policy.startTime
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2016 VMware, Inc. All Rights Reserved.
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
(function() {
|
||||
|
||||
'use strict';
|
||||
|
||||
angular
|
||||
.module('harbor.services.user')
|
||||
.factory('IsAdminService', IsAdminService);
|
||||
|
||||
IsAdminService.$inject = ['$http', '$log'];
|
||||
|
||||
function IsAdminService($http, $log) {
|
||||
|
||||
return IsAdmin;
|
||||
|
||||
function IsAdmin() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})
|
Loading…
Reference in New Issue
Block a user