From 87a03849491a8042dab61cc3aa2d86df010bfdcd Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 24 Sep 2021 13:20:39 +0800 Subject: [PATCH 1/5] =?UTF-8?q?perf:=20=E4=BF=AE=E6=94=B9=E4=B8=8D?= =?UTF-8?q?=E5=86=8D=E5=AD=98=E5=82=A8=20.env.devlopement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development => .env.development.example | 4 ++-- .gitignore | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) rename .env.development => .env.development.example (86%) diff --git a/.env.development b/.env.development.example similarity index 86% rename from .env.development rename to .env.development.example index 203a99a11..6f48e8b47 100644 --- a/.env.development +++ b/.env.development.example @@ -20,6 +20,6 @@ VUE_APP_LOGOUT_PATH = '/core/auth/logout/' # Dev server for core proxy -VUE_APP_CORE_HOST = 'https://jumpserver-test.fit2cloud.com/' -VUE_APP_CORE_WS = 'wss://jumpserver-test.fit2cloud.com/' +VUE_APP_CORE_HOST = 'http://localhost:8080/' +VUE_APP_CORE_WS = 'http://localhost:8080/' VUE_APP_ENV = 'development' diff --git a/.gitignore b/.gitignore index e5c58cf89..bc4a7ffa3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ tests/**/coverage/ *.ntvs* *.njsproj *.sln +.env.development From 972b7276cfbfcaa20da73c4d511031943c10ef7e Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 28 Sep 2021 10:20:39 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Announcement/index.vue | 46 +++++++++++++++++++++++++++ src/components/index.js | 1 + src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + src/userviews/assets/index.vue | 15 +++++++-- src/views/dashboard/index.vue | 8 ++++- 6 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 src/components/Announcement/index.vue diff --git a/src/components/Announcement/index.vue b/src/components/Announcement/index.vue new file mode 100644 index 000000000..3af3b9b07 --- /dev/null +++ b/src/components/Announcement/index.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/components/index.js b/src/components/index.js index df7aa70b7..75d4f44a9 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -26,3 +26,4 @@ export { default as AccountListTable } from './AccountListTable/index' export { default as AppAccountListTable } from './AppAccountListTable' export { default as AssetRelationCard } from './AssetRelationCard' export { default as MFAVerifyDialog } from './MFAVerifyDialog' +export { default as Announcement } from './Announcement' diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index cd0d013a5..92c68c262 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -233,6 +233,7 @@ "ReLogin": "重新登录" }, "common": { + "Announcement": "公告", "Logging": "日志记录", "Database": "数据库记录", "Params": "参数", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 056f2ad17..80efd36fd 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -231,6 +231,7 @@ "ReLogin": "Re-Login" }, "common": { + "Announcement": "Announcement", "Logging": "Logging", "Database": "Database", "Params": "Params", diff --git a/src/userviews/assets/index.vue b/src/userviews/assets/index.vue index a551fc750..52b841d14 100644 --- a/src/userviews/assets/index.vue +++ b/src/userviews/assets/index.vue @@ -1,13 +1,18 @@ diff --git a/src/views/settings/Basic/announcement.vue b/src/views/settings/Basic/announcement.vue new file mode 100644 index 000000000..d350c18c5 --- /dev/null +++ b/src/views/settings/Basic/announcement.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/src/views/settings/Basic.vue b/src/views/settings/Basic/index.vue similarity index 80% rename from src/views/settings/Basic.vue rename to src/views/settings/Basic/index.vue index a3601a054..076fbc10d 100644 --- a/src/views/settings/Basic.vue +++ b/src/views/settings/Basic/index.vue @@ -9,6 +9,7 @@ :submit-method="submitMethod" :has-detail-in-msg="false" :on-perform-success="onPerformSuccess" + class="form" /> @@ -17,6 +18,7 @@ import GenericCreateUpdateForm from '@/layout/components/GenericCreateUpdateForm' import { IBox } from '@/components' import rules from '@/components/DataForm/rules' +import Announcement from './announcement' export default { name: 'Basic', @@ -32,6 +34,11 @@ export default { 'SITE_URL', 'USER_GUIDE_URL', 'GLOBAL_ORG_DISPLAY_NAME' ] + ], + [ + '功能', [ + 'TICKETS_ENABLED', 'ANNOUNCEMENT_ENABLED' + ] ] ], fieldsMeta: { @@ -42,6 +49,10 @@ export default { hidden: () => { return !this.$store.getters.hasValidLicense } + }, + ANNOUNCEMENT_ENABLED: { + // label: '公告', + component: Announcement } }, successUrl: { name: 'Settings', params: { activeMenu: 'Basic' }}, @@ -60,5 +71,8 @@ export default { diff --git a/src/views/settings/Other.vue b/src/views/settings/Other.vue index 296ea1ea8..75891909f 100644 --- a/src/views/settings/Other.vue +++ b/src/views/settings/Other.vue @@ -22,7 +22,7 @@ export default { [ this.$t('common.Basic'), [ - 'EMAIL_SUFFIX', 'TICKETS_ENABLED' + 'EMAIL_SUFFIX' ] ], [ diff --git a/src/views/settings/SMS/index.vue b/src/views/settings/SMS/index.vue index c9a191f9f..82459fab8 100644 --- a/src/views/settings/SMS/index.vue +++ b/src/views/settings/SMS/index.vue @@ -68,7 +68,7 @@ export default { diff --git a/src/views/settings/index.vue b/src/views/settings/index.vue index 1a1a4d05a..54b19ccba 100644 --- a/src/views/settings/index.vue +++ b/src/views/settings/index.vue @@ -12,7 +12,7 @@ import TabPage from '@/layout/components/TabPage' import AutoDataForm from '@/components/AutoDataForm' import IBox from '@/components/IBox' -import Basic from './Basic' +import Basic from './Basic/index' import Email from './Email/index' import Auth from './Auth' import Ldap from './Ldap' From 6f5db82ce3fbdb7318668876932d83f7056d77c5 Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 28 Sep 2021 18:09:34 +0800 Subject: [PATCH 4/5] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=85=AC?= =?UTF-8?q?=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Announcement/index.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Announcement/index.vue b/src/components/Announcement/index.vue index a7bd93793..200b73b0e 100644 --- a/src/components/Announcement/index.vue +++ b/src/components/Announcement/index.vue @@ -29,7 +29,7 @@ export default { ]), announcement() { const ann = this.publicSettings.ANNOUNCEMENT - return { subject: ann['SUBJECT'], content: ann['CONTENT'], link: ann['LINK'] } + return { id: ann['ID'], subject: ann['SUBJECT'], content: ann['CONTENT'], link: ann['LINK'] } }, enabled() { return this.publicSettings.ANNOUNCEMENT_ENABLED @@ -37,11 +37,11 @@ export default { }, methods: { onClose() { - localStorage.setItem(this.viewedKey, this.announcement.subject) + localStorage.setItem(this.viewedKey, this.announcement.id) }, isViewed() { const viewedId = localStorage.getItem(this.viewedKey) - return viewedId === this.announcement.subject + return viewedId === this.announcement.id } } } From 30b936330cbeb7a1300d4dbc15b993e48469784d Mon Sep 17 00:00:00 2001 From: ibuler Date: Tue, 28 Sep 2021 18:59:34 +0800 Subject: [PATCH 5/5] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E7=BF=BB?= =?UTF-8?q?=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Announcement/index.vue | 10 ++++++++-- src/i18n/langs/cn.json | 2 ++ src/i18n/langs/en.json | 2 ++ src/views/settings/Basic/announcement.vue | 7 ++++++- src/views/settings/Basic/index.vue | 2 +- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/components/Announcement/index.vue b/src/components/Announcement/index.vue index 200b73b0e..057e2b1bc 100644 --- a/src/components/Announcement/index.vue +++ b/src/components/Announcement/index.vue @@ -3,12 +3,15 @@ v-if="enabled && !isViewed()" type="success" :center="false" - :title="this.$t('common.Announcement') + ': ' + announcement.subject" + :title="title" @close="onClose" > {{ announcement.content }} - 查看更多 + + {{ $t('common.ViewMore') }} + + @@ -33,6 +36,9 @@ export default { }, enabled() { return this.publicSettings.ANNOUNCEMENT_ENABLED + }, + title() { + return this.$t('common.Announcement') + ': ' + this.announcement.subject } }, methods: { diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 92c68c262..66eaa0648 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -233,6 +233,7 @@ "ReLogin": "重新登录" }, "common": { + "ViewMore": "查看更多", "Announcement": "公告", "Logging": "日志记录", "Database": "数据库记录", @@ -779,6 +780,7 @@ } }, "setting": { + "Feature": "功能", "AlibabaCloud": "阿里云", "TencentCloud": "腾讯云", "Radius": "Radius", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 80efd36fd..fb8bdb1ba 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -231,6 +231,7 @@ "ReLogin": "Re-Login" }, "common": { + "ViewMore": "View more", "Announcement": "Announcement", "Logging": "Logging", "Database": "Database", @@ -762,6 +763,7 @@ } }, "setting": { + "Feature": "Feature", "SMSProvider": "SMS provider", "SMS": "SMS setting", "AlibabaCloud": "Alibaba cloud", diff --git a/src/views/settings/Basic/announcement.vue b/src/views/settings/Basic/announcement.vue index d350c18c5..755705c40 100644 --- a/src/views/settings/Basic/announcement.vue +++ b/src/views/settings/Basic/announcement.vue @@ -33,7 +33,7 @@ export default { }, data() { return { - title: '公告', + title: this.$t('common.Announcement'), visible: false, config: { fields: [ @@ -45,6 +45,11 @@ export default { 'SUBJECT', 'CONTENT', 'LINK' ], fieldsMeta: { + CONTENT: { + el: { + rows: 5 + } + } } } }, diff --git a/src/views/settings/Basic/index.vue b/src/views/settings/Basic/index.vue index 076fbc10d..0213a1b74 100644 --- a/src/views/settings/Basic/index.vue +++ b/src/views/settings/Basic/index.vue @@ -36,7 +36,7 @@ export default { ] ], [ - '功能', [ + this.$t('setting.Feature'), [ 'TICKETS_ENABLED', 'ANNOUNCEMENT_ENABLED' ] ]