diff --git a/ui/src/declarations.d.ts b/ui/src/declarations.d.ts new file mode 100644 index 00000000..eb3a1b90 --- /dev/null +++ b/ui/src/declarations.d.ts @@ -0,0 +1,4 @@ +declare module "antd/locale/zh_CN" { + import zhCN from "antd/locale/zh_CN"; + export default zhCN; +} diff --git a/ui/src/hooks/index.ts b/ui/src/hooks/index.ts index b65c3d17..d859a546 100644 --- a/ui/src/hooks/index.ts +++ b/ui/src/hooks/index.ts @@ -1,3 +1,3 @@ import useTheme from "./useTheme"; -export { useResponsive, useTheme }; +export { useTheme }; diff --git a/ui/src/pages/accesses/AccessList.tsx b/ui/src/pages/accesses/AccessList.tsx index ee346d2f..e29f357b 100644 --- a/ui/src/pages/accesses/AccessList.tsx +++ b/ui/src/pages/accesses/AccessList.tsx @@ -190,16 +190,16 @@ const AccessList = () => { current: page, pageSize: pageSize, total: tableTotal, - onChange: (page, pageSize) => { + onChange: (page: number, pageSize: number) => { setPage(page); setPageSize(pageSize); }, - onShowSizeChange: (page, pageSize) => { + onShowSizeChange: (page: number, pageSize: number) => { setPage(page); setPageSize(pageSize); }, }} - rowKey={(record) => record.id} + rowKey={(record: AccessModel) => record.id} scroll={{ x: "max(100%, 960px)" }} /> diff --git a/ui/src/pages/certificates/CertificateList.tsx b/ui/src/pages/certificates/CertificateList.tsx index 9938c011..ae7525d5 100644 --- a/ui/src/pages/certificates/CertificateList.tsx +++ b/ui/src/pages/certificates/CertificateList.tsx @@ -232,16 +232,16 @@ const CertificateList = () => { current: page, pageSize: pageSize, total: tableTotal, - onChange: (page, pageSize) => { + onChange: (page: number, pageSize: number) => { setPage(page); setPageSize(pageSize); }, - onShowSizeChange: (page, pageSize) => { + onShowSizeChange: (page: number, pageSize: number) => { setPage(page); setPageSize(pageSize); }, }} - rowKey={(record) => record.id} + rowKey={(record: CertificateModel) => record.id} scroll={{ x: "max(100%, 960px)" }} /> diff --git a/ui/src/pages/workflows/WorkflowList.tsx b/ui/src/pages/workflows/WorkflowList.tsx index d3923ee9..9196aad6 100644 --- a/ui/src/pages/workflows/WorkflowList.tsx +++ b/ui/src/pages/workflows/WorkflowList.tsx @@ -265,7 +265,7 @@ const WorkflowList = () => { content: t("workflow.action.delete.confirm"), onOk: async () => { try { - const resp = await removeWorkflow(workflow); + const resp: boolean = await removeWorkflow(workflow); if (resp) { setTableData((prev) => prev.filter((item) => item.id !== workflow.id)); } @@ -313,16 +313,16 @@ const WorkflowList = () => { current: page, pageSize: pageSize, total: tableTotal, - onChange: (page, pageSize) => { + onChange: (page: number, pageSize: number) => { setPage(page); setPageSize(pageSize); }, - onShowSizeChange: (page, pageSize) => { + onShowSizeChange: (page: number, pageSize: number) => { setPage(page); setPageSize(pageSize); }, }} - rowKey={(record) => record.id} + rowKey={(record: WorkflowModel) => record.id} scroll={{ x: "max(100%, 960px)" }} /> diff --git a/ui/src/providers/notify/index.tsx b/ui/src/providers/notify/index.tsx index 963babd9..f90b6b63 100644 --- a/ui/src/providers/notify/index.tsx +++ b/ui/src/providers/notify/index.tsx @@ -20,7 +20,7 @@ interface NotifyProviderProps { } export const NotifyProvider = ({ children }: NotifyProviderProps) => { - const [notify, dispatchNotify] = useReducer(notifyReducer, {}); + const [notify, dispatchNotify] = useReducer(notifyReducer, {} as SettingsModel); useEffect(() => { featchData(); diff --git a/ui/src/repository/workflow.ts b/ui/src/repository/workflow.ts index 2aecfb1e..a57769e4 100644 --- a/ui/src/repository/workflow.ts +++ b/ui/src/repository/workflow.ts @@ -40,7 +40,7 @@ export const save = async (record: Record { - await getPocketBase().collection(COLLECTION_NAME).delete(record.id); + return await getPocketBase().collection(COLLECTION_NAME).delete(record.id); }; type WorkflowLogsReq = { diff --git a/ui/tsconfig.app.json b/ui/tsconfig.app.json index 84b288d1..2ce8c6a2 100644 --- a/ui/tsconfig.app.json +++ b/ui/tsconfig.app.json @@ -4,18 +4,12 @@ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "target": "ES2020", "useDefineForClassFields": true, - "lib": [ - "ES2020", - "DOM", - "DOM.Iterable" - ], + "lib": ["ES2020", "DOM", "DOM.Iterable"], "module": "ESNext", "skipLibCheck": true, "baseUrl": ".", "paths": { - "@/*": [ - "./src/*" - ] + "@/*": ["./src/*"] }, /* Bundler mode */ "moduleResolution": "bundler", @@ -31,7 +25,5 @@ "noUnusedParameters": true, "noFallthroughCasesInSwitch": true }, - "include": [ - "src" - ] -} \ No newline at end of file + "include": ["src", "src/declarations.d.ts"] +} diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 20ff94b4..0302a048 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -11,9 +11,8 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "@/*": [ - "./src/*" - ] + "@/*": ["./src/*"] } } -} \ No newline at end of file +} + diff --git a/ui/tsconfig.node.json b/ui/tsconfig.node.json index 8a58917e..3afdd6e3 100644 --- a/ui/tsconfig.node.json +++ b/ui/tsconfig.node.json @@ -9,7 +9,5 @@ "strict": true, "noEmit": true }, - "include": [ - "vite.config.ts" - ] -} \ No newline at end of file + "include": ["vite.config.ts"] +}