mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-30 19:41:29 +01:00
update for timezone setting in time-picker and log retrieval logic.
This commit is contained in:
parent
7eef8d5cd6
commit
ed08eb1c16
@ -109,9 +109,9 @@
|
||||
function getCurrentProjectMemberFailed(data, status) {
|
||||
vm.isProjectMember = false;
|
||||
|
||||
$scope.$emit('modalTitle', $filter('tr')('error'));
|
||||
$scope.$emit('modalMessage', $filter('tr')('failed_to_get_project_member'));
|
||||
$scope.$emit('raiseError', true);
|
||||
// $scope.$emit('modalTitle', $filter('tr')('error'));
|
||||
// $scope.$emit('modalMessage', $filter('tr')('failed_to_get_project_member'));
|
||||
// $scope.$emit('raiseError', true);
|
||||
|
||||
console.log('Current user has no member for the project:' + status + ', location.url:' + $location.url());
|
||||
}
|
||||
|
@ -15,6 +15,30 @@
|
||||
vm.close = close;
|
||||
|
||||
vm.opAll = true;
|
||||
|
||||
$scope.$watch('vm.op', function(current) {
|
||||
if(current && vm.op[0] === 'all') {
|
||||
vm.opCreate = true;
|
||||
vm.opPull = true;
|
||||
vm.opPush = true;
|
||||
vm.opDelete = true;
|
||||
vm.opOthers = true;
|
||||
vm.others = "";
|
||||
}
|
||||
}, true);
|
||||
|
||||
$scope.$watch('vm.fromDate', function(current) {
|
||||
if(current) {
|
||||
vm.fromDate = current;
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$watch('vm.toDate', function(current) {
|
||||
if(current) {
|
||||
vm.toDate = current;
|
||||
}
|
||||
});
|
||||
|
||||
vm.opCreate = true;
|
||||
vm.opPull = true;
|
||||
vm.opPush = true;
|
||||
@ -69,6 +93,11 @@
|
||||
}
|
||||
|
||||
function close() {
|
||||
vm.op = [];
|
||||
vm.op.push('all');
|
||||
vm.fromDate = '';
|
||||
vm.toDate = '';
|
||||
vm.others = '';
|
||||
vm.isOpen = false;
|
||||
}
|
||||
}
|
||||
|
@ -80,6 +80,18 @@
|
||||
|
||||
function listLogComplete(response) {
|
||||
vm.logs = response.data;
|
||||
|
||||
vm.queryParams = {
|
||||
'beginTimestamp' : 0,
|
||||
'endTimestamp' : 0,
|
||||
'keywords' : '',
|
||||
'projectId': vm.projectId,
|
||||
'username' : ''
|
||||
};
|
||||
vm.op = ['all'];
|
||||
vm.fromDate = '';
|
||||
vm.toDate = '';
|
||||
vm.others = '';
|
||||
vm.isOpen = false;
|
||||
}
|
||||
function listLogFailed(response){
|
||||
@ -98,13 +110,8 @@
|
||||
t.setHours(hour);
|
||||
t.setMinutes(min);
|
||||
t.setSeconds(sec);
|
||||
var utcTime = new Date(t.getUTCFullYear(),
|
||||
t.getUTCMonth(),
|
||||
t.getUTCDate(),
|
||||
t.getUTCHours(),
|
||||
t.getUTCMinutes(),
|
||||
t.getUTCSeconds());
|
||||
return utcTime.getTime() / 1000;
|
||||
|
||||
return t.getTime() / 1000;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -172,18 +172,11 @@
|
||||
if(!angular.isDefined(date) || date === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
var t = new Date(date);
|
||||
t.setHours(hour);
|
||||
t.setMinutes(min);
|
||||
t.setSeconds(sec);
|
||||
var utcTime = new Date(t.getUTCFullYear(),
|
||||
t.getUTCMonth(),
|
||||
t.getUTCDate(),
|
||||
t.getUTCHours(),
|
||||
t.getUTCMinutes(),
|
||||
t.getUTCSeconds());
|
||||
return utcTime.getTime() / 1000;
|
||||
return t.getTime() / 1000;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,17 +1,38 @@
|
||||
(function() {
|
||||
'use strict';
|
||||
angular
|
||||
.module('harbor.app')
|
||||
.config(function($interpolateProvider){
|
||||
$interpolateProvider.startSymbol('//');
|
||||
$interpolateProvider.endSymbol('//');
|
||||
})
|
||||
.config(function($httpProvider) {
|
||||
$httpProvider.defaults.headers.common = {'Accept': 'application/json, text/javascript, */*; q=0.01'};
|
||||
})
|
||||
.factory('getParameterByName', getParameterByName)
|
||||
.filter('dateL', localizeDate)
|
||||
.filter('tr', tr);
|
||||
'use strict';
|
||||
angular
|
||||
.module('harbor.app')
|
||||
.config(function($interpolateProvider){
|
||||
$interpolateProvider.startSymbol('//');
|
||||
$interpolateProvider.endSymbol('//');
|
||||
})
|
||||
.config(function($httpProvider) {
|
||||
$httpProvider.defaults.headers.common = {'Accept': 'application/json, text/javascript, */*; q=0.01'};
|
||||
$httpProvider.interceptors.push('redirectInterceptor');
|
||||
})
|
||||
.factory('redirectInterceptor', RedirectInterceptorFactory)
|
||||
.factory('getParameterByName', getParameterByName)
|
||||
.filter('dateL', localizeDate)
|
||||
.filter('tr', tr);
|
||||
|
||||
RedirectInterceptorFactory.$inject = ['$q', '$window'];
|
||||
|
||||
function RedirectInterceptorFactory($q, $window) {
|
||||
return redirectInterceptor;
|
||||
function redirectInterceptor() {
|
||||
return {
|
||||
'request' : function(r) {
|
||||
console.log('global interceptor has being triggered, "Request"');
|
||||
},
|
||||
'response': function(r) {
|
||||
console.log('global interceptor has being triggered, "Response"');
|
||||
},
|
||||
'responseError': function(rejection) {
|
||||
console.log('global interceptor has being triggered. "ResponseError"');
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
function getParameterByName() {
|
||||
return get;
|
||||
|
Loading…
Reference in New Issue
Block a user