Skip to content
Open
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
46 changes: 3 additions & 43 deletions react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@
const ChatPage = React.lazy(() => import('./pages/ChatPage'));

const AIAgentPage = React.lazy(() => import('./pages/AIAgentPage'));
const ReservoirPage = React.lazy(() => import('./pages/ReservoirPage'));

Check warning on line 84 in react/src/App.tsx

View workflow job for this annotation

GitHub Actions / react-coverage

'ReservoirPage' is assigned a value but never used

Check warning on line 84 in react/src/App.tsx

View workflow job for this annotation

GitHub Actions / react-coverage

'ReservoirPage' is assigned a value but never used
const ReservoirArtifactDetailPage = React.lazy(

Check warning on line 85 in react/src/App.tsx

View workflow job for this annotation

GitHub Actions / react-coverage

'ReservoirArtifactDetailPage' is assigned a value but never used

Check warning on line 85 in react/src/App.tsx

View workflow job for this annotation

GitHub Actions / react-coverage

'ReservoirArtifactDetailPage' is assigned a value but never used
() => import('./pages/ReservoirArtifactDetailPage'),
);

const SchedulerPage = React.lazy(() => import('./pages/SchedulerPage'));
// Deployment pages
// const DeploymentListPage = React.lazy(
// () => import('./pages/Deployments/DeploymentListPage'),
// );
const DeploymentListPage = React.lazy(
() => import('./pages/DeploymentListPage'),
);
Expand Down Expand Up @@ -521,49 +524,6 @@
handle: { labelKey: 'webui.menu.ResourcePolicy' },
Component: ResourcePolicyPage,
},
{
path: '/reservoir',
handle: { labelKey: 'webui.menu.Reservoir' },
children: [
{
path: '',
Component: () => {
const baiClient = useSuspendedBackendaiClient();
return baiClient?.supports('reservoir') ? (
<BAIErrorBoundary>
<Suspense
fallback={
<BAIFlex direction="column" style={{ maxWidth: 700 }}>
<Skeleton active />
</BAIFlex>
}
>
<ReservoirPage />
</Suspense>
</BAIErrorBoundary>
) : (
<WebUINavigate to={'/error'} replace />
);
},
},
{
path: '/reservoir/:artifactId',
Component: () => {
const baiClient = useSuspendedBackendaiClient();
return baiClient?.supports('reservoir') ? (
<BAIErrorBoundary>
<Suspense fallback={<Skeleton active />}>
<ReservoirArtifactDetailPage />
</Suspense>
</BAIErrorBoundary>
) : (
<WebUINavigate to={'/error'} replace />
);
},
handle: { labelKey: 'webui.menu.ArtifactDetails' },
},
],
},
{
path: '/settings',
element: (
Expand Down
11 changes: 10 additions & 1 deletion react/src/components/MainLayout/WebUISider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
CloudUploadOutlined,
ControlOutlined,
DashboardOutlined,
DeploymentUnitOutlined,
FileDoneOutlined,
HddOutlined,
InfoCircleOutlined,
Expand Down Expand Up @@ -185,12 +186,20 @@ const WebUISider: React.FC<WebUISiderProps> = (props) => {
key: 'job',
group: 'workload',
},
{
!baiClient.supports('deployment') && {
label: <WebUILink to="/serving">{t('webui.menu.Serving')}</WebUILink>,
icon: <BAIEndpointsIcon style={{ color: token.colorPrimary }} />,
key: 'serving',
group: 'service',
},
baiClient.supports('deployment') && {
label: (
<WebUILink to="/deployment">{t('webui.menu.Deployment')}</WebUILink>
),
icon: <DeploymentUnitOutlined style={{ color: token.colorPrimary }} />,
key: 'deployment',
group: 'service',
},
{
label: <WebUILink to="/model-store">{t('data.ModelStore')}</WebUILink>,
icon: <BAIModelStoreIcon style={{ color: token.colorPrimary }} />,
Expand Down
2 changes: 1 addition & 1 deletion react/src/pages/DeploymentDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const DeploymentDetailPage: React.FC = () => {
const { deployment } = useLazyLoadQuery<DeploymentDetailPageQuery>(
graphql`
query DeploymentDetailPageQuery($deploymentId: ID!) {
deployment(id: $deploymentId) {
deployment(id: $deploymentId) @since(version: "25.14.0") {
id @required(action: THROW)
metadata {
name
Expand Down
2 changes: 1 addition & 1 deletion react/src/pages/DeploymentListPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const DeploymentListPage: React.FC = () => {
const deployments = useLazyLoadQuery<DeploymentListPageQuery>(
graphql`
query DeploymentListPageQuery($filter: DeploymentFilter, $first: Int) {
deployments(filter: $filter, first: $first) {
deployments(filter: $filter, first: $first) @since(version: "25.14.0") {
edges {
node {
id
Expand Down
9 changes: 8 additions & 1 deletion src/components/backend-ai-webui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ export default class BackendAIWebUI extends connect(store)(LitElement) {
@property({ type: Number }) minibarWidth = 88;
@property({ type: Number }) sidebarWidth = 250;
@property({ type: Number }) sidepanelWidth = 250;
@property({ type: Object }) supports = Object();
@property({ type: Array }) availablePages = [
'start',
'dashboard',
Expand Down Expand Up @@ -627,6 +626,14 @@ export default class BackendAIWebUI extends connect(store)(LitElement) {
page: 'agent-summary',
available: !this.isHideAgents,
},
{
page: 'serving',
available: !globalThis.backendaiclient.supports('deployment'),
},
{
page: 'deployment',
available: !!globalThis.backendaiclient.supports('deployment'),
},
];

if (this._page === 'start') {
Expand Down
3 changes: 3 additions & 0 deletions src/lib/backend.ai-client-esm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ class Client {
if (this.isManagerVersionCompatibleWith('25.12.0')) {
this._features['reservoir'] = true;
}
if (this.isManagerVersionCompatibleWith('25.14.0')) {
this._features['deployment'] = true;
}
}

/**
Expand Down
Loading