This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git
The following commit(s) were added to refs/heads/main by this push:
new 98e6ec1a [Improvement] Follow eslint checkstyle suggestion (#274)
98e6ec1a is described below
commit 98e6ec1a359aad21545019e4be8626070ee24ac9
Author: xiaomo <[email protected]>
AuthorDate: Sat Jun 1 01:02:58 2024 +0800
[Improvement] Follow eslint checkstyle suggestion (#274)
---
paimon-web-ui/license.node.js | 60 ++++++++--------
paimon-web-ui/package.json | 2 +-
paimon-web-ui/pnpm-lock.yaml | 44 ++++++++----
paimon-web-ui/src/api/models/cdc/index.ts | 4 +-
paimon-web-ui/src/api/models/cluster/index.ts | 6 +-
paimon-web-ui/src/api/models/job/index.ts | 6 +-
paimon-web-ui/src/api/models/login/index.ts | 2 +-
paimon-web-ui/src/api/models/user/types.ts | 1 -
.../components/dynamic-form/fields/get-field.ts | 7 +-
paimon-web-ui/src/components/modal/use-task.ts | 3 +-
paimon-web-ui/src/composables/locales.ts | 2 -
.../src/form-lib/metadata/use-database.ts | 2 +-
paimon-web-ui/src/form-lib/metadata/use-options.ts | 2 +-
paimon-web-ui/src/store/job/index.ts | 24 +++----
paimon-web-ui/src/store/job/type.ts | 2 +-
.../src/views/cdc/components/dag/index.tsx | 4 +-
.../src/views/cdc/components/list/index.tsx | 2 +-
.../src/views/cdc/components/list/use-table.ts | 8 ++-
paimon-web-ui/src/views/cdc/index.tsx | 29 ++++----
.../metadata/components/catalog-form/index.tsx | 8 +--
.../metadata/components/columns-form/index.tsx | 4 +-
.../metadata/components/database-form/index.tsx | 8 +--
.../views/metadata/components/menu-tree/index.tsx | 6 +-
.../metadata/components/options-form/edit.tsx | 6 +-
.../metadata/components/options-form/index.tsx | 6 +-
.../views/metadata/components/options/index.tsx | 4 +-
.../components/table-column-content/index.tsx | 1 -
.../views/metadata/components/table-form/index.tsx | 2 +-
.../src/views/metadata/components/table/index.tsx | 4 +-
.../console/components/controls/index.tsx | 82 +++++++++++++---------
.../components/console/components/table/index.tsx | 43 ++++++------
.../components/query/components/debugger/index.tsx | 60 ++++++++--------
.../query/components/menu-tree/index.tsx | 8 +--
.../components/query/components/tabs/index.tsx | 2 +-
.../views/playground/components/query/index.tsx | 31 ++++----
.../workbench/components/debugger/index.tsx | 3 +-
.../cluster/components/cluster-form/index.tsx | 3 -
37 files changed, 254 insertions(+), 237 deletions(-)
diff --git a/paimon-web-ui/license.node.js b/paimon-web-ui/license.node.js
index f4685172..72590782 100644
--- a/paimon-web-ui/license.node.js
+++ b/paimon-web-ui/license.node.js
@@ -15,10 +15,10 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
-const fs = require('fs');
-const path = require('path');
+const fs = require('node:fs')
+const path = require('node:path')
-const filePath = path.resolve(__dirname, './src');
+const filePath = path.resolve(__dirname, './src')
const xmlLicenses = `
<!--
@@ -61,58 +61,56 @@ under the License. */
`
function fileDisplay(filePath) {
- fs.readdir(filePath, function (err, files) {
+ fs.readdir(filePath, (err, files) => {
if (err) {
- console.warn('get file list error: ' + err);
- } else {
+ console.warn(`get file list error: ${err}`)
+ }
+ else {
for (let index = 0; index < files.length; index++) {
- const filename = files[index];
- const filedir = path.join(filePath, filename);
- fs.stat(filedir, function (eror, stats) {
+ const filename = files[index]
+ const filedir = path.join(filePath, filename)
+ fs.stat(filedir, (eror, stats) => {
if (eror) {
- console.warn('get file stat error: ' + eror);
- } else {
- const isFile = stats.isFile();
- const isDir = stats.isDirectory();
+ console.warn(`get file stat error: ${eror}`)
+ }
+ else {
+ const isFile = stats.isFile()
+ const isDir = stats.isDirectory()
if (isFile) {
- const res = read(filedir);
- const fileName = path.basename(filedir);
- res && console.log('success file: ' + fileName);
+ const res = read(filedir)
+ const fileName = path.basename(filedir)
+ res && console.log(`success file: ${fileName}`)
}
- if (isDir) {
+ if (isDir)
fileDisplay(filedir)
- }
}
})
}
}
- });
+ })
}
function read(fPath) {
- var data = fs.readFileSync(fPath, "utf-8");
+ const data = fs.readFileSync(fPath, 'utf-8')
return write(data, fPath)
}
function write(data, fPath) {
- if (data.includes('Apache') && data.includes('License')) {
+ if (data.includes('Apache') && data.includes('License'))
return true
- }
- const fileName = path.basename(fPath);
- let license;
- if (fileName.endsWith('.tsx') || fileName.endsWith('.ts') ||
fileName.endsWith('.js') || fileName.endsWith('.css') ||
fileName.endsWith('.scss')) {
+ const fileName = path.basename(fPath)
+ let license
+ if (fileName.endsWith('.tsx') || fileName.endsWith('.ts') ||
fileName.endsWith('.js') || fileName.endsWith('.css') ||
fileName.endsWith('.scss'))
license = tsLicenses
- }
- if (fileName.endsWith('.vue') || fileName.endsWith('.html')) {
+
+ if (fileName.endsWith('.vue') || fileName.endsWith('.html'))
license = xmlLicenses
- }
-
if (license) {
const newFile = `${license}\n${data}`
- fs.writeFileSync(`${fPath}`, newFile, { encoding: 'utf-8' });
+ fs.writeFileSync(`${fPath}`, newFile, { encoding: 'utf-8' })
return true
}
@@ -122,4 +120,4 @@ function write(data, fPath) {
}
}
-fileDisplay(filePath);
+fileDisplay(filePath)
diff --git a/paimon-web-ui/package.json b/paimon-web-ui/package.json
index 0a1f3bb6..6e594b4d 100644
--- a/paimon-web-ui/package.json
+++ b/paimon-web-ui/package.json
@@ -51,7 +51,7 @@
"eslint": "^9.3.0",
"husky": "^9.0.11",
"mockm": "1.1.27-alpha.2",
- "naive-ui": "^2.36.0",
+ "naive-ui": "^2.38.2",
"npm-run-all": "^4.1.5",
"postcss": "^8.4.29",
"prettier": "^3.0.3",
diff --git a/paimon-web-ui/pnpm-lock.yaml b/paimon-web-ui/pnpm-lock.yaml
index cd1e2bae..4860b389 100644
--- a/paimon-web-ui/pnpm-lock.yaml
+++ b/paimon-web-ui/pnpm-lock.yaml
@@ -17,10 +17,6 @@
lockfileVersion: '6.0'
-settings:
- autoInstallPeers: true
- excludeLinksFromLockfile: false
-
dependencies:
'@antv/x6':
specifier: ^2.15.3
@@ -35,8 +31,8 @@ dependencies:
specifier: ^1.25.0
version: 1.25.0
dayjs:
- specifier: ^1.11.10
- version: 1.11.10
+ specifier: ^1.11.11
+ version: 1.11.11
lodash:
specifier: ^4.17.21
version: 4.17.21
@@ -117,12 +113,15 @@ devDependencies:
eslint:
specifier: ^9.3.0
version: 9.3.0
+ husky:
+ specifier: ^9.0.11
+ version: 9.0.11
mockm:
specifier: 1.1.27-alpha.2
version: 1.1.27-alpha.2
naive-ui:
- specifier: ^2.36.0
- version: 2.36.0([email protected])
+ specifier: ^2.38.2
+ version: 2.38.2([email protected])
npm-run-all:
specifier: ^4.1.5
version: 4.1.5
@@ -298,7 +297,7 @@ packages:
dependencies:
'@antv/x6': 2.15.3
vue: 3.3.4
- vue-demi: 0.14.7([email protected])
+ vue-demi: 0.14.8([email protected])
dev: false
/@antv/[email protected]:
@@ -2931,6 +2930,10 @@ packages:
/[email protected]:
resolution: {integrity:
sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==}
+ /[email protected]:
+ resolution: {integrity:
sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==}
+ dev: true
+
/[email protected]([email protected]):
resolution: {integrity:
sha512-DXCnp1A/Xa69FujksUfdvWQFAnIn/C+4Wuv8t+UVdZkF/lY5bzj98GGKOGme7V/ckSHDLxE29Xp76sJ5Cpsp5A==}
hasBin: true
@@ -2981,8 +2984,8 @@ packages:
'@babel/runtime': 7.22.15
dev: true
- /[email protected]:
- resolution: {integrity:
sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==}
+ /[email protected]:
+ resolution: {integrity:
sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==}
dev: false
/[email protected]:
@@ -4455,6 +4458,12 @@ packages:
engines: {node: '>=10.17.0'}
dev: true
+ /[email protected]:
+ resolution: {integrity:
sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==}
+ engines: {node: '>=18'}
+ hasBin: true
+ dev: true
+
/[email protected]:
resolution: {integrity:
sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
engines: {node: '>=0.10.0'}
@@ -5297,8 +5306,8 @@ packages:
dev: true
optional: true
- /[email protected]([email protected]):
- resolution: {integrity:
sha512-r1ydtEm1Ryf/aWpbLCf32mQAGK99jd1eXgpkCtIomcBRZeAtusfy6zCtIpCppoCuIKM3BW5DMafhVxilubk/lQ==}
+ /[email protected]([email protected]):
+ resolution: {integrity:
sha512-WhZ+6DW61aYSmFyfH7evcSGFmd2xR68Yq1mNRrVdJwBhZsnNdAUsMN9IeNCVEPMCND/jzYZghkStoNoR5Xa09g==}
peerDependencies:
vue: ^3.0.0
dependencies:
@@ -5309,6 +5318,7 @@ packages:
'@types/lodash-es': 4.17.9
async-validator: 4.2.5
css-render: 0.15.12
+ csstype: 3.1.3
date-fns: 2.30.0
date-fns-tz: 2.0.0([email protected])
evtd: 0.2.4
@@ -7220,8 +7230,8 @@ packages:
vue: 3.3.4
dev: false
- /[email protected]([email protected]):
- resolution: {integrity:
sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==}
+ /[email protected]([email protected]):
+ resolution: {integrity:
sha512-Uuqnk9YE9SsWeReYqK2alDI5YzciATE0r2SkA6iMAtuXvNTMNACJLJEXNXaEy94ECuBe4Sk6RzRU80kjdbIo1Q==}
engines: {node: '>=12'}
hasBin: true
requiresBuild: true
@@ -7564,3 +7574,7 @@ packages:
resolution: {integrity:
sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==}
engines: {node: '>=12.20'}
dev: true
+
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
diff --git a/paimon-web-ui/src/api/models/cdc/index.ts
b/paimon-web-ui/src/api/models/cdc/index.ts
index dc365b03..0f6d59da 100644
--- a/paimon-web-ui/src/api/models/cdc/index.ts
+++ b/paimon-web-ui/src/api/models/cdc/index.ts
@@ -37,8 +37,8 @@ export function updateCdcJob(cdcJobDefinition:
CdcJobDefinition) {
/**
* # List all cdc job definitions
*/
-export function listAllCdcJob(withConfig: boolean,jobName: string |undefined|
null, currentPage: number, pageSize: number) {
- return httpRequest.get('/cdc-job-definition/list', { withConfig,jobName,
currentPage, pageSize })
+export function listAllCdcJob(withConfig: boolean, jobName: string | undefined
| null, currentPage: number, pageSize: number) {
+ return httpRequest.get('/cdc-job-definition/list', { withConfig, jobName,
currentPage, pageSize })
}
/**
diff --git a/paimon-web-ui/src/api/models/cluster/index.ts
b/paimon-web-ui/src/api/models/cluster/index.ts
index ec937e3c..d14c112e 100644
--- a/paimon-web-ui/src/api/models/cluster/index.ts
+++ b/paimon-web-ui/src/api/models/cluster/index.ts
@@ -16,7 +16,7 @@ specific language governing permissions and limitations
under the License. */
import httpRequest from '../../request'
-import type {Cluster, ClusterDTO, ClusterNameParams} from './types'
+import type { Cluster, ClusterDTO, ClusterNameParams } from './types'
import type { ResponseOptions } from '@/api/types'
/**
@@ -36,8 +36,8 @@ export function getClusterListByType(type: string, pageNum:
number, pageSize: nu
return httpRequest.get('/cluster/list', {
type,
pageNum,
- pageSize
- });
+ pageSize,
+ })
}
/**
diff --git a/paimon-web-ui/src/api/models/job/index.ts
b/paimon-web-ui/src/api/models/job/index.ts
index e83fdfb4..2f6858ed 100644
--- a/paimon-web-ui/src/api/models/job/index.ts
+++ b/paimon-web-ui/src/api/models/job/index.ts
@@ -16,8 +16,8 @@ specific language governing permissions and limitations
under the License. */
import httpRequest from '../../request'
-import type {JobSubmitDTO, Job, ResultFetchDTO, JobResultData, JobStatus,
StopJobDTO} from "@/api/models/job/types/job"
-import type {ResponseOptions} from "@/api/types"
+import type { Job, JobResultData, JobStatus, JobSubmitDTO, ResultFetchDTO,
StopJobDTO } from '@/api/models/job/types/job'
+import type { ResponseOptions } from '@/api/types'
/**
* # Submit a job
@@ -52,4 +52,4 @@ export function getJobStatus(jobId: string) {
*/
export function stopJob(stopJobDTO: StopJobDTO) {
return httpRequest.post<StopJobDTO, ResponseOptions<void>>('/job/stop',
stopJobDTO)
-}
\ No newline at end of file
+}
diff --git a/paimon-web-ui/src/api/models/login/index.ts
b/paimon-web-ui/src/api/models/login/index.ts
index 4d4dac62..09f6ee11 100644
--- a/paimon-web-ui/src/api/models/login/index.ts
+++ b/paimon-web-ui/src/api/models/login/index.ts
@@ -23,7 +23,7 @@ import type { ResponseOptions } from '@/api/types'
/**
* # Login
- * @param {LoginOptions} options
+ * @params {LoginOptions} options
*/
export function onLogin(params: LoginOptions) {
return httpRequest.post<LoginOptions, ResponseOptions<any>>('/login', params)
diff --git a/paimon-web-ui/src/api/models/user/types.ts
b/paimon-web-ui/src/api/models/user/types.ts
index 6ef57923..ee0ddccd 100644
--- a/paimon-web-ui/src/api/models/user/types.ts
+++ b/paimon-web-ui/src/api/models/user/types.ts
@@ -1,4 +1,3 @@
-
/* Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
diff --git a/paimon-web-ui/src/components/dynamic-form/fields/get-field.ts
b/paimon-web-ui/src/components/dynamic-form/fields/get-field.ts
index 2b2a6443..0763f428 100644
--- a/paimon-web-ui/src/components/dynamic-form/fields/get-field.ts
+++ b/paimon-web-ui/src/components/dynamic-form/fields/get-field.ts
@@ -26,13 +26,14 @@ const TYPES = [
'checkbox',
]
-function getField(item: IJsonItem, fields: { [field: string]: any }, rules?:
IFormRules) {
+function getField(item: IJsonItem, fields: { [field: string]: any }, _rules?:
IFormRules) {
const { type = 'input' } = isFunction(item) ? item() : item
if (!TYPES.includes(type))
return null
+
const renderTypeName = `render${upperFirst(camelCase(type))}`
- // @ts-expect-error
- return Field[renderTypeName](item, fields)
+
+ return Field[renderTypeName as keyof typeof Field](item, fields)
}
export default getField
diff --git a/paimon-web-ui/src/components/modal/use-task.ts
b/paimon-web-ui/src/components/modal/use-task.ts
index 81616a6d..4784d620 100644
--- a/paimon-web-ui/src/components/modal/use-task.ts
+++ b/paimon-web-ui/src/components/modal/use-task.ts
@@ -49,7 +49,8 @@ export function useTask({
const task = tasks[formType as keyof typeof tasks]
const { model, json } = task(params)
jsonRef.value = json
- const getElements = () => {
+
+ function getElements() {
const { rules, elements } = getElementByJson(jsonRef.value, model)
elementsRef.value = elements
rulesRef.value = rules
diff --git a/paimon-web-ui/src/composables/locales.ts
b/paimon-web-ui/src/composables/locales.ts
index afa9f906..e159fb1d 100644
--- a/paimon-web-ui/src/composables/locales.ts
+++ b/paimon-web-ui/src/composables/locales.ts
@@ -15,8 +15,6 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
-import type { UseI18nOptions } from 'vue-i18n'
-
import type { LANGUAGES } from '@/locales'
import i18n from '@/locales'
diff --git a/paimon-web-ui/src/form-lib/metadata/use-database.ts
b/paimon-web-ui/src/form-lib/metadata/use-database.ts
index 30ee4533..4620ebfc 100644
--- a/paimon-web-ui/src/form-lib/metadata/use-database.ts
+++ b/paimon-web-ui/src/form-lib/metadata/use-database.ts
@@ -6,7 +6,7 @@ to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
diff --git a/paimon-web-ui/src/form-lib/metadata/use-options.ts
b/paimon-web-ui/src/form-lib/metadata/use-options.ts
index 2aa36fe9..913cbfd9 100644
--- a/paimon-web-ui/src/form-lib/metadata/use-options.ts
+++ b/paimon-web-ui/src/form-lib/metadata/use-options.ts
@@ -6,7 +6,7 @@ to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
+ http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
diff --git a/paimon-web-ui/src/store/job/index.ts
b/paimon-web-ui/src/store/job/index.ts
index ad2d264b..098e940e 100644
--- a/paimon-web-ui/src/store/job/index.ts
+++ b/paimon-web-ui/src/store/job/index.ts
@@ -22,7 +22,7 @@ export interface JobState {
executionMode: ExecutionMode
currentJob: Job | null
jobResultData: JobResultData | null
- jobStatus: string,
+ jobStatus: string
executionTime: string
}
@@ -33,7 +33,7 @@ export const useJobStore = defineStore({
currentJob: null,
jobResultData: null,
jobStatus: '',
- executionTime: '0m:0s'
+ executionTime: '0m:0s',
}),
persist: false,
getters: {
@@ -47,29 +47,27 @@ export const useJobStore = defineStore({
return this.jobResultData
},
getColumns(): number {
- if (this.currentJob && this.currentJob.resultData &&
this.currentJob.resultData.length > 0) {
+ if (this.currentJob && this.currentJob.resultData &&
this.currentJob.resultData.length > 0)
return Object.keys(this.currentJob.resultData[0]).length
- }else if (this.jobResultData && this.jobResultData.resultData &&
this.jobResultData.resultData.length > 0) {
+ else if (this.jobResultData && this.jobResultData.resultData &&
this.jobResultData.resultData.length > 0)
return Object.keys(this.jobResultData.resultData[0]).length
- } else {
+ else
return 0
- }
},
getRows(): number {
- if (this.currentJob && this.currentJob.resultData &&
this.currentJob.resultData.length > 0) {
+ if (this.currentJob && this.currentJob.resultData &&
this.currentJob.resultData.length > 0)
return this.currentJob.resultData.length
- }else if (this.jobResultData && this.jobResultData.resultData &&
this.jobResultData.resultData.length > 0) {
+ else if (this.jobResultData && this.jobResultData.resultData &&
this.jobResultData.resultData.length > 0)
return this.jobResultData.resultData.length
- } else {
+ else
return 0
- }
},
getJobStatus(): string {
return this.jobStatus
},
getExecutionTime(): string {
return this.executionTime
- }
+ },
},
actions: {
setExecutionMode(executionMode: ExecutionMode) {
@@ -93,5 +91,5 @@ export const useJobStore = defineStore({
this.jobStatus = ''
this.executionTime = '0m:0s'
},
- }
-})
\ No newline at end of file
+ },
+})
diff --git a/paimon-web-ui/src/store/job/type.ts
b/paimon-web-ui/src/store/job/type.ts
index 3eeeb003..13ea0f54 100644
--- a/paimon-web-ui/src/store/job/type.ts
+++ b/paimon-web-ui/src/store/job/type.ts
@@ -15,4 +15,4 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
-export type ExecutionMode = 'Streaming' | 'Batch'
\ No newline at end of file
+export type ExecutionMode = 'Streaming' | 'Batch'
diff --git a/paimon-web-ui/src/views/cdc/components/dag/index.tsx
b/paimon-web-ui/src/views/cdc/components/dag/index.tsx
index 87292e2d..9c322044 100644
--- a/paimon-web-ui/src/views/cdc/components/dag/index.tsx
+++ b/paimon-web-ui/src/views/cdc/components/dag/index.tsx
@@ -27,6 +27,8 @@ export default defineComponent({
setup() {
const { t } = useLocaleHooks()
const CDCStore = useCDCStore()
+ const router: Router = useRouter()
+
const name = ref('')
onMounted(() => {
name.value = CDCStore.getModel.name
@@ -47,10 +49,8 @@ export default defineComponent({
router.push({ path: '/cdc_ingestion' })
})
}
-
}
- const router: Router = useRouter()
const handleJump = () => {
router.push({ path: '/cdc_ingestion' })
}
diff --git a/paimon-web-ui/src/views/cdc/components/list/index.tsx
b/paimon-web-ui/src/views/cdc/components/list/index.tsx
index e3c74150..6a2f30f6 100644
--- a/paimon-web-ui/src/views/cdc/components/list/index.tsx
+++ b/paimon-web-ui/src/views/cdc/components/list/index.tsx
@@ -30,7 +30,7 @@ export default defineComponent({
return {
t,
...toRefs(tableVariables),
- getTableData
+ getTableData,
}
},
render() {
diff --git a/paimon-web-ui/src/views/cdc/components/list/use-table.ts
b/paimon-web-ui/src/views/cdc/components/list/use-table.ts
index ad6e6aec..5344fc30 100644
--- a/paimon-web-ui/src/views/cdc/components/list/use-table.ts
+++ b/paimon-web-ui/src/views/cdc/components/list/use-table.ts
@@ -110,14 +110,16 @@ export function useTable(ctx: any) {
},
},
})
- const getTableData = (jobName?:string) => {
- listAllCdcJob(false,jobName, tableVariables.pagination.page,
tableVariables.pagination.pageSize).then(
+
+ function getTableData(jobName?: string) {
+ listAllCdcJob(false, jobName, tableVariables.pagination.page,
tableVariables.pagination.pageSize).then(
(res: any) => {
tableVariables.data = res.data
- tableVariables.pagination.itemCount = res.total
+ tableVariables.pagination.itemCount = res.total
},
)
}
+
return {
tableVariables,
getTableData,
diff --git a/paimon-web-ui/src/views/cdc/index.tsx
b/paimon-web-ui/src/views/cdc/index.tsx
index 1087e231..ba1e23dc 100644
--- a/paimon-web-ui/src/views/cdc/index.tsx
+++ b/paimon-web-ui/src/views/cdc/index.tsx
@@ -22,7 +22,6 @@ import styles from './index.module.scss'
import Modal from '@/components/modal'
import { useCDCStore } from '@/store/cdc'
import { type CdcJobSubmit, submitCdcJob } from '@/api/models/cdc'
-import job from '../job'
export default defineComponent({
name: 'CDCPage',
@@ -30,14 +29,8 @@ export default defineComponent({
const { t } = useLocaleHooks()
const showModalRef = ref(false)
const showSubmitCdcJobModalRef = ref(false)
- const handleOpenModal = () => {
- showModalRef.value = true
- }
-
- const handleOpenSubmitCdcJobModal = () => {
- showSubmitCdcJobModalRef.value = true
- }
+ const filterValue = ref()
const CDCStore = useCDCStore()
const router: Router = useRouter()
const CDCModalRef = ref()
@@ -51,18 +44,24 @@ export default defineComponent({
const cdcJobTableRef = ref()
- const handleCdcSubmitConfirm = (form: CdcJobSubmit) => {
+ function handleOpenModal() {
+ showModalRef.value = true
+ }
+
+ function handleOpenSubmitCdcJobModal() {
+ showSubmitCdcJobModalRef.value = true
+ }
+
+ function handleCdcSubmitConfirm(form: CdcJobSubmit) {
const CDCStore = useCDCStore()
submitCdcJob(CDCStore.getModel.id, form)
showSubmitCdcJobModalRef.value = false
}
- const handleSeachCdcJobTable = ()=>{
+ function handleSeachCdcJobTable() {
cdcJobTableRef.value.getTableData(filterValue.value)
}
- const filterValue = ref()
-
return {
t,
showModalRef,
@@ -75,7 +74,7 @@ export default defineComponent({
handleCdcSubmitConfirm,
cdcJobTableRef,
handleSeachCdcJobTable,
- filterValue
+ filterValue,
}
},
render() {
@@ -95,7 +94,7 @@ export default defineComponent({
placeholder={this.t('playground.search')}
v-model:value={this.filterValue}
v-slots={{
- prefix: () => <n-icon component={Search} />
+ prefix: () => <n-icon component={Search} />,
}}
onBlur={this.handleSeachCdcJobTable}
/>
@@ -131,5 +130,5 @@ export default defineComponent({
</n-card>
</div>
)
- }
+ },
})
diff --git a/paimon-web-ui/src/views/metadata/components/catalog-form/index.tsx
b/paimon-web-ui/src/views/metadata/components/catalog-form/index.tsx
index 19c2b76d..45d42c70 100644
--- a/paimon-web-ui/src/views/metadata/components/catalog-form/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/catalog-form/index.tsx
@@ -82,7 +82,7 @@ export default defineComponent({
})
const showModal = ref(false)
- const handleConfirm = async () => {
+ async function handleConfirm() {
await formRef.value.validate()
await createFetch({
params: toRaw(formValue.value),
@@ -94,17 +94,17 @@ export default defineComponent({
catalogStore.getAllCatalogs(true)
}
- const handleOpenModal = (e: Event) => {
+ function handleOpenModal(e: Event) {
e.stopPropagation()
showModal.value = true
}
- const handleCloseModal = () => {
+ function handleCloseModal() {
showModal.value = false
resetState()
}
- const resetState = () => {
+ function resetState() {
formValue.value = {
name: '',
type: '',
diff --git a/paimon-web-ui/src/views/metadata/components/columns-form/index.tsx
b/paimon-web-ui/src/views/metadata/components/columns-form/index.tsx
index c177ae01..f912c99b 100644
--- a/paimon-web-ui/src/views/metadata/components/columns-form/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/columns-form/index.tsx
@@ -55,7 +55,7 @@ export default defineComponent({
return Boolean(props.tableColumns)
})
- const handleConfirm = async () => {
+ async function handleConfirm() {
await formRef.value.validate()
await createFetch({
params: transformOption({
@@ -69,7 +69,7 @@ export default defineComponent({
props.onConfirm!()
}
- const handleCloseModal = () => {
+ function handleCloseModal() {
props.onClose!()
nextTick(() => {
formValue.value = resetState()
diff --git
a/paimon-web-ui/src/views/metadata/components/database-form/index.tsx
b/paimon-web-ui/src/views/metadata/components/database-form/index.tsx
index f4087081..f4197d34 100644
--- a/paimon-web-ui/src/views/metadata/components/database-form/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/database-form/index.tsx
@@ -37,12 +37,12 @@ export default defineComponent({
const message = useMessage()
const catalogStore = useCatalogStore()
- const [, createFetch, { loading }] = createDatabase()
+ const [, createFetch] = createDatabase()
const modalRef = ref<{ formRef: IFormInst }>()
const showModal = ref(false)
- const handleConfirm = async (values: DatabaseFormDTO) => {
+ async function handleConfirm(values: DatabaseFormDTO) {
await modalRef.value?.formRef?.validate()
if (props.catalogId) {
await createFetch({
@@ -61,12 +61,12 @@ export default defineComponent({
}
}
- const handleOpenModal = (e: Event) => {
+ function handleOpenModal(e: Event) {
e.stopPropagation()
showModal.value = true
}
- const handleCloseModal = () => {
+ function handleCloseModal() {
showModal.value = false
modalRef.value?.formRef?.resetValues({
name: '',
diff --git a/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx
b/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx
index 33df11b9..15ef9728 100644
--- a/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/menu-tree/index.tsx
@@ -50,12 +50,14 @@ export default defineComponent({
const renderSuffix = ({ option }: { option: TreeOption }) => {
switch (option.type) {
- case 'catalog':
+ case 'catalog': {
const [catalogId] = option.key?.toString()?.split(' ') || []
return h(DatabaseFormButton, { catalogId: Number(catalogId) })
- case 'database':
+ }
+ case 'database': {
const [id, name, databaseName] = option.key?.toString()?.split(' ')
|| []
return h(TableFormButton, { catalogId: Number(id), catalogName:
name, databaseName })
+ }
default:
return undefined
}
diff --git a/paimon-web-ui/src/views/metadata/components/options-form/edit.tsx
b/paimon-web-ui/src/views/metadata/components/options-form/edit.tsx
index 19054340..a962d041 100644
--- a/paimon-web-ui/src/views/metadata/components/options-form/edit.tsx
+++ b/paimon-web-ui/src/views/metadata/components/options-form/edit.tsx
@@ -56,7 +56,7 @@ export default defineComponent({
const formValue = ref({ ...toRaw(props.option) })
- const handleConfirm = async () => {
+ async function handleConfirm() {
await formRef.value?.validate()
await createFetch({
params: transformOption({
@@ -69,13 +69,13 @@ export default defineComponent({
message.success(t('Edit Successfully'))
}
- const handleOpenModal = (e: Event) => {
+ function handleOpenModal(e: Event) {
e.stopPropagation()
formValue.value = { ...toRaw(props.option) }
showModal.value = true
}
- const handleCloseModal = () => {
+ function handleCloseModal() {
showModal.value = false
props.onConfirm!()
}
diff --git a/paimon-web-ui/src/views/metadata/components/options-form/index.tsx
b/paimon-web-ui/src/views/metadata/components/options-form/index.tsx
index d3d1b379..cc83f7fb 100644
--- a/paimon-web-ui/src/views/metadata/components/options-form/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/options-form/index.tsx
@@ -61,17 +61,17 @@ export default defineComponent({
props.onConfirm!()
}
- const handleOpenModal = (e: Event) => {
+ function handleOpenModal(e: Event) {
e.stopPropagation()
showModal.value = true
}
- const handleCloseModal = () => {
+ function handleCloseModal() {
showModal.value = false
resetState()
}
- const resetState = () => {
+ function resetState() {
formValue.value = {
options: [{ ...newOption }],
}
diff --git a/paimon-web-ui/src/views/metadata/components/options/index.tsx
b/paimon-web-ui/src/views/metadata/components/options/index.tsx
index 30ed2524..9f0ee567 100644
--- a/paimon-web-ui/src/views/metadata/components/options/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/options/index.tsx
@@ -66,13 +66,13 @@ export default defineComponent({
},
]
- const onFetchData = async () => {
+ async function onFetchData() {
useOptionsList({
params: catalogStore.currentTable,
})
}
- const onDeleteOption = async (optionKey: string) => {
+ async function onDeleteOption(optionKey: string) {
await useDelete({
config: {
params: {
diff --git
a/paimon-web-ui/src/views/metadata/components/table-column-content/index.tsx
b/paimon-web-ui/src/views/metadata/components/table-column-content/index.tsx
index 1f676d4e..4bbfad47 100644
--- a/paimon-web-ui/src/views/metadata/components/table-column-content/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/table-column-content/index.tsx
@@ -16,7 +16,6 @@ specific language governing permissions and limitations
under the License. */
import type { DataTableColumns } from 'naive-ui'
-import { VueDraggable } from 'vue-draggable-plus'
import { UnorderedListOutlined } from '@vicons/antd'
import { dataTypeOptions, hasEndLength, hasLength } from './constant'
diff --git a/paimon-web-ui/src/views/metadata/components/table-form/index.tsx
b/paimon-web-ui/src/views/metadata/components/table-form/index.tsx
index dc10cf24..7cfd100a 100644
--- a/paimon-web-ui/src/views/metadata/components/table-form/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/table-form/index.tsx
@@ -106,7 +106,7 @@ export default defineComponent({
showModal.value = true
}
- const handleCloseModal = () => {
+ function handleCloseModal() {
showModal.value = false
formValue.value = resetFormValue()
}
diff --git a/paimon-web-ui/src/views/metadata/components/table/index.tsx
b/paimon-web-ui/src/views/metadata/components/table/index.tsx
index 7e69d854..601c2ecf 100644
--- a/paimon-web-ui/src/views/metadata/components/table/index.tsx
+++ b/paimon-web-ui/src/views/metadata/components/table/index.tsx
@@ -122,7 +122,7 @@ export default defineComponent({
},
]
- const onDeleteColumn = async (columnName: string) => {
+ async function onDeleteColumn(columnName: string) {
await deleteColumns({
...toRaw(catalogStore.currentTable),
columnName,
@@ -131,7 +131,7 @@ export default defineComponent({
await onFetchData()
}
- const onFetchData = async () => {
+ async function onFetchData() {
useColumns({
params: catalogStore.currentTable,
})
diff --git
a/paimon-web-ui/src/views/playground/components/query/components/console/components/controls/index.tsx
b/paimon-web-ui/src/views/playground/components/query/components/console/components/controls/index.tsx
index be3e5058..a1ed454a 100644
---
a/paimon-web-ui/src/views/playground/components/query/components/console/components/controls/index.tsx
+++
b/paimon-web-ui/src/views/playground/components/query/components/console/components/controls/index.tsx
@@ -16,23 +16,23 @@ specific language governing permissions and limitations
under the License. */
import { Copy, DataTable, Renew } from '@vicons/carbon'
-import { StopOutline, Stop } from '@vicons/ionicons5'
+import { Stop, StopOutline } from '@vicons/ionicons5'
import { ClockCircleOutlined, DownloadOutlined, LineChartOutlined } from
'@vicons/antd'
-import styles from './index.module.scss'
-import {fetchResult, stopJob} from "@/api/models/job"
-import {useMessage} from "naive-ui"
+import { useMessage } from 'naive-ui'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
+import styles from './index.module.scss'
+import { fetchResult, stopJob } from '@/api/models/job'
import { useJobStore } from '@/store/job'
export default defineComponent({
name: 'TableActionBar',
- setup: function () {
- const {t} = useLocaleHooks()
+ setup() {
+ const { t } = useLocaleHooks()
const message = useMessage()
const jobStore = useJobStore()
- const {mittBus} = getCurrentInstance()!.appContext.config.globalProperties
+ const { mittBus } =
getCurrentInstance()!.appContext.config.globalProperties
const currentJob = computed(() => jobStore.getCurrentJob)
const jobStatus = computed(() => jobStore.getJobStatus)
@@ -56,45 +56,48 @@ export default defineComponent({
clusterId,
sessionId,
taskType,
- token
+ token,
}
- const response = await fetchResult(resultFetchDTO)
+ const response = await fetchResult(resultFetchDTO)
jobStore.setJobResultData(response.data)
- } catch (error) {
+ }
+ catch (error) {
console.error('Error fetching result:', error)
}
- } else {
+ }
+ else {
message.warning(t('playground.no_data'))
}
- } else {
+ }
+ else {
message.warning(t('playground.no_data'))
}
}
const handleStopJob = async () => {
if (currentJob.value) {
- const job = toRaw(currentJob.value);
- const { clusterId, jobId, type: taskType} = job
+ const job = toRaw(currentJob.value)
+ const { clusterId, jobId, type: taskType } = job
const stopJobDTO = {
clusterId,
jobId,
taskType,
- withSavepoint: false
+ withSavepoint: false,
}
try {
- const response = await stopJob(stopJobDTO);
- if (response.code === 200) {
+ const response = await stopJob(stopJobDTO)
+ if (response.code === 200)
message.success(t('playground.job_stopping_successfully'))
- } else {
+ else
message.warning(t('playground.job_stopping_failed'))
- }
- } catch (error) {
+ }
+ catch (error) {
message.warning(t('playground.job_stopping_failed'))
}
}
}
- const currentStopIcon = computed(() => jobStatus.value === 'RUNNING' ?
StopOutline : Stop);
+ const currentStopIcon = computed(() => jobStatus.value === 'RUNNING' ?
StopOutline : Stop)
const isButtonDisabled = computed(() => {
return jobStatus.value !== 'RUNNING'
@@ -115,7 +118,7 @@ export default defineComponent({
case 'FAILED':
return '#f9827c'
default:
- return '#7ce998';
+ return '#7ce998'
}
})
@@ -129,8 +132,8 @@ export default defineComponent({
{ label: '10s', key: '10s' },
{ label: '30s', key: '30s' },
{ label: '1m', key: '1m' },
- { label: '5m', key: '5m' }
- ];
+ { label: '5m', key: '5m' },
+ ]
const clearRefreshInterval = () => {
if (refreshIntervalId.value) {
@@ -146,13 +149,12 @@ export default defineComponent({
watch(jobStatus, () => {
if (jobStatus.value !== 'RUNNING') {
- if (refreshIntervalId.value) {
+ if (refreshIntervalId.value)
clearRefreshInterval()
- }
}
})
- dayjs.extend(duration);
+ dayjs.extend(duration)
const handleSelect = (key: any) => {
selectedInterval.value = key
switch (key) {
@@ -199,7 +201,7 @@ export default defineComponent({
handleSelect,
columnCount,
rowCount,
- executionTime
+ executionTime,
}
},
render() {
@@ -302,27 +304,39 @@ export default defineComponent({
<n-button
text
disabled={this.isScheduleButtonDisabled}
- class={styles['table-action-bar-button']}>
+ class={styles['table-action-bar-button']}
+ >
</n-button>
),
default: () => (
<n-icon
size="20"
class={styles['table-action-bar-button']}
- component={ClockCircleOutlined}/>
- )
+ component={ClockCircleOutlined}
+ />
+ ),
}}
/>
<n-divider vertical style="height: 20px; margin-left: 0px;
margin-right: 0px;" />
- <span class={styles['table-action-bar-text']}>{this.columnCount}
Columns</span>
+ <span class={styles['table-action-bar-text']}>
+ {this.columnCount}
+ {' '}
+ Columns
+ </span>
</n-space>
<div class={styles.right}>
<n-space item-style="display: flex; align-items: center;">
<div class={styles['table-action-bar-text']}>
Job:
- <span style={{color: this.jobStatusColor}}>
{this.formattedJobStatus}</span>
+ <span style={{ color: this.jobStatusColor }}>
+ {' '}
+ {this.formattedJobStatus}
+ </span>
</div>
- <span class={styles['table-action-bar-text']}>Rows:
{this.rowCount}</span>
+ <span class={styles['table-action-bar-text']}>
+ Rows:
+ {this.rowCount}
+ </span>
<span class={styles['table-action-bar-text']}>{ this.executionTime
}</span>
<n-popover
trigger="hover"
diff --git
a/paimon-web-ui/src/views/playground/components/query/components/console/components/table/index.tsx
b/paimon-web-ui/src/views/playground/components/query/components/console/components/table/index.tsx
index ed195933..d400f58e 100644
---
a/paimon-web-ui/src/views/playground/components/query/components/console/components/table/index.tsx
+++
b/paimon-web-ui/src/views/playground/components/query/components/console/components/table/index.tsx
@@ -15,15 +15,15 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
-import styles from './index.module.scss'
import type { DataTableInst } from 'naive-ui'
-import { useMessage } from "naive-ui"
+import { useMessage } from 'naive-ui'
+import styles from './index.module.scss'
import { useJobStore } from '@/store/job'
export default defineComponent({
name: 'TableResult',
- setup: function (props, {emit}) {
- const {t} = useLocaleHooks()
+ setup() {
+ const { t } = useLocaleHooks()
const message = useMessage()
const jobStore = useJobStore()
@@ -37,42 +37,41 @@ export default defineComponent({
render?: (row: any, index: number) => string | number | JSX.Element
}
- const initialData = computed(() => jobStore.getCurrentJob?.resultData ||
[]);
- const refreshedData = computed(() => jobStore.getJobResultData?.resultData
|| []);
- const data = computed(() => refreshedData.value.length > 0 ?
refreshedData.value : initialData.value);
+ const initialData = computed(() => jobStore.getCurrentJob?.resultData ||
[])
+ const refreshedData = computed(() => jobStore.getJobResultData?.resultData
|| [])
+ const data = computed(() => refreshedData.value.length > 0 ?
refreshedData.value : initialData.value)
const columns = computed(() => {
- if (data.value.length > 0) {
- return generateColumns(data.value[0]);
- }
- return [];
- });
+ if (data.value.length > 0)
+ return generateColumns(data.value[0])
- const {mittBus} = getCurrentInstance()!.appContext.config.globalProperties
+ return []
+ })
- const generateColumns = (sampleObject: any) => {
+ const { mittBus } =
getCurrentInstance()!.appContext.config.globalProperties
+
+ function generateColumns(sampleObject: any) {
const indexColumn: TableColumn = {
title: '#',
key: 'index',
fixed: 'left',
width: 50,
- render: (row, index) => `${index + 1}`
+ render: (_, index) => `${index + 1}`,
}
const dynamicColumns = Object.keys(sampleObject).map(key => ({
title: key,
- key: key,
+ key,
resizable: true,
- sortable: true
+ sortable: true,
}))
- return [indexColumn, ...dynamicColumns];
+ return [indexColumn, ...dynamicColumns]
}
mittBus.on('triggerDownloadCsv', () => {
- if (tableRef.value) {
- tableRef.value.downloadCsv({fileName: 'data-table'})
- }
+ if (tableRef.value)
+ tableRef.value?.downloadCsv({ fileName: 'data-table' })
})
mittBus.on('triggerCopyData', () => {
@@ -87,7 +86,7 @@ export default defineComponent({
onUnmounted(() => {
mittBus.off('triggerDownloadCsv')
mittBus.off('triggerCopyData')
- });
+ })
return {
columns,
diff --git
a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
index 1386c6b1..9008fb47 100644
---
a/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
+++
b/paimon-web-ui/src/views/playground/components/query/components/debugger/index.tsx
@@ -16,14 +16,14 @@ specific language governing permissions and limitations
under the License. */
import { ChevronDown, Play, ReaderOutline, Save } from '@vicons/ionicons5'
-import { getClusterListByType } from '@/api/models/cluster'
+import { useMessage } from 'naive-ui'
import styles from './index.module.scss'
-import type { Cluster } from "@/api/models/cluster/types"
-import type {JobSubmitDTO} from "@/api/models/job/types/job"
-import { submitJob } from "@/api/models/job"
-import { useMessage } from "naive-ui"
+import { getClusterListByType } from '@/api/models/cluster'
+import type { Cluster } from '@/api/models/cluster/types'
+import type { JobSubmitDTO } from '@/api/models/job/types/job'
+import { submitJob } from '@/api/models/job'
import { useJobStore } from '@/store/job'
-import type {ExecutionMode} from "@/store/job/type"
+import type { ExecutionMode } from '@/store/job/type'
export default defineComponent({
name: 'EditorDebugger',
@@ -36,13 +36,13 @@ export default defineComponent({
const tabData = ref({}) as any
const debuggerVariables = reactive<{
- operatingConditionOptions: { label: string; key: string }[]
+ operatingConditionOptions: { label: string, key: string }[]
conditionValue: string
- bigDataOptions: { label: string; value: string }[]
+ bigDataOptions: { label: string, value: string }[]
conditionValue2: string
- clusterOptions: { label: string; value: string }[]
+ clusterOptions: { label: string, value: string }[]
conditionValue3: string
- executionModeOptions: { label: string; value: string }[]
+ executionModeOptions: { label: string, value: string }[]
}>({
operatingConditionOptions: [
{ label: 'Limit 100 items', key: '100' },
@@ -62,8 +62,7 @@ export default defineComponent({
],
})
- const handleSelect = (key: string) => {
- console.log(key)
+ const handleSelect = () => {
}
const handleFormat = () => {
@@ -75,66 +74,65 @@ export default defineComponent({
}
function getClusterData() {
- getClusterListByType(debuggerVariables.conditionValue, 1,
Number.MAX_SAFE_INTEGER).then(response => {
+ getClusterListByType(debuggerVariables.conditionValue, 1,
Number.MAX_SAFE_INTEGER).then((response) => {
if (response && response.data) {
const clusterList = response.data as Cluster[]
debuggerVariables.clusterOptions = clusterList.map(cluster => ({
label: cluster.clusterName,
- value: cluster.id.toString()
+ value: cluster.id.toString(),
}))
- if (debuggerVariables.clusterOptions.length > 0) {
+ if (debuggerVariables.clusterOptions.length > 0)
debuggerVariables.conditionValue2 =
debuggerVariables.clusterOptions[0].value
- }
}
- }).catch(error => {
+ }).catch((error) => {
console.error('Failed to fetch clusters:', error)
})
}
- watch(() => debuggerVariables.conditionValue, (newValue) => {
+ watch(() => debuggerVariables.conditionValue, () => {
getClusterData()
})
- onMounted(() => {getClusterData()})
+ onMounted(getClusterData)
const { mittBus } =
getCurrentInstance()!.appContext.config.globalProperties
mittBus.on('initTabData', (data: any) => {
tabData.value = data
- });
+ })
const handleSubmit = async () => {
const currentTab = tabData.value.panelsList.find((item: any) => item.key
=== tabData.value.chooseTab)
- if (!currentTab) {
+ if (!currentTab)
return
- }
jobStore.setExecutionMode(debuggerVariables.conditionValue3 as
ExecutionMode)
jobStore.resetCurrentResult()
const currentSQL = currentTab.content
- if (!currentSQL) {
+ if (!currentSQL)
return
- }
const jobDataDTO: JobSubmitDTO = {
jobName: currentTab.tableName,
taskType: debuggerVariables.conditionValue,
clusterId: debuggerVariables.conditionValue2,
statements: currentSQL,
- streaming: debuggerVariables.conditionValue3 === 'Streaming'
- };
+ streaming: debuggerVariables.conditionValue3 === 'Streaming',
+ }
try {
- const response = await submitJob(jobDataDTO);
+ const response = await submitJob(jobDataDTO)
if (response.code === 200) {
message.success(t('playground.job_submission_successfully'))
jobStore.setCurrentJob(response.data)
- mittBus.emit('jobResult', response.data);
- } else {
+ mittBus.emit('jobResult', response.data)
+ }
+ else {
message.error(`${t('playground.job_submission_failed')}`)
}
- } catch (error) {
+ }
+ catch (error) {
console.error('Failed to submit job:', error)
}
}
@@ -145,7 +143,7 @@ export default defineComponent({
handleSelect,
handleFormat,
handleSave,
- handleSubmit
+ handleSubmit,
}
},
render() {
diff --git
a/paimon-web-ui/src/views/playground/components/query/components/menu-tree/index.tsx
b/paimon-web-ui/src/views/playground/components/query/components/menu-tree/index.tsx
index 40ee514b..1841c277 100644
---
a/paimon-web-ui/src/views/playground/components/query/components/menu-tree/index.tsx
+++
b/paimon-web-ui/src/views/playground/components/query/components/menu-tree/index.tsx
@@ -30,8 +30,10 @@ export default defineComponent({
const catalogStore = useCatalogStore()
const catalogStoreRef = storeToRefs(catalogStore)
- const [tableColumns, useColumns, { loading }] = getColumns()
+ const [tableColumns, useColumns] = getColumns()
+ const tabData = ref({}) as any
+ const isDetailVisible = ref(true)
const filterValue = ref('')
const selectedKeys = ref([])
@@ -108,11 +110,10 @@ export default defineComponent({
}
}
- const handleTreeSelect = ({ option }: { option: TreeOption }) => {
+ const handleTreeSelect = () => {
}
// mitt - handle tab choose
- const tabData = ref({}) as any
const { mittBus } =
getCurrentInstance()!.appContext.config.globalProperties
mittBus.on('initTabData', (data: any) => {
tabData.value = data
@@ -160,7 +161,6 @@ export default defineComponent({
},
]) as any
- const isDetailVisible = ref(true)
const handleClose = () => {
isDetailVisible.value = !isDetailVisible.value
}
diff --git
a/paimon-web-ui/src/views/playground/components/query/components/tabs/index.tsx
b/paimon-web-ui/src/views/playground/components/query/components/tabs/index.tsx
index 62ea32a4..0d480bb0 100644
---
a/paimon-web-ui/src/views/playground/components/query/components/tabs/index.tsx
+++
b/paimon-web-ui/src/views/playground/components/query/components/tabs/index.tsx
@@ -15,9 +15,9 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
+import dayjs from 'dayjs'
import styles from './index.module.scss'
import ContextMenu from '@/components/context-menu'
-import dayjs from 'dayjs'
export default defineComponent({
name: 'EditorTabs',
diff --git a/paimon-web-ui/src/views/playground/components/query/index.tsx
b/paimon-web-ui/src/views/playground/components/query/index.tsx
index 8c7ab808..b6eeb395 100644
--- a/paimon-web-ui/src/views/playground/components/query/index.tsx
+++ b/paimon-web-ui/src/views/playground/components/query/index.tsx
@@ -25,7 +25,7 @@ import EditorDebugger from './components/debugger'
import EditorConsole from './components/console'
import MonacoEditor from '@/components/monaco-editor'
import { useJobStore } from '@/store/job'
-import {getJobStatus} from "@/api/models/job"
+import { getJobStatus } from '@/api/models/job'
export default defineComponent({
name: 'QueryPage',
@@ -33,6 +33,7 @@ export default defineComponent({
const message = useMessage()
const jobStore = useJobStore()
+ const tabData = ref({}) as any
const startTime = ref(0)
const elapsedTime = ref(0)
const currentJob = computed(() => jobStore.getCurrentJob)
@@ -87,29 +88,27 @@ export default defineComponent({
)
// mitt - handle tab choose
- const tabData = ref({}) as any
const { mittBus } =
getCurrentInstance()!.appContext.config.globalProperties
mittBus.on('initTabData', (data: any) => {
tabData.value = data
})
- let getJobStatusIntervalId: number
+ const getJobStatusIntervalId = ref<number | undefined>()
onMounted(() => {
- getJobStatusIntervalId = setInterval(async () => {
+ getJobStatusIntervalId.value = setInterval(async () => {
if (currentJob.value && currentJob.value.jobId) {
const response = await getJobStatus(currentJob.value.jobId)
- if (response.data) {
+ if (response.data)
jobStore.setJobStatus(response.data.status)
- }
}
}, 1000)
})
let computeExecutionTimeIntervalId: number
const startTimer = () => {
- if (computeExecutionTimeIntervalId) {
+ if (computeExecutionTimeIntervalId)
clearInterval(computeExecutionTimeIntervalId)
- }
+
elapsedTime.value = 0
startTime.value = Date.now()
computeExecutionTimeIntervalId = setInterval(() => {
@@ -117,22 +116,22 @@ export default defineComponent({
}, 3000)
}
- const stopTimer = ()=> {
- if (computeExecutionTimeIntervalId) {
+ const stopTimer = () => {
+ if (computeExecutionTimeIntervalId)
clearInterval(computeExecutionTimeIntervalId)
- }
}
watch(jobStatus, (newStatus, oldStatus) => {
if (newStatus === 'RUNNING' && oldStatus !== 'RUNNING') {
- startTimer();
- } else if (newStatus !== 'RUNNING' && oldStatus === 'RUNNING') {
- stopTimer();
+ startTimer()
+ }
+ else if (newStatus !== 'RUNNING' && oldStatus === 'RUNNING') {
+ stopTimer()
elapsedTime.value = Math.floor((Date.now() - startTime.value) / 1000)
}
})
- const formatTime = (seconds: number): string => {
+ const formatTime = (seconds: number): string => {
const days = Math.floor(seconds / 86400)
const hours = Math.floor((seconds % 86400) / 3600)
const mins = Math.floor((seconds % 3600) / 60)
@@ -141,7 +140,7 @@ export default defineComponent({
}
const formattedTime = computed(() => formatTime(elapsedTime.value))
- watch(formattedTime, (formattedTime) =>
jobStore.setExecutionTime(formattedTime))
+ watch(formattedTime, formattedTime =>
jobStore.setExecutionTime(formattedTime))
onUnmounted(() => jobStore.resetCurrentResult())
diff --git
a/paimon-web-ui/src/views/playground/components/workbench/components/debugger/index.tsx
b/paimon-web-ui/src/views/playground/components/workbench/components/debugger/index.tsx
index d647cb58..79386a3e 100644
---
a/paimon-web-ui/src/views/playground/components/workbench/components/debugger/index.tsx
+++
b/paimon-web-ui/src/views/playground/components/workbench/components/debugger/index.tsx
@@ -59,8 +59,7 @@ export default defineComponent({
],
})
- const handleSelect = (key: string) => {
- console.log(key)
+ const handleSelect = () => {
}
const handleFormat = () => {
diff --git
a/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx
b/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx
index 37c3c6f6..b1bf9b2d 100644
--- a/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx
+++ b/paimon-web-ui/src/views/system/cluster/components/cluster-form/index.tsx
@@ -15,10 +15,7 @@ KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. */
-import type { FormItemRule } from 'naive-ui'
-
import type { ClusterDTO } from '@/api/models/cluster/types'
-import { listRoles } from '@/api/models/role'
const props = {
'visible': {