mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
fix jobs list header
This commit is contained in:
19
awx/ui/client/features/jobs/index.controller.js
Normal file
19
awx/ui/client/features/jobs/index.controller.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
function IndexJobsController ($scope, strings, dataset) {
|
||||||
|
const vm = this;
|
||||||
|
vm.strings = strings;
|
||||||
|
vm.count = dataset.data.count;
|
||||||
|
|
||||||
|
$scope.$on('updateDataset', (e, { count }) => {
|
||||||
|
if (count) {
|
||||||
|
vm.count = count;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
IndexJobsController.$inject = [
|
||||||
|
'$scope',
|
||||||
|
'JobsStrings',
|
||||||
|
'Dataset'
|
||||||
|
];
|
||||||
|
|
||||||
|
export default IndexJobsController;
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<at-panel ng-cloak id="htmlTemplate">
|
<at-panel ng-cloak id="htmlTemplate">
|
||||||
<div>
|
<div>
|
||||||
<div ng-hide="$state.includes('schedules')">
|
<div ng-hide="$state.includes('schedules')">
|
||||||
<at-panel-heading title="{{:: vm.strings.get('list.PANEL_TITLE') }}" hide-dismiss="true">
|
<at-panel-heading title="{{:: vm.strings.get('list.PANEL_TITLE') }}" hide-dismiss="true" badge="{{ vm.count }}">
|
||||||
</at-panel-heading>
|
</at-panel-heading>
|
||||||
<div ui-view="jobsList"></div>
|
<div ui-view="jobsList"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { N_ } from '../../../src/i18n';
|
import { N_ } from '../../../src/i18n';
|
||||||
import jobsListController from '../jobsList.controller';
|
import jobsListController from '../jobsList.controller';
|
||||||
|
import indexController from '../index.controller';
|
||||||
|
|
||||||
const indexTemplate = require('~features/jobs/index.view.html');
|
const indexTemplate = require('~features/jobs/index.view.html');
|
||||||
const jobsListTemplate = require('~features/jobs/jobsList.view.html');
|
const jobsListTemplate = require('~features/jobs/jobsList.view.html');
|
||||||
@@ -59,10 +60,7 @@ export default {
|
|||||||
views: {
|
views: {
|
||||||
'@': {
|
'@': {
|
||||||
templateUrl: indexTemplate,
|
templateUrl: indexTemplate,
|
||||||
controller: ['JobsStrings', (strings) => {
|
controller: indexController,
|
||||||
const vm = this || {};
|
|
||||||
vm.strings = strings;
|
|
||||||
}],
|
|
||||||
controllerAs: 'vm'
|
controllerAs: 'vm'
|
||||||
},
|
},
|
||||||
'jobsList@jobs': {
|
'jobsList@jobs': {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
function IndexTemplatesController ($scope, strings, dataset) {
|
function IndexTemplatesController ($scope, strings, dataset) {
|
||||||
let vm = this;
|
const vm = this;
|
||||||
vm.strings = strings;
|
vm.strings = strings;
|
||||||
vm.count = dataset.data.count;
|
vm.count = dataset.data.count;
|
||||||
|
|
||||||
$scope.$on('updateDataset', (e, { count }) => {
|
$scope.$on('updateDataset', (e, { count }) => {
|
||||||
if (count) {
|
if (count) {
|
||||||
vm.count = count;
|
vm.count = count;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user