Add all webhook events

This commit is contained in:
Yang Luo 2023-08-26 23:39:02 +08:00
parent a637707e77
commit 7e3c361ce7
4 changed files with 27 additions and 12 deletions

View File

@ -423,13 +423,13 @@ class ProviderEditPage extends React.Component {
[
{id: "Captcha", name: "Captcha"},
{id: "Email", name: "Email"},
{id: "Notification", name: "Notification"},
{id: "OAuth", name: "OAuth"},
{id: "Payment", name: "Payment"},
{id: "SAML", name: "SAML"},
{id: "SMS", name: "SMS"},
{id: "Storage", name: "Storage"},
{id: "Web3", name: "Web3"},
{id: "Notification", name: "Notification"},
]
.sort((a, b) => a.name.localeCompare(b.name))
.map((providerCategory, index) => <Option key={index} value={providerCategory.id}>{providerCategory.name}</Option>)

View File

@ -142,13 +142,15 @@ class ProviderListPage extends BaseListPage {
key: "category",
filterMultiple: false,
filters: [
{text: "OAuth", value: "OAuth"},
{text: "Captcha", value: "Captcha"},
{text: "Email", value: "Email"},
{text: "Notification", value: "Notification"},
{text: "OAuth", value: "OAuth"},
{text: "Payment", value: "Payment"},
{text: "SAML", value: "SAML"},
{text: "SMS", value: "SMS"},
{text: "Storage", value: "Storage"},
{text: "SAML", value: "SAML"},
{text: "Captcha", value: "Captcha"},
{text: "Payment", value: "Payment"},
{text: "Web3", value: "Web3"},
],
width: "110px",
sorter: true,
@ -161,13 +163,15 @@ class ProviderListPage extends BaseListPage {
align: "center",
filterMultiple: false,
filters: [
{text: "OAuth", value: "OAuth", children: Setting.getProviderTypeOptions("OAuth").map((o) => {return {text: o.id, value: o.name};})},
{text: "Captcha", value: "Captcha", children: Setting.getProviderTypeOptions("Captcha").map((o) => {return {text: o.id, value: o.name};})},
{text: "Email", value: "Email", children: Setting.getProviderTypeOptions("Email").map((o) => {return {text: o.id, value: o.name};})},
{text: "Notification", value: "Notification", children: Setting.getProviderTypeOptions("Notification").map((o) => {return {text: o.id, value: o.name};})},
{text: "OAuth", value: "OAuth", children: Setting.getProviderTypeOptions("OAuth").map((o) => {return {text: o.id, value: o.name};})},
{text: "Payment", value: "Payment", children: Setting.getProviderTypeOptions("Payment").map((o) => {return {text: o.id, value: o.name};})},
{text: "SAML", value: "SAML", children: Setting.getProviderTypeOptions("SAML").map((o) => {return {text: o.id, value: o.name};})},
{text: "SMS", value: "SMS", children: Setting.getProviderTypeOptions("SMS").map((o) => {return {text: o.id, value: o.name};})},
{text: "Storage", value: "Storage", children: Setting.getProviderTypeOptions("Storage").map((o) => {return {text: o.id, value: o.name};})},
{text: "SAML", value: "SAML", children: Setting.getProviderTypeOptions("SAML").map((o) => {return {text: o.id, value: o.name};})},
{text: "Captcha", value: "Captcha", children: Setting.getProviderTypeOptions("Captcha").map((o) => {return {text: o.id, value: o.name};})},
{text: "Payment", value: "Payment", children: Setting.getProviderTypeOptions("Payment").map((o) => {return {text: o.id, value: o.name};})},
{text: "Web3", value: "Web3", children: Setting.getProviderTypeOptions("Web3").map((o) => {return {text: o.id, value: o.name};})},
],
sorter: true,
render: (text, record, index) => {

View File

@ -274,7 +274,7 @@ export const OtherProviderInfo = {
},
"Custom HTTP": {
logo: `${StaticBaseUrl}/img/email_default.png`,
url: "https://casdoor.org/docs/provider/sms/overview",
url: "https://casdoor.org/docs/provider/notification/overview",
},
},
};
@ -927,7 +927,7 @@ export function getProviderTypeOptions(category) {
{id: "Local File System", name: "Local File System"},
{id: "AWS S3", name: "AWS S3"},
{id: "MinIO", name: "MinIO"},
{id: "Aliyun OSS", name: "Aliyun OSS"},
{id: "Aliyun OSS", name: "Alibaba Cloud OSS"},
{id: "Tencent Cloud COS", name: "Tencent Cloud COS"},
{id: "Azure Blob", name: "Azure Blob"},
{id: "Qiniu Cloud Kodo", name: "Qiniu Cloud Kodo"},

View File

@ -159,6 +159,17 @@ class WebhookEditPage extends React.Component {
});
}
getApiPaths() {
const objects = ["organization", "group", "user", "application", "provider", "resource", "cert", "role", "permission", "model", "adapter", "enforcer", "session", "record", "token", "product", "payment", "plan", "pricing", "subscription", "syncer", "webhook"];
const res = [];
objects.forEach(obj => {
["add", "update", "delete"].forEach(action => {
res.push(`${action}-${obj}`);
});
});
return res;
}
renderWebhook() {
const preview = Setting.deepCopy(previewTemplate);
if (this.state.webhook.isUserExtended) {
@ -263,7 +274,7 @@ class WebhookEditPage extends React.Component {
}} >
{
(
["signup", "login", "logout", "add-user", "update-user", "delete-user", "add-organization", "update-organization", "delete-organization", "add-application", "update-application", "delete-application", "add-provider", "update-provider", "delete-provider", "update-subscription"].map((option, index) => {
["signup", "login", "logout"].concat(this.getApiPaths()).map((option, index) => {
return (
<Option key={option} value={option}>{option}</Option>
);