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) }, })