mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-24 08:20:31 +08:00
Add Custom to resourceType
This commit is contained in:
parent
cc566bf31f
commit
05703720c5
@ -264,10 +264,12 @@ class PermissionEditPage extends React.Component {
|
|||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} style={{width: "100%"}} value={this.state.permission.resourceType} onChange={(value => {
|
<Select virtual={false} style={{width: "100%"}} value={this.state.permission.resourceType} onChange={(value => {
|
||||||
this.updatePermissionField("resourceType", value);
|
this.updatePermissionField("resourceType", value);
|
||||||
|
this.updatePermissionField("resources", []);
|
||||||
})}
|
})}
|
||||||
options={[
|
options={[
|
||||||
{value: "Application", name: i18next.t("general:Application")},
|
{value: "Application", name: i18next.t("general:Application")},
|
||||||
{value: "TreeNode", name: i18next.t("permission:TreeNode")},
|
{value: "TreeNode", name: i18next.t("permission:TreeNode")},
|
||||||
|
{value: "Custom", name: i18next.t("general:Custom")},
|
||||||
].map((item) => Setting.getOption(item.name, item.value))}
|
].map((item) => Setting.getOption(item.name, item.value))}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
@ -277,7 +279,7 @@ class PermissionEditPage extends React.Component {
|
|||||||
{Setting.getLabel(i18next.t("general:Resources"), i18next.t("permission:Resources - Tooltip"))} :
|
{Setting.getLabel(i18next.t("general:Resources"), i18next.t("permission:Resources - Tooltip"))} :
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={22} >
|
<Col span={22} >
|
||||||
<Select virtual={false} mode="multiple" style={{width: "100%"}} value={this.state.permission.resources}
|
<Select virtual={false} mode={(this.state.permission.resourceType === "Custom") ? "tags" : "multiple"} style={{width: "100%"}} value={this.state.permission.resources}
|
||||||
onChange={(value => {this.updatePermissionField("resources", value);})}
|
onChange={(value => {this.updatePermissionField("resources", value);})}
|
||||||
options={this.state.resources.map((resource) => Setting.getOption(`${resource.name}`, `${resource.name}`))
|
options={this.state.resources.map((resource) => Setting.getOption(`${resource.name}`, `${resource.name}`))
|
||||||
} />
|
} />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user