mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 02:35:49 +08:00
Add providers to app.
This commit is contained in:
parent
84c1f2634e
commit
b13ec27981
@ -1,8 +1,11 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import {Button, Card, Col, Input, Row} from 'antd';
|
import {Button, Card, Col, Input, Row, Select} 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";
|
||||||
|
import * as ProviderBackend from "./backend/ProviderBackend";
|
||||||
|
|
||||||
|
const { Option } = Select;
|
||||||
|
|
||||||
class ApplicationEditPage extends React.Component {
|
class ApplicationEditPage extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -11,13 +14,13 @@ class ApplicationEditPage extends React.Component {
|
|||||||
classes: props,
|
classes: props,
|
||||||
applicationName: props.match.params.applicationName,
|
applicationName: props.match.params.applicationName,
|
||||||
application: null,
|
application: null,
|
||||||
tasks: [],
|
providers: [],
|
||||||
resources: [],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillMount() {
|
componentWillMount() {
|
||||||
this.getApplication();
|
this.getApplication();
|
||||||
|
this.getProviders();
|
||||||
}
|
}
|
||||||
|
|
||||||
getApplication() {
|
getApplication() {
|
||||||
@ -29,6 +32,15 @@ class ApplicationEditPage extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getProviders() {
|
||||||
|
ProviderBackend.getProviders("admin")
|
||||||
|
.then((res) => {
|
||||||
|
this.setState({
|
||||||
|
providers: res,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
parseApplicationField(key, value) {
|
parseApplicationField(key, value) {
|
||||||
// if ([].includes(key)) {
|
// if ([].includes(key)) {
|
||||||
// value = Setting.myParseInt(value);
|
// value = Setting.myParseInt(value);
|
||||||
@ -79,9 +91,15 @@ class ApplicationEditPage extends React.Component {
|
|||||||
Providers:
|
Providers:
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Input value={this.state.application.providers} onChange={e => {
|
<Select mode="tags" style={{width: '100%'}}
|
||||||
this.updateApplicationField('providers', e.target.value);
|
value={this.state.application.providers}
|
||||||
}} />
|
onChange={value => {
|
||||||
|
this.updateApplicationField('providers', value);
|
||||||
|
}} >
|
||||||
|
{
|
||||||
|
this.state.providers.map((provider, index) => <Option key={index} value={provider.name}>{provider.name}</Option>)
|
||||||
|
}
|
||||||
|
</Select>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -100,7 +100,7 @@ class ApplicationListPage extends React.Component {
|
|||||||
title: 'Providers',
|
title: 'Providers',
|
||||||
dataIndex: 'providers',
|
dataIndex: 'providers',
|
||||||
key: 'providers',
|
key: 'providers',
|
||||||
width: '150px',
|
width: '300px',
|
||||||
sorter: (a, b) => a.providers.localeCompare(b.providers),
|
sorter: (a, b) => a.providers.localeCompare(b.providers),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -11,8 +11,6 @@ class OrganizationEditPage extends React.Component {
|
|||||||
classes: props,
|
classes: props,
|
||||||
organizationName: props.match.params.organizationName,
|
organizationName: props.match.params.organizationName,
|
||||||
organization: null,
|
organization: null,
|
||||||
tasks: [],
|
|
||||||
resources: [],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,6 @@ class ProviderEditPage extends React.Component {
|
|||||||
classes: props,
|
classes: props,
|
||||||
providerName: props.match.params.providerName,
|
providerName: props.match.params.providerName,
|
||||||
provider: null,
|
provider: null,
|
||||||
tasks: [],
|
|
||||||
resources: [],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,8 +11,6 @@ class UserEditPage extends React.Component {
|
|||||||
classes: props,
|
classes: props,
|
||||||
userName: props.match.params.userName,
|
userName: props.match.params.userName,
|
||||||
user: null,
|
user: null,
|
||||||
tasks: [],
|
|
||||||
resources: [],
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user