Custom Views support configurable table header names
This commit is contained in:
parent
a254b8ab6c
commit
ee942f82d6
@ -63,12 +63,40 @@
|
|||||||
},
|
},
|
||||||
"customViewsConfig": {
|
"customViewsConfig": {
|
||||||
"customView1": {
|
"customView1": {
|
||||||
"cells": ["hosts_host", "host_address", "duration", "last_check", "host_status"],
|
"cells": {
|
||||||
|
"text": [
|
||||||
|
"Host",
|
||||||
|
"Address",
|
||||||
|
"Duration",
|
||||||
|
"Last check",
|
||||||
|
"Host status"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
"hosts_host",
|
||||||
|
"host_address",
|
||||||
|
"duration",
|
||||||
|
"last_check",
|
||||||
|
"host_status"
|
||||||
|
]
|
||||||
|
},
|
||||||
"apiName": "hosts",
|
"apiName": "hosts",
|
||||||
"filters": {}
|
"filters": {}
|
||||||
},
|
},
|
||||||
"customView2": {
|
"customView2": {
|
||||||
"cells": ["host", "service_check", "duration", "last_check"],
|
"cells": {
|
||||||
|
"text": [
|
||||||
|
"Host",
|
||||||
|
"Service check",
|
||||||
|
"Duration",
|
||||||
|
"Last check"
|
||||||
|
],
|
||||||
|
"name": [
|
||||||
|
"host",
|
||||||
|
"service_check",
|
||||||
|
"duration",
|
||||||
|
"last_check"
|
||||||
|
]
|
||||||
|
},
|
||||||
"apiName": "services",
|
"apiName": "services",
|
||||||
"filters": {}
|
"filters": {}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,19 @@
|
|||||||
<div ng-controller="CustomViewsCtrl" id="tactical">
|
<article ng-controller="CustomViewsCtrl" id="tactical">
|
||||||
|
|
||||||
<h2>Custom View</h2>
|
<section class="main__content tabpanel">
|
||||||
|
|
||||||
<adg-table cells="{{customViewCells}}" api-name="{{customViewApiName}}" filters="{{customViewFilters}}"></adg-table>
|
|
||||||
|
|
||||||
|
<div class="tab-content">
|
||||||
|
<div role="tabpanel" class="problems tab-pane active" id="openProblems">
|
||||||
|
<header class="main__content__header clearfix">
|
||||||
|
<h2 class="main__content__title">Custom View</h2>
|
||||||
|
</header>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<adg-table cells-name="{{customViewCellsName}}"
|
||||||
|
cells-text="{{customViewCellsText}}"
|
||||||
|
api-name="{{customViewApiName}}"
|
||||||
|
filters="{{customViewFilters}}">
|
||||||
|
|
||||||
|
</section>
|
||||||
|
</article>
|
||||||
|
@ -23,11 +23,12 @@ angular.module('adagios.view.custom', ['ngRoute',
|
|||||||
if (!!$routeParams.view) {
|
if (!!$routeParams.view) {
|
||||||
viewName = $routeParams.view;
|
viewName = $routeParams.view;
|
||||||
} else {
|
} else {
|
||||||
console.log("ERROR : 'view' GET parameter must be the custom view name");
|
console.error("ERROR : 'view' GET parameter must be the custom view name");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.customViewCells = customViewsConfig[viewName].cells.join();
|
$scope.customViewCellsText = customViewsConfig[viewName].cells.text.join();
|
||||||
|
$scope.customViewCellsName = customViewsConfig[viewName].cells.name.join();
|
||||||
$scope.customViewApiName = customViewsConfig[viewName].apiName;
|
$scope.customViewApiName = customViewsConfig[viewName].apiName;
|
||||||
$scope.customViewFilters = customViewsConfig[viewName].filters;
|
$scope.customViewFilters = customViewsConfig[viewName].filters;
|
||||||
}])
|
}])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user