Directive

This commit is contained in:
Vincent Fournier 2015-04-30 17:06:20 -04:00
parent afcf64a384
commit 81df96c208
4 changed files with 41 additions and 4 deletions

View File

@ -358,7 +358,15 @@ angular.module('bansho.live', [])
}).error(function () {
throw new Error('acknowledge : POST Request failed');
});
}
};
var downtime = function (host_name, service_description, attrs) {
var data = {};
angular.forEach(attrs, function (key, value) {
console.log(key + "; " + value);
});
};
return {
getHost: getHost,
@ -373,7 +381,7 @@ angular.module('bansho.live', [])
getHostProblems: getHostProblems,
getTableData: getTableData,
getTotalHosts: getTotalHosts,
getTotalServices: getTotalServices
}
getTotalServices: getTotalServices,
downtime: downtime
};
}]);

View File

@ -134,5 +134,8 @@
<button type="button" ng-click="ackFormIsOpen = !ackFormIsOpen">Close</button>
<button type="button" ng-click="acknowledgeProblems()">Send</button>
</div>
</div>
<bansho-downtime_form data-ng-show="isDowntimeShown" is-shown="isDowntimeShown" selected-hosts="selected"></bansho-downtime_form>
</menu>

View File

@ -66,6 +66,8 @@ angular.module('bansho.table.actionbar', ['bansho.table',
$scope.activateFilter = function (item) {
$scope.actionbarFilters.activeFilter = $scope.actionbarFilters.possibleFilters[item];
};
$scope.isDowntimeShown = true;
}])
.filter('actionbarSelectFilter', function () {
@ -105,4 +107,18 @@ angular.module('bansho.table.actionbar', ['bansho.table',
restrict: 'E',
templateUrl: 'components/table/actionbar/actionbar.html'
};
})
.directive('banshoDowntimeForm', function () {
return {
restrict: 'E',
templateUrl: 'components/table/actionbar/downtime_form.html',
scope: {
isShown: '=',
selectedHosts: '='
},
controller: function ($scope) {
console.log($scope.isShown)
}
};
});

View File

@ -0,0 +1,10 @@
<div>
<h1>Downtime form {{isShown}} </h1>
<form>
<div>
<label for="author">Author :</label>
<input type="text" id="acknowledge-author" ng-model="acknowledgeData.author">
</div>
<button type="button" ng-click="sendDowntime()">Send</button>
</form>
</div>