Table first draft
This commit is contained in:
parent
e1de293602
commit
3186a97f01
@ -1,16 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('adagios.live.getservices', [])
|
||||
angular.module('adagios.live')
|
||||
|
||||
.factory('GetServices', ['$http', function ($http) {
|
||||
alert('Salut');
|
||||
$http.post("/rest/status/json/services/").
|
||||
success(function(data, status, headers, config) {
|
||||
alert(data);
|
||||
}).
|
||||
error(function(data, status, headers, config) {
|
||||
alert('Request error');
|
||||
});
|
||||
.factory('GetServices', ['$http', function ($http, columns) {
|
||||
|
||||
return data;
|
||||
return function (columns) {
|
||||
return $http.get('/rest/status/json/services/?fields=' + columns)
|
||||
.error(function (data, status, headers, config) {
|
||||
console.error('GetServices : GET Request failed');
|
||||
});
|
||||
};
|
||||
}]);
|
||||
|
3
app/components/live/live.js
Normal file
3
app/components/live/live.js
Normal file
@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('adagios.live', []);
|
@ -1,19 +1,9 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('adagios.live', [])
|
||||
angular.module('adagios.live')
|
||||
|
||||
.factory('GetProblems', ['$http', function ($http) {
|
||||
var problem_number = 44;
|
||||
|
||||
return problem_number;
|
||||
}])
|
||||
|
||||
.factory('GetServices', ['$http', function ($http) {
|
||||
$http.post("/rest/status/json/services", "host_name")
|
||||
.success(function(data, status, headers, config) {
|
||||
return data;
|
||||
})
|
||||
.error(function(data, status, headers, config) {
|
||||
alert('request error');
|
||||
});
|
||||
}]);
|
||||
|
@ -22,7 +22,9 @@
|
||||
<!-- Application -->
|
||||
<script src="app.js"></script>
|
||||
<!-- COMPONENTS -->
|
||||
<script src="components/live/live.js"></script>
|
||||
<script src="components/live/notifications.js"></script>
|
||||
<script src="components/live/get_services.js"></script>
|
||||
<script src="components/ng-justgage/ng-justgage.js"></script>
|
||||
<!-- MODULES -->
|
||||
<!-- Sidebar -->>
|
||||
|
@ -7,7 +7,7 @@ angular.module('adagios.table.entry', ['adagios.table.entry.column_duration',
|
||||
])
|
||||
|
||||
.controller('EntryCtrl', ['$scope', '$http', function ($scope, $http) {
|
||||
noop;
|
||||
return;
|
||||
}])
|
||||
|
||||
.directive('entry', function () {
|
||||
|
@ -1,15 +1,15 @@
|
||||
<div ng-app="adagios.table" ng-controller="TableCtrl" id="table">
|
||||
<table>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th ng-repeat="(key, value) in entries[0]">
|
||||
<cell cell_type="header" > {{key}} </cell>
|
||||
{{key}}
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr ng-repeat="entry in entries">
|
||||
<td ng-repeat="(key, value) in entry">
|
||||
<cell cell_type="{{key}}" > {{value}} </cell>
|
||||
{{value}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -3,14 +3,15 @@
|
||||
angular.module('adagios.table', ['ngRoute', 'adagios.table.entry', 'adagios.live'])
|
||||
|
||||
.controller('TableCtrl', ['$scope', '$http', 'GetServices', function ($scope, $http, GetServices) {
|
||||
$scope.entries = GetServices;
|
||||
|
||||
console.log(new GetServices(['host_name', 'last_check'])
|
||||
.success(function (data) {
|
||||
$scope.entries = data;
|
||||
}));
|
||||
}])
|
||||
|
||||
.directive('servicetable', function () {
|
||||
.directive('servicesTable', function () {
|
||||
return {
|
||||
restrict: 'E',
|
||||
templateUrl: "table/table.html"
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -19,6 +19,6 @@
|
||||
|
||||
</div>
|
||||
|
||||
<servicetable></servicetable>
|
||||
<services-table></services-table>
|
||||
|
||||
</div>
|
||||
|
@ -9,10 +9,12 @@ module.exports = function (config) {
|
||||
'app/bower_components/angular/angular.js',
|
||||
'app/bower_components/angular-route/angular-route.js',
|
||||
'app/bower_components/angular-mocks/angular-mocks.js',
|
||||
'app/components/live/live.js',
|
||||
'app/components/**/*.js',
|
||||
'app/navbar/**/*.js',
|
||||
'app/topbar/**/*.js',
|
||||
'app/sidebar/**/*.js',
|
||||
'app/tactical/**/*.js'
|
||||
'app/tactical/**/*.js',
|
||||
'app/table/**/*.js'
|
||||
],
|
||||
|
||||
autoWatch : true,
|
||||
|
Loading…
x
Reference in New Issue
Block a user