Merge pull request #973 from qianxi0410/eslint

feat(web): add some eslint rules
This commit is contained in:
Yang Luo 2022-08-07 00:41:51 +08:00 committed by GitHub
commit cba338eef2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
72 changed files with 353 additions and 341 deletions

View File

@ -21,7 +21,7 @@
"rules": {
// "eqeqeq": "error",
"semi": ["error", "always"],
// "indent": ["error", 2],
"indent": ["error", 2],
// follow antd's style guide
"quotes": ["error", "double"],
"jsx-quotes": ["error", "prefer-double"],
@ -48,6 +48,19 @@
"sort-imports": ["error", {
"ignoreDeclarationSort": true
}],
"no-multiple-empty-lines": ["error", { "max": 1, "maxBOF": 0, "maxEOF": 0 }],
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"space-infix-ops": "error",
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"comma-style": ["error", "last"],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "never",
"exports": "never",
"functions": "never"
}],
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"react/prop-types": "off",

View File

@ -34,7 +34,7 @@ module.exports = {
"/cas/validate": {
target: "http://localhost:8000",
changeOrigin: true,
}
},
},
},
plugins: [

View File

@ -116,7 +116,7 @@ class AccountTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("provider:visible"),
@ -129,7 +129,7 @@ class AccountTable extends React.Component {
this.updateField(table, index, "visible", checked);
}} />
);
}
},
},
{
title: i18next.t("organization:viewRule"),
@ -156,7 +156,7 @@ class AccountTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("organization:modifyRule"),
@ -191,7 +191,7 @@ class AccountTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("general:Action"),
@ -211,7 +211,7 @@ class AccountTable extends React.Component {
</Tooltip>
</div>
);
}
},
},
];

View File

@ -238,7 +238,7 @@ class App extends Component {
const owner = this.state.account.owner;
this.setState({
account: null
account: null,
});
Setting.showMessage("success", "Logged out successfully");
@ -258,7 +258,7 @@ class App extends Component {
onUpdateAccount(account) {
this.setState({
account: account
account: account,
});
}
@ -566,7 +566,7 @@ class App extends Component {
renderContent() {
if (!Setting.isMobile()) {
return (
<div style={{display: "flex", flex: "auto", width:"100%", flexDirection: "column"}}>
<div style={{display: "flex", flex: "auto", width: "100%", flexDirection: "column"}}>
<Layout style={{display: "flex", alignItems: "stretch"}}>
<Header style={{padding: "0", marginBottom: "3px"}}>
{

View File

@ -156,7 +156,7 @@ class ApplicationEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitApplicationEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteApplication()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
@ -181,7 +181,7 @@ class ApplicationEditPage extends React.Component {
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Logo"), i18next.t("general:Logo - Tooltip"))} :
</Col>
<Col span={22} style={(Setting.isMobile()) ? {maxWidth: "100%"} :{}}>
<Col span={22} style={(Setting.isMobile()) ? {maxWidth: "100%"} : {}}>
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 1}>
{Setting.getLabel(i18next.t("general:URL"), i18next.t("general:URL - Tooltip"))} :
@ -583,7 +583,7 @@ class ApplicationEditPage extends React.Component {
{i18next.t("application:Copy signup page URL")}
</Button>
<br />
<div style={{position: "relative", width: "90%", border: "1px solid rgb(217,217,217)", boxShadow: "10px 10px 5px #888888", alignItems:"center", overflow:"auto", flexDirection:"column", flex: "auto"}}>
<div style={{position: "relative", width: "90%", border: "1px solid rgb(217,217,217)", boxShadow: "10px 10px 5px #888888", alignItems: "center", overflow: "auto", flexDirection: "column", flex: "auto"}}>
{
this.state.application.enablePassword ? (
<SignupPage application={this.state.application} />
@ -603,7 +603,7 @@ class ApplicationEditPage extends React.Component {
{i18next.t("application:Copy signin page URL")}
</Button>
<br />
<div style={{position: "relative", width: "90%", border: "1px solid rgb(217,217,217)", boxShadow: "10px 10px 5px #888888", alignItems:"center", overflow:"auto", flexDirection:"column", flex: "auto"}}>
<div style={{position: "relative", width: "90%", border: "1px solid rgb(217,217,217)", boxShadow: "10px 10px 5px #888888", alignItems: "center", overflow: "auto", flexDirection: "column", flex: "auto"}}>
<LoginPage type={"login"} mode={"signin"} application={this.state.application} />
<div style={maskStyle}></div>
</div>

View File

@ -99,7 +99,7 @@ class ApplicationListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -109,7 +109,7 @@ class ApplicationListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -130,7 +130,7 @@ class ApplicationListPage extends BaseListPage {
<img src={text} alt={text} width={150} />
</a>
);
}
},
},
{
title: i18next.t("general:Organization"),
@ -145,7 +145,7 @@ class ApplicationListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Providers"),
@ -222,7 +222,7 @@ class ApplicationListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -73,7 +73,7 @@ class CertEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitCertEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteCert()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :

View File

@ -82,7 +82,7 @@ class CertListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -92,7 +92,7 @@ class CertListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -169,7 +169,7 @@ class CertListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -42,7 +42,7 @@ class LdapEditPage extends React.Component {
.then((res) => {
if (res.status === "ok") {
this.setState({
ldap: res.data
ldap: res.data,
});
} else {
Setting.showMessage("error", res.msg);
@ -71,7 +71,7 @@ class LdapEditPage extends React.Component {
return (
<span style={{
color: "#faad14",
marginLeft: "20px"
marginLeft: "20px",
}}>{i18next.t("ldap:The Auto Sync option will sync all users to specify organization")}</span>
);
}

View File

@ -23,7 +23,7 @@ class LdapListPage extends React.Component {
constructor(props) {
super(props);
this.state = {
ldaps: null
ldaps: null,
};
}
@ -65,7 +65,7 @@ class LdapListPage extends React.Component {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Organization"),
@ -79,7 +79,7 @@ class LdapListPage extends React.Component {
{text}
</Link>
);
}
},
},
{
title: i18next.t("ldap:Server"),
@ -89,7 +89,7 @@ class LdapListPage extends React.Component {
sorter: (a, b) => a.host.localeCompare(b.host),
render: (text, record, index) => {
return `${text}:${record.port}`;
}
},
},
{
title: i18next.t("ldap:Base DN"),
@ -114,7 +114,7 @@ class LdapListPage extends React.Component {
render: (text, record, index) => {
return text === 0 ? (<span style={{color: "#faad14"}}>Disable</span>) : (
<span style={{color: "#52c41a"}}>{text + " mins"}</span>);
}
},
},
{
title: i18next.t("ldap:Last Sync"),
@ -124,7 +124,7 @@ class LdapListPage extends React.Component {
sorter: (a, b) => a.lastSync.localeCompare(b.lastSync),
render: (text, record, index) => {
return text;
}
},
},
{
title: i18next.t("general:Action"),
@ -148,7 +148,7 @@ class LdapListPage extends React.Component {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -87,7 +87,6 @@ class LdapSyncPage extends React.Component {
});
}
getLdapUser(ldap) {
LdapBackend.getLdapUser(ldap)
.then((res) => {

View File

@ -48,7 +48,7 @@ class LdapTable extends React.Component {
passwd: "123",
baseDn: "ou=People,dc=example,dc=com",
autosync: 0,
lastSync: ""
lastSync: "",
};
}
@ -104,7 +104,7 @@ class LdapTable extends React.Component {
{text}
</Link>
);
}
},
},
{
title: i18next.t("ldap:Server"),
@ -114,7 +114,7 @@ class LdapTable extends React.Component {
sorter: (a, b) => a.host.localeCompare(b.host),
render: (text, record, index) => {
return `${text}:${record.port}`;
}
},
},
{
title: i18next.t("ldap:Base DN"),
@ -132,7 +132,7 @@ class LdapTable extends React.Component {
render: (text, record, index) => {
return text === 0 ? (<span style={{color: "#faad14"}}>Disable</span>) : (
<span style={{color: "#52c41a"}}>{text + " mins"}</span>);
}
},
},
{
title: i18next.t("ldap:Last Sync"),
@ -142,7 +142,7 @@ class LdapTable extends React.Component {
sorter: (a, b) => a.lastSync.localeCompare(b.lastSync),
render: (text, record, index) => {
return text;
}
},
},
{
title: i18next.t("general:Action"),
@ -166,7 +166,7 @@ class LdapTable extends React.Component {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -97,7 +97,7 @@ class ModelEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitModelEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteModel()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :

View File

@ -76,7 +76,7 @@ class ModelListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Name"),
@ -92,7 +92,7 @@ class ModelListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -102,7 +102,7 @@ class ModelListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -122,7 +122,7 @@ class ModelListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -143,7 +143,7 @@ class ModelListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -60,7 +60,7 @@ class OrganizationEditPage extends React.Component {
}
}
this.setState({
ldaps: resdata
ldaps: resdata,
});
});
}
@ -91,7 +91,7 @@ class OrganizationEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitOrganizationEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteOrganization()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :

View File

@ -112,7 +112,7 @@ class OrganizationListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -122,7 +122,7 @@ class OrganizationListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -143,7 +143,7 @@ class OrganizationListPage extends BaseListPage {
<img src={text} alt={text} width={40} />
</a>
);
}
},
},
{
title: i18next.t("organization:Website URL"),
@ -158,7 +158,7 @@ class OrganizationListPage extends BaseListPage {
{text}
</a>
);
}
},
},
{
title: i18next.t("general:Password type"),
@ -192,7 +192,7 @@ class OrganizationListPage extends BaseListPage {
<img src={text} alt={text} width={40} />
</a>
);
}
},
},
{
title: i18next.t("organization:Soft deletion"),
@ -204,7 +204,7 @@ class OrganizationListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -226,7 +226,7 @@ class OrganizationListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -152,7 +152,7 @@ class PaymentEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitPaymentEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deletePayment()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :

View File

@ -89,7 +89,7 @@ class PaymentListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:User"),
@ -104,7 +104,7 @@ class PaymentListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Name"),
@ -120,7 +120,7 @@ class PaymentListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -130,7 +130,7 @@ class PaymentListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
// {
// title: i18next.t("general:Display name"),
@ -154,7 +154,7 @@ class PaymentListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("payment:Type"),
@ -163,12 +163,12 @@ class PaymentListPage extends BaseListPage {
width: "140px",
align: "center",
filterMultiple: false,
filters: Setting.getProviderTypeOptions("Payment").map((o) => {return {text:o.id, value:o.name};}),
filters: Setting.getProviderTypeOptions("Payment").map((o) => {return {text: o.id, value: o.name};}),
sorter: true,
render: (text, record, index) => {
record.category = "Payment";
return Provider.getProviderLogoWidget(record);
}
},
},
{
title: i18next.t("payment:Product"),
@ -221,7 +221,7 @@ class PaymentListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -67,7 +67,7 @@ class PaymentResultPage extends React.Component {
Setting.goToLink(payment.returnUrl);
}}>
{i18next.t("payment:Return to Website")}
</Button>
</Button>,
]}
/>
</div>
@ -103,7 +103,7 @@ class PaymentResultPage extends React.Component {
Setting.goToLink(payment.returnUrl);
}}>
{i18next.t("payment:Return to Website")}
</Button>
</Button>,
]}
/>
</div>

View File

@ -132,7 +132,7 @@ class PermissionEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitPermissionEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deletePermission()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :

View File

@ -81,7 +81,7 @@ class PermissionListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Name"),
@ -97,7 +97,7 @@ class PermissionListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -107,7 +107,7 @@ class PermissionListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -126,7 +126,7 @@ class PermissionListPage extends BaseListPage {
...this.getColumnSearchProps("users"),
render: (text, record, index) => {
return Setting.getTags(text);
}
},
},
{
title: i18next.t("role:Sub roles"),
@ -137,7 +137,7 @@ class PermissionListPage extends BaseListPage {
...this.getColumnSearchProps("roles"),
render: (text, record, index) => {
return Setting.getTags(text);
}
},
},
{
title: i18next.t("permission:Resource type"),
@ -159,7 +159,7 @@ class PermissionListPage extends BaseListPage {
...this.getColumnSearchProps("resources"),
render: (text, record, index) => {
return Setting.getTags(text);
}
},
},
{
title: i18next.t("permission:Actions"),
@ -170,7 +170,7 @@ class PermissionListPage extends BaseListPage {
...this.getColumnSearchProps("actions"),
render: (text, record, index) => {
return Setting.getTags(text);
}
},
},
{
title: i18next.t("permission:Effect"),
@ -194,7 +194,7 @@ class PermissionListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -214,7 +214,7 @@ class PermissionListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -85,7 +85,7 @@ class ProductEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitProductEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteProduct()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
@ -110,7 +110,7 @@ class ProductEditPage extends React.Component {
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("product:Image"), i18next.t("product:Image - Tooltip"))} :
</Col>
<Col span={22} style={(Setting.isMobile()) ? {maxWidth: "100%"} :{}}>
<Col span={22} style={(Setting.isMobile()) ? {maxWidth: "100%"} : {}}>
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 1}>
{Setting.getLabel(i18next.t("general:URL"), i18next.t("general:URL - Tooltip"))} :

View File

@ -84,7 +84,7 @@ class ProductListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -94,7 +94,7 @@ class ProductListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -115,7 +115,7 @@ class ProductListPage extends BaseListPage {
<img src={text} alt={text} width={150} />
</a>
);
}
},
},
{
title: i18next.t("product:Tag"),
@ -240,7 +240,7 @@ class ProductListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -167,7 +167,7 @@ class ProviderEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitProviderEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteProvider()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Name"), i18next.t("general:Name - Tooltip"))} :
@ -269,7 +269,7 @@ class ProviderEditPage extends React.Component {
</Col>
</Row>
{
this.state.provider.type !== "WeCom" ? null : (
this.state.provider.type !== "WeCom" ? null : (
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={2}>
{Setting.getLabel(i18next.t("provider:Method"), i18next.t("provider:Method - Tooltip"))} :
@ -418,7 +418,7 @@ class ProviderEditPage extends React.Component {
)
}
{
this.state.provider.type !== "Adfs" && this.state.provider.type !== "Casdoor" && this.state.provider.type !== "Okta" ? null : (
this.state.provider.type !== "Adfs" && this.state.provider.type !== "Casdoor" && this.state.provider.type !== "Okta" ? null : (
<Row style={{marginTop: "20px"}} >
<Col style={{marginTop: "5px"}} span={2}>
{Setting.getLabel(i18next.t("provider:Domain"), i18next.t("provider:Domain - Tooltip"))} :

View File

@ -85,7 +85,7 @@ class ProviderListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -95,7 +95,7 @@ class ProviderListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -128,17 +128,17 @@ 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: "Email", value: "Email", children: Setting.getProviderTypeOptions("Email").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: "OAuth", value: "OAuth", children: Setting.getProviderTypeOptions("OAuth").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: "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};})},
],
sorter: true,
render: (text, record, index) => {
return Provider.getProviderLogoWidget(record);
}
},
},
{
title: i18next.t("provider:Client ID"),
@ -149,7 +149,7 @@ class ProviderListPage extends BaseListPage {
...this.getColumnSearchProps("clientId"),
render: (text, record, index) => {
return Setting.getShortText(text);
}
},
},
{
title: i18next.t("provider:Provider URL"),
@ -166,7 +166,7 @@ class ProviderListPage extends BaseListPage {
}
</a>
);
}
},
},
{
title: i18next.t("general:Action"),
@ -186,7 +186,7 @@ class ProviderListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -82,7 +82,7 @@ class ProviderTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("provider:Category"),
@ -92,7 +92,7 @@ class ProviderTable extends React.Component {
render: (text, record, index) => {
const provider = Setting.getArrayItem(this.props.providers, "name", record.name);
return provider?.category;
}
},
},
{
title: i18next.t("provider:Type"),
@ -102,7 +102,7 @@ class ProviderTable extends React.Component {
render: (text, record, index) => {
const provider = Setting.getArrayItem(this.props.providers, "name", record.name);
return Provider.getProviderLogoWidget(provider);
}
},
},
{
title: i18next.t("provider:canSignUp"),
@ -119,7 +119,7 @@ class ProviderTable extends React.Component {
this.updateField(table, index, "canSignUp", checked);
}} />
);
}
},
},
{
title: i18next.t("provider:canSignIn"),
@ -136,7 +136,7 @@ class ProviderTable extends React.Component {
this.updateField(table, index, "canSignIn", checked);
}} />
);
}
},
},
{
title: i18next.t("provider:canUnlink"),
@ -153,7 +153,7 @@ class ProviderTable extends React.Component {
this.updateField(table, index, "canUnlink", checked);
}} />
);
}
},
},
{
title: i18next.t("provider:prompted"),
@ -170,7 +170,7 @@ class ProviderTable extends React.Component {
this.updateField(table, index, "prompted", checked);
}} />
);
}
},
},
// {
// title: i18next.t("provider:alertType"),
@ -211,7 +211,7 @@ class ProviderTable extends React.Component {
</Tooltip>
</div>
);
}
},
},
];

View File

@ -32,7 +32,7 @@ class RecordListPage extends BaseListPage {
return {
owner: "built-in",
name: "1234",
id : "1234",
id: "1234",
clientIp: "::1",
timestamp: moment().format(),
organization: "built-in",
@ -74,7 +74,7 @@ class RecordListPage extends BaseListPage {
{text}
</a>
);
}
},
},
{
title: i18next.t("general:Timestamp"),
@ -84,7 +84,7 @@ class RecordListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Organization"),
@ -99,7 +99,7 @@ class RecordListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:User"),
@ -114,7 +114,7 @@ class RecordListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Method"),
@ -153,7 +153,7 @@ class RecordListPage extends BaseListPage {
fixed: (Setting.isMobile()) ? "false" : "right",
render: (text, record, index) => {
return text;
}
},
},
{
title: i18next.t("record:Is Triggered"),
@ -170,7 +170,7 @@ class RecordListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
];

View File

@ -99,7 +99,7 @@ class ResourceListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("resource:Application"),
@ -114,7 +114,7 @@ class ResourceListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("resource:User"),
@ -129,7 +129,7 @@ class ResourceListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("resource:Parent"),
@ -155,7 +155,7 @@ class ResourceListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("resource:Tag"),
@ -196,7 +196,7 @@ class ResourceListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFriendlyFileSize(text);
}
},
},
{
title: i18next.t("general:Preview"),
@ -219,7 +219,7 @@ class ResourceListPage extends BaseListPage {
</div>
);
}
}
},
},
{
title: i18next.t("general:URL"),
@ -238,7 +238,7 @@ class ResourceListPage extends BaseListPage {
</Button>
</div>
);
}
},
},
{
title: i18next.t("general:Action"),
@ -260,7 +260,7 @@ class ResourceListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -107,7 +107,7 @@ class RoleEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitRoleEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteRole()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :

View File

@ -77,7 +77,7 @@ class RoleListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Name"),
@ -93,7 +93,7 @@ class RoleListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -103,7 +103,7 @@ class RoleListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -122,7 +122,7 @@ class RoleListPage extends BaseListPage {
...this.getColumnSearchProps("users"),
render: (text, record, index) => {
return Setting.getTags(text);
}
},
},
{
title: i18next.t("role:Sub roles"),
@ -133,7 +133,7 @@ class RoleListPage extends BaseListPage {
...this.getColumnSearchProps("roles"),
render: (text, record, index) => {
return Setting.getTags(text);
}
},
},
{
title: i18next.t("general:Is enabled"),
@ -145,7 +145,7 @@ class RoleListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -165,7 +165,7 @@ class RoleListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -75,35 +75,35 @@ export const OtherProviderInfo = {
},
"Azure Blob": {
logo: `${StaticBaseUrl}/img/social_azure.jpg`,
url: "https://azure.microsoft.com/en-us/services/storage/blobs/"
}
url: "https://azure.microsoft.com/en-us/services/storage/blobs/",
},
},
SAML: {
"Aliyun IDaaS": {
logo: `${StaticBaseUrl}/img/social_aliyun.png`,
url: "https://aliyun.com/product/idaas"
url: "https://aliyun.com/product/idaas",
},
"Keycloak": {
logo: `${StaticBaseUrl}/img/social_keycloak.png`,
url: "https://www.keycloak.org/"
url: "https://www.keycloak.org/",
},
},
Payment: {
"Alipay": {
logo: `${StaticBaseUrl}/img/payment_alipay.png`,
url: "https://www.alipay.com/"
url: "https://www.alipay.com/",
},
"WeChat Pay": {
logo: `${StaticBaseUrl}/img/payment_wechat_pay.png`,
url: "https://pay.weixin.qq.com/"
url: "https://pay.weixin.qq.com/",
},
"PayPal": {
logo: `${StaticBaseUrl}/img/payment_paypal.png`,
url: "https://www.paypal.com/"
url: "https://www.paypal.com/",
},
"GC": {
logo: `${StaticBaseUrl}/img/payment_gc.png`,
url: "https://gc.org"
url: "https://gc.org",
},
},
Captcha: {
@ -126,8 +126,8 @@ export const OtherProviderInfo = {
"GEETEST": {
logo: `${StaticBaseUrl}/img/social_geetest.png`,
url: "https://www.geetest.com",
}
}
},
},
};
export function getCountryRegionData() {
@ -140,7 +140,7 @@ export function getCountryRegionData() {
countries.registerLocale(require("i18n-iso-countries/langs/" + language + ".json"));
var data = countries.getNames(language, {select: "official"});
var result = [];
for (var i in data) {result.push({code:i, name:data[i]});}
for (var i in data) {result.push({code: i, name: data[i]});}
return result;
}
@ -305,7 +305,7 @@ export function isPromptAnswered(user, application) {
}
const providerItems = getAllPromptedProviderItems(application);
for (let i = 0; i < providerItems.length; i ++) {
for (let i = 0; i < providerItems.length; i++) {
if (!isProviderItemAnswered(user, application, providerItems[i])) {
return false;
}
@ -432,7 +432,7 @@ export function getShortName(s) {
return s.split("/").slice(-1)[0];
}
export function getShortText(s, maxLength=35) {
export function getShortText(s, maxLength = 35) {
if (s.length > maxLength) {
return `${s.slice(0, maxLength)}...`;
} else {
@ -449,13 +449,13 @@ export function getFriendlyFileSize(size) {
let num = (size / Math.pow(1024, i));
let round = Math.round(num);
num = round < 10 ? num.toFixed(2) : round < 100 ? num.toFixed(1) : round;
return `${num} ${"KMGTPEZY"[i-1]}B`;
return `${num} ${"KMGTPEZY"[i - 1]}B`;
}
function getRandomInt(s) {
let hash = 0;
if (s.length !== 0) {
for (let i = 0; i < s.length; i ++) {
for (let i = 0; i < s.length; i++) {
let char = s.charCodeAt(i);
hash = ((hash << 5) - hash) + char;
hash = hash & hash;
@ -598,7 +598,7 @@ export function getProviderTypeOptions(category) {
{id: "AWS S3", name: "AWS S3"},
{id: "Aliyun OSS", name: "Aliyun OSS"},
{id: "Tencent Cloud COS", name: "Tencent Cloud COS"},
{id: "Azure Blob", name: "Azure Blob"}
{id: "Azure Blob", name: "Azure Blob"},
]
);
} else if (category === "SAML") {
@ -723,7 +723,7 @@ export function goToForget(ths, application) {
}
export function renderHelmet(application) {
if (application === undefined || application === null || application.organizationObj === undefined || application.organizationObj === null ||application.organizationObj === "") {
if (application === undefined || application === null || application.organizationObj === undefined || application.organizationObj === null || application.organizationObj === "") {
return null;
}
@ -791,7 +791,7 @@ export function getDeduplicatedArray(array, filterArray, key) {
export function getNewRowNameForTable(table, rowName) {
const emptyCount = table.filter(row => row.name.includes(rowName)).length;
let res = rowName;
for (let i = 0; i < emptyCount; i ++) {
for (let i = 0; i < emptyCount; i++) {
res = res + " ";
}
return res;
@ -852,86 +852,86 @@ export function getSyncerTableColumns(syncer) {
case "Keycloak":
return [
{
"name":"ID",
"type":"string",
"casdoorName":"Id",
"isHashed":true,
"values":[
"name": "ID",
"type": "string",
"casdoorName": "Id",
"isHashed": true,
"values": [
]
],
},
{
"name":"USERNAME",
"type":"string",
"casdoorName":"Name",
"isHashed":true,
"values":[
"name": "USERNAME",
"type": "string",
"casdoorName": "Name",
"isHashed": true,
"values": [
]
],
},
{
"name":"LAST_NAME+FIRST_NAME",
"type":"string",
"casdoorName":"DisplayName",
"isHashed":true,
"values":[
"name": "LAST_NAME+FIRST_NAME",
"type": "string",
"casdoorName": "DisplayName",
"isHashed": true,
"values": [
]
],
},
{
"name":"EMAIL",
"type":"string",
"casdoorName":"Email",
"isHashed":true,
"values":[
"name": "EMAIL",
"type": "string",
"casdoorName": "Email",
"isHashed": true,
"values": [
]
],
},
{
"name":"EMAIL_VERIFIED",
"type":"boolean",
"casdoorName":"EmailVerified",
"isHashed":true,
"values":[
"name": "EMAIL_VERIFIED",
"type": "boolean",
"casdoorName": "EmailVerified",
"isHashed": true,
"values": [
]
],
},
{
"name":"FIRST_NAME",
"type":"string",
"casdoorName":"FirstName",
"isHashed":true,
"values":[
"name": "FIRST_NAME",
"type": "string",
"casdoorName": "FirstName",
"isHashed": true,
"values": [
]
],
},
{
"name":"LAST_NAME",
"type":"string",
"casdoorName":"LastName",
"isHashed":true,
"values":[
"name": "LAST_NAME",
"type": "string",
"casdoorName": "LastName",
"isHashed": true,
"values": [
]
],
},
{
"name":"CREATED_TIMESTAMP",
"type":"string",
"casdoorName":"CreatedTime",
"isHashed":true,
"values":[
"name": "CREATED_TIMESTAMP",
"type": "string",
"casdoorName": "CreatedTime",
"isHashed": true,
"values": [
]
],
},
{
"name":"ENABLED",
"type":"boolean",
"casdoorName":"IsForbidden",
"isHashed":true,
"values":[
"name": "ENABLED",
"type": "boolean",
"casdoorName": "IsForbidden",
"isHashed": true,
"values": [
]
}
],
},
];
default:
return [];

View File

@ -101,7 +101,7 @@ class SignupTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("provider:visible"),
@ -123,7 +123,7 @@ class SignupTable extends React.Component {
}
}} />
);
}
},
},
{
title: i18next.t("provider:required"),
@ -140,7 +140,7 @@ class SignupTable extends React.Component {
this.updateField(table, index, "required", checked);
}} />
);
}
},
},
{
title: i18next.t("provider:prompted"),
@ -161,7 +161,7 @@ class SignupTable extends React.Component {
this.updateField(table, index, "prompted", checked);
}} />
);
}
},
},
{
title: i18next.t("application:rule"),
@ -201,7 +201,7 @@ class SignupTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("general:Action"),
@ -221,7 +221,7 @@ class SignupTable extends React.Component {
</Tooltip>
</div>
);
}
},
},
];

View File

@ -89,7 +89,7 @@ class SyncerEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitSyncerEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteSyncer()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :

View File

@ -101,7 +101,7 @@ class SyncerListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Name"),
@ -117,7 +117,7 @@ class SyncerListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -127,7 +127,7 @@ class SyncerListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("provider:Type"),
@ -212,7 +212,7 @@ class SyncerListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -233,7 +233,7 @@ class SyncerListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -73,7 +73,7 @@ class SyncerTableColumnTable extends React.Component {
this.updateField(table, index, "name", e.target.value);
}} />
);
}
},
},
{
title: i18next.t("syncer:Column type"),
@ -88,7 +88,7 @@ class SyncerTableColumnTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("syncer:Casdoor column"),
@ -105,7 +105,7 @@ class SyncerTableColumnTable extends React.Component {
}
</Select>
);
}
},
},
{
title: i18next.t("syncer:Is hashed"),
@ -117,7 +117,7 @@ class SyncerTableColumnTable extends React.Component {
this.updateField(table, index, "isHashed", checked);
}} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -137,7 +137,7 @@ class SyncerTableColumnTable extends React.Component {
</Tooltip>
</div>
);
}
},
},
];

View File

@ -54,6 +54,6 @@ function testEmailProvider(provider, email = "") {
return fetch(`${Setting.ServerUrl}/api/send-email`, {
method: "POST",
credentials: "include",
body: JSON.stringify(emailForm)
body: JSON.stringify(emailForm),
}).then(res => res.json());
}

View File

@ -68,7 +68,7 @@ class TokenEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitTokenEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteToken()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{i18next.t("general:Name")}:

View File

@ -81,7 +81,7 @@ class TokenListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -91,7 +91,7 @@ class TokenListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Application"),
@ -106,7 +106,7 @@ class TokenListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Organization"),
@ -121,7 +121,7 @@ class TokenListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:User"),
@ -136,7 +136,7 @@ class TokenListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("token:Authorization code"),
@ -147,7 +147,7 @@ class TokenListPage extends BaseListPage {
...this.getColumnSearchProps("code"),
render: (text, record, index) => {
return Setting.getClickable(text);
}
},
},
{
title: i18next.t("token:Access token"),
@ -159,7 +159,7 @@ class TokenListPage extends BaseListPage {
...this.getColumnSearchProps("accessToken"),
render: (text, record, index) => {
return Setting.getClickable(text);
}
},
},
{
title: i18next.t("token:Expires in"),
@ -202,7 +202,7 @@ class TokenListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -71,7 +71,7 @@ class UrlTable extends React.Component {
this.updateField(table, index, e.target.value);
}} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -91,7 +91,7 @@ class UrlTable extends React.Component {
</Tooltip>
</div>
);
}
},
},
];

View File

@ -567,7 +567,7 @@ class UserEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitUserEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteUser()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
{
this.state.application?.organizationObj.accountItems?.map(accountItem => {
return (

View File

@ -152,7 +152,7 @@ class UserListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Application"),
@ -168,7 +168,7 @@ class UserListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Name"),
@ -184,7 +184,7 @@ class UserListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -194,7 +194,7 @@ class UserListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("general:Display name"),
@ -215,7 +215,7 @@ class UserListPage extends BaseListPage {
<img src={text} alt={text} width={50} />
</a>
);
}
},
},
{
title: i18next.t("general:Email"),
@ -230,7 +230,7 @@ class UserListPage extends BaseListPage {
{text}
</a>
);
}
},
},
{
title: i18next.t("general:Phone"),
@ -281,7 +281,7 @@ class UserListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("user:Is global admin"),
@ -293,7 +293,7 @@ class UserListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("user:Is forbidden"),
@ -305,7 +305,7 @@ class UserListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("user:Is deleted"),
@ -317,7 +317,7 @@ class UserListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -337,7 +337,7 @@ class UserListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -35,8 +35,8 @@ class WebAuthnCredentialTable extends React.Component {
{i18next.t("general:Delete")}
</Button>
);
}
}
},
},
];
return (

View File

@ -84,8 +84,8 @@ const userTemplate = {
"phoneVerifiedTime": "",
"renameQuota": "3",
"tagline": "",
"website": ""
}
"website": "",
},
};
class WebhookEditPage extends React.Component {
@ -155,7 +155,7 @@ class WebhookEditPage extends React.Component {
<Button style={{marginLeft: "20px"}} type="primary" onClick={() => this.submitWebhookEdit(true)}>{i18next.t("general:Save & Exit")}</Button>
{this.state.mode === "add" ? <Button style={{marginLeft: "20px"}} onClick={() => this.deleteWebhook()}>{i18next.t("general:Cancel")}</Button> : null}
</div>
} style={(Setting.isMobile())? {margin: "5px"}:{}} type="inner">
} style={(Setting.isMobile()) ? {margin: "5px"} : {}} type="inner">
<Row style={{marginTop: "10px"}} >
<Col style={{marginTop: "5px"}} span={(Setting.isMobile()) ? 22 : 2}>
{Setting.getLabel(i18next.t("general:Organization"), i18next.t("general:Organization - Tooltip"))} :

View File

@ -72,7 +72,7 @@ class WebhookHeaderTable extends React.Component {
this.updateField(table, index, "name", e.target.value);
}} />
);
}
},
},
{
title: i18next.t("webhook:Value"),
@ -84,7 +84,7 @@ class WebhookHeaderTable extends React.Component {
this.updateField(table, index, "value", e.target.value);
}} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -104,7 +104,7 @@ class WebhookHeaderTable extends React.Component {
</Tooltip>
</div>
);
}
},
},
];

View File

@ -80,7 +80,7 @@ class WebhookListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Name"),
@ -96,7 +96,7 @@ class WebhookListPage extends BaseListPage {
{text}
</Link>
);
}
},
},
{
title: i18next.t("general:Created time"),
@ -106,7 +106,7 @@ class WebhookListPage extends BaseListPage {
sorter: true,
render: (text, record, index) => {
return Setting.getFormattedDate(text);
}
},
},
{
title: i18next.t("webhook:URL"),
@ -123,7 +123,7 @@ class WebhookListPage extends BaseListPage {
}
</a>
);
}
},
},
{
title: i18next.t("webhook:Method"),
@ -143,7 +143,7 @@ class WebhookListPage extends BaseListPage {
filters: [
{text: "application/json", value: "application/json"},
{text: "application/x-www-form-urlencoded", value: "application/x-www-form-urlencoded"},
]
],
},
{
title: i18next.t("webhook:Events"),
@ -154,7 +154,7 @@ class WebhookListPage extends BaseListPage {
...this.getColumnSearchProps("events"),
render: (text, record, index) => {
return Setting.getTags(text);
}
},
},
{
title: i18next.t("webhook:Is user extended"),
@ -166,7 +166,7 @@ class WebhookListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Is enabled"),
@ -178,7 +178,7 @@ class WebhookListPage extends BaseListPage {
return (
<Switch disabled checkedChildren="ON" unCheckedChildren="OFF" checked={text} />
);
}
},
},
{
title: i18next.t("general:Action"),
@ -198,7 +198,7 @@ class WebhookListPage extends BaseListPage {
</Popconfirm>
</div>
);
}
},
},
];

View File

@ -17,7 +17,7 @@ import {authConfig} from "./Auth";
export function getAccount(query) {
return fetch(`${authConfig.serverUrl}/api/get-account${query}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -96,7 +96,7 @@ class ForgetPage extends React.Component {
AuthBackend.getEmailAndPhone({
application: forms.step1.getFieldValue("application"),
organization: forms.step1.getFieldValue("organization"),
username: username
username: username,
}).then((res) => {
if (res.status === "ok") {
const phone = res.data.phone;
@ -147,7 +147,7 @@ class ForgetPage extends React.Component {
name: this.state.name,
code: forms.step2.getFieldValue("emailCode"),
phonePrefix: this.state.application?.organizationObj.phonePrefix,
type: "login"
type: "login",
}, oAuthParams).then(res => {
if (res.status === "ok") {
this.setState({current: 2, userId: res.data, username: res.data.split("/")[1]});
@ -468,7 +468,7 @@ class ForgetPage extends React.Component {
</Form.Item>
<br />
<Form.Item hidden={this.state.current !== 2}>
<Button block type="primary" htmlType="submit" disabled={this.state.userId === ""}>
<Button block type="primary" htmlType="submit" disabled={this.state.userId === ""}>
{i18next.t("forget:Change Password")}
</Button>
</Form.Item>

View File

@ -37,7 +37,7 @@ class LoginPage extends React.Component {
classes: props,
type: props.type,
applicationName: props.applicationName !== undefined ? props.applicationName : (props.match === undefined ? null : props.match.params.applicationName),
owner : props.owner !== undefined ? props.owner : (props.match === undefined ? null : props.match.params.owner),
owner: props.owner !== undefined ? props.owner : (props.match === undefined ? null : props.match.params.owner),
application: null,
mode: props.mode !== undefined ? props.mode : (props.match === undefined ? null : props.match.params.mode), // "signup" or "signin"
isCodeSignin: false,
@ -46,7 +46,7 @@ class LoginPage extends React.Component {
validEmailOrPhone: false,
validEmail: false,
validPhone: false,
loginMethod: "password"
loginMethod: "password",
};
if (this.state.type === "cas" && props.match?.params.casApplicationName !== undefined) {
@ -291,7 +291,7 @@ class LoginPage extends React.Component {
<Button type="primary" key="signin">
Sign In
</Button>
</Link>
</Link>,
]}
>
</Result>
@ -339,7 +339,7 @@ class LoginPage extends React.Component {
rules={[
{
required: true,
message: i18next.t("login:Please input your username, Email or phone!")
message: i18next.t("login:Please input your username, Email or phone!"),
},
{
validator: (_, value) => {
@ -359,8 +359,8 @@ class LoginPage extends React.Component {
this.setState({validEmailOrPhone: true});
return Promise.resolve();
}
}
},
},
]}
>
<Input
@ -403,14 +403,14 @@ class LoginPage extends React.Component {
</Button>
) :
(
<Button
type="primary"
htmlType="submit"
style={{width: "100%", marginBottom: "5px"}}
disabled={!application.enablePassword}
>
{i18next.t("login:Sign in with WebAuthn")}
</Button>
<Button
type="primary"
htmlType="submit"
style={{width: "100%", marginBottom: "5px"}}
disabled={!application.enablePassword}
>
{i18next.t("login:Sign in with WebAuthn")}
</Button>
)
}
{
@ -557,7 +557,7 @@ class LoginPage extends React.Component {
let application = this.getApplicationObj();
return fetch(`${Setting.ServerUrl}/api/webauthn/signin/begin?owner=${application.organization}&name=${username}`, {
method: "GET",
credentials: "include"
credentials: "include",
})
.then(res => res.json())
.then((credentialRequestOptions) => {
@ -572,7 +572,7 @@ class LoginPage extends React.Component {
});
return navigator.credentials.get({
publicKey: credentialRequestOptions.publicKey
publicKey: credentialRequestOptions.publicKey,
});
})
.then((assertion) => {
@ -594,7 +594,7 @@ class LoginPage extends React.Component {
signature: UserWebauthnBackend.webAuthnBufferEncode(sig),
userHandle: UserWebauthnBackend.webAuthnBufferEncode(userHandle),
},
})
}),
})
.then(res => res.json()).then((res) => {
if (res.msg === "") {

View File

@ -202,7 +202,7 @@ class PromptPage extends React.Component {
Setting.goToLogin(this, application);
}}>
Sign In
</Button>
</Button>,
]}
>
</Result>

View File

@ -34,7 +34,7 @@ const authInfo = {
scope: "snsapi_login",
endpoint: "https://open.weixin.qq.com/connect/qrconnect",
mpScope: "snsapi_userinfo",
mpEndpoint: "https://open.weixin.qq.com/connect/oauth2/authorize"
mpEndpoint: "https://open.weixin.qq.com/connect/oauth2/authorize",
},
WeChatMiniProgram: {
endpoint: "https://mp.weixin.qq.com/",
@ -119,8 +119,8 @@ const authInfo = {
endpoint: "https://example.com/",
},
Bilibili: {
endpoint: "https://passport.bilibili.com/register/pc_oauth2.html"
}
endpoint: "https://passport.bilibili.com/register/pc_oauth2.html",
},
};
export function getProviderUrl(provider) {

View File

@ -73,7 +73,7 @@ class ResultPage extends React.Component {
}
}}>
{i18next.t("login:Sign In")}
</Button>
</Button>,
]}
/>
</div>

View File

@ -340,8 +340,8 @@ class SignupPage extends React.Component {
this.setState({validEmail: true});
return Promise.resolve();
}
}
},
},
]}
>
<Input onChange={e => this.setState({email: e.target.value})} />
@ -386,8 +386,8 @@ class SignupPage extends React.Component {
this.setState({validPhone: true});
return Promise.resolve();
}
}
},
},
]}
>
<Input
@ -530,7 +530,7 @@ class SignupPage extends React.Component {
Setting.goToLogin(this, application);
}}>
Sign In
</Button>
</Button>,
]}
>
</Result>
@ -617,7 +617,7 @@ class SignupPage extends React.Component {
<CustomGithubCorner />
&nbsp;
<Row>
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
<div style={{marginTop: "10px", textAlign: "center"}}>
{
Setting.renderHelmet(application)

View File

@ -76,7 +76,7 @@ export function renderMessageLarge(ths, msg) {
}
function getRefinedValue(value) {
return (value === null)? "" : value;
return (value === null) ? "" : value;
}
export function getCasParameters(params) {

View File

@ -17,28 +17,28 @@ import * as Setting from "../Setting";
export function getApplications(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-applications?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getApplicationsByOrganization(owner, organization) {
return fetch(`${Setting.ServerUrl}/api/get-applications?owner=${owner}&organization=${organization}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getApplication(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-application?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getUserApplication(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-user-application?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
@ -73,6 +73,6 @@ export function deleteApplication(application) {
export function getSamlMetadata(owner, name) {
return fetch(`${Setting.ServerUrl}/api/saml/metadata?application=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.text());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getCerts(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-certs?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getCert(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-cert?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getModels(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-models?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getModel(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-model?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getOrganizations(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-organizations?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getOrganization(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-organization?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getPayments(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-payments?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getPayment(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-payment?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
@ -58,6 +58,6 @@ export function deletePayment(payment) {
export function invoicePayment(owner, name) {
return fetch(`${Setting.ServerUrl}/api/invoice-payment?id=${owner}/${encodeURIComponent(name)}`, {
method: "POST",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getPermissions(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-permissions?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getPermission(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-permission?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getProducts(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-products?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getProduct(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-product?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getProviders(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-providers?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getProvider(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-provider?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,6 +17,6 @@ import * as Setting from "../Setting";
export function getRecords(page, pageSize, field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-records?pageSize=${pageSize}&p=${page}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getResources(owner, user, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-resources?owner=${owner}&user=${user}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getResource(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-resource?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
@ -46,7 +46,7 @@ export function addResource(resource) {
}).then(res => res.json());
}
export function deleteResource(resource, provider="") {
export function deleteResource(resource, provider = "") {
let newResource = Setting.deepCopy(resource);
return fetch(`${Setting.ServerUrl}/api/delete-resource?provider=${provider}`, {
method: "POST",
@ -55,7 +55,7 @@ export function deleteResource(resource, provider="") {
}).then(res => res.json());
}
export function uploadResource(owner, user, tag, parent, fullFilePath, file, provider="") {
export function uploadResource(owner, user, tag, parent, fullFilePath, file, provider = "") {
const application = "app-built-in";
let formData = new FormData();
formData.append("file", file);

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getRoles(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-roles?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getRole(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-role?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getSyncers(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-syncers?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getSyncer(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-syncer?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getTokens(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-tokens?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getToken(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-token?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -18,21 +18,21 @@ import i18next from "i18next";
export function getGlobalUsers(page, pageSize, field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-global-users?p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getUsers(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-users?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getUser(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-user?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
@ -84,7 +84,7 @@ export function setPassword(userOwner, userName, oldPassword, newPassword) {
return fetch(`${Setting.ServerUrl}/api/set-password`, {
method: "POST",
credentials: "include",
body: formData
body: formData,
}).then(res => res.json());
}
@ -100,7 +100,7 @@ export function sendCode(checkType, checkId, checkKey, dest, type, applicationId
return fetch(`${Setting.ServerUrl}/api/send-verification-code`, {
method: "POST",
credentials: "include",
body: formData
body: formData,
}).then(res => res.json()).then(res => {
if (res.status === "ok") {
Setting.showMessage("success", i18next.t("user:Code Sent"));
@ -120,7 +120,7 @@ export function verifyCaptcha(captchaType, captchaToken, clientSecret) {
return fetch(`${Setting.ServerUrl}/api/verify-captcha`, {
method: "POST",
credentials: "include",
body: formData
body: formData,
}).then(res => res.json()).then(res => {
if (res.status === "ok") {
if (res.data) {
@ -144,12 +144,12 @@ export function resetEmailOrPhone(dest, type, code) {
return fetch(`${Setting.ServerUrl}/api/reset-email-or-phone`, {
method: "POST",
credentials: "include",
body: formData
body: formData,
}).then(res => res.json());
}
export function getCaptcha(owner, name, isCurrentProvider) {
return fetch(`${Setting.ServerUrl}/api/get-captcha?applicationId=${owner}/${encodeURIComponent(name)}&isCurrentProvider=${isCurrentProvider}`, {
method: "GET"
method: "GET",
}).then(res => res.json()).then(res => res.data);
}

View File

@ -17,7 +17,7 @@ import * as Setting from "../Setting";
export function registerWebauthnCredential() {
return fetch(`${Setting.ServerUrl}/api/webauthn/signup/begin`, {
method: "GET",
credentials: "include"
credentials: "include",
})
.then(res => res.json())
.then((credentialCreationOptions) => {
@ -29,7 +29,7 @@ export function registerWebauthnCredential() {
}
}
return navigator.credentials.create({
publicKey: credentialCreationOptions.publicKey
publicKey: credentialCreationOptions.publicKey,
});
})
.then((credential) => {
@ -47,7 +47,7 @@ export function registerWebauthnCredential() {
attestationObject: webAuthnBufferEncode(attestationObject),
clientDataJSON: webAuthnBufferEncode(clientDataJSON),
},
})
}),
})
.then(res => res.json());
});
@ -61,7 +61,7 @@ export function deleteUserWebAuthnCredential(credentialID) {
method: "POST",
credentials: "include",
body: form,
dataType: "text"
dataType: "text",
}).then(res => res.json());
}

View File

@ -17,14 +17,14 @@ import * as Setting from "../Setting";
export function getWebhooks(owner, page = "", pageSize = "", field = "", value = "", sortField = "", sortOrder = "") {
return fetch(`${Setting.ServerUrl}/api/get-webhooks?owner=${owner}&p=${page}&pageSize=${pageSize}&field=${field}&value=${value}&sortField=${sortField}&sortOrder=${sortOrder}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}
export function getWebhook(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-webhook?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",
credentials: "include"
credentials: "include",
}).then(res => res.json());
}

View File

@ -51,7 +51,7 @@ class HomePage extends React.Component {
{link: "/applications", name: i18next.t("general:Applications"), organizer: i18next.t("general:Applications that require authentication")},
];
for (let i = 0; i < items.length; i ++) {
for (let i = 0; i < items.length; i++) {
let filename = items[i].link;
if (filename === "/account") {
filename = "/users";
@ -111,7 +111,7 @@ class HomePage extends React.Component {
return (
<div>
<Row style={{width: "100%"}}>
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
<Col span={24} style={{display: "flex", justifyContent: "center"}} >
{
this.renderCards()
}

View File

@ -88,8 +88,8 @@ export const CaptchaWidget = ({captchaType, subType, siteKey, clientSecret, onCh
if (window.initGeetest4 && siteKey && !getLock) {
const captchaId = String(siteKey);
window.initGeetest4({
captchaId,
product: "float",
captchaId,
product: "float",
}, function(captchaObj) {
if (!getLock) {
captchaObj.appendTo("#captcha");

View File

@ -104,7 +104,7 @@ export const CountDownInput = (props) => {
width: "200px",
borderRadius: "3px",
border: "1px solid #ccc",
marginBottom: 10
marginBottom: 10,
}}
/>
<Row>