mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-15 05:33:50 +08:00
Improve creation UI for pages.
This commit is contained in:
@ -181,7 +181,8 @@ class ProviderEditPage extends React.Component {
|
||||
<Card size="small" title={
|
||||
<div>
|
||||
{i18next.t("provider:Edit Provider")}
|
||||
<Button type="primary" onClick={this.submitProviderEdit.bind(this)}>{i18next.t("general:Save")}</Button>
|
||||
<Button onClick={() => this.submitProviderEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: '20px'}} type="primary" onClick={() => this.submitProviderEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
</div>
|
||||
} style={(Setting.isMobile())? {margin: '5px'}:{}} type="inner">
|
||||
<Row style={{marginTop: '10px'}} >
|
||||
@ -521,7 +522,7 @@ class ProviderEditPage extends React.Component {
|
||||
)
|
||||
}
|
||||
|
||||
submitProviderEdit() {
|
||||
submitProviderEdit(willExist) {
|
||||
let provider = Setting.deepCopy(this.state.provider);
|
||||
ProviderBackend.updateProvider(this.state.provider.owner, this.state.providerName, provider)
|
||||
.then((res) => {
|
||||
@ -530,7 +531,12 @@ class ProviderEditPage extends React.Component {
|
||||
this.setState({
|
||||
providerName: this.state.provider.name,
|
||||
});
|
||||
this.props.history.push(`/providers/${this.state.provider.name}`);
|
||||
|
||||
if (willExist) {
|
||||
this.props.history.push(`/providers`);
|
||||
} else {
|
||||
this.props.history.push(`/providers/${this.state.provider.name}`);
|
||||
}
|
||||
} else {
|
||||
Setting.showMessage("error", res.msg);
|
||||
this.updateProviderField('name', this.state.providerName);
|
||||
@ -548,7 +554,8 @@ class ProviderEditPage extends React.Component {
|
||||
this.state.provider !== null ? this.renderProvider() : null
|
||||
}
|
||||
<div style={{marginTop: '20px', marginLeft: '40px'}}>
|
||||
<Button type="primary" size="large" onClick={this.submitProviderEdit.bind(this)}>{i18next.t("general:Save")}</Button>
|
||||
<Button size="large" onClick={() => this.submitProviderEdit(false)}>{i18next.t("general:Save")}</Button>
|
||||
<Button style={{marginLeft: '20px'}} type="primary" size="large" onClick={() => this.submitProviderEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Reference in New Issue
Block a user