diff --git a/flamenco-manager-example.yaml b/flamenco-manager-example.yaml index c519dc49..cb23d929 100644 --- a/flamenco-manager-example.yaml +++ b/flamenco-manager-example.yaml @@ -125,3 +125,6 @@ test_tasks: # The location where the Worker will save the rendered frame. render_output: '{render}/_flamenco/tests/renders' + +# Name of this Manager shown on the dashboard. +manager_name: "Flamenco Manager" diff --git a/flamenco/dashboard.go b/flamenco/dashboard.go index 1380ff48..853e0b4c 100644 --- a/flamenco/dashboard.go +++ b/flamenco/dashboard.go @@ -186,6 +186,8 @@ func (dash *Dashboard) sendStatusReport(w http.ResponseWriter, r *http.Request) UpstreamQueueSize: upstreamQueueSize, Version: dash.flamencoVersion, Workers: workers, + ManagerMode: dash.config.Mode, + ManagerName: dash.config.ManagerName, } statusreport.Server.Name = dash.serverName statusreport.Server.URL = dash.serverURL diff --git a/flamenco/documents.go b/flamenco/documents.go index 29b895ed..3233d2e4 100644 --- a/flamenco/documents.go +++ b/flamenco/documents.go @@ -223,6 +223,8 @@ type StatusReport struct { UpstreamQueueSize int `json:"upstream_queue_size"` Version string `json:"version"` Workers []Worker `json:"workers"` + ManagerName string `json:"manager_name"` + ManagerMode string `json:"manager_mode"` // either "develop" or "production", see settings.go Conf.Mode. Server struct { Name string `json:"name"` URL string `json:"url"` diff --git a/flamenco/settings.go b/flamenco/settings.go index 53940d7a..0f2fd52d 100644 --- a/flamenco/settings.go +++ b/flamenco/settings.go @@ -46,6 +46,7 @@ type TestTasks struct { // Conf represents the Manager's configuration file. type Conf struct { Mode string `yaml:"mode"` // either "develop" or "production" + ManagerName string `yaml:"manager_name"` DatabaseURL string `yaml:"database_url"` DatabasePath string `yaml:"database_path"` TaskLogsPath string `yaml:"task_logs_path"` @@ -115,6 +116,7 @@ func LoadConf(filename string) (Conf, error) { // Construct the struct with some more or less sensible defaults. c := Conf{ Mode: "production", + ManagerName: "Flamenco Manager", Listen: ":8083", DatabasePath: "./db", TaskLogsPath: "./task-logs", diff --git a/static/dashboard.js b/static/dashboard.js index 11db4831..12af46cf 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -68,6 +68,11 @@ WORKER_ACTIONS = Object.freeze({ }, }); +Vue.component('page-header', { + props: ['serverinfo'], + template: '#template_header', +}); + Vue.component('status', { props: ['serverinfo', 'errormsg', 'idle_workers'], template: '#template_status', @@ -361,6 +366,8 @@ var vueApp = new Vue({ name: "unknown", url: "#", }, + manager_name: "Flamenco Manager", + manager_mode: "", }, idle_workers: [], current_workers: [], @@ -368,7 +375,7 @@ var vueApp = new Vue({ }, computed: { all_workers_selected: function() { - return this.current_workers.length && this.current_workers.length == this.selected_worker_ids.length; + return Boolean(this.current_workers.length && this.current_workers.length == this.selected_worker_ids.length); }, }, methods: { @@ -385,6 +392,7 @@ var vueApp = new Vue({ if (!this.serverinfo.hasOwnProperty(key)) continue; this.serverinfo[key] = info[key]; } + document.title = this.serverinfo.manager_name + " " + this.serverinfo.version; // Split workers into "current" and "idle for too long" let too_long = 14 * 24 * 3600000; // in milliseconds diff --git a/static/vue-components.html b/static/vue-components.html index a02df22d..1cc57fc3 100644 --- a/static/vue-components.html +++ b/static/vue-components.html @@ -1,5 +1,14 @@ + + + +