mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-22 18:25:47 +08:00
Add app's EnablePassword.
This commit is contained in:
parent
8543d09d05
commit
4b66c24bb6
@ -27,6 +27,7 @@ type Application struct {
|
||||
DisplayName string `xorm:"varchar(100)" json:"displayName"`
|
||||
Logo string `xorm:"varchar(100)" json:"logo"`
|
||||
Organization string `xorm:"varchar(100)" json:"organization"`
|
||||
EnablePassword bool `json:"enablePassword"`
|
||||
Providers []string `xorm:"varchar(100)" json:"providers"`
|
||||
ProviderObjs []*Provider `xorm:"-" json:"providerObjs"`
|
||||
}
|
||||
|
@ -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 ApplicationBackend from "./backend/ApplicationBackend";
|
||||
import * as Setting from "./Setting";
|
||||
@ -152,6 +152,16 @@ class ApplicationEditPage extends React.Component {
|
||||
</Select>
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: '20px'}} >
|
||||
<Col style={{marginTop: '5px'}} span={2}>
|
||||
Enable Password:
|
||||
</Col>
|
||||
<Col span={1} >
|
||||
{
|
||||
<Switch checked={this.state.application.enablePassword} onChange={(checked => {this.updateApplicationField('enablePassword', checked);})} />
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
<Row style={{marginTop: '20px'}} >
|
||||
<Col style={{marginTop: '5px'}} span={2}>
|
||||
Providers:
|
||||
|
@ -48,6 +48,7 @@ class ApplicationListPage extends React.Component {
|
||||
createdTime: moment().format(),
|
||||
displayName: `New Application - ${this.state.applications.length}`,
|
||||
logo: "https://cdn.jsdelivr.net/gh/casbin/static/img/logo@2x.png",
|
||||
EnablePassword: true,
|
||||
providers: [],
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ class Face extends React.Component {
|
||||
<Input
|
||||
prefix={<UserOutlined className="site-form-item-icon" />}
|
||||
placeholder="username"
|
||||
disabled={!this.getApplicationObj().enablePassword}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
@ -97,11 +98,14 @@ class Face extends React.Component {
|
||||
prefix={<LockOutlined className="site-form-item-icon" />}
|
||||
type="password"
|
||||
placeholder="password"
|
||||
disabled={!this.getApplicationObj().enablePassword}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item>
|
||||
<Form.Item name="remember" valuePropName="checked" noStyle>
|
||||
<Checkbox style={{float: "left"}}>Auto login</Checkbox>
|
||||
<Checkbox style={{float: "left"}} disabled={!this.getApplicationObj().enablePassword}>
|
||||
Auto login
|
||||
</Checkbox>
|
||||
</Form.Item>
|
||||
<a style={{float: "right"}} href="">
|
||||
Forgot password?
|
||||
@ -113,6 +117,7 @@ class Face extends React.Component {
|
||||
type="primary"
|
||||
htmlType="submit"
|
||||
style={{width: "100%"}}
|
||||
disabled={!this.getApplicationObj().enablePassword}
|
||||
>
|
||||
Login
|
||||
</Button>
|
||||
|
Loading…
x
Reference in New Issue
Block a user