|
@@ -305,7 +305,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
<!-- ko ifnot: hasPagination -->
|
|
<!-- ko ifnot: hasPagination -->
|
|
|
<div class="inline">
|
|
<div class="inline">
|
|
|
<span data-bind="text: paginationResultCounts()"></span>
|
|
<span data-bind="text: paginationResultCounts()"></span>
|
|
|
- ${ _('jobs') }.
|
|
|
|
|
|
|
+ ${ _('jobs') }
|
|
|
</div>
|
|
</div>
|
|
|
<!-- /ko -->
|
|
<!-- /ko -->
|
|
|
|
|
|
|
@@ -318,7 +318,6 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
<span data-bind="text: Math.min(paginationPage() * paginationResultPage(), paginationResultCounts())"></span>
|
|
<span data-bind="text: Math.min(paginationPage() * paginationResultPage(), paginationResultCounts())"></span>
|
|
|
${ _('of') }
|
|
${ _('of') }
|
|
|
<span data-bind="text: paginationResultCounts"></span>
|
|
<span data-bind="text: paginationResultCounts"></span>
|
|
|
- .
|
|
|
|
|
|
|
|
|
|
##${ _('Show')}
|
|
##${ _('Show')}
|
|
|
##<span data-bind="text: paginationResultPage"></span>
|
|
##<span data-bind="text: paginationResultPage"></span>
|
|
@@ -326,10 +325,10 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<ul class="inline">
|
|
<ul class="inline">
|
|
|
- <li class="previous-page">
|
|
|
|
|
|
|
+ <li class="previous-page" data-bind="visible: showPreviousPage">
|
|
|
<a href="javascript:void(0);" data-bind="click: previousPage" title="${_('Previous page')}"><i class="fa fa-backward"></i></a>
|
|
<a href="javascript:void(0);" data-bind="click: previousPage" title="${_('Previous page')}"><i class="fa fa-backward"></i></a>
|
|
|
</li>
|
|
</li>
|
|
|
- <li class="next-page">
|
|
|
|
|
|
|
+ <li class="next-page" data-bind="visible: showNextPage">
|
|
|
<a href="javascript:void(0);" data-bind="click: nextPage" title="${_('Next page')}"><i class="fa fa-forward"></i></a>
|
|
<a href="javascript:void(0);" data-bind="click: nextPage" title="${_('Next page')}"><i class="fa fa-forward"></i></a>
|
|
|
</li>
|
|
</li>
|
|
|
</ul>
|
|
</ul>
|
|
@@ -1196,6 +1195,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
var self = this;
|
|
var self = this;
|
|
|
|
|
|
|
|
self.apps = ko.observableArray();
|
|
self.apps = ko.observableArray();
|
|
|
|
|
+ self.totalApps = ko.observable(null);
|
|
|
self.runningApps = ko.computed(function(job) {
|
|
self.runningApps = ko.computed(function(job) {
|
|
|
return $.grep(self.apps(), function(job) { return job.apiStatus() == 'RUNNING'; });
|
|
return $.grep(self.apps(), function(job) { return job.apiStatus() == 'RUNNING'; });
|
|
|
});
|
|
});
|
|
@@ -1219,39 +1219,48 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
{'value': 'minutes', 'name': '${_("minutes")}'},
|
|
{'value': 'minutes', 'name': '${_("minutes")}'},
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
- self.filters = ko.computed(function() {
|
|
|
|
|
- return [
|
|
|
|
|
- {'text': self.textFilter()},
|
|
|
|
|
- {'time': {'time_value': self.timeValueFilter(), 'time_unit': self.timeUnitFilter()}},
|
|
|
|
|
- {'states': self.statesFilter()},
|
|
|
|
|
- ];
|
|
|
|
|
- });
|
|
|
|
|
- self.filters.subscribe(function(value) {
|
|
|
|
|
- self.fetchJobs();
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
self.hasPagination = ko.computed(function() {
|
|
self.hasPagination = ko.computed(function() {
|
|
|
- return vm.interface() != 'jobs';
|
|
|
|
|
|
|
+ return ['workflows', 'schedules', 'bundles'].indexOf(vm.interface()) != -1;
|
|
|
});
|
|
});
|
|
|
self.paginationPage = ko.observable(1);
|
|
self.paginationPage = ko.observable(1);
|
|
|
- self.paginationOffset = ko.observable(0);
|
|
|
|
|
|
|
+ self.paginationOffset = ko.observable(1);
|
|
|
self.paginationResultPage = ko.observable(100);
|
|
self.paginationResultPage = ko.observable(100);
|
|
|
self.paginationResultCounts = ko.computed(function() {
|
|
self.paginationResultCounts = ko.computed(function() {
|
|
|
return self.apps().length;
|
|
return self.apps().length;
|
|
|
});
|
|
});
|
|
|
self.pagination = ko.computed(function() {
|
|
self.pagination = ko.computed(function() {
|
|
|
- var pagination = [];
|
|
|
|
|
- pagination.push({'paginationPage': self.paginationPage()});
|
|
|
|
|
- pagination.push({'paginationOffset': self.paginationOffset()});
|
|
|
|
|
- pagination.push({'paginationResultPage': self.paginationResultPage()});
|
|
|
|
|
- return pagination;
|
|
|
|
|
|
|
+ return {
|
|
|
|
|
+ 'page': self.paginationPage(),
|
|
|
|
|
+ 'offset': self.paginationOffset(),
|
|
|
|
|
+ 'limit': self.paginationResultPage()
|
|
|
|
|
+ };
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ self.showPreviousPage = ko.computed(function() {
|
|
|
|
|
+ return self.paginationOffset() > 1;
|
|
|
|
|
+ });
|
|
|
|
|
+ self.showNextPage = ko.computed(function() {
|
|
|
|
|
+ return self.totalApps() != null && (self.paginationOffset() + self.paginationResultPage()) < self.totalApps();
|
|
|
|
|
+ });
|
|
|
self.previousPage = function() {
|
|
self.previousPage = function() {
|
|
|
|
|
+ self.paginationOffset(self.paginationOffset() - self.paginationResultPage());
|
|
|
};
|
|
};
|
|
|
self.nextPage = function() {
|
|
self.nextPage = function() {
|
|
|
|
|
+ self.paginationOffset(self.paginationOffset() + self.paginationResultPage());
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+ self.filters = ko.computed(function() {
|
|
|
|
|
+ return [
|
|
|
|
|
+ {'text': self.textFilter()},
|
|
|
|
|
+ {'time': {'time_value': self.timeValueFilter(), 'time_unit': self.timeUnitFilter()}},
|
|
|
|
|
+ {'states': self.statesFilter()},
|
|
|
|
|
+ {'pagination': self.pagination()},
|
|
|
|
|
+ ];
|
|
|
|
|
+ });
|
|
|
|
|
+ self.filters.subscribe(function(value) {
|
|
|
|
|
+ self.fetchJobs();
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
|
|
|
self.fetchJobs = function () {
|
|
self.fetchJobs = function () {
|
|
|
self.loadingJobs(true);
|
|
self.loadingJobs(true);
|
|
@@ -1269,6 +1278,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
self.apps(apps);
|
|
self.apps(apps);
|
|
|
|
|
+ self.totalApps(data.total);
|
|
|
} else {
|
|
} else {
|
|
|
$(document).trigger("error", data.message);
|
|
$(document).trigger("error", data.message);
|
|
|
}
|
|
}
|
|
@@ -1353,7 +1363,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
|
|
|
switch (h) {
|
|
switch (h) {
|
|
|
case '':
|
|
case '':
|
|
|
break;
|
|
break;
|
|
|
- case 'apps':
|
|
|
|
|
|
|
+ case 'jobs':
|
|
|
case 'workflows':
|
|
case 'workflows':
|
|
|
case 'schedules':
|
|
case 'schedules':
|
|
|
case 'bundles':
|
|
case 'bundles':
|