mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-03 06:28:06 +01:00
update for creation time filter of replication jobs.
This commit is contained in:
parent
0ec5024351
commit
f059029109
@ -86,7 +86,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function toUTCSeconds(date, hour, min, sec) {
|
function toUTCSeconds(date, hour, min, sec) {
|
||||||
if(date === "") {
|
if(!angular.isDefined(date) || date === '') {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,12 +100,11 @@
|
|||||||
<table class="table table-pane table-header">
|
<table class="table table-pane table-header">
|
||||||
<thead>
|
<thead>
|
||||||
<th width="15%">// 'name' | tr //</th>
|
<th width="15%">// 'name' | tr //</th>
|
||||||
<th width="12%">// 'operation' | tr //</th>
|
<th width="15%">// 'operation' | tr //</th>
|
||||||
<th width="18%">// 'creation_time' | tr //</th>
|
<th width="24%">// 'creation_time' | tr //</th>
|
||||||
<th width="18%">// 'start_time' | tr //</th>
|
<th width="24%">// 'end_time' | tr //</th>
|
||||||
<th width="18%">// 'end_time' | tr //</th>
|
|
||||||
<th width="10%">// 'status' | tr //</th>
|
<th width="10%">// 'status' | tr //</th>
|
||||||
<th width="9%">// 'logs' | tr //</th>
|
<th width="12%">// 'logs' | tr //</th>
|
||||||
</thead>
|
</thead>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -117,12 +116,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr ng-if="vm.replicationJobs.length > 0" ng-repeat="r in vm.replicationJobs">
|
<tr ng-if="vm.replicationJobs.length > 0" ng-repeat="r in vm.replicationJobs">
|
||||||
<td width="15%">//r.repository//</td>
|
<td width="15%">//r.repository//</td>
|
||||||
<td width="12%">//r.operation//</td>
|
<td width="15%">//r.operation//</td>
|
||||||
<td width="18%">//r.creation_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
|
<td width="24%">//r.creation_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
|
||||||
<td width="18%">//r.creation_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
|
<td width="24%">//r.update_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
|
||||||
<td width="18%">//r.update_time | dateL : 'YYYY-MM-DD HH:mm:ss'//</td>
|
|
||||||
<td width="10%">//r.status//</td>
|
<td width="10%">//r.status//</td>
|
||||||
<td width="9%">
|
<td width="12%">
|
||||||
<a style="margin-left: 20px;" ng-show="r.status != 'canceled' && r.status != 'pending'" href="javascript:void(0);" ng-click="vm.downloadLog(r.id)" title="// 'download_log' | tr //"><span class="glyphicon glyphicon-file"></span></a>
|
<a style="margin-left: 20px;" ng-show="r.status != 'canceled' && r.status != 'pending'" href="javascript:void(0);" ng-click="vm.downloadLog(r.id)" title="// 'download_log' | tr //"><span class="glyphicon glyphicon-file"></span></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -54,6 +54,8 @@
|
|||||||
vm.jobStatus = jobStatus;
|
vm.jobStatus = jobStatus;
|
||||||
vm.currentStatus = vm.jobStatus()[0];
|
vm.currentStatus = vm.jobStatus()[0];
|
||||||
|
|
||||||
|
vm.pickUp = pickUp;
|
||||||
|
|
||||||
function searchReplicationPolicy() {
|
function searchReplicationPolicy() {
|
||||||
vm.retrievePolicy();
|
vm.retrievePolicy();
|
||||||
}
|
}
|
||||||
@ -72,7 +74,7 @@
|
|||||||
|
|
||||||
function retrieveJob(policyId) {
|
function retrieveJob(policyId) {
|
||||||
var status = (vm.currentStatus.key === 'all' ? '' : vm.currentStatus.key);
|
var status = (vm.currentStatus.key === 'all' ? '' : vm.currentStatus.key);
|
||||||
ListReplicationJobService(policyId, vm.replicationJobName, status)
|
ListReplicationJobService(policyId, vm.replicationJobName, status, toUTCSeconds(vm.fromDate, 0, 0, 0), toUTCSeconds(vm.toDate, 23, 59, 59))
|
||||||
.success(listReplicationJobSuccess)
|
.success(listReplicationJobSuccess)
|
||||||
.error(listReplicationJobFailed);
|
.error(listReplicationJobFailed);
|
||||||
}
|
}
|
||||||
@ -138,6 +140,37 @@
|
|||||||
function downloadLog(policyId) {
|
function downloadLog(policyId) {
|
||||||
$window.open('/api/jobs/replication/' + policyId + '/log', '_blank');
|
$window.open('/api/jobs/replication/' + policyId + '/log', '_blank');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function pickUp(e) {
|
||||||
|
switch(e.key){
|
||||||
|
case 'fromDate':
|
||||||
|
vm.fromDate = e.value;
|
||||||
|
break;
|
||||||
|
case 'toDate':
|
||||||
|
vm.toDate = e.value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$scope.$apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
function toUTCSeconds(date, hour, min, sec) {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function listReplication($timeout) {
|
function listReplication($timeout) {
|
||||||
|
@ -12,13 +12,15 @@
|
|||||||
|
|
||||||
return listReplicationJob;
|
return listReplicationJob;
|
||||||
|
|
||||||
function listReplicationJob(policyId, repository, status) {
|
function listReplicationJob(policyId, repository, status, startTime, endTime) {
|
||||||
return $http
|
return $http
|
||||||
.get('/api/jobs/replication/', {
|
.get('/api/jobs/replication/', {
|
||||||
'params': {
|
'params': {
|
||||||
'policy_id': policyId,
|
'policy_id': policyId,
|
||||||
'repository': repository,
|
'repository': repository,
|
||||||
'status': status
|
'status': status,
|
||||||
|
'start_time': startTime,
|
||||||
|
'end_time': endTime
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user