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