From 1c955c03321ee69805cbdafc4474d38709a88b31 Mon Sep 17 00:00:00 2001 From: vapao Date: Fri, 10 Nov 2023 16:08:56 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E7=A7=BB=E9=99=A4=E5=86=85=E7=BD=AE?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E7=9B=B8=E5=85=B3=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/system/setting/AlarmSetting.js | 19 ++----- .../src/pages/system/setting/BasicSetting.js | 52 ------------------- spug_web/src/pages/system/setting/index.js | 5 +- 3 files changed, 5 insertions(+), 71 deletions(-) delete mode 100644 spug_web/src/pages/system/setting/BasicSetting.js diff --git a/spug_web/src/pages/system/setting/AlarmSetting.js b/spug_web/src/pages/system/setting/AlarmSetting.js index 2b03381..88c7a7e 100644 --- a/spug_web/src/pages/system/setting/AlarmSetting.js +++ b/spug_web/src/pages/system/setting/AlarmSetting.js @@ -5,7 +5,7 @@ */ import React, { useState } from 'react'; import { observer } from 'mobx-react'; -import { Button, Form, Input, Radio, Space, message } from 'antd'; +import { Button, Form, Input, Space, message } from 'antd'; import styles from './index.module.css'; import { http } from 'libs'; import store from './store'; @@ -13,7 +13,6 @@ import store from './store'; export default observer(function () { const [form] = Form.useForm(); const setting = store.settings.mail_service || {}; - const [mode, setMode] = useState(setting.server === undefined ? '1' : '2'); const [loading, setLoading] = useState(false); function handleEmailTest() { @@ -37,9 +36,7 @@ export default observer(function () { function handleSubmit() { let formData = form.getFieldsValue(); - if (mode === '1') { - formData = {} - } else if (!formData.server || !formData.port || !formData.username || !formData.password) { + if (!formData.server || !formData.port || !formData.username || !formData.password) { return message.error('请完成邮件服务配置'); } _doSubmit([{key: 'mail_service', value: formData}]) @@ -50,15 +47,7 @@ export default observer(function () {
报警服务设置
- setMode(e.target.value)}> - 内置 - 自定义 - -
+
@@ -79,7 +68,7 @@ export default observer(function () {
- {mode !== '1' && } +
diff --git a/spug_web/src/pages/system/setting/BasicSetting.js b/spug_web/src/pages/system/setting/BasicSetting.js deleted file mode 100644 index 407886b..0000000 --- a/spug_web/src/pages/system/setting/BasicSetting.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) OpenSpug Organization. https://github.com/openspug/spug - * Copyright (c) - * Released under the AGPL-3.0 License. - */ -import React from 'react'; -import { observer } from 'mobx-react'; -import { Form, Popover, Input, Button, message } from 'antd'; -import styles from './index.module.css'; -import { http } from 'libs'; -import store from './store'; - -export default observer(function () { - function handleSubmit() { - const spug_key = store.settings.spug_key; - if (!spug_key) return message.error('请输入调用凭据'); - store.loading = true; - http.post('/api/setting/', {data: [{key: 'spug_key', value: spug_key}]}) - .then(() => { - message.success('保存成功'); - store.fetchSettings() - }) - .finally(() => store.loading = false) - } - - const spugWx = spug; - return ( - -
基本设置
-
- 如需要使用Spug的邮件、微信和MFA等内置服务,请关注公众号 - - - Spug - - - 在【我的】页面获取调用凭据,否则请留空。}> - store.update('spug_key', e.target.value)} - placeholder="请输入Spug微信公众号获取到的Token"/> - - - - -
-
- ) -}) diff --git a/spug_web/src/pages/system/setting/index.js b/spug_web/src/pages/system/setting/index.js index aee5bf0..40c95f9 100644 --- a/spug_web/src/pages/system/setting/index.js +++ b/spug_web/src/pages/system/setting/index.js @@ -6,7 +6,6 @@ import React from 'react'; import { Menu } from 'antd'; import { AuthDiv, Breadcrumb } from 'components'; -import BasicSetting from './BasicSetting'; import AlarmSetting from './AlarmSetting'; import LDAPSetting from './LDAPSetting'; import OpenService from './OpenService'; @@ -22,7 +21,7 @@ class Index extends React.Component { constructor(props) { super(props); this.state = { - selectedKeys: ['basic'] + selectedKeys: ['security'] } } @@ -46,7 +45,6 @@ class Index extends React.Component { selectedKeys={selectedKeys} style={{border: 'none'}} onSelect={({selectedKeys}) => this.setState({selectedKeys})}> - 基本设置 安全设置 LDAP设置 密钥设置 @@ -57,7 +55,6 @@ class Index extends React.Component {
- {selectedKeys[0] === 'basic' && } {selectedKeys[0] === 'security' && } {selectedKeys[0] === 'ldap' && } {selectedKeys[0] === 'alarm' && }