mirror of
https://github.com/goharbor/harbor.git
synced 2024-09-07 11:38:07 +02:00
Merge pull request #512 from wknet123/master
Update for interaction with enter key press when doing searches
This commit is contained in:
commit
0c5e6caa5e
@ -16,7 +16,7 @@
|
|||||||
<div class="col-xs-12 col-md-12 each-tab-pane">
|
<div class="col-xs-12 col-md-12 each-tab-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.username" size="30">
|
<input type="text" id="txtSearchInput" class="form-control" placeholder="" ng-model="vm.username" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.search({op: vm.op, username: vm.username})"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.search({op: vm.op, username: vm.username})"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -145,19 +145,28 @@
|
|||||||
|
|
||||||
function listLog() {
|
function listLog() {
|
||||||
var directive = {
|
var directive = {
|
||||||
restrict: 'E',
|
'restrict': 'E',
|
||||||
templateUrl: '/static/resources/js/components/log/list-log.directive.html',
|
'templateUrl': '/static/resources/js/components/log/list-log.directive.html',
|
||||||
scope: {
|
'scope': {
|
||||||
'sectionHeight': '=',
|
'sectionHeight': '=',
|
||||||
'target': '=',
|
'target': '=',
|
||||||
'publicity': '='
|
'publicity': '='
|
||||||
},
|
},
|
||||||
controller: ListLogController,
|
'link': link,
|
||||||
controllerAs: 'vm',
|
'controller': ListLogController,
|
||||||
bindToController: true
|
'controllerAs': 'vm',
|
||||||
|
'bindToController': true
|
||||||
};
|
};
|
||||||
|
|
||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
element.find('#txtSearchInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.search({'op': ctrl.op, 'username': ctrl.username});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
@ -16,7 +16,7 @@
|
|||||||
<div class="col-xs-12 col-md-12 each-tab-pane">
|
<div class="col-xs-12 col-md-12 each-tab-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.username" size="30">
|
<input type="text" id="txtSearchInput" class="form-control" placeholder="" ng-model="vm.username" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.search({projectId: vm.projectId, username: vm.username})"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.search({projectId: vm.projectId, username: vm.username})"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -106,12 +106,21 @@
|
|||||||
'sectionHeight': '=',
|
'sectionHeight': '=',
|
||||||
'target': '='
|
'target': '='
|
||||||
},
|
},
|
||||||
|
'link': link,
|
||||||
'controller': ListProjectMemberController,
|
'controller': ListProjectMemberController,
|
||||||
'controllerAs': 'vm',
|
'controllerAs': 'vm',
|
||||||
'bindToController': true
|
'bindToController': true
|
||||||
};
|
};
|
||||||
|
|
||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
element.find('#txtSearchInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.retrieve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
@ -16,7 +16,7 @@
|
|||||||
<div class="col-xs-12 col-md-12 each-tab-pane">
|
<div class="col-xs-12 col-md-12 each-tab-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.replicationPolicyName" size="30">
|
<input type="text" id="txtSearchPolicyInput" class="form-control" placeholder="" ng-model="vm.replicationPolicyName" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.searchReplicationPolicy()"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.searchReplicationPolicy()"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
@ -79,7 +79,7 @@
|
|||||||
<hr class="hr-line"/>
|
<hr class="hr-line"/>
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.replicationJobName" size="30">
|
<input type="text" id="txtSearchJobInput" class="form-control" placeholder="" ng-model="vm.replicationJobName" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.searchReplicationJob()" loading-progress hide-target = "true" toggle-in-progress="vm.searchJobTIP"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.searchReplicationJob()" loading-progress hide-target = "true" toggle-in-progress="vm.searchJobTIP"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -143,7 +143,7 @@
|
|||||||
$scope.$emit('raiseAlert', alertInfo);
|
$scope.$emit('raiseAlert', alertInfo);
|
||||||
vm.searchJobTIP = false;
|
vm.searchJobTIP = false;
|
||||||
vm.refreshJobTIP = false;
|
vm.refreshJobTIP = false;
|
||||||
}
|
}searchReplicationJob
|
||||||
|
|
||||||
function listReplicationJobFailed(data, status) {
|
function listReplicationJobFailed(data, status) {
|
||||||
console.log('Failed to list replication job:' + data);
|
console.log('Failed to list replication job:' + data);
|
||||||
@ -303,6 +303,19 @@
|
|||||||
element.find('#toDatePicker').on('blur', function(){
|
element.find('#toDatePicker').on('blur', function(){
|
||||||
ctrl.pickUp({'key': 'toDate', 'value': $(this).val()});
|
ctrl.pickUp({'key': 'toDate', 'value': $(this).val()});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
element.find('#txtSearchPolicyInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.searchReplicationPolicy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
element.find('#txtSearchJobInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.searchReplicationJob();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="col-xs-12 col-md-12 each-tab-pane">
|
<div class="col-xs-12 col-md-12 each-tab-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.filterInput" value="" size="30">
|
<input type="text" id="txtSearchInput" class="form-control" placeholder="" ng-model="vm.filterInput" value="" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.retrieve()"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.retrieve()"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -175,7 +175,11 @@
|
|||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
function link(scope, element, attr, ctrl) {
|
function link(scope, element, attr, ctrl) {
|
||||||
|
element.find('#txtSearchInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.retrieve();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
.on('keydown', keydownHandler);
|
.on('keydown', keydownHandler);
|
||||||
|
|
||||||
function keydownHandler(e) {
|
function keydownHandler(e) {
|
||||||
if(e.keyCode === 13) {
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
ctrl.searchFor($(this).val());
|
ctrl.searchFor($(this).val());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<div class="col-xs-12 col-md-12 each-tab-pane">
|
<div class="col-xs-12 col-md-12 each-tab-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.destinationName" size="30">
|
<input type="text" id="txtSearchInput" class="form-control" placeholder="" ng-model="vm.destinationName" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.search()"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.search()"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -108,11 +108,20 @@
|
|||||||
'restrict': 'E',
|
'restrict': 'E',
|
||||||
'templateUrl': '/static/resources/js/components/system-management/destination.directive.html',
|
'templateUrl': '/static/resources/js/components/system-management/destination.directive.html',
|
||||||
'scope': true,
|
'scope': true,
|
||||||
|
'link': link,
|
||||||
'controller': DestinationController,
|
'controller': DestinationController,
|
||||||
'controllerAs': 'vm',
|
'controllerAs': 'vm',
|
||||||
'bindToController': true
|
'bindToController': true
|
||||||
};
|
};
|
||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
element.find('#txtSearchInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.retrieve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
@ -16,7 +16,7 @@
|
|||||||
<div class="col-xs-12 col-md-12 each-tab-pane">
|
<div class="col-xs-12 col-md-12 each-tab-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.replicationName" size="30">
|
<input type="text" id="txtSearchInput" class="form-control" placeholder="" ng-model="vm.replicationName" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.search()"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.search()"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -111,11 +111,20 @@
|
|||||||
'restrict': 'E',
|
'restrict': 'E',
|
||||||
'templateUrl': '/static/resources/js/components/system-management/replication.directive.html',
|
'templateUrl': '/static/resources/js/components/system-management/replication.directive.html',
|
||||||
'scope': true,
|
'scope': true,
|
||||||
|
'link': link,
|
||||||
'controller': ReplicationController,
|
'controller': ReplicationController,
|
||||||
'controllerAs': 'vm',
|
'controllerAs': 'vm',
|
||||||
'bindToController': true
|
'bindToController': true
|
||||||
};
|
};
|
||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
element.find('#txtSearchInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.retrieve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
@ -16,7 +16,7 @@
|
|||||||
<div class="col-xs-12 col-md-12 each-tab-pane">
|
<div class="col-xs-12 col-md-12 each-tab-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.username" size="30">
|
<input type="text" id="txtSearchInput" class="form-control" placeholder="" ng-model="vm.username" size="30">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.searchUser()"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.searchUser()"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
@ -102,8 +102,12 @@
|
|||||||
};
|
};
|
||||||
return directive;
|
return directive;
|
||||||
|
|
||||||
function link(scope, element, attrs) {
|
function link(scope, element, attrs, ctrl) {
|
||||||
|
element.find('#txtSearchInput').on('keydown', function(e) {
|
||||||
|
if($(this).is(':focus') && e.keyCode === 13) {
|
||||||
|
ctrl.retrieve();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
vm.retrieve();
|
vm.retrieve();
|
||||||
vm.getProjectRole = getProjectRole;
|
vm.getProjectRole = getProjectRole;
|
||||||
|
|
||||||
|
vm.searchProjectByKeyPress = searchProjectByKeyPress;
|
||||||
|
|
||||||
|
|
||||||
//Error message dialog handler for project.
|
//Error message dialog handler for project.
|
||||||
$scope.$on('modalTitle', function(e, val) {
|
$scope.$on('modalTitle', function(e, val) {
|
||||||
@ -116,6 +118,13 @@
|
|||||||
console.log('vm.publicity:' + vm.publicity);
|
console.log('vm.publicity:' + vm.publicity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function searchProjectByKeyPress($event) {
|
||||||
|
var keyCode = $event.which || $event.keyCode;
|
||||||
|
if(keyCode === 13) {
|
||||||
|
vm.retrieve();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
})();
|
})();
|
@ -28,7 +28,7 @@
|
|||||||
<div class="search-pane">
|
<div class="search-pane">
|
||||||
<div class="form-inline">
|
<div class="form-inline">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" placeholder="" ng-model="vm.projectName" size="30">
|
<input type="text" class="form-control" placeholder="" ng-model="vm.projectName" size="30" ng-keydown="vm.searchProjectByKeyPress($event)">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-primary" type="button" ng-click="vm.searchProject()"><span class="glyphicon glyphicon-search"></span></button>
|
<button class="btn btn-primary" type="button" ng-click="vm.searchProject()"><span class="glyphicon glyphicon-search"></span></button>
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user