mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-09 01:13:41 +08:00
feat: add AiAssistantUrl to frontend config (#3385)
This commit is contained in:
@ -308,7 +308,7 @@ class App extends Component {
|
|||||||
AI Assistant
|
AI Assistant
|
||||||
</a>
|
</a>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<a className="custom-link" style={{float: "right", marginTop: "2px"}} target="_blank" rel="noreferrer" href={"https://ai.casbin.com"}>
|
<a className="custom-link" style={{float: "right", marginTop: "2px"}} target="_blank" rel="noreferrer" href={`${Conf.AiAssistantUrl}`}>
|
||||||
<ShareAltOutlined className="custom-link" style={{fontSize: "20px", color: "rgb(140,140,140)"}} />
|
<ShareAltOutlined className="custom-link" style={{fontSize: "20px", color: "rgb(140,140,140)"}} />
|
||||||
</a>
|
</a>
|
||||||
<a className="custom-link" style={{float: "right", marginRight: "30px", marginTop: "2px"}} target="_blank" rel="noreferrer" href={"https://github.com/casibase/casibase"}>
|
<a className="custom-link" style={{float: "right", marginRight: "30px", marginTop: "2px"}} target="_blank" rel="noreferrer" href={"https://github.com/casibase/casibase"}>
|
||||||
@ -326,7 +326,7 @@ class App extends Component {
|
|||||||
}}
|
}}
|
||||||
visible={this.state.isAiAssistantOpen}
|
visible={this.state.isAiAssistantOpen}
|
||||||
>
|
>
|
||||||
<iframe id="iframeHelper" title={"iframeHelper"} src={"https://ai.casbin.com/?isRaw=1"} width="100%" height="100%" scrolling="no" frameBorder="no" />
|
<iframe id="iframeHelper" title={"iframeHelper"} src={`${Conf.AiAssistantUrl}/?isRaw=1`} width="100%" height="100%" scrolling="no" frameBorder="no" />
|
||||||
</Drawer>
|
</Drawer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -31,3 +31,6 @@ export const ThemeDefault = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const CustomFooter = null;
|
export const CustomFooter = null;
|
||||||
|
|
||||||
|
// Blank or null to hide Ai Assistant button
|
||||||
|
export const AiAssistantUrl = "https://ai.casbin.com";
|
||||||
|
@ -192,11 +192,15 @@ function ManagementPage(props) {
|
|||||||
themeAlgorithm={props.themeAlgorithm}
|
themeAlgorithm={props.themeAlgorithm}
|
||||||
onChange={props.setLogoAndThemeAlgorithm} />
|
onChange={props.setLogoAndThemeAlgorithm} />
|
||||||
<LanguageSelect languages={props.account.organization.languages} />
|
<LanguageSelect languages={props.account.organization.languages} />
|
||||||
<Tooltip title="Click to open AI assitant">
|
{
|
||||||
|
Conf.AiAssistantUrl?.trim() && (
|
||||||
|
<Tooltip title="Click to open AI assistant">
|
||||||
<div className="select-box" onClick={props.openAiAssistant}>
|
<div className="select-box" onClick={props.openAiAssistant}>
|
||||||
<DeploymentUnitOutlined style={{fontSize: "24px"}} />
|
<DeploymentUnitOutlined style={{fontSize: "24px"}} />
|
||||||
</div>
|
</div>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
)
|
||||||
|
}
|
||||||
<OpenTour />
|
<OpenTour />
|
||||||
{Setting.isAdminUser(props.account) && (props.uri.indexOf("/trees") === -1) &&
|
{Setting.isAdminUser(props.account) && (props.uri.indexOf("/trees") === -1) &&
|
||||||
<OrganizationSelect
|
<OrganizationSelect
|
||||||
|
Reference in New Issue
Block a user