mirror of https://github.com/openspug/spug
A web update
parent
5ec88738d0
commit
c2685a35fe
|
@ -37,7 +37,8 @@ class JSONView extends React.Component {
|
||||||
const formData = {type: store.type, o_id: store.id, env_id: store.env.id, data};
|
const formData = {type: store.type, o_id: store.id, env_id: store.env.id, data};
|
||||||
http.post('/api/config/parse/json/', formData)
|
http.post('/api/config/parse/json/', formData)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
message.success('保存成功')
|
message.success('保存成功');
|
||||||
|
this.updateValue()
|
||||||
})
|
})
|
||||||
.finally(() => this.setState({loading: false}))
|
.finally(() => this.setState({loading: false}))
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -61,12 +62,16 @@ class JSONView extends React.Component {
|
||||||
onChange={v => this.setState({body: v})}/>
|
onChange={v => this.setState({body: v})}/>
|
||||||
{readOnly && <Button
|
{readOnly && <Button
|
||||||
icon="edit"
|
icon="edit"
|
||||||
style={{position: 'absolute', top: 20, right: 0}}
|
type="link"
|
||||||
|
size="large"
|
||||||
|
style={{position: 'absolute', top: 0, right: 0}}
|
||||||
onClick={() => this.setState({readOnly: false})}>编辑</Button>}
|
onClick={() => this.setState({readOnly: false})}>编辑</Button>}
|
||||||
{readOnly || <Button
|
{readOnly || <Button
|
||||||
icon="save"
|
icon="save"
|
||||||
|
type="link"
|
||||||
|
size="large"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
style={{position: 'absolute', top: 20, right: 0}}
|
style={{position: 'absolute', top: 0, right: 0}}
|
||||||
onClick={this.handleSubmit}>保存</Button>}
|
onClick={this.handleSubmit}>保存</Button>}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -35,7 +35,8 @@ class TextView extends React.Component {
|
||||||
const formData = {type: store.type, o_id: store.id, env_id: store.env.id, data: this.state.body};
|
const formData = {type: store.type, o_id: store.id, env_id: store.env.id, data: this.state.body};
|
||||||
http.post('/api/config/parse/text/', formData)
|
http.post('/api/config/parse/text/', formData)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
message.success('保存成功')
|
message.success('保存成功');
|
||||||
|
this.updateValue()
|
||||||
})
|
})
|
||||||
.finally(() => this.setState({loading: false}))
|
.finally(() => this.setState({loading: false}))
|
||||||
};
|
};
|
||||||
|
@ -55,12 +56,16 @@ class TextView extends React.Component {
|
||||||
onChange={v => this.setState({body: v})}/>
|
onChange={v => this.setState({body: v})}/>
|
||||||
{readOnly && <Button
|
{readOnly && <Button
|
||||||
icon="edit"
|
icon="edit"
|
||||||
style={{position: 'absolute', top: 20, right: 10}}
|
type="link"
|
||||||
|
size="large"
|
||||||
|
style={{position: 'absolute', top: 0, right: 0}}
|
||||||
onClick={() => this.setState({readOnly: false})}>编辑</Button>}
|
onClick={() => this.setState({readOnly: false})}>编辑</Button>}
|
||||||
{readOnly || <Button
|
{readOnly || <Button
|
||||||
icon="save"
|
icon="save"
|
||||||
|
type="link"
|
||||||
|
size="large"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
style={{position: 'absolute', top: 20, right: 10}}
|
style={{position: 'absolute', top: 0, right: 0}}
|
||||||
onClick={this.handleSubmit}>保存</Button>}
|
onClick={this.handleSubmit}>保存</Button>}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue