From c8a0fe4d36e24a056c3e6041595abb3c40760276 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 25 Oct 2021 17:02:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E5=90=8E=E5=8F=B0=E5=BC=80?= =?UTF-8?q?=E5=90=AFgzip=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/application.properties | 6 ++++++ frontend/src/styles/index.scss | 4 ++-- frontend/vue.config.js | 9 +++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index c9076ac69d..4b4a49e919 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -79,6 +79,12 @@ upload.file.path=/opt/dataease/data/kettle/ dataease.sqlinjection.whitelists=/dataset/table/sqlPreview,/dataset/table/update +#开启压缩 提高响应速度 减少带宽压力 +server.compression.enabled=true +server.compression.mime-types=application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain +server.compression.min-response-size=1024 + + diff --git a/frontend/src/styles/index.scss b/frontend/src/styles/index.scss index 15a3c8f7fa..04e9b1cc5a 100644 --- a/frontend/src/styles/index.scss +++ b/frontend/src/styles/index.scss @@ -439,10 +439,10 @@ div:focus { } } -.el-pager li { +/* .blackTheme .el-pager li { color: var(--TableColor) !important; background-color: var(--MainBG) !important; -} +} */ /* .blackTheme .el-select-dropdown { background-color: var(--MainBG) !important; diff --git a/frontend/vue.config.js b/frontend/vue.config.js index 4dcd9d89bf..a0b8c6cfdf 100644 --- a/frontend/vue.config.js +++ b/frontend/vue.config.js @@ -3,6 +3,7 @@ const path = require('path') const defaultSettings = require('./src/settings.js') const CopyWebpackPlugin = require('copy-webpack-plugin') +// const CompressionPlugin = require('compression-webpack-plugin') function resolve(dir) { return path.join(__dirname, dir) @@ -79,6 +80,14 @@ module.exports = { .options({ symbolId: 'icon-[name]' }) + if (process.env.NODE_ENV === 'production') { + /* config.plugin('compressionPlugin').use(new CompressionPlugin({ + test: /\.(js|css|less)$/, // 匹配文件名 + threshold: 10240, // 对超过10k的数据压缩 + minRatio: 0.8, + deleteOriginalAssets: true // 删除源文件 + })) */ + } }, css: { loaderOptions: { From cf3f02ad398c5305d3e4da1c4a8787161cc9bcd8 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 27 Oct 2021 18:37:15 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/package.json | 1 + frontend/src/lang/zh.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index e867c675c2..b461345d93 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,6 +20,7 @@ "@tinymce/tinymce-vue": "^3.2.8", "axios": "^0.21.1", "core-js": "^2.6.5", + "css-color-function": "^1.3.3", "echarts": "^5.0.1", "element-resize-detector": "^1.2.3", "element-ui": "2.15.6", diff --git a/frontend/src/lang/zh.js b/frontend/src/lang/zh.js index 9125c205b9..e25fb2d08f 100644 --- a/frontend/src/lang/zh.js +++ b/frontend/src/lang/zh.js @@ -176,6 +176,7 @@ export default { annotation: '注释', clear: '清空', save: '保存', + otherSave: '另存为', update: '更新', save_success: '保存成功', delete_success: '删除成功', @@ -341,7 +342,8 @@ export default { ok: '确认', cancel: '取消' }, - ukey_title: 'API Keys' + ukey_title: 'API Keys', + thumbnail: '缩略图' }, documentation: { documentation: '文档', @@ -441,7 +443,8 @@ export default { sysParams: { display: '显示设置', ldap: 'LDAP设置', - oidc: 'OIDC设置' + oidc: 'OIDC设置', + theme: '主题设置' }, license: { i18n_no_license_record: '没有 License 记录', From 50ff8d5b44431fc8be8166a0570de55dbd6c6134 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Sun, 31 Oct 2021 02:01:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=9F=BA=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/service/impl/ShiroServiceImpl.java | 4 ++ .../dataease/plugins/server/ThemeServer.java | 50 ++++++++++++++++++ frontend/src/App.vue | 4 +- frontend/src/assets/fill_radio.png | Bin 0 -> 3083 bytes frontend/src/assets/theme-custom.png | Bin 0 -> 20411 bytes frontend/src/assets/theme-dark.png | Bin 0 -> 14446 bytes frontend/src/assets/theme-default.png | Bin 0 -> 15877 bytes frontend/src/lang/zh.js | 2 +- frontend/src/layout/components/Topbar.vue | 27 +++++----- frontend/src/layout/index.vue | 2 +- frontend/src/permission.js | 1 - frontend/src/styles/index.scss | 15 +++--- frontend/src/styles/theme/dark.scss | 7 +-- frontend/src/utils/ThemeUtil.js | 27 ++++++++++ frontend/src/views/dataset/add/AddExcel.vue | 2 +- frontend/src/views/login/index.vue | 22 +++++--- frontend/src/views/panel/edit/index.vue | 2 +- .../src/views/panel/list/PanelViewShow.vue | 2 +- frontend/src/views/system/SysParam/index.vue | 12 +++-- frontend/static/img/theme-custom.946c21a.png | Bin 0 -> 20411 bytes frontend/static/img/theme-dark.974c426.png | Bin 0 -> 14446 bytes frontend/static/img/theme-default.ebe6160.png | Bin 0 -> 15877 bytes 22 files changed, 135 insertions(+), 44 deletions(-) create mode 100644 backend/src/main/java/io/dataease/plugins/server/ThemeServer.java create mode 100644 frontend/src/assets/fill_radio.png create mode 100644 frontend/src/assets/theme-custom.png create mode 100644 frontend/src/assets/theme-dark.png create mode 100644 frontend/src/assets/theme-default.png create mode 100644 frontend/src/utils/ThemeUtil.js create mode 100644 frontend/static/img/theme-custom.946c21a.png create mode 100644 frontend/static/img/theme-dark.974c426.png create mode 100644 frontend/static/img/theme-default.ebe6160.png diff --git a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java index 05b437a764..824180e3f3 100644 --- a/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java +++ b/backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java @@ -42,6 +42,10 @@ public class ShiroServiceImpl implements ShiroService { filterChainDefinitionMap.put("/index.html", ANON); filterChainDefinitionMap.put("/link.html", ANON); + //获取主题信息 + filterChainDefinitionMap.put("/plugin/theme/themes", ANON); + filterChainDefinitionMap.put("/plugin/theme/items/**", ANON); + //验证链接 filterChainDefinitionMap.put("/api/link/validate**", ANON); filterChainDefinitionMap.put("/api/map/areaEntitys/**", ANON); diff --git a/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java b/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java new file mode 100644 index 0000000000..08e2d10374 --- /dev/null +++ b/backend/src/main/java/io/dataease/plugins/server/ThemeServer.java @@ -0,0 +1,50 @@ +package io.dataease.plugins.server; + +import java.util.List; + +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import io.dataease.plugins.config.SpringContextUtil; +import io.dataease.plugins.xpack.theme.dto.ThemeDto; +import io.dataease.plugins.xpack.theme.dto.ThemeItem; +import io.dataease.plugins.xpack.theme.dto.ThemeRequest; +import io.dataease.plugins.xpack.theme.service.ThemeXpackService; + +@RequestMapping("/plugin/theme") +@RestController +public class ThemeServer { + + + + @PostMapping("/themes") + public List themes(){ + + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + return themeXpackService.themes(); + } + + @PostMapping("/items/{themeId}") + public List themeItems(@PathVariable("themeId") int themeId) { + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + return themeXpackService.queryItems(themeId); + } + + @PostMapping("/save") + public void save(@RequestPart("request") ThemeRequest request, @RequestPart(value = "file", required = false) MultipartFile bodyFile) { + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + themeXpackService.save(request, bodyFile); + } + + @PostMapping("/delete/{themeId}") + public void save(@PathVariable("themeId") int themeId) { + ThemeXpackService themeXpackService = SpringContextUtil.getBean(ThemeXpackService.class); + themeXpackService.deleteTheme(themeId); + } + +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 66a91a15c0..27046fe564 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,14 +1,16 @@