Improve creation UI for pages.

This commit is contained in:
Gucheng Wang
2021-12-12 18:51:12 +08:00
parent 2f71d9743b
commit 1762d19787
12 changed files with 94 additions and 27 deletions

View File

@ -47,14 +47,14 @@ class WebhookListPage extends React.Component {
}
newWebhook() {
var randomName = Math.random().toString(36).slice(-6)
const randomName = Setting.getRandomName();
return {
owner: "admin", // this.props.account.webhookname,
name: `webhook_${randomName}`,
createdTime: moment().format(),
url: "https://example.com/callback",
contentType: "application/json",
events: [],
events: ["signup", "login", "logout", "update-user"],
organization: "built-in",
}
}
@ -68,6 +68,7 @@ class WebhookListPage extends React.Component {
webhooks: Setting.prependRow(this.state.webhooks, newWebhook),
total: this.state.total + 1
});
this.props.history.push(`/webhooks/${newWebhook.name}`);
}
)
.catch(error => {