Add isEnabled to webhook.

This commit is contained in:
Yang Luo
2021-12-26 21:02:56 +08:00
parent 0c665edcbc
commit 9943e3c316
13 changed files with 95 additions and 25 deletions

View File

@ -250,7 +250,7 @@ class SyncerEditPage extends React.Component {
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 19 : 2}>
{Setting.getLabel(i18next.t("syncer:Is enabled"), i18next.t("syncer:Is enabled - Tooltip"))} :
{Setting.getLabel(i18next.t("general:Is enabled"), i18next.t("general:Is enabled - Tooltip"))} :
</Col>
<Col span={1} >
<Switch checked={this.state.syncer.isEnabled} onChange={checked => {

View File

@ -192,7 +192,7 @@ class SyncerListPage extends BaseListPage {
...this.getColumnSearchProps('syncInterval'),
},
{
title: i18next.t("syncer:Is enabled"),
title: i18next.t("general:Is enabled"),
dataIndex: 'isEnabled',
key: 'isEnabled',
width: '120px',

View File

@ -13,7 +13,7 @@
// limitations under the License.
import React from "react";
import {Button, Card, Col, Input, Row, Select} from 'antd';
import {Button, Card, Col, Input, Row, Select, Switch} from 'antd';
import {LinkOutlined} from "@ant-design/icons";
import * as WebhookBackend from "./backend/WebhookBackend";
import * as OrganizationBackend from "./backend/OrganizationBackend";
@ -181,6 +181,16 @@ class WebhookEditPage extends React.Component {
</Select>
</Col>
</Row>
<Row style={{marginTop: '20px'}} >
<Col style={{marginTop: '5px'}} span={(Setting.isMobile()) ? 19 : 2}>
{Setting.getLabel(i18next.t("general:Is enabled"), i18next.t("general:Is enabled - Tooltip"))} :
</Col>
<Col span={1} >
<Switch checked={this.state.webhook.isEnabled} onChange={checked => {
this.updateWebhookField('isEnabled', checked);
}} />
</Col>
</Row>
</Card>
)
}

View File

@ -14,7 +14,7 @@
import React from "react";
import {Link} from "react-router-dom";
import {Button, Popconfirm, Table} from 'antd';
import {Button, Popconfirm, Switch, Table} from 'antd';
import moment from "moment";
import * as Setting from "./Setting";
import * as WebhookBackend from "./backend/WebhookBackend";
@ -34,6 +34,7 @@ class WebhookListPage extends BaseListPage {
contentType: "application/json",
headers: [],
events: ["signup", "login", "logout", "update-user"],
isEnabled: true,
}
}
@ -156,6 +157,18 @@ class WebhookListPage extends BaseListPage {
return Setting.getTags(text);
}
},
{
title: i18next.t("general:Is enabled"),
dataIndex: 'isEnabled',
key: 'isEnabled',
width: '120px',
sorter: true,
render: (text, record, index) => {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
)
}
},
{
title: i18next.t("general:Action"),
dataIndex: '',

View File

@ -87,6 +87,8 @@
"Home - Tooltip": "Application homepage",
"ID": "ID",
"ID - Tooltip": "random string",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"LDAPs": "LDAPs",
"LDAPs - Tooltip": "LDAPs - Tooltip",
"Logo - Tooltip": "App's image tag",
@ -335,8 +337,6 @@
"Database type": "Database type",
"Database type - Tooltip": "Database type - Tooltip",
"Edit Syncer": "Edit Syncer",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"Is hashed": "Is hashed",
"Sync interval": "Sync interval",
"Sync interval - Tooltip": "Sync interval - Tooltip",
@ -417,7 +417,13 @@
"Edit Webhook": "Edit Webhook",
"Events": "Events",
"Events - Tooltip": "Events - Tooltip",
"Headers": "Headers",
"Headers - Tooltip": "Headers - Tooltip",
"Method": "Method",
"Method - Tooltip": "Method - Tooltip",
"Name": "Name",
"URL": "URL",
"URL - Tooltip": "URL - Tooltip"
"URL - Tooltip": "URL - Tooltip",
"Value": "Value"
}
}

View File

@ -87,6 +87,8 @@
"Home - Tooltip": "Home - Tooltip",
"ID": "ID",
"ID - Tooltip": "ID - Tooltip",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"LDAPs": "LDAPs",
"LDAPs - Tooltip": "LDAPs - Tooltip",
"Logo - Tooltip": "Logo - Tooltip",
@ -335,8 +337,6 @@
"Database type": "Database type",
"Database type - Tooltip": "Database type - Tooltip",
"Edit Syncer": "Edit Syncer",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"Is hashed": "Is hashed",
"Sync interval": "Sync interval",
"Sync interval - Tooltip": "Sync interval - Tooltip",
@ -417,7 +417,13 @@
"Edit Webhook": "Edit Webhook",
"Events": "Events",
"Events - Tooltip": "Events - Tooltip",
"Headers": "Headers",
"Headers - Tooltip": "Headers - Tooltip",
"Method": "Method",
"Method - Tooltip": "Method - Tooltip",
"Name": "Name",
"URL": "URL",
"URL - Tooltip": "URL - Tooltip"
"URL - Tooltip": "URL - Tooltip",
"Value": "Value"
}
}

View File

@ -87,6 +87,8 @@
"Home - Tooltip": "Application homepage",
"ID": "ID",
"ID - Tooltip": "random string",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"LDAPs": "LDAPs",
"LDAPs - Tooltip": "LDAPs - Tooltip",
"Logo - Tooltip": "App's image tag",
@ -335,8 +337,6 @@
"Database type": "Database type",
"Database type - Tooltip": "Database type - Tooltip",
"Edit Syncer": "Edit Syncer",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"Is hashed": "Is hashed",
"Sync interval": "Sync interval",
"Sync interval - Tooltip": "Sync interval - Tooltip",
@ -417,7 +417,13 @@
"Edit Webhook": "Edit Webhook",
"Events": "Events",
"Events - Tooltip": "Events - Tooltip",
"Headers": "Headers",
"Headers - Tooltip": "Headers - Tooltip",
"Method": "Method",
"Method - Tooltip": "Method - Tooltip",
"Name": "Name",
"URL": "URL",
"URL - Tooltip": "URL - Tooltip"
"URL - Tooltip": "URL - Tooltip",
"Value": "Value"
}
}

View File

@ -87,6 +87,8 @@
"Home - Tooltip": "Application homepage",
"ID": "ID",
"ID - Tooltip": "random string",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"LDAPs": "LDAPs",
"LDAPs - Tooltip": "LDAPs - Tooltip",
"Logo - Tooltip": "App's image tag",
@ -335,8 +337,6 @@
"Database type": "Database type",
"Database type - Tooltip": "Database type - Tooltip",
"Edit Syncer": "Edit Syncer",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"Is hashed": "Is hashed",
"Sync interval": "Sync interval",
"Sync interval - Tooltip": "Sync interval - Tooltip",
@ -417,7 +417,13 @@
"Edit Webhook": "Edit Webhook",
"Events": "Events",
"Events - Tooltip": "Events - Tooltip",
"Headers": "Headers",
"Headers - Tooltip": "Headers - Tooltip",
"Method": "Method",
"Method - Tooltip": "Method - Tooltip",
"Name": "Name",
"URL": "URL",
"URL - Tooltip": "URL - Tooltip"
"URL - Tooltip": "URL - Tooltip",
"Value": "Value"
}
}

View File

@ -87,6 +87,8 @@
"Home - Tooltip": "Application homepage",
"ID": "ID",
"ID - Tooltip": "random string",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"LDAPs": "LDAPs",
"LDAPs - Tooltip": "LDAPs - Tooltip",
"Logo - Tooltip": "App's image tag",
@ -335,8 +337,6 @@
"Database type": "Database type",
"Database type - Tooltip": "Database type - Tooltip",
"Edit Syncer": "Edit Syncer",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"Is hashed": "Is hashed",
"Sync interval": "Sync interval",
"Sync interval - Tooltip": "Sync interval - Tooltip",
@ -417,7 +417,13 @@
"Edit Webhook": "Edit Webhook",
"Events": "Events",
"Events - Tooltip": "Events - Tooltip",
"Headers": "Headers",
"Headers - Tooltip": "Headers - Tooltip",
"Method": "Method",
"Method - Tooltip": "Method - Tooltip",
"Name": "Name",
"URL": "URL",
"URL - Tooltip": "URL - Tooltip"
"URL - Tooltip": "URL - Tooltip",
"Value": "Value"
}
}

View File

@ -87,6 +87,8 @@
"Home - Tooltip": "Application homepage",
"ID": "ID",
"ID - Tooltip": "random string",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"LDAPs": "LDAPs",
"LDAPs - Tooltip": "LDAPs - Tooltip",
"Logo - Tooltip": "App's image tag",
@ -335,8 +337,6 @@
"Database type": "Database type",
"Database type - Tooltip": "Database type - Tooltip",
"Edit Syncer": "Edit Syncer",
"Is enabled": "Is enabled",
"Is enabled - Tooltip": "Is enabled - Tooltip",
"Is hashed": "Is hashed",
"Sync interval": "Sync interval",
"Sync interval - Tooltip": "Sync interval - Tooltip",
@ -417,7 +417,13 @@
"Edit Webhook": "Edit Webhook",
"Events": "Events",
"Events - Tooltip": "Events - Tooltip",
"Headers": "Headers",
"Headers - Tooltip": "Headers - Tooltip",
"Method": "Method",
"Method - Tooltip": "Method - Tooltip",
"Name": "Name",
"URL": "URL",
"URL - Tooltip": "URL - Tooltip"
"URL - Tooltip": "URL - Tooltip",
"Value": "Value"
}
}

View File

@ -87,6 +87,8 @@
"Home - Tooltip": "应用的首页",
"ID": "ID",
"ID - Tooltip": "唯一的随机字符串",
"Is enabled": "已启用",
"Is enabled - Tooltip": "是否启用",
"LDAPs": "LDAPs",
"LDAPs - Tooltip": "LDAPs",
"Logo - Tooltip": "应用程序向外展示的图标",
@ -335,8 +337,6 @@
"Database type": "数据库类型",
"Database type - Tooltip": "数据库类型",
"Edit Syncer": "修改同步器",
"Is enabled": "已启用",
"Is enabled - Tooltip": "是否启用",
"Is hashed": "是否参与哈希计算",
"Sync interval": "同步间隔",
"Sync interval - Tooltip": "单位为分钟",
@ -417,7 +417,13 @@
"Edit Webhook": "修改Webhook",
"Events": "事件",
"Events - Tooltip": "事件",
"Headers": "协议头",
"Headers - Tooltip": "HTTP协议头键值对",
"Method": "方法",
"Method - Tooltip": "HTTP方法",
"Name": "名称",
"URL": "URL",
"URL - Tooltip": "URL"
"URL - Tooltip": "URL",
"Value": "值"
}
}