From cd1011066f7459479ce88aa4ef337158e7ad10dd Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Thu, 13 Jul 2023 10:58:44 -0700 Subject: [PATCH 01/30] Retrieve current Flamenco version --- web/app/src/views/JobsView.vue | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/web/app/src/views/JobsView.vue b/web/app/src/views/JobsView.vue index ed04e62d..f34905f6 100644 --- a/web/app/src/views/JobsView.vue +++ b/web/app/src/views/JobsView.vue @@ -39,7 +39,9 @@ import { useJobs } from '@/stores/jobs'; import { useTasks } from '@/stores/tasks'; import { useNotifs } from '@/stores/notifications' import { useTaskLog } from '@/stores/tasklog' -import { getAPIClient } from "@/api-client"; +import { getAPIClient } from '@/api-client'; +import { apiClient } from '@/stores/api-query-count'; +import { MetaApi } from '@/manager-api'; import FooterPopup from '@/components/footer/FooterPopup.vue' import GetTheAddon from '@/components/GetTheAddon.vue' @@ -271,9 +273,28 @@ export default { // SocketIO connection event handlers: onSIOReconnected() { + this.$refs.jobsTable.onReconnected(); if (this.$refs.tasksTable) this.$refs.tasksTable.onReconnected(); + + /*Grab Flamenco version from backend + Compare with previous version + If different than before log a notification about the upgrade, + and actually refresh the entire page to ensure the new version is loaded properly. */ + const metaAPI = new MetaApi(apiClient); + let currVersion; + metaAPI.getVersion() + .then((version) => { + this.flamencoName = version.name; + this.flamencoVersion = version.version; + + currVersion = this.flamencoVersion + }) + .catch((error) => { + console.log("Error getting the Flamenco version:", error); + }) + }, onSIODisconnected(reason) { }, -- 2.30.2 From 7fec95587318ba2eba0db23f5fdd3431e86f6dd1 Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Wed, 19 Jul 2023 10:24:09 -0700 Subject: [PATCH 02/30] Revert changes of JobsView to original --- web/app/src/views/JobsView.vue | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/web/app/src/views/JobsView.vue b/web/app/src/views/JobsView.vue index f34905f6..b88b8bc1 100644 --- a/web/app/src/views/JobsView.vue +++ b/web/app/src/views/JobsView.vue @@ -277,24 +277,6 @@ export default { this.$refs.jobsTable.onReconnected(); if (this.$refs.tasksTable) this.$refs.tasksTable.onReconnected(); - - /*Grab Flamenco version from backend - Compare with previous version - If different than before log a notification about the upgrade, - and actually refresh the entire page to ensure the new version is loaded properly. */ - const metaAPI = new MetaApi(apiClient); - let currVersion; - metaAPI.getVersion() - .then((version) => { - this.flamencoName = version.name; - this.flamencoVersion = version.version; - - currVersion = this.flamencoVersion - }) - .catch((error) => { - console.log("Error getting the Flamenco version:", error); - }) - }, onSIODisconnected(reason) { }, -- 2.30.2 From eaf6fd3148c206fd63a6c1ea5e043dd661f84e52 Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Wed, 19 Jul 2023 13:18:30 -0700 Subject: [PATCH 03/30] Add SocketIO reconnection and version check --- web/app/src/App.vue | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/web/app/src/App.vue b/web/app/src/App.vue index 6f9016d4..12af4404 100644 --- a/web/app/src/App.vue +++ b/web/app/src/App.vue @@ -14,7 +14,7 @@ - + add-on | API @@ -28,8 +28,11 @@ import * as API from '@/manager-api'; import { getAPIClient } from "@/api-client"; import { backendURL } from '@/urls'; +import { useSocketStatus } from '@/stores/socket-status'; -import ApiSpinner from '@/components/ApiSpinner.vue' +import ApiSpinner from '@/components/ApiSpinner.vue'; +import UpdateListener from '@/components/UpdateListener.vue'; +import ConnectionStatus from '@/components/ConnectionStatus.vue'; const DEFAULT_FLAMENCO_NAME = "Flamenco"; const DEFAULT_FLAMENCO_VERSION = "unknown"; @@ -38,6 +41,8 @@ export default { name: 'App', components: { ApiSpinner, + UpdateListener, + ConnectionStatus }, data: () => ({ flamencoName: DEFAULT_FLAMENCO_NAME, @@ -47,6 +52,14 @@ export default { mounted() { window.app = this; this.fetchManagerInfo(); + + const sockStatus = useSocketStatus(); + this.$watch(() => sockStatus.isConnected, (isConnected) => { + if (isConnected) { + this.socketIOReconnect(); + } + }); + }, methods: { // TODO: also call this when SocketIO reconnects. @@ -57,6 +70,16 @@ export default { this.flamencoVersion = version.version; }) }, + + socketIOReconnect() { + this.fetchManagerInfo() + if (this.flamencoVersion !== DEFAULT_FLAMENCO_VERSION || this.flamencoName !== DEFAULT_FLAMENCO_NAME ) { + console.log(`Upgraded Flamenco Version: ${this.flamencoVersion}`); + + // Reload the page + location.reload(); + } + } }, } -- 2.30.2 From 2f286504e8557f6241ce5ce7419eba9b06cc77e6 Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Fri, 21 Jul 2023 07:21:41 -0700 Subject: [PATCH 04/30] Revert accidental changes --- web/app/src/views/JobsView.vue | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web/app/src/views/JobsView.vue b/web/app/src/views/JobsView.vue index b88b8bc1..134d8500 100644 --- a/web/app/src/views/JobsView.vue +++ b/web/app/src/views/JobsView.vue @@ -39,9 +39,7 @@ import { useJobs } from '@/stores/jobs'; import { useTasks } from '@/stores/tasks'; import { useNotifs } from '@/stores/notifications' import { useTaskLog } from '@/stores/tasklog' -import { getAPIClient } from '@/api-client'; -import { apiClient } from '@/stores/api-query-count'; -import { MetaApi } from '@/manager-api'; +import { getAPIClient } from "@/api-client"; import FooterPopup from '@/components/footer/FooterPopup.vue' import GetTheAddon from '@/components/GetTheAddon.vue' @@ -273,10 +271,10 @@ export default { // SocketIO connection event handlers: onSIOReconnected() { - this.$refs.jobsTable.onReconnected(); if (this.$refs.tasksTable) this.$refs.tasksTable.onReconnected(); + }, onSIODisconnected(reason) { }, -- 2.30.2 From 09333db822c8bf4a69e88e258e4279b269716eb0 Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Fri, 21 Jul 2023 07:52:01 -0700 Subject: [PATCH 05/30] Update socket reconnection status --- web/app/src/App.vue | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/web/app/src/App.vue b/web/app/src/App.vue index 12af4404..83768a69 100644 --- a/web/app/src/App.vue +++ b/web/app/src/App.vue @@ -49,15 +49,16 @@ export default { flamencoVersion: DEFAULT_FLAMENCO_VERSION, backendURL: backendURL, }), + mounted() { window.app = this; this.fetchManagerInfo(); const sockStatus = useSocketStatus(); this.$watch(() => sockStatus.isConnected, (isConnected) => { - if (isConnected) { - this.socketIOReconnect(); - } + if (!isConnected) return; + if (!sockStatus.wasEverDisconnected) return; + this.socketIOReconnect(); }); }, @@ -72,14 +73,14 @@ export default { }, socketIOReconnect() { - this.fetchManagerInfo() - if (this.flamencoVersion !== DEFAULT_FLAMENCO_VERSION || this.flamencoName !== DEFAULT_FLAMENCO_NAME ) { - console.log(`Upgraded Flamenco Version: ${this.flamencoVersion}`); - - // Reload the page + const metaAPI = new API.MetaApi(getAPIClient()) + metaAPI.getVersion().then((version) => { + if (version.name === this.flamencoName && version.version == this.flamencoVersion) + return; + console.log(`Updated from ${this.flamencoVersion} to ${version.version}`); location.reload(); - } - } + }); + }, }, } -- 2.30.2 From 821e375a8bee12ccd6874edc87fc858b4be1ade6 Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Fri, 21 Jul 2023 08:15:02 -0700 Subject: [PATCH 06/30] Clean up code --- web/app/src/App.vue | 7 +------ web/app/src/views/JobsView.vue | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/web/app/src/App.vue b/web/app/src/App.vue index 83768a69..07b37290 100644 --- a/web/app/src/App.vue +++ b/web/app/src/App.vue @@ -14,7 +14,7 @@ - + add-on | API @@ -31,8 +31,6 @@ import { backendURL } from '@/urls'; import { useSocketStatus } from '@/stores/socket-status'; import ApiSpinner from '@/components/ApiSpinner.vue'; -import UpdateListener from '@/components/UpdateListener.vue'; -import ConnectionStatus from '@/components/ConnectionStatus.vue'; const DEFAULT_FLAMENCO_NAME = "Flamenco"; const DEFAULT_FLAMENCO_VERSION = "unknown"; @@ -41,15 +39,12 @@ export default { name: 'App', components: { ApiSpinner, - UpdateListener, - ConnectionStatus }, data: () => ({ flamencoName: DEFAULT_FLAMENCO_NAME, flamencoVersion: DEFAULT_FLAMENCO_VERSION, backendURL: backendURL, }), - mounted() { window.app = this; this.fetchManagerInfo(); diff --git a/web/app/src/views/JobsView.vue b/web/app/src/views/JobsView.vue index 134d8500..ed04e62d 100644 --- a/web/app/src/views/JobsView.vue +++ b/web/app/src/views/JobsView.vue @@ -274,7 +274,6 @@ export default { this.$refs.jobsTable.onReconnected(); if (this.$refs.tasksTable) this.$refs.tasksTable.onReconnected(); - }, onSIODisconnected(reason) { }, -- 2.30.2 From 5f4a8b3fbadef99cb837bcfba86a3c19978c41b9 Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Thu, 3 Aug 2023 07:41:36 -0700 Subject: [PATCH 07/30] Create tag interface --- web/app/src/views/TagsView.vue | 164 +++++++++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 web/app/src/views/TagsView.vue diff --git a/web/app/src/views/TagsView.vue b/web/app/src/views/TagsView.vue new file mode 100644 index 00000000..ca5fc6b5 --- /dev/null +++ b/web/app/src/views/TagsView.vue @@ -0,0 +1,164 @@ + + + + + -- 2.30.2 From 6caa642d5f9663907fa2ddf383d9688ef7107aac Mon Sep 17 00:00:00 2001 From: Eveline Anderson Date: Thu, 3 Aug 2023 07:42:35 -0700 Subject: [PATCH 08/30] Add router for tag tab --- web/app/src/App.vue | 3 +++ web/app/src/router/index.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/web/app/src/App.vue b/web/app/src/App.vue index 51da6358..1f435612 100644 --- a/web/app/src/App.vue +++ b/web/app/src/App.vue @@ -9,6 +9,9 @@
  • Workers
  • +
  • + Tags +
  • Last Rendered
  • diff --git a/web/app/src/router/index.js b/web/app/src/router/index.js index 3bba9319..fe59c250 100644 --- a/web/app/src/router/index.js +++ b/web/app/src/router/index.js @@ -20,6 +20,12 @@ const router = createRouter({ component: () => import('../views/WorkersView.vue'), props: true, }, + { + path: '/tags/:tagID?', + name: 'tags', + component: () => import('../views/TagsView.vue'), + props: true, + }, { path: '/last-rendered', name: 'last-rendered', -- 2.30.2 From 7ecf89e94b2caf551c58eb19694667b3b433644b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 3 Aug 2023 17:07:56 +0200 Subject: [PATCH 09/30] Actually create worker tags via API Still needs styling work & maybe some better error checking. --- web/app/src/views/TagsView.vue | 37 +++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/web/app/src/views/TagsView.vue b/web/app/src/views/TagsView.vue index ca5fc6b5..3eda3e5b 100644 --- a/web/app/src/views/TagsView.vue +++ b/web/app/src/views/TagsView.vue @@ -3,12 +3,19 @@

    Tag Details

    - +
    +
    +
    + + +
    +
    + @@ -98,6 +105,9 @@