mirror of
https://github.com/goharbor/harbor.git
synced 2025-03-11 22:20:00 +01:00
update for advanced-search options.
This commit is contained in:
parent
ed08eb1c16
commit
ae3bfba3c8
@ -46,7 +46,7 @@
|
|||||||
<div class="col-xs-2 col-md-2">
|
<div class="col-xs-2 col-md-2">
|
||||||
<form>
|
<form>
|
||||||
<div class="form-group" style="margin-top: 40%;">
|
<div class="form-group" style="margin-top: 40%;">
|
||||||
<button type="button" class="btn btn-primary" ng-click="vm.search({op: vm.op})">// 'search' | tr //</button>
|
<button type="button" class="btn btn-primary" ng-click="vm.doSearch({op: vm.op})">// 'search' | tr //</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
vm.opAll = true;
|
vm.opAll = true;
|
||||||
|
|
||||||
|
vm.doSearch = doSearch;
|
||||||
|
|
||||||
$scope.$watch('vm.op', function(current) {
|
$scope.$watch('vm.op', function(current) {
|
||||||
if(current && vm.op[0] === 'all') {
|
if(current && vm.op[0] === 'all') {
|
||||||
vm.opCreate = true;
|
vm.opCreate = true;
|
||||||
@ -23,7 +25,6 @@
|
|||||||
vm.opPush = true;
|
vm.opPush = true;
|
||||||
vm.opDelete = true;
|
vm.opDelete = true;
|
||||||
vm.opOthers = true;
|
vm.opOthers = true;
|
||||||
vm.others = "";
|
|
||||||
}
|
}
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
@ -38,13 +39,14 @@
|
|||||||
vm.toDate = current;
|
vm.toDate = current;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
vm.opCreate = true;
|
vm.opCreate = true;
|
||||||
vm.opPull = true;
|
vm.opPull = true;
|
||||||
vm.opPush = true;
|
vm.opPush = true;
|
||||||
vm.opDelete = true;
|
vm.opDelete = true;
|
||||||
vm.opOthers = true;
|
vm.opOthers = true;
|
||||||
vm.others = "";
|
vm.others = '';
|
||||||
|
|
||||||
vm.op = [];
|
vm.op = [];
|
||||||
vm.op.push('all');
|
vm.op.push('all');
|
||||||
@ -56,26 +58,25 @@
|
|||||||
vm.opDelete = vm.opAll;
|
vm.opDelete = vm.opAll;
|
||||||
vm.opOthers = vm.opAll;
|
vm.opOthers = vm.opAll;
|
||||||
}else {
|
}else {
|
||||||
|
vm.op = [];
|
||||||
vm.opAll = false;
|
vm.opAll = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.op = [];
|
|
||||||
|
|
||||||
if(vm.opCreate) {
|
if(vm.opCreate) {
|
||||||
vm.op.push('create');
|
vm.op.push('create');
|
||||||
}
|
}
|
||||||
if(vm.opPull) {
|
if(vm.opPull) {
|
||||||
vm.op.push('pull');
|
vm.op.push('pull');
|
||||||
}
|
}
|
||||||
if(vm.opPush) {
|
if(vm.opPush) {
|
||||||
vm.op.push('push');
|
vm.op.push('push');
|
||||||
}
|
}
|
||||||
if(vm.opDelete) {
|
if(vm.opDelete) {
|
||||||
vm.op.push('delete');
|
vm.op.push('delete');
|
||||||
|
}
|
||||||
|
if(vm.opOthers && $.trim(vm.others) !== '') {
|
||||||
|
vm.op.push($.trim(vm.others));
|
||||||
}
|
}
|
||||||
if(vm.opOthers && vm.others !== "") {
|
|
||||||
vm.op.push(vm.others);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.pickUp = pickUp;
|
vm.pickUp = pickUp;
|
||||||
@ -100,6 +101,13 @@
|
|||||||
vm.others = '';
|
vm.others = '';
|
||||||
vm.isOpen = false;
|
vm.isOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doSearch (e){
|
||||||
|
if(vm.opOthers && $.trim(vm.others) !== '') {
|
||||||
|
e.op.push(vm.others);
|
||||||
|
}
|
||||||
|
vm.search(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function advancedSearch() {
|
function advancedSearch() {
|
||||||
@ -109,6 +117,7 @@
|
|||||||
'scope': {
|
'scope': {
|
||||||
'isOpen': '=',
|
'isOpen': '=',
|
||||||
'op': '=',
|
'op': '=',
|
||||||
|
'opOthers': '=',
|
||||||
'others': '=',
|
'others': '=',
|
||||||
'fromDate': '=',
|
'fromDate': '=',
|
||||||
'toDate': '=',
|
'toDate': '=',
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<advanced-search ng-show="vm.isOpen" is-open="vm.isOpen" op="vm.op" others="vm.others" search='vm.search({op: vm.op, username: vm.username})' from-date="vm.fromDate" to-date="vm.toDate"></advanced-search>
|
<advanced-search ng-show="vm.isOpen" is-open="vm.isOpen" op="vm.op" others="vm.others" search='vm.search({op: vm.op, username: vm.username})' from-date="vm.fromDate" to-date="vm.toDate" op-others="vm.opOthers"></advanced-search>
|
||||||
<div class="pane">
|
<div class="pane">
|
||||||
<div class="sub-pane">
|
<div class="sub-pane">
|
||||||
<div class="table-head-container">
|
<div class="table-head-container">
|
||||||
|
@ -24,7 +24,8 @@
|
|||||||
vm.username = "";
|
vm.username = "";
|
||||||
|
|
||||||
vm.op = [];
|
vm.op = [];
|
||||||
|
vm.opOthers = true;
|
||||||
|
|
||||||
vm.search = search;
|
vm.search = search;
|
||||||
vm.showAdvancedSearch = showAdvancedSearch;
|
vm.showAdvancedSearch = showAdvancedSearch;
|
||||||
|
|
||||||
@ -52,9 +53,18 @@
|
|||||||
|
|
||||||
function search(e) {
|
function search(e) {
|
||||||
if(e.op[0] === 'all') {
|
if(e.op[0] === 'all') {
|
||||||
vm.queryParams.keywords = '';
|
if(vm.opOthers && $.trim(vm.others) !== '') {
|
||||||
|
e.op = [];
|
||||||
|
e.op.push(vm.others);
|
||||||
|
vm.queryParams.keywords = e.op.join('/');
|
||||||
|
}else{
|
||||||
|
vm.queryParams.keywords = '';
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
vm.queryParams.keywords = e.op.join('/') ;
|
if(vm.opOthers && $.trim(vm.others) !== '') {
|
||||||
|
e.op.push(vm.others);
|
||||||
|
}
|
||||||
|
vm.queryParams.keywords = e.op.join('/');
|
||||||
}
|
}
|
||||||
vm.queryParams.username = e.username;
|
vm.queryParams.username = e.username;
|
||||||
|
|
||||||
@ -92,6 +102,7 @@
|
|||||||
vm.fromDate = '';
|
vm.fromDate = '';
|
||||||
vm.toDate = '';
|
vm.toDate = '';
|
||||||
vm.others = '';
|
vm.others = '';
|
||||||
|
vm.opOthers = true;
|
||||||
vm.isOpen = false;
|
vm.isOpen = false;
|
||||||
}
|
}
|
||||||
function listLogFailed(response){
|
function listLogFailed(response){
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
$scope.$on('$locationChangeSuccess', function() {
|
$scope.$on('$locationChangeSuccess', function() {
|
||||||
vm.projectId = getParameterByName('project_id', $location.absUrl());
|
vm.projectId = getParameterByName('project_id', $location.absUrl());
|
||||||
|
vm.filterInput = '';
|
||||||
vm.retrieve();
|
vm.retrieve();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user