iss #19 - Getting list of IT services and SLA property selection.
This commit is contained in:
@@ -51,16 +51,26 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<!-- IT Service editor -->
|
||||||
<ul class="tight-form-list" role="menu" ng-show="target.ITService">
|
<ul class="tight-form-list" role="menu" ng-show="target.ITService">
|
||||||
<!-- Select IT Service -->
|
<li class="tight-form-item input-small">IT Service</li>
|
||||||
<li class="tight-form-item input-small" style="width: 5em">IT Service</li>
|
|
||||||
<li>
|
<li>
|
||||||
<input type="text"
|
<select class="tight-form-input input-large"
|
||||||
class="tight-form-input input-medium"
|
ng-change="selectITService()"
|
||||||
ng-model="target.itservice"
|
ng-model="target.itservice"
|
||||||
spellcheck='false'
|
bs-tooltip="target.itservice.name.length > 25 ? target.itservice.name : ''"
|
||||||
placeholder="IT Service"
|
ng-options="itservice.name for itservice in itserviceList track by itservice.name">
|
||||||
ng-blur="targetBlur()">
|
<option value="">-- Select IT service --</option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="tight-form-item input-small">SLA property</li>
|
||||||
|
<li>
|
||||||
|
<select class="tight-form-input input-medium"
|
||||||
|
ng-change="selectSLAProperty()"
|
||||||
|
ng-model="target.slaProperty"
|
||||||
|
ng-options="slaProperty for slaProperty in slaPropertyList track by slaProperty">
|
||||||
|
<option value="">-- SLA property --</option>
|
||||||
|
</select>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|||||||
@@ -13,20 +13,31 @@ function (angular, _) {
|
|||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
$scope.targetLetters = targetLetters;
|
$scope.targetLetters = targetLetters;
|
||||||
$scope.metric = {
|
if ($scope.target.ITService) {
|
||||||
hostGroupList: [],
|
$scope.slaPropertyList = [
|
||||||
hostList: [{name: '*', visible_name: 'All'}],
|
"sla",
|
||||||
applicationList: [{name: '*', visible_name: 'All'}],
|
"okTime",
|
||||||
itemList: [{name: 'All'}]
|
"problemTime",
|
||||||
};
|
"downtimeTime"
|
||||||
|
];
|
||||||
|
$scope.itserviceList = [{name: "test"}];
|
||||||
|
$scope.updateITServiceList();
|
||||||
|
} else {
|
||||||
|
$scope.metric = {
|
||||||
|
hostGroupList: [],
|
||||||
|
hostList: [{name: '*', visible_name: 'All'}],
|
||||||
|
applicationList: [{name: '*', visible_name: 'All'}],
|
||||||
|
itemList: [{name: 'All'}]
|
||||||
|
};
|
||||||
|
|
||||||
// Update host group, host, application and item lists
|
// Update host group, host, application and item lists
|
||||||
$scope.updateGroupList();
|
$scope.updateGroupList();
|
||||||
$scope.updateHostList();
|
$scope.updateHostList();
|
||||||
$scope.updateAppList();
|
$scope.updateAppList();
|
||||||
$scope.updateItemList();
|
$scope.updateItemList();
|
||||||
|
|
||||||
setItemAlias();
|
setItemAlias();
|
||||||
|
}
|
||||||
|
|
||||||
$scope.target.errors = validateTarget($scope.target);
|
$scope.target.errors = validateTarget($scope.target);
|
||||||
};
|
};
|
||||||
@@ -49,6 +60,17 @@ function (angular, _) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Call when IT service is selected.
|
||||||
|
*/
|
||||||
|
$scope.selectITService = function() {
|
||||||
|
$scope.target.errors = validateTarget($scope.target);
|
||||||
|
if (!_.isEqual($scope.oldTarget, $scope.target) && _.isEmpty($scope.target.errors)) {
|
||||||
|
$scope.oldTarget = angular.copy($scope.target);
|
||||||
|
$scope.get_data();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call when host group selected
|
* Call when host group selected
|
||||||
*/
|
*/
|
||||||
@@ -116,6 +138,17 @@ function (angular, _) {
|
|||||||
// SUGGESTION QUERIES
|
// SUGGESTION QUERIES
|
||||||
//////////////////////////////
|
//////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update list of IT services
|
||||||
|
*/
|
||||||
|
$scope.updateITServiceList = function() {
|
||||||
|
$scope.datasource.zabbixAPI.getITService().then(function (iteservices) {
|
||||||
|
$scope.itserviceList = [];
|
||||||
|
$scope.itserviceList = $scope.itserviceList.concat(iteservices);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update list of host groups
|
* Update list of host groups
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user