diff --git a/src/frontend/src/App.vue b/src/frontend/src/App.vue index 9f8e804b2..8b0c08731 100644 --- a/src/frontend/src/App.vue +++ b/src/frontend/src/App.vue @@ -15,6 +15,7 @@ :style="{ 'margin-top': isMobile ? '10px' : '25px', height: '100' }" > + @@ -33,6 +34,7 @@ import { computed, provide, watch } from 'vue' import { useLoginStore } from '@/stores/LoginStore' import SnapshotList from './components/SnapshotList.vue' + import CreateButton from './components/CreateButton.vue' const store = useLoginStore() @@ -64,4 +66,24 @@ } }) + const includeCreateButton = [ + 'home', + 'experiments', + 'experimentJobs', + 'entrypoints', + 'plugins', + 'pluginFiles', + 'queues', + 'jobs', + 'pluginParams', + 'tags', + 'models', + 'artifacts' + ] + + const addCreateButton = computed(() => { + return typeof route.name === 'string' && includeCreateButton.includes(route.name) + }) + + \ No newline at end of file diff --git a/src/frontend/src/components/CreateButton.vue b/src/frontend/src/components/CreateButton.vue index e04a357e5..fe235903c 100644 --- a/src/frontend/src/components/CreateButton.vue +++ b/src/frontend/src/components/CreateButton.vue @@ -15,8 +15,8 @@ Create {{ resource.name }} @@ -29,23 +29,74 @@ \ No newline at end of file diff --git a/src/frontend/src/router/index.ts b/src/frontend/src/router/index.ts index 7a3b15ff9..5333cb3cc 100644 --- a/src/frontend/src/router/index.ts +++ b/src/frontend/src/router/index.ts @@ -6,23 +6,27 @@ const router = createRouter({ routes: [ { path: '/', - component: HomeView + component: HomeView, + name: 'home' }, { path: '/entrypoints', - component: () => import('../views/EntryPointsView.vue') + component: () => import('../views/EntryPointsView.vue'), + name: 'entrypoints' }, { path: '/entrypoints/:id', - component: () => import('../views/CreateEntryPoint.vue') + component: () => import('../views/CreateEntryPoint.vue'), }, { path: '/plugins', - component: () => import('../views/PluginsView.vue') + component: () => import('../views/PluginsView.vue'), + name: 'plugins' }, { path: '/plugins/:id/files', - component: () => import('../views/PluginFiles.vue') + component: () => import('../views/PluginFiles.vue'), + name: 'pluginFiles' }, { path: '/plugins/:id/files/:fileId', @@ -30,19 +34,23 @@ const router = createRouter({ }, { path: '/queues', - component: () => import('../views/QueuesView.vue') + component: () => import('../views/QueuesView.vue'), + name: 'queues' }, { path: '/experiments', - component: () => import('../views/ExperimentsView.vue') + component: () => import('../views/ExperimentsView.vue'), + name: 'experiments' }, { path: '/jobs', - component: () => import('../views/AllJobsView.vue') + component: () => import('../views/AllJobsView.vue'), + name: 'jobs' }, { path: '/experiments/:id/jobs', - component: () => import('../views/JobsView.vue') + component: () => import('../views/JobsView.vue'), + name: 'experimentJobs' }, { path: '/experiments/:id/jobs/:jobId', @@ -67,19 +75,23 @@ const router = createRouter({ }, { path: '/tags', - component: () => import('../views/TagsView.vue') + component: () => import('../views/TagsView.vue'), + name: 'tags' }, { path: '/pluginParams', - component: () => import('../views/PluginParamsView.vue') + component: () => import('../views/PluginParamsView.vue'), + name: 'pluginParams' }, { path: '/models', - component: () => import('../views/ModelsView.vue') + component: () => import('../views/ModelsView.vue'), + name: 'models' }, { path: '/artifacts', - component: () => import('../views/ArtifactsView.vue') + component: () => import('../views/ArtifactsView.vue'), + name: 'artifacts' }, { path: '/login', diff --git a/src/frontend/src/views/ArtifactsView.vue b/src/frontend/src/views/ArtifactsView.vue index 34fdcd42b..75a8a6934 100644 --- a/src/frontend/src/views/ArtifactsView.vue +++ b/src/frontend/src/views/ArtifactsView.vue @@ -26,19 +26,7 @@ /> --> - + - - Register new Entrypoint - - Register new Entrypoint - - - diff --git a/src/frontend/src/views/ExperimentsView.vue b/src/frontend/src/views/ExperimentsView.vue index 1b0695e6d..227b4e3db 100644 --- a/src/frontend/src/views/ExperimentsView.vue +++ b/src/frontend/src/views/ExperimentsView.vue @@ -32,8 +32,6 @@ - - - \ No newline at end of file diff --git a/src/frontend/src/views/PluginFiles.vue b/src/frontend/src/views/PluginFiles.vue index 7b1c1ba8f..48720af72 100644 --- a/src/frontend/src/views/PluginFiles.vue +++ b/src/frontend/src/views/PluginFiles.vue @@ -16,19 +16,6 @@ {{ props.row.tasks.length }} - - Create New Plugin File - - Create New Plugin File - - {{ props.row.group.name }} - - Register a new Plugin Param Type - - Register a new Plugin Param Type - - + store.triggerPopup, (newVal) => { + if(newVal) { + showAddDialog.value = true + store.triggerPopup = false + } + }) + \ No newline at end of file diff --git a/src/frontend/src/views/PluginsView.vue b/src/frontend/src/views/PluginsView.vue index d12655b28..03b3c2331 100644 --- a/src/frontend/src/views/PluginsView.vue +++ b/src/frontend/src/views/PluginsView.vue @@ -38,19 +38,7 @@ /> - - Register a new Plugin - - Register a new Plugin - - + store.triggerPopup, (newVal) => { + if(newVal) { + showPluginDialog.value = true + store.triggerPopup = false + } + }) const plugins = ref([]) diff --git a/src/frontend/src/views/QueuesView.vue b/src/frontend/src/views/QueuesView.vue index ea4fe8ab5..cdd0dd805 100644 --- a/src/frontend/src/views/QueuesView.vue +++ b/src/frontend/src/views/QueuesView.vue @@ -24,19 +24,7 @@ /> - - Register a new Queue - - Register a new Queue - - + store.triggerPopup, (newVal) => { + if(newVal) { + showQueueDialog.value = true + store.triggerPopup = false + } + }) + diff --git a/src/frontend/src/views/TagsView.vue b/src/frontend/src/views/TagsView.vue index 21125863f..f248cf542 100644 --- a/src/frontend/src/views/TagsView.vue +++ b/src/frontend/src/views/TagsView.vue @@ -17,19 +17,7 @@ - - Register a new Tag - - Register a new Tag - - + store.triggerPopup, (newVal) => { + if(newVal) { + showAddDialog.value = true + store.triggerPopup = false + } + }) +