Skip to content

Commit

Permalink
Hotfix][UI] Fix warnings in the project. (apache#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
songjianet authored Mar 6, 2023
1 parent ab66dda commit 9cb3169
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 45 deletions.
21 changes: 0 additions & 21 deletions seatunnel-ui/src/service/script/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ export function scriptDelete(scriptId: number): any {
})
}

export function scriptContent(scriptId: number): any {
return axios({
url: `/script/${scriptId}/content`,
method: 'get'
})
}

export function scriptUpdate(scriptId: number, content: string): any {
return axios({
url: `/script/${scriptId}/content`,
Expand All @@ -65,20 +58,6 @@ export function scriptUpdate(scriptId: number, content: string): any {
})
}

export function scriptParam(scriptId: number): any {
return axios({
url: `/script/${scriptId}/param`,
method: 'get'
})
}

export function scriptParamUpdate(scriptId: number): any {
return axios({
url: `/script/${scriptId}/param`,
method: 'put'
})
}

export function scriptPublish(scriptId: number): any {
return axios({
url: `/script/${scriptId}/publish`,
Expand Down
28 changes: 21 additions & 7 deletions seatunnel-ui/src/views/data-pipes/list/use-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ export function useTable() {
})
}
},
row.name
{
default: () => row.name
}
)
}
},
Expand All @@ -68,9 +70,17 @@ export function useTable() {
key: 'status',
render: (row: ScriptDetail) => {
if (row.status === 'published') {
return h(NTag, { type: 'info' }, t('tasks.published'))
return h(
NTag,
{ type: 'info' },
{ default: () => t('tasks.published') }
)
} else {
return h(NTag, { type: 'default' }, t('tasks.unpublished'))
return h(
NTag,
{ type: 'default' },
{ default: () => t('tasks.unpublished') }
)
}
}
},
Expand All @@ -95,7 +105,9 @@ export function useTable() {
disabled: row.status !== 'published',
onClick: () => handleExecute(row)
},
t('data_pipes.execute')
{
default: () => t('data_pipes.execute')
}
),
h(
NButton,
Expand All @@ -108,7 +120,9 @@ export function useTable() {
})
}
},
t('data_pipes.edit')
{
default: () => t('data_pipes.edit')
}
),
h(
NButton,
Expand All @@ -117,7 +131,7 @@ export function useTable() {
disabled: row.status === 'published',
onClick: () => handlePublish(row)
},
t('data_pipes.publish')
{ default: () => t('data_pipes.publish') }
),
h(
NButton,
Expand All @@ -126,7 +140,7 @@ export function useTable() {
disabled: row.status === 'published',
onClick: () => handleDelete(row)
},
t('data_pipes.delete')
{ default: () => t('data_pipes.delete') }
)
]
})
Expand Down
4 changes: 2 additions & 2 deletions seatunnel-ui/src/views/jobs/list/use-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function useTable() {
disabled: row.jobStatus === 'OFFLINE',
onClick: () => handleExecute(row.jobId)
},
t('jobs.execute')
{ default: () => t('jobs.execute') }
),
h(
NButton,
Expand All @@ -76,7 +76,7 @@ export function useTable() {
disabled: row.jobStatus === 'OFFLINE',
onClick: () => handleRecycle(row.jobId)
},
t('jobs.recycle')
{ default: () => t('jobs.recycle') }
)
]
})
Expand Down
36 changes: 28 additions & 8 deletions seatunnel-ui/src/views/tasks/list/use-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,35 @@ export function useTable() {
key: 'status',
render: (row: JobDetail) => {
if (row.status === 'SUCCESS') {
return h(NTag, { type: 'success' }, t('tasks.success'))
return h(
NTag,
{ type: 'success' },
{ default: () => t('tasks.success') }
)
} else if (row.status === 'FAILED') {
return h(NTag, { type: 'error' }, t('tasks.fail'))
return h(
NTag,
{ type: 'error' },
{ default: () => t('tasks.fail') }
)
} else if (row.status === 'STOPPED') {
return h(NTag, { type: 'warning' }, t('tasks.stop'))
return h(
NTag,
{ type: 'warning' },
{ default: () => t('tasks.stop') }
)
} else if (row.status === 'RUNNING') {
return h(NTag, { type: 'info' }, t('tasks.running'))
return h(
NTag,
{ type: 'info' },
{ default: () => t('tasks.running') }
)
} else {
return h(NTag, { type: 'default' }, t('tasks.unknown'))
return h(
NTag,
{ type: 'default' },
{ default: () => t('tasks.unknown') }
)
}
}
},
Expand Down Expand Up @@ -90,7 +110,7 @@ export function useTable() {
disabled: row.status === 'RUNNING',
onClick: () => handleRerun(row)
},
t('tasks.rerun')
{ default: () => t('tasks.rerun') }
),
h(
NButton,
Expand All @@ -99,12 +119,12 @@ export function useTable() {
disabled: row.status !== 'RUNNING',
onClick: () => handleKill(row)
},
t('tasks.kill')
{ default: () => t('tasks.kill') }
),
h(
NButton,
{ text: true, onClick: () => handleViewLog(row) },
t('tasks.view_log')
{ default: () => t('tasks.view_log') }
)
]
})
Expand Down
13 changes: 8 additions & 5 deletions seatunnel-ui/src/views/user-manage/list/use-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,22 @@ export function useTable() {
h(
NButton,
{ text: true, onClick: () => handleStatus(row) },
row.status === 1
? t('user_manage.enable')
: t('user_manage.disable')
{
default: () =>
row.status === 1
? t('user_manage.enable')
: t('user_manage.disable')
}
),
h(
NButton,
{ text: true, onClick: () => handleEdit(row) },
t('user_manage.edit')
{ default: () => t('user_manage.edit') }
),
h(
NButton,
{ text: true, onClick: () => handleDelete(row) },
t('user_manage.delete')
{ default: () => t('user_manage.delete') }
)
]
})
Expand Down
5 changes: 3 additions & 2 deletions seatunnel-ui/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default defineConfig({
],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
'@': path.resolve(__dirname, 'src'),
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
}
},
server: {
Expand All @@ -47,4 +48,4 @@ export default defineConfig({
}
}
}
})
})

0 comments on commit 9cb3169

Please sign in to comment.