From 31b36276b1ae8977a81254fa97f7d16184ba97f7 Mon Sep 17 00:00:00 2001 From: gy2006 <32008001@qq.com> Date: Wed, 3 Nov 2021 20:52:14 +0100 Subject: [PATCH 01/20] init notification home page --- src/i18n/cn.js | 3 +- src/i18n/en.js | 3 +- src/router/index.js | 10 ++++++ src/view/Settings/FunList.vue | 46 ++++++++++++++---------- src/view/Settings/Notification/Index.vue | 19 ++++++++++ 5 files changed, 60 insertions(+), 21 deletions(-) create mode 100644 src/view/Settings/Notification/Index.vue diff --git a/src/i18n/cn.js b/src/i18n/cn.js index 1f23e3a1..82255987 100644 --- a/src/i18n/cn.js +++ b/src/i18n/cn.js @@ -164,7 +164,8 @@ export default { secret: '秘钥管理', config: '配置管理', plugin: '插件', - system: '系统设置' + system: '系统设置', + notify: '通知' }, profile: { diff --git a/src/i18n/en.js b/src/i18n/en.js index a1729187..f52f0c39 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -166,7 +166,8 @@ export default { secret: 'Secret', config: 'Config', plugin: 'Plugin', - system: 'System' + system: 'System', + notify: 'Notification' }, profile: { diff --git a/src/router/index.js b/src/router/index.js index acdc58dc..f99c846b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -35,6 +35,9 @@ import SettingsConfigNew from '@/view/Settings/Config/New' import SettingsConfigEdit from '@/view/Settings/Config/Edit' import SettingsPluginHome from '@/view/Settings/Plugin/Index' + +import SettingsNotificationHome from '@/view/Settings/Notification/Index' + import SettingsSystemHome from '@/view/Settings/System/Index' Vue.use(Router) @@ -189,6 +192,13 @@ export default new Router({ name: 'PluginSettingsHome', component: SettingsPluginHome }, + + { + path: 'notifications', + name: 'SettingsNotificationHome', + component: SettingsNotificationHome + }, + { path: 'system', name: 'SystemSettingsHome', diff --git a/src/view/Settings/FunList.vue b/src/view/Settings/FunList.vue index ba62e22c..ec71c1e3 100644 --- a/src/view/Settings/FunList.vue +++ b/src/view/Settings/FunList.vue @@ -10,6 +10,10 @@ dense class="bottom-border left-border" @click="onMenuItemClick(item.path)"> + + + {{ item.icon }} + {{ $t(`${item.i18n}`) }} @@ -29,31 +33,43 @@ items: [ { i18n: 'settings.li.profile', - path: 'profile' + path: 'profile', + icon: 'mdi-account-circle-outline' }, { i18n: 'settings.li.users', - path: 'users' + path: 'users', + icon: 'mdi-account-multiple-outline' }, { i18n: 'settings.li.agent', - path: 'agents' + path: 'agents', + icon: 'mdi-server' }, { i18n: 'settings.li.secret', - path: 'secrets' + path: 'secrets', + icon: 'mdi-key' }, { i18n: 'settings.li.config', - path: 'configs' + path: 'configs', + icon: 'mdi-code-braces' }, { i18n: 'settings.li.plugin', - path: 'plugins' + path: 'plugins', + icon: 'mdi-puzzle-outline' + }, + { + i18n: 'settings.li.notify', + path: 'notifications', + icon: 'mdi-bell-outline' }, { i18n: 'settings.li.system', - path: 'system' + path: 'system', + icon: 'mdi-settings' } ] } @@ -70,18 +86,10 @@ .func-list { font-size: 1px !important; - div[role="listitem"][aria-selected="true"] > div::before { - background-color: #3dace3; - bottom: 0; - content: ""; - left: 0; - position: absolute; - top: 0; - width: 3px; - } - - .on-active{ - color: #ffffff !important; + .v-list-item { + .v-list-item__icon { + margin-right: 16px !important; + } } } diff --git a/src/view/Settings/Notification/Index.vue b/src/view/Settings/Notification/Index.vue new file mode 100644 index 00000000..d9fd170d --- /dev/null +++ b/src/view/Settings/Notification/Index.vue @@ -0,0 +1,19 @@ + + + + + \ No newline at end of file From cf5483264de6b23e80027a028aa632c6b8ac0332 Mon Sep 17 00:00:00 2001 From: gy2006 <32008001@qq.com> Date: Thu, 4 Nov 2021 22:30:00 +0100 Subject: [PATCH 02/20] add create notification page --- src/assets/styles/common.scss | 9 ++ src/components/Common/TextBox.vue | 13 ++ src/i18n/cn.js | 10 ++ src/i18n/en.js | 4 + src/router/index.js | 6 + src/util/configs.js | 2 +- src/util/notifications.js | 19 +++ src/view/Settings/Config/Edit.vue | 2 +- src/view/Settings/Config/New.vue | 11 +- .../Config/{Smtp.vue => SmtpSettings.vue} | 0 src/view/Settings/Home.vue | 2 +- .../Settings/Notification/EmailSettings.vue | 95 +++++++++++++ src/view/Settings/Notification/Index.vue | 35 ++++- src/view/Settings/Notification/New.vue | 126 ++++++++++++++++++ src/view/Settings/Secret/New.vue | 27 ++-- 15 files changed, 336 insertions(+), 25 deletions(-) create mode 100644 src/util/notifications.js rename src/view/Settings/Config/{Smtp.vue => SmtpSettings.vue} (100%) create mode 100644 src/view/Settings/Notification/EmailSettings.vue create mode 100644 src/view/Settings/Notification/New.vue diff --git a/src/assets/styles/common.scss b/src/assets/styles/common.scss index 29aee539..f457b119 100644 --- a/src/assets/styles/common.scss +++ b/src/assets/styles/common.scss @@ -11,6 +11,10 @@ border-bottom: 1px solid #e1e4e8 } +.bottom-border-large { + border-bottom: 3px solid #BDBDBD +} + .left-border { border-left: 1px solid #e1e4e8 } @@ -42,6 +46,11 @@ display: flex; } +.v-subheader-thin { + padding: 0; + height: auto !important; +} + @-moz-keyframes loader { from { transform: rotate(0); diff --git a/src/components/Common/TextBox.vue b/src/components/Common/TextBox.vue index b8089a20..723ef1d2 100644 --- a/src/components/Common/TextBox.vue +++ b/src/components/Common/TextBox.vue @@ -4,6 +4,7 @@ diff --git a/src/i18n/cn.js b/src/i18n/cn.js index 82255987..33949516 100644 --- a/src/i18n/cn.js +++ b/src/i18n/cn.js @@ -168,6 +168,12 @@ export default { notify: '通知' }, + common: { + name_required: '请输入名称', + name_size: '名称长度应当在 2 - 20 字符', + name_rule: '名称只允许 a-z, A-Z, 0-9, _, -', + }, + profile: { password_not_empty: '请输入密码', password_not_same: '密码不配备' @@ -175,6 +181,10 @@ export default { hint: { agent_disabled: '提示: 主机已禁用' + }, + + notification: { + email_settings: '邮件通知配置' } }, diff --git a/src/i18n/en.js b/src/i18n/en.js index f52f0c39..9f8868be 100644 --- a/src/i18n/en.js +++ b/src/i18n/en.js @@ -177,6 +177,10 @@ export default { hint: { agent_disabled: 'Hint: The host is disabled' + }, + + notification: { + email_settings: 'Email Settings' } }, diff --git a/src/router/index.js b/src/router/index.js index f99c846b..b660bbc2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -37,6 +37,7 @@ import SettingsConfigEdit from '@/view/Settings/Config/Edit' import SettingsPluginHome from '@/view/Settings/Plugin/Index' import SettingsNotificationHome from '@/view/Settings/Notification/Index' +import SettingsNotificationNew from '@/view/Settings/Notification/New' import SettingsSystemHome from '@/view/Settings/System/Index' @@ -198,6 +199,11 @@ export default new Router({ name: 'SettingsNotificationHome', component: SettingsNotificationHome }, + { + path: 'notifications/new', + name: 'SettingsNotificationNew', + component: SettingsNotificationNew + }, { path: 'system', diff --git a/src/util/configs.js b/src/util/configs.js index acf3e9e9..2f9561c6 100644 --- a/src/util/configs.js +++ b/src/util/configs.js @@ -6,7 +6,7 @@ export const SECURE_SSL = 'SSL' export const SECURE_TLS = 'TLS' export const CategoriesSelection = [ - {name: 'Smtp', value: CATEGORY_SMTP, icon: 'mdi-email-outline'}, + {name: 'SMTP', value: CATEGORY_SMTP, icon: 'mdi-email-outline'}, {name: 'Text', value: CATEGORY_TEXT, icon: 'mdi-text'}, ] diff --git a/src/util/notifications.js b/src/util/notifications.js new file mode 100644 index 00000000..392bde4c --- /dev/null +++ b/src/util/notifications.js @@ -0,0 +1,19 @@ + +export const CATEGORY_EMAIL = 'Email' +export const CATEGORY_WEBHOOK = 'WebHook' + +export const TRIGGER_ON_JOB_FINISHED = "OnJobFinished" +export const TRIGGER_ON_AGENT_STATUS_CHANGE = "OnAgentStatusChange" +export const TRIGGER_ON_USER_CREATED = "OnUserCreated" +export const TRIGGER_ON_USER_ADDED_TO_FLOW = "OnUserAddedToFlow" + +export const TO_ALL_FLOW_USERS = "FLOW_USERS" + +export const CategorySelection = [ + {name: 'Email', value: CATEGORY_EMAIL, icon: 'mdi-email-outline'}, + {name: 'WebHook', value: CATEGORY_WEBHOOK, icon: 'mdi-webhook'}, +] + +export const TriggerSelection = [ + {name: 'On Job Finished', value: TRIGGER_ON_JOB_FINISHED, icon: ''} +] \ No newline at end of file diff --git a/src/view/Settings/Config/Edit.vue b/src/view/Settings/Config/Edit.vue index 8adc0537..5080c7de 100644 --- a/src/view/Settings/Config/Edit.vue +++ b/src/view/Settings/Config/Edit.vue @@ -58,7 +58,7 @@ + + \ No newline at end of file diff --git a/src/view/Settings/Notification/Index.vue b/src/view/Settings/Notification/Index.vue index d9fd170d..25ee1774 100644 --- a/src/view/Settings/Notification/Index.vue +++ b/src/view/Settings/Notification/Index.vue @@ -1,5 +1,17 @@ diff --git a/src/view/Settings/Notification/New.vue b/src/view/Settings/Notification/New.vue new file mode 100644 index 00000000..99d6c9cb --- /dev/null +++ b/src/view/Settings/Notification/New.vue @@ -0,0 +1,126 @@ + + + + + \ No newline at end of file diff --git a/src/view/Settings/Secret/New.vue b/src/view/Settings/Secret/New.vue index 1e522911..87f1f561 100644 --- a/src/view/Settings/Secret/New.vue +++ b/src/view/Settings/Secret/New.vue @@ -1,20 +1,21 @@ + + \ No newline at end of file diff --git a/src/view/Settings/Notification/EmailSettings.vue b/src/view/Settings/Notification/EmailSettings.vue index 7d2f46ad..a9e59d98 100644 --- a/src/view/Settings/Notification/EmailSettings.vue +++ b/src/view/Settings/Notification/EmailSettings.vue @@ -10,7 +10,7 @@ @@ -51,12 +51,10 @@ + + \ No newline at end of file diff --git a/src/view/Settings/Trigger/New.vue b/src/view/Settings/Trigger/New.vue index f615ef5f..35f43f57 100644 --- a/src/view/Settings/Trigger/New.vue +++ b/src/view/Settings/Trigger/New.vue @@ -31,6 +31,12 @@ > + + + + + + @@ -56,6 +62,7 @@ import TextSelect from '@/components/Common/TextSelect' import SaveBtn from '@/components/Settings/SaveBtn' import BackBtn from '@/components/Settings/BackBtn' import EmailSettings from './EmailSettings' +import WebhookSettings from './WebhookSettings' import { ActionSelection, CATEGORY_EMAIL, @@ -73,6 +80,7 @@ export default { SaveBtn, BackBtn, EmailSettings, + WebhookSettings }, data() { return { diff --git a/src/view/Settings/Trigger/WebhookSettings.vue b/src/view/Settings/Trigger/WebhookSettings.vue new file mode 100644 index 00000000..88b8aced --- /dev/null +++ b/src/view/Settings/Trigger/WebhookSettings.vue @@ -0,0 +1,62 @@ + + + + + \ No newline at end of file From b437f36e659d6d1cd411d84a4322e981284f988b Mon Sep 17 00:00:00 2001 From: gy2006 <32008001@qq.com> Date: Mon, 22 Nov 2021 21:27:06 +0100 Subject: [PATCH 11/20] enable to edit webhook trigger params & headers --- src/util/triggers.js | 69 ++++++++++++++++++- src/view/Settings/Trigger/KeyValueTable.vue | 10 ++- src/view/Settings/Trigger/New.vue | 21 +++--- src/view/Settings/Trigger/WebhookSettings.vue | 17 +++-- 4 files changed, 95 insertions(+), 22 deletions(-) diff --git a/src/util/triggers.js b/src/util/triggers.js index f27461bd..97ad743d 100644 --- a/src/util/triggers.js +++ b/src/util/triggers.js @@ -26,4 +26,71 @@ export const Categories = { export const ActionSelection = [ {name: 'On Job Finished', value: TRIGGER_ON_JOB_FINISHED, icon: ''} -] \ No newline at end of file +] + +export const WebhookHelper = { + NewKvItem() { + return {key: '', value: '', keyError: false, valueError: false, showAddBtn: true} + }, + + SetParamsAndHeaderFromKvItems(obj) { + const convertKvItemToMap = (items) => { + const map = {} + for (const item of items) { + if (item.key === '') { + continue + } + map[item.key] = item.value + } + return map + } + + obj.params = convertKvItemToMap(obj.paramItems) + obj.headers = convertKvItemToMap(obj.headerItems) + }, + + SetKvItemsFromParamsAndHeader(obj) { + const convertMapToKvItems = (map) => { + const items = [] + for (const [key, value] of Object.entries(map)) { + items.push({key: key, value: value, keyError: false, valueError: false, showAddBtn: false}) + } + + items.push(this.NewKvItem()) + return items + } + + if (!obj.params) { + obj.params = {} + } + + if (!obj.headers) { + obj.headers = {} + } + + obj.paramItems = convertMapToKvItems(obj.params) + obj.headerItems = convertMapToKvItems(obj.headers) + } +} + +export function NewEmptyObj() { + const obj = { + name: '', + category: CATEGORY_EMAIL, + trigger: TRIGGER_ON_JOB_FINISHED, + // email properties + from: '', + to: '', + subject: '', + smtpConfig: '', + // webhook properties + url: '', + httpMethod: '', + params: {}, + headers: {}, + body: '' + } + + WebhookHelper.SetKvItemsFromParamsAndHeader(obj) + return obj +} diff --git a/src/view/Settings/Trigger/KeyValueTable.vue b/src/view/Settings/Trigger/KeyValueTable.vue index a7552c0d..b2d2712c 100644 --- a/src/view/Settings/Trigger/KeyValueTable.vue +++ b/src/view/Settings/Trigger/KeyValueTable.vue @@ -43,6 +43,8 @@ From 5fc4392de4c75a29cf4219e365309ac2d5349072 Mon Sep 17 00:00:00 2001 From: gy2006 <32008001@qq.com> Date: Tue, 23 Nov 2021 19:53:38 +0100 Subject: [PATCH 12/20] enable to edit webhook trigger params and headers --- src/store/module/triggers.js | 2 ++ src/view/Settings/Trigger/Edit.vue | 16 +++++++++++++++- src/view/Settings/Trigger/New.vue | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/store/module/triggers.js b/src/store/module/triggers.js index 48f086f0..9219f160 100644 --- a/src/store/module/triggers.js +++ b/src/store/module/triggers.js @@ -1,4 +1,5 @@ import http from '../http' +import {WebhookHelper} from "@/util/triggers"; const state = { items: [], @@ -20,6 +21,7 @@ const mutations = { }, loaded(state, n) { + WebhookHelper.SetKvItemsFromParamsAndHeader(n) state.loaded = n }, diff --git a/src/view/Settings/Trigger/Edit.vue b/src/view/Settings/Trigger/Edit.vue index 78917a97..e236dcce 100644 --- a/src/view/Settings/Trigger/Edit.vue +++ b/src/view/Settings/Trigger/Edit.vue @@ -31,6 +31,12 @@ > + + + + + + @@ -69,11 +75,13 @@ import ConfirmBtn from '@/components/Common/ConfirmBtn' import SaveBtn from '@/components/Settings/SaveBtn' import BackBtn from '@/components/Settings/BackBtn' import EmailSettings from './EmailSettings' +import WebhookSettings from './WebhookSettings' import { CATEGORY_EMAIL, CATEGORY_WEBHOOK, CategorySelection, TRIGGER_ON_JOB_FINISHED, + WebhookHelper } from '@/util/triggers' import {mapState} from "vuex"; @@ -85,6 +93,7 @@ export default { SaveBtn, BackBtn, EmailSettings, + WebhookSettings }, props: { name: { @@ -152,9 +161,14 @@ export default { action = actions.triggers.saveEmail } + if (this.obj.category === CATEGORY_WEBHOOK) { + action = actions.triggers.saveWebhook + WebhookHelper.SetParamsAndHeaderFromKvItems(this.obj) + } + this.$store.dispatch(action, this.obj) .then(() => { - this.showSnackBar(`Notification ${this.obj.name} has been saved`) + this.showSnackBar(`Trigger ${this.obj.name} has been saved`) this.onBackClick() }) .catch(e => { diff --git a/src/view/Settings/Trigger/New.vue b/src/view/Settings/Trigger/New.vue index 8c099acb..2ca04855 100644 --- a/src/view/Settings/Trigger/New.vue +++ b/src/view/Settings/Trigger/New.vue @@ -145,6 +145,7 @@ export default { } this.$store.dispatch(action, this.obj).then(() => { + this.showSnackBar(`Trigger ${this.obj.name} has been created`) this.onBackClick() }).catch(e => { this.error = e.message From cff91228e24b6fd184903f04031dbf2cc93f6e60 Mon Sep 17 00:00:00 2001 From: gy2006 <32008001@qq.com> Date: Tue, 23 Nov 2021 19:55:02 +0100 Subject: [PATCH 13/20] rename to tirgger --- src/view/Settings/Trigger/Edit.vue | 6 +++--- src/view/Settings/Trigger/Index.vue | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/view/Settings/Trigger/Edit.vue b/src/view/Settings/Trigger/Edit.vue index e236dcce..8c09cb82 100644 --- a/src/view/Settings/Trigger/Edit.vue +++ b/src/view/Settings/Trigger/Edit.vue @@ -56,7 +56,7 @@ @click="onDeleteClick"> @@ -86,7 +86,7 @@ import { import {mapState} from "vuex"; export default { - name: "SettingsNotificationEdit", + name: "SettingsTriggerEdit", components: { ConfirmBtn, TextBox, @@ -179,7 +179,7 @@ export default { onDeleteClick() { this.$store.dispatch(actions.triggers.delete, this.obj.name) .then(() => { - this.showSnackBar(`Notification ${this.obj.name} has been deleted`) + this.showSnackBar(`Trigger ${this.obj.name} has been deleted`) this.onBackClick() }) .catch((err) => { diff --git a/src/view/Settings/Trigger/Index.vue b/src/view/Settings/Trigger/Index.vue index 8b8e761c..87234c82 100644 --- a/src/view/Settings/Trigger/Index.vue +++ b/src/view/Settings/Trigger/Index.vue @@ -29,7 +29,7 @@ From aa8dcf472d729ba3489b53d0f75f5d5a3411eadd Mon Sep 17 00:00:00 2001 From: gy2006 <32008001@qq.com> Date: Tue, 23 Nov 2021 20:27:35 +0100 Subject: [PATCH 14/20] refactor kubeconfig editor to data eidtor and load secret in edit page --- .../{KubeConfigEditor.vue => DataEditor.vue} | 29 ++++++----- src/view/Settings/Secret/Edit.vue | 52 +++++++++---------- src/view/Settings/Secret/Index.vue | 2 +- src/view/Settings/Secret/New.vue | 6 +-- 4 files changed, 46 insertions(+), 43 deletions(-) rename src/components/Settings/{KubeConfigEditor.vue => DataEditor.vue} (71%) diff --git a/src/components/Settings/KubeConfigEditor.vue b/src/components/Settings/DataEditor.vue similarity index 71% rename from src/components/Settings/KubeConfigEditor.vue rename to src/components/Settings/DataEditor.vue index 2764dfd2..a84f7134 100644 --- a/src/components/Settings/KubeConfigEditor.vue +++ b/src/components/Settings/DataEditor.vue @@ -7,17 +7,14 @@ import CodeMirror from 'codemirror' import 'codemirror/mode/yaml/yaml' export default { - name: 'KubeConfigEditor', + name: 'DataEditor', props: { - /** - * Ex: { - * content: { - * data: 'xxx', - * } - * } - */ - model: { - type: Object, + value: { + type: String, + required: true + }, + mode: { + type: String, required: true }, isReadOnly: { @@ -30,23 +27,29 @@ export default { return { CodeMirror, instance: null, + adaptor: this.value } }, mounted() { this.instance = CodeMirror.fromTextArea(this.$refs.codemirror, { lineNumbers: true, - mode: 'yaml', + mode: this.mode, theme: 'base16-light', tabSize: 2, readOnly: this.isReadOnly }) - this.instance.getDoc().setValue(this.model.content.data) + this.instance.getDoc().setValue(this.adaptor) this.instance.on('change', this.onChange) }, + watch: { + adaptor(val) { + this.$emit('input', val) + } + }, methods: { onChange(instance, data) { - this.model.content.data = instance.getValue() + this.adaptor = instance.getValue() } } } diff --git a/src/view/Settings/Secret/Edit.vue b/src/view/Settings/Secret/Edit.vue index ecd878ae..76a3dfc9 100644 --- a/src/view/Settings/Secret/Edit.vue +++ b/src/view/Settings/Secret/Edit.vue @@ -5,8 +5,8 @@ @@ -38,8 +38,11 @@ - - + + @@ -84,18 +87,18 @@ import AuthEditor from '@/components/Common/AuthEditor' import TokenEditor from '@/components/Common/TokenEditor' import TextBox from '@/components/Common/TextBox' import AndroidSignEditor from '@/components/Settings/AndroidSignEditor' -import KubeConfigEditor from '@/components/Settings/KubeConfigEditor' +import DataEditor from '@/components/Settings/DataEditor' import BackBtn from '@/components/Settings/BackBtn' import ConfirmBtn from '@/components/Common/ConfirmBtn' import { Categories, + CATEGORY_ANDROID_SIGN, CATEGORY_AUTH, + CATEGORY_KUBE_CONFIG, CATEGORY_SSH_RSA, - CATEGORY_TOKEN, - CATEGORY_ANDROID_SIGN, - CATEGORY_KUBE_CONFIG + CATEGORY_TOKEN } from '@/util/secrets' -import { mapState } from 'vuex' +import {mapState} from 'vuex' export default { name: 'SettingsSecretEdit', @@ -106,20 +109,13 @@ export default { AuthEditor, TokenEditor, AndroidSignEditor, - KubeConfigEditor, + DataEditor, BackBtn }, props: { - secretObj: { - type: Object, - required: false, - default() { - return { - name: '', - privateKey: '', - publicKey: '', - } - } + name: { + type: String, + required: true } }, data() { @@ -133,11 +129,15 @@ export default { navs: this.navs, showAddBtn: false }) - this.$store.dispatch(actions.flows.listByCredential, this.name).then() + + this.$store.dispatch(actions.secrets.get, this.name).then(() => { + this.$store.dispatch(actions.flows.listByCredential, this.name).then() + }) }, computed: { ...mapState({ - connectedFlows: state => state.flows.itemsByCredential + connectedFlows: state => state.flows.itemsByCredential, + secretObj: state => state.secrets.loaded }), navs() { @@ -147,8 +147,8 @@ export default { ] }, - name() { - return this.secretObj.name + category() { + return Categories[this.secretObj.category] || {icon: '', name: ''} }, isSshRsa() { @@ -167,7 +167,7 @@ export default { return this.secretObj.category === CATEGORY_ANDROID_SIGN }, - isKubeconfig() { + isKubeConfig() { return this.secretObj.category === CATEGORY_KUBE_CONFIG }, @@ -187,7 +187,7 @@ export default { } } - if (this.isToken || this.isAndroidSign || this.isKubeconfig) { + if (this.isToken || this.isAndroidSign || this.isKubeConfig) { return this.secretObj } diff --git a/src/view/Settings/Secret/Index.vue b/src/view/Settings/Secret/Index.vue index 7a6f15a8..5684c0a1 100644 --- a/src/view/Settings/Secret/Index.vue +++ b/src/view/Settings/Secret/Index.vue @@ -85,7 +85,7 @@ this.$router.push({ name: 'SettingsSecretEdit', params: { - secretObj: secret + name: secret.name } }) } diff --git a/src/view/Settings/Secret/New.vue b/src/view/Settings/Secret/New.vue index 83e737ae..42e15d99 100644 --- a/src/view/Settings/Secret/New.vue +++ b/src/view/Settings/Secret/New.vue @@ -39,7 +39,7 @@ - + @@ -64,7 +64,7 @@ import SshRsaEditor from '@/components/Common/SshRsaEditor' import AuthEditor from '@/components/Common/AuthEditor' import TokenEditor from '@/components/Common/TokenEditor' import AndroidSignEditor from '@/components/Settings/AndroidSignEditor' -import KubeConfigEditor from '@/components/Settings/KubeConfigEditor' +import DataEditor from '@/components/Settings/DataEditor' import SaveBtn from '@/components/Settings/SaveBtn' import BackBtn from '@/components/Settings/BackBtn' import TextBox from '@/components/Common/TextBox' @@ -91,7 +91,7 @@ export default { SaveBtn, BackBtn, AndroidSignEditor, - KubeConfigEditor + DataEditor }, data() { return { From 908376876c4f10229639bca9ca9961e51d57fda6 Mon Sep 17 00:00:00 2001 From: gy2006 <32008001@qq.com> Date: Tue, 23 Nov 2021 20:42:30 +0100 Subject: [PATCH 15/20] enable to save webhook body --- src/components/Settings/DataEditor.vue | 1 + src/view/Settings/Trigger/WebhookSettings.vue | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Settings/DataEditor.vue b/src/components/Settings/DataEditor.vue index a84f7134..bb20e495 100644 --- a/src/components/Settings/DataEditor.vue +++ b/src/components/Settings/DataEditor.vue @@ -5,6 +5,7 @@ + + \ No newline at end of file diff --git a/src/view/Settings/Trigger/Edit.vue b/src/view/Settings/Trigger/Edit.vue index 5206b3b3..223431c4 100644 --- a/src/view/Settings/Trigger/Edit.vue +++ b/src/view/Settings/Trigger/Edit.vue @@ -1,8 +1,8 @@