support search task
This commit is contained in:
parent
2c50e31fbe
commit
8173e5ec27
|
@ -34,6 +34,7 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<nav class="navbar navbar-static-top" role="navigation">
|
<nav class="navbar navbar-static-top" role="navigation">
|
||||||
|
<div class="navbar-toolbar">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li>
|
<li>
|
||||||
<a class="toolbar" title="{{'New' | translate}}">
|
<a class="toolbar" title="{{'New' | translate}}">
|
||||||
|
@ -100,6 +101,17 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="navbar-searchbar hidden-xs">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li>
|
||||||
|
<input class="form-control" placeholder="{{('Search' | translate)}}" ng-model="searchContext.text" />
|
||||||
|
<div class="form-control-icon">
|
||||||
|
<span class="fa fa-search form-control-feedback"></span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
"Pause": "暂停下载任务",
|
"Pause": "暂停下载任务",
|
||||||
"Delete": "删除下载任务",
|
"Delete": "删除下载任务",
|
||||||
"Display Order": "显示顺序",
|
"Display Order": "显示顺序",
|
||||||
|
"Search": "搜索",
|
||||||
"Default": "默认",
|
"Default": "默认",
|
||||||
"By File Name": "按文件名",
|
"By File Name": "按文件名",
|
||||||
"By File Size": "按文件大小",
|
"By File Size": "按文件大小",
|
||||||
|
|
|
@ -85,6 +85,18 @@
|
||||||
|
|
||||||
$scope.titleWidth = getTitleWidth();
|
$scope.titleWidth = getTitleWidth();
|
||||||
|
|
||||||
|
$scope.filterByTaskName = function (task) {
|
||||||
|
if (!task || !angular.isString(task.taskName)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$scope.searchContext || !$scope.searchContext.text) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (task.taskName.toLowerCase().indexOf($scope.searchContext.text.toLowerCase()) >= 0);
|
||||||
|
};
|
||||||
|
|
||||||
$scope.getOrderType = function () {
|
$scope.getOrderType = function () {
|
||||||
return ariaNgSettingService.getDisplayOrder();
|
return ariaNgSettingService.getDisplayOrder();
|
||||||
};
|
};
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
|
|
||||||
refreshGlobalStat();
|
refreshGlobalStat();
|
||||||
|
|
||||||
|
$scope.searchContext = {
|
||||||
|
text: ''
|
||||||
|
};
|
||||||
|
|
||||||
$scope.changeDisplayOrder = function (type, autoSetReverse) {
|
$scope.changeDisplayOrder = function (type, autoSetReverse) {
|
||||||
var oldType = utils.parseOrderType(ariaNgSettingService.getDisplayOrder());
|
var oldType = utils.parseOrderType(ariaNgSettingService.getDisplayOrder());
|
||||||
var newType = utils.parseOrderType(type);
|
var newType = utils.parseOrderType(type);
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
'Pause': 'Pause',
|
'Pause': 'Pause',
|
||||||
'Delete': 'Delete',
|
'Delete': 'Delete',
|
||||||
'Display Order': 'Display Order',
|
'Display Order': 'Display Order',
|
||||||
|
'Search': 'Search',
|
||||||
'Default': 'Default',
|
'Default': 'Default',
|
||||||
'By File Name': 'By File Name',
|
'By File Name': 'By File Name',
|
||||||
'By File Size': 'By File Size',
|
'By File Size': 'By File Size',
|
||||||
|
|
|
@ -43,6 +43,16 @@
|
||||||
color: #0080ff;
|
color: #0080ff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.skin-aria-ng .main-header .navbar .navbar-searchbar {
|
||||||
|
padding-top: 8px;
|
||||||
|
padding-right: 20px;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skin-aria-ng .main-header .navbar .navbar-searchbar .form-control-icon {
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
@media (max-width: 767px) {
|
@media (max-width: 767px) {
|
||||||
.skin-aria-ng .main-header .navbar {
|
.skin-aria-ng .main-header .navbar {
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="task-table-body">
|
<div class="task-table-body">
|
||||||
<div class="row" ng-repeat="task in downloadTasks | taskOrderBy: getOrderType()" data-gid="{{task.gid}}">
|
<div class="row" ng-repeat="task in downloadTasks | filter: filterByTaskName | taskOrderBy: getOrderType()" data-gid="{{task.gid}}">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<span class="task-name" ng-bind="task.taskName | substring: (titleWidth / 20)" title="{{task.taskName}}"></span>
|
<span class="task-name" ng-bind="task.taskName | substring: (titleWidth / 20)" title="{{task.taskName}}"></span>
|
||||||
<div class="task-files">
|
<div class="task-files">
|
||||||
|
|
Reference in a new issue