From fef9fcd43836ab12d4d2c178bc76ae79838abf11 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Sun, 14 Aug 2016 14:14:24 +0300 Subject: Use angular for the front-end --- public/client.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 public/client.js (limited to 'public/client.js') diff --git a/public/client.js b/public/client.js new file mode 100644 index 0000000..193683d --- /dev/null +++ b/public/client.js @@ -0,0 +1,16 @@ +var statusapp = angular.module('status-app', []); + +statusapp.controller('status-controller', ['$scope', '$http', function status_controller($scope, $http) { + $scope.systems = []; + + setInterval(function() { + $http({ + method: "GET", + url: "/status" + }).then(function successCallback(response) { + $scope.systems = response.data; + }, function errorCallback(response) { + + }); + }, 5000); +}]); -- cgit v1.3