Browse Source

feat: rename events to jobs

Signed-off-by: mertmit <mertmit99@gmail.com>
feat/export-nest-dir-restructure
mertmit 2 years ago committed by starbirdtech383
parent
commit
94737755cd
  1. 4
      packages/nc-gui/pages/index/index/index.vue
  2. 4
      packages/nc-gui/plugins/jobs.ts

4
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') {

4
packages/nc-gui/plugins/events.ts → 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)
})
Loading…
Cancel
Save