mirror of
https://github.com/openfaas/faas.git
synced 2025-06-09 08:46:48 +00:00
32 lines
805 B
JavaScript
32 lines
805 B
JavaScript
"use strict"
|
|
var app = angular.module('faasGateway', ['ngMaterial']);
|
|
|
|
app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', function($scope, $log, $http, $location, $timeout) {
|
|
$scope.functions = [];
|
|
|
|
setInterval(function() {
|
|
fetch();
|
|
}, 1000);
|
|
|
|
var fetch = function() {
|
|
$http.get("/system/functions").then(function(response) {
|
|
$scope.functions = response.data;
|
|
});
|
|
};
|
|
|
|
$scope.showFunction = function(fn) {
|
|
$scope.selectedFunction = fn;
|
|
};
|
|
|
|
// TODO: popup + form to create new Docker service.
|
|
$scope.newFunction = function() {
|
|
$scope.functions.push({
|
|
name: "f" +($scope.functions.length+2),
|
|
replicas: 0,
|
|
invokedCount: 0
|
|
});
|
|
};
|
|
|
|
fetch();
|
|
}]);
|