mirror of
https://github.com/openfaas/faas.git
synced 2025-06-11 09:46:48 +00:00
Add auto-refresh to UI
This commit is contained in:
parent
cf2317696d
commit
79bc6a54ea
@ -5,7 +5,7 @@ services:
|
||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||
ports:
|
||||
- 8080:8080
|
||||
image: alexellis2/faas-gateway:latest-dev2
|
||||
image: alexellis2/faas-gateway:latest-dev3
|
||||
networks:
|
||||
- functions
|
||||
deploy:
|
||||
|
@ -2,11 +2,11 @@ FROM alpine:latest
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
COPY gateway .
|
||||
COPY assets assets
|
||||
|
||||
EXPOSE 8080
|
||||
ENV http_proxy ""
|
||||
ENV https_proxy ""
|
||||
|
||||
COPY gateway .
|
||||
COPY assets assets
|
||||
|
||||
CMD ["./gateway"]
|
||||
|
@ -10,9 +10,10 @@ RUN go get -d github.com/docker/docker/api/types \
|
||||
|
||||
WORKDIR /go/src/github.com/alexellis/faas/gateway
|
||||
|
||||
COPY metrics metrics
|
||||
COPY requests requests
|
||||
COPY server.go .
|
||||
COPY proxy.go .
|
||||
COPY metrics metrics
|
||||
COPY requests requests
|
||||
COPY tests tests
|
||||
COPY server.go .
|
||||
COPY proxy.go .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
|
||||
|
@ -1,8 +1,7 @@
|
||||
<html ng-app="faasGateway" >
|
||||
<head>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic" />
|
||||
<!--<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">-->
|
||||
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic" />
|
||||
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/angular_material/1.1.0/angular-material.min.css">
|
||||
<!-- Angular Material CSS now available via Google CDN; version 1.0.7 used here -->
|
||||
<link rel="stylesheet" href="style/angular-material.min.css">
|
||||
|
||||
@ -11,9 +10,7 @@
|
||||
</head>
|
||||
|
||||
<body ng-controller="home">
|
||||
|
||||
|
||||
<div layout="column" style="height:100%;" ng-cloak>
|
||||
<div layout="column" style="height:100%;" ng-cloak>
|
||||
|
||||
<section id="popupContainer" layout="row" flex>
|
||||
<md-sidenav
|
||||
@ -30,7 +27,7 @@
|
||||
<md-button ng-click="newFunction()" ng-disabled="isFunctionBeingCreated" class="md-primary">New function</md-button>
|
||||
|
||||
<md-list>
|
||||
<md-list-item ng-switch class="md-3-line" ng-click="showFunction(function)" ng-repeat="function in functions" ng-class="function.name == selectedFunction.name ? 'selected' : false">
|
||||
<md-list-item ng-switch class="md-3-line" ng-click="showFunction(function)" ng-repeat="function in functions | orderBy: '-invocationCount'" ng-class="function.name == selectedFunction.name ? 'selected' : false">
|
||||
<md-icon ng-switch-when="true" style="color: blue" md-svg-icon="person"></md-icon>
|
||||
<md-icon ng-switch-when="false" md-svg-icon="person-outline"></md-icon>
|
||||
<p>{{function.name}}</p>
|
||||
|
16
gateway/assets/script/bootstrap.js
vendored
16
gateway/assets/script/bootstrap.js
vendored
@ -1,10 +1,18 @@
|
||||
"use strict"
|
||||
var app = angular.module('faasGateway', ['ngMaterial']);
|
||||
|
||||
app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', function($scope, $log, $http, $location, $timeout) {
|
||||
$scope.functions = [];
|
||||
$http.get("/system/functions").then(function(response) {
|
||||
$scope.functions = response.data;
|
||||
});
|
||||
|
||||
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;
|
||||
@ -18,4 +26,6 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', func
|
||||
invokedCount: 0
|
||||
});
|
||||
};
|
||||
|
||||
fetch();
|
||||
}]);
|
||||
|
@ -10,4 +10,4 @@ docker rm -f gateway_extract
|
||||
|
||||
echo Building alexellis2/faas-gateway:latest
|
||||
|
||||
docker build -t alexellis2/faas-gateway:latest-dev2 .
|
||||
docker build -t alexellis2/faas-gateway:latest-dev3 .
|
||||
|
Loading…
x
Reference in New Issue
Block a user