From 94737755cd99c8ab09f7751a9bd88537527c7acf Mon Sep 17 00:00:00 2001 From: mertmit Date: Tue, 25 Apr 2023 18:28:13 +0300 Subject: [PATCH] feat: rename events to jobs Signed-off-by: mertmit --- packages/nc-gui/pages/index/index/index.vue | 4 ++-- packages/nc-gui/plugins/{events.ts => jobs.ts} | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename packages/nc-gui/plugins/{events.ts => jobs.ts} (97%) diff --git a/packages/nc-gui/pages/index/index/index.vue b/packages/nc-gui/pages/index/index/index.vue index d1175baee6..18b4732536 100644 --- a/packages/nc-gui/pages/index/index/index.vue +++ b/packages/nc-gui/pages/index/index/index.vue @@ -27,7 +27,7 @@ definePageMeta({ title: 'title.myProject', }) -const { $api, $e, $events } = useNuxtApp() +const { $api, $e, $jobs } = useNuxtApp() const { api, isLoading } = useApi() @@ -95,7 +95,7 @@ const duplicateProject = (project: ProjectType) => { await loadProjects() - $events.subscribe(jobData.name, jobData.id, async (data: { status: string }) => { + $jobs.subscribe(jobData.name, jobData.id, async (data: { status: string }) => { if (data.status === 'completed') { await loadProjects() } else if (data.status === 'failed') { diff --git a/packages/nc-gui/plugins/events.ts b/packages/nc-gui/plugins/jobs.ts similarity index 97% rename from packages/nc-gui/plugins/events.ts rename to packages/nc-gui/plugins/jobs.ts index f90d4064fe..b672da60d1 100644 --- a/packages/nc-gui/plugins/events.ts +++ b/packages/nc-gui/plugins/jobs.ts @@ -28,7 +28,7 @@ export default defineNuxtPlugin(async (nuxtApp) => { await init(nuxtApp.$state.token.value) } - const events = { + const jobs = { subscribe(name: string, id: string, cb: (data: any) => void) { if (socket) { socket.emit('subscribe', { name, id }) @@ -64,5 +64,5 @@ export default defineNuxtPlugin(async (nuxtApp) => { else if (!newToken) socket?.disconnect() }) - nuxtApp.provide('events', events) + nuxtApp.provide('jobs', jobs) })