From 9b18af192a47099e03f1241fd74232e8b242397b Mon Sep 17 00:00:00 2001 From: vapao Date: Wed, 26 Aug 2020 19:58:52 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E7=8E=AF=E5=A2=83=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=A6=81=E7=94=A8=E5=B7=B2=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=9A=84=E7=8E=AF=E5=A2=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/deploy/app/Ext1Setup1.js | 24 +++++++++++++++++---- spug_web/src/pages/deploy/app/Ext2Setup1.js | 22 ++++++++++++++++--- spug_web/src/pages/deploy/app/Table.js | 1 + 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/spug_web/src/pages/deploy/app/Ext1Setup1.js b/spug_web/src/pages/deploy/app/Ext1Setup1.js index 0459e7a..7d23391 100644 --- a/spug_web/src/pages/deploy/app/Ext1Setup1.js +++ b/spug_web/src/pages/deploy/app/Ext1Setup1.js @@ -3,14 +3,29 @@ * Copyright (c) * Released under the AGPL-3.0 License. */ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import { observer } from 'mobx-react'; import { Link } from 'react-router-dom'; import { Switch, Col, Form, Input, Select, Button } from "antd"; import envStore from 'pages/config/environment/store'; import store from './store'; -export default observer(function Ext2Setup1() { +export default observer(function Ext1Setup1() { + const [envs, setEnvs] = useState([]); + + function updateEnvs() { + const ids = store.records[store.app_id]['deploys'].map(x => x.env_id); + setEnvs(ids.filter(x => x !== store.deploy.env_id)) + } + + useEffect(() => { + if (store.records[store.app_id]['deploys'] === undefined) { + store.loadDeploys(store.app_id).then(updateEnvs) + } else { + updateEnvs() + } + }, []) + const info = store.deploy; return (
@@ -18,7 +33,7 @@ export default observer(function Ext2Setup1() { @@ -45,7 +60,8 @@ export default observer(function Ext2Setup1() { }> info['rst_notify']['mode'] = v}> + value={info['rst_notify']['mode']} style={{width: 100}} + onChange={v => info['rst_notify']['mode'] = v}> 关闭 钉钉 企业微信 diff --git a/spug_web/src/pages/deploy/app/Ext2Setup1.js b/spug_web/src/pages/deploy/app/Ext2Setup1.js index 1af7460..647e349 100644 --- a/spug_web/src/pages/deploy/app/Ext2Setup1.js +++ b/spug_web/src/pages/deploy/app/Ext2Setup1.js @@ -3,7 +3,7 @@ * Copyright (c) * Released under the AGPL-3.0 License. */ -import React from 'react'; +import React, { useState, useEffect } from 'react'; import { observer } from 'mobx-react'; import { Link } from 'react-router-dom'; import { Switch, Col, Form, Select, Button, Input } from "antd"; @@ -11,6 +11,21 @@ import envStore from 'pages/config/environment/store'; import store from './store'; export default observer(function Ext2Setup1() { + const [envs, setEnvs] = useState([]); + + function updateEnvs() { + const ids = store.records[store.app_id]['deploys'].map(x => x.env_id); + setEnvs(ids.filter(x => x !== store.deploy.env_id)) + } + + useEffect(() => { + if (store.records[store.app_id]['deploys'] === undefined) { + store.loadDeploys(store.app_id).then(updateEnvs) + } else { + updateEnvs() + } + }, []) + const info = store.deploy; return ( @@ -18,7 +33,7 @@ export default observer(function Ext2Setup1() { @@ -41,7 +56,8 @@ export default observer(function Ext2Setup1() { }> info['rst_notify']['mode'] = v}> + value={info['rst_notify']['mode']} style={{width: 100}} + onChange={v => info['rst_notify']['mode'] = v}> 关闭 钉钉 企业微信 diff --git a/spug_web/src/pages/deploy/app/Table.js b/spug_web/src/pages/deploy/app/Table.js index 1836284..a7be40c 100644 --- a/spug_web/src/pages/deploy/app/Table.js +++ b/spug_web/src/pages/deploy/app/Table.js @@ -71,6 +71,7 @@ class ComTable extends React.Component { return Promise.reject() } const info = JSON.parse(this.cloneObj); + info.env_id = undefined; store.showExtForm(null, id, info, true) }, })