Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.toml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ enableExtendLoginSession = false # If true, enables login session extensi
enableImportFromHuggingFace = false # Enable import from Hugging Face feature. (From Backend.AI 24.09)
enableInteractiveLoginAccountSwitch = true # If false, hide the "Sign in with a different account" button from the interactive login page.
enableModelFolders = true # Enable model folders feature. (From Backend.AI 23.03)
enableReservoir = false # Enable reservoir page

[wsproxy]
proxyURL = "[Proxy URL]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,9 @@ const BAIArtifactTable = ({
<Button
title={t('comp:BAIArtifactTable.Deactivate')}
size="small"
type="text"
style={{
color: token.colorError,
background: token.colorErrorBg,
}}
// type="text"
color={'red'}
variant="filled"
icon={<BanIcon />}
onClick={() => onClickDelete(record.id)}
/>
Expand All @@ -173,12 +171,10 @@ const BAIArtifactTable = ({
<Button
title={t('comp:BAIArtifactTable.Activate')}
size="small"
type="text"
color="blue"
variant="filled"
// type="text"
icon={<UndoIcon />}
style={{
color: token.colorInfo,
background: token.colorInfoBg,
}}
onClick={() => onClickRestore(record.id)}
/>
);
Expand Down
13 changes: 8 additions & 5 deletions react/src/components/MainLayout/WebUISider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,14 @@ const WebUISider: React.FC<WebUISiderProps> = (props) => {
icon: <SolutionOutlined style={{ color: token.colorInfo }} />,
key: 'resource-policy',
},
baiClient?.supports('reservoir') && {
label: <WebUILink to="/reservoir">{t('webui.menu.Reservoir')}</WebUILink>,
icon: <PackagePlus style={{ color: token.colorInfo }} />,
key: 'reservoir',
},
baiClient?.supports('reservoir') &&
baiClient?._config.enableReservoir && {
label: (
<WebUILink to="/reservoir">{t('webui.menu.Reservoir')}</WebUILink>
),
icon: <PackagePlus style={{ color: token.colorInfo }} />,
key: 'reservoir',
},
]);

const superAdminMenu: MenuProps['items'] = [
Expand Down
1 change: 1 addition & 0 deletions react/src/hooks/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,7 @@ type BackendAIConfig = {
showNonInstalledImages: boolean;
enableInteractiveLoginAccountSwitch: boolean;
isDirectorySizeVisible: boolean;
enableReservoir: boolean;
debug: boolean;
[key: string]: any;
};
9 changes: 9 additions & 0 deletions src/components/backend-ai-login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export default class BackendAILogin extends BackendAIPage {
@property({ type: Boolean }) enableExtendLoginSession = false;
@property({ type: Boolean }) enableModelFolders = true;
@property({ type: Boolean }) showNonInstalledImages = false;
@property({ type: Boolean }) enableReservoir = false;
@property({ type: Boolean }) enableInteractiveLoginAccountSwitch = true;
@property({ type: String }) eduAppNamePrefix;
@property({ type: String }) pluginPages;
Expand Down Expand Up @@ -867,6 +868,12 @@ export default class BackendAILogin extends BackendAIPage {
defaultValue: true,
value: generalConfig?.enableModelFolders,
} as ConfigValueObject) as boolean;
// Enable reservoir feature
this.enableReservoir = this._getConfigValueByExists(generalConfig, {
valueType: 'boolean',
defaultValue: false,
value: generalConfig?.enableReservoir,
} as ConfigValueObject) as boolean;
}

/**
Expand Down Expand Up @@ -1937,6 +1944,8 @@ export default class BackendAILogin extends BackendAIPage {
globalThis.backendaiclient._config.inactiveList = this.inactiveList;
globalThis.backendaiclient._config.allowSignout = this.allow_signout;
globalThis.backendaiclient.ready = true;
globalThis.backendaiclient._config.enableReservoir =
this.enableReservoir;
if (
this.endpoints.indexOf(
globalThis.backendaiclient._config.endpoint as string,
Expand Down