Browse Source

feat: update meta tag

Ahmad Kholid 2 years ago
parent
commit
531064bd12
2 changed files with 9 additions and 2 deletions
  1. 5 2
      src/newtab/App.vue
  2. 4 0
      src/newtab/pages/workflows/[id].vue

+ 5 - 2
src/newtab/App.vue

@@ -237,8 +237,11 @@ useHead(() => {
   const runningWorkflows = workflowStore.states.length;
 
   return {
-    title:
-      runningWorkflows > 0 ? `${runningWorkflows} Workflows Running` : 'Automa',
+    title: 'Dashboard',
+    titleTemplate:
+      runningWorkflows > 0
+        ? `%s (${runningWorkflows} Workflows Running) - Automa`
+        : '%s - Automa',
   };
 });
 

+ 4 - 0
src/newtab/pages/workflows/[id].vue

@@ -300,6 +300,7 @@ import cloneDeep from 'lodash.clonedeep';
 import { useI18n } from 'vue-i18n';
 import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router';
 import { customAlphabet } from 'nanoid';
+import { useHead } from '@vueuse/head';
 import { useToast } from 'vue-toastification';
 import defu from 'defu';
 import dagre from 'dagre';
@@ -1556,6 +1557,9 @@ function checkWorkflowUpdate() {
     });
 }
 
+useHead({
+  title: () => `${workflow.value?.name} workflow` || 'Edit workflow',
+});
 const shortcut = useShortcut([
   getShortcut('editor:toggle-sidebar', toggleSidebar),
   getShortcut('editor:duplicate-block', duplicateElements),