Return error for RunSyncer()

This commit is contained in:
Yang Luo
2023-08-27 02:08:45 +08:00
parent 7e3c361ce7
commit 988b26b3c2
7 changed files with 74 additions and 51 deletions

View File

@ -86,8 +86,13 @@ class SyncerListPage extends BaseListPage {
this.setState({loading: true});
SyncerBackend.runSyncer("admin", this.state.data[i].name)
.then((res) => {
this.setState({loading: false});
Setting.showMessage("success", "Syncer sync users successfully");
if (res.status === "ok") {
this.setState({loading: false});
Setting.showMessage("success", i18next.t("general:Successfully synced"));
} else {
this.setState({loading: false});
Setting.showMessage("error", `${i18next.t("general:Failed to sync")}: ${res.msg}`);
}
}
)
.catch(error => {
@ -151,6 +156,13 @@ class SyncerListPage extends BaseListPage {
{text: "LDAP", value: "LDAP"},
],
},
{
title: i18next.t("syncer:Database type"),
dataIndex: "databaseType",
key: "databaseType",
width: "130px",
sorter: (a, b) => a.databaseType.localeCompare(b.databaseType),
},
{
title: i18next.t("provider:Host"),
dataIndex: "host",
@ -183,13 +195,6 @@ class SyncerListPage extends BaseListPage {
sorter: true,
...this.getColumnSearchProps("password"),
},
{
title: i18next.t("syncer:Database type"),
dataIndex: "databaseType",
key: "databaseType",
width: "120px",
sorter: (a, b) => a.databaseType.localeCompare(b.databaseType),
},
{
title: i18next.t("syncer:Database"),
dataIndex: "database",
@ -208,7 +213,7 @@ class SyncerListPage extends BaseListPage {
title: i18next.t("syncer:Sync interval"),
dataIndex: "syncInterval",
key: "syncInterval",
width: "130px",
width: "140px",
sorter: true,
...this.getColumnSearchProps("syncInterval"),
},