From 133a0e9501c0a3a0e17727efffeafc23be0b60f9 Mon Sep 17 00:00:00 2001 From: 0xJacky Date: Mon, 28 Nov 2022 22:12:42 +0800 Subject: [PATCH] chore: update StdDesign --- frontend/components.d.ts | 33 ++++++++++--------- frontend/package.json | 2 +- .../StdDataDisplay/StdBatchEdit.vue | 2 +- .../src/components/StdDataDisplay/StdCurd.vue | 6 +++- .../StdDataDisplay/StdPagination.vue | 17 ++++++++-- .../components/StdDataDisplay/StdTable.vue | 6 +++- frontend/src/version.json | 2 +- frontend/version.json | 2 +- frontend/vite.config.ts | 25 +++++++------- 9 files changed, 59 insertions(+), 36 deletions(-) diff --git a/frontend/components.d.ts b/frontend/components.d.ts index f24a9211..da24afca 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -33,7 +33,6 @@ declare module '@vue/runtime-core' { APagination: typeof import('ant-design-vue/es')['Pagination'] APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] AProgress: typeof import('ant-design-vue/es')['Progress'] - AreaChart: typeof import('./src/components/Chart/AreaChart.vue')['default'] AResult: typeof import('ant-design-vue/es')['Result'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] @@ -49,21 +48,25 @@ declare module '@vue/runtime-core' { ATabs: typeof import('ant-design-vue/es')['Tabs'] ATag: typeof import('ant-design-vue/es')['Tag'] ATextarea: typeof import('ant-design-vue/es')['Textarea'] - Breadcrumb: typeof import('./src/components/Breadcrumb/Breadcrumb.vue')['default'] - CodeEditor: typeof import('./src/components/CodeEditor/CodeEditor.vue')['default'] - FooterToolBar: typeof import('./src/components/FooterToolbar/FooterToolBar.vue')['default'] - Logo: typeof import('./src/components/Logo/Logo.vue')['default'] - PageHeader: typeof import('./src/components/PageHeader/PageHeader.vue')['default'] - RadialBarChart: typeof import('./src/components/Chart/RadialBarChart.vue')['default'] + BreadcrumbBreadcrumb: typeof import('./src/components/Breadcrumb/Breadcrumb.vue')['default'] + ChartAreaChart: typeof import('./src/components/Chart/AreaChart.vue')['default'] + ChartRadialBarChart: typeof import('./src/components/Chart/RadialBarChart.vue')['default'] + CodeEditorCodeEditor: typeof import('./src/components/CodeEditor/CodeEditor.vue')['default'] + FooterToolbarFooterToolBar: typeof import('./src/components/FooterToolbar/FooterToolBar.vue')['default'] + LogoLogo: typeof import('./src/components/Logo/Logo.vue')['default'] + PageHeaderPageHeader: typeof import('./src/components/PageHeader/PageHeader.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] - SetLanguage: typeof import('./src/components/SetLanguage/SetLanguage.vue')['default'] - StdBatchEdit: typeof import('./src/components/StdDataDisplay/StdBatchEdit.vue')['default'] - StdCurd: typeof import('./src/components/StdDataDisplay/StdCurd.vue')['default'] - StdPagination: typeof import('./src/components/StdDataDisplay/StdPagination.vue')['default'] - StdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default'] - StdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default'] - StdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default'] - StdTable: typeof import('./src/components/StdDataDisplay/StdTable.vue')['default'] + SetLanguageSetLanguage: typeof import('./src/components/SetLanguage/SetLanguage.vue')['default'] + StdDataDisplayStdBatchEdit: typeof import('./src/components/StdDataDisplay/StdBatchEdit.vue')['default'] + StdDataDisplayStdCurd: typeof import('./src/components/StdDataDisplay/StdCurd.vue')['default'] + StdDataDisplayStdPagination: typeof import('./src/components/StdDataDisplay/StdPagination.vue')['default'] + StdDataDisplayStdTable: typeof import('./src/components/StdDataDisplay/StdTable.vue')['default'] + StdDataEntryComponentsStdPassword: typeof import('./src/components/StdDataEntry/components/StdPassword.vue')['default'] + StdDataEntryComponentsStdSelect: typeof import('./src/components/StdDataEntry/components/StdSelect.vue')['default'] + StdDataEntryComponentsStdSelector: typeof import('./src/components/StdDataEntry/components/StdSelector.vue')['default'] + StdDataEntryCompontentsStdPassword: typeof import('./src/components/StdDataEntry/compontents/StdPassword.vue')['default'] + StdDataEntryCompontentsStdSelect: typeof import('./src/components/StdDataEntry/compontents/StdSelect.vue')['default'] + StdDataEntryCompontentsStdSelector: typeof import('./src/components/StdDataEntry/compontents/StdSelector.vue')['default'] } } diff --git a/frontend/package.json b/frontend/package.json index 7b4f3c67..10cbc50c 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "nginx-ui-frontend-next", "private": true, - "version": "1.6.6", + "version": "1.6.7", "type": "commonjs", "scripts": { "dev": "vite", diff --git a/frontend/src/components/StdDataDisplay/StdBatchEdit.vue b/frontend/src/components/StdDataDisplay/StdBatchEdit.vue index 8c611345..49eb82a8 100644 --- a/frontend/src/components/StdDataDisplay/StdBatchEdit.vue +++ b/frontend/src/components/StdDataDisplay/StdBatchEdit.vue @@ -40,7 +40,7 @@ async function ok() { message.success($gettext('Save successfully')) emit('onSave') }).catch((e: any) => { - message.error(e?.message ?? $gettext('Server error')) + message.error($gettext(e?.message) ?? $gettext('Server error')) }).finally(() => { loading.value = false }) diff --git a/frontend/src/components/StdDataDisplay/StdCurd.vue b/frontend/src/components/StdDataDisplay/StdCurd.vue index 7d1af108..6239cd45 100644 --- a/frontend/src/components/StdDataDisplay/StdCurd.vue +++ b/frontend/src/components/StdDataDisplay/StdCurd.vue @@ -123,7 +123,11 @@ function cancel() { } function edit(id: any) { - props.api!.get(id).then((r: any) => { + props.api!.get(id).then(async (r: any) => { + Object.keys(data).forEach(k => { + delete data[k] + }) + data.id = null Object.assign(data, r) visible.value = true }).catch((e: any) => { diff --git a/frontend/src/components/StdDataDisplay/StdPagination.vue b/frontend/src/components/StdDataDisplay/StdPagination.vue index 7b6bc8d5..7982a100 100644 --- a/frontend/src/components/StdDataDisplay/StdPagination.vue +++ b/frontend/src/components/StdDataDisplay/StdPagination.vue @@ -1,20 +1,31 @@ - + diff --git a/frontend/src/version.json b/frontend/src/version.json index 07e79478..44bed42d 100644 --- a/frontend/src/version.json +++ b/frontend/src/version.json @@ -1 +1 @@ -{"version":"1.6.5","build_id":53,"total_build":123} \ No newline at end of file +{"version":"1.6.7","build_id":56,"total_build":126} \ No newline at end of file diff --git a/frontend/version.json b/frontend/version.json index 07e79478..44bed42d 100644 --- a/frontend/version.json +++ b/frontend/version.json @@ -1 +1 @@ -{"version":"1.6.5","build_id":53,"total_build":123} \ No newline at end of file +{"version":"1.6.7","build_id":56,"total_build":126} \ No newline at end of file diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 072ea44f..c84067b0 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -11,7 +11,7 @@ import vitePluginBuildId from 'vite-plugin-build-id' export default defineConfig({ resolve: { alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)), + '@': fileURLToPath(new URL('./src', import.meta.url)) }, extensions: [ '.mjs', @@ -26,7 +26,8 @@ export default defineConfig({ }, plugins: [vue(), vueJsx(), vitePluginBuildId(), Components({ - resolvers: [AntDesignVueResolver({importStyle: false})] + resolvers: [AntDesignVueResolver({importStyle: false})], + directoryAsNamespace: true }), createHtmlPlugin({ minify: true, @@ -46,20 +47,20 @@ export default defineConfig({ */ inject: { data: { - title: 'Nginx UI', - }, - }, - }), + title: 'Nginx UI' + } + } + }) ], css: { preprocessorOptions: { less: { modifyVars: { - 'border-radius-base': '4px', + 'border-radius-base': '4px' }, - javascriptEnabled: true, + javascriptEnabled: true } - }, + } }, server: { proxy: { @@ -67,9 +68,9 @@ export default defineConfig({ target: 'https://nginx.jackyu.cn/', changeOrigin: true, secure: false, - ws: true, - }, - }, + ws: true + } + } }, build: { chunkSizeWarningLimit: 600