Skip to content

Commit 66bf5d3

Browse files
committed
feat(FR-1405): version control of deployment features
1 parent 1494c8e commit 66bf5d3

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

react/src/components/MainLayout/WebUISider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ const WebUISider: React.FC<WebUISiderProps> = (props) => {
185185
key: 'job',
186186
group: 'workload',
187187
},
188-
{
188+
!baiClient.supports('deployment') && {
189189
label: <WebUILink to="/serving">{t('webui.menu.Serving')}</WebUILink>,
190190
icon: <BAIEndpointsIcon style={{ color: token.colorPrimary }} />,
191191
key: 'serving',
192192
group: 'service',
193193
},
194-
{
194+
baiClient.supports('deployment') && {
195195
label: (
196196
<WebUILink to="/deployment">{t('webui.menu.Deployment')}</WebUILink>
197197
),

react/src/pages/DeploymentDetailPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const DeploymentDetailPage: React.FC = () => {
8989
const { deployment } = useLazyLoadQuery<DeploymentDetailPageQuery>(
9090
graphql`
9191
query DeploymentDetailPageQuery($deploymentId: ID!) {
92-
deployment(id: $deploymentId) {
92+
deployment(id: $deploymentId) @since(version: "25.14.0") {
9393
id @required(action: THROW)
9494
metadata {
9595
name

react/src/pages/DeploymentListPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const DeploymentListPage: React.FC = () => {
5353
const deployments = useLazyLoadQuery<DeploymentListPageQuery>(
5454
graphql`
5555
query DeploymentListPageQuery($filter: DeploymentFilter, $first: Int) {
56-
deployments(filter: $filter, first: $first) {
56+
deployments(filter: $filter, first: $first) @since(version: "25.14.0") {
5757
edges {
5858
node {
5959
id

src/components/backend-ai-webui.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ export default class BackendAIWebUI extends connect(store)(LitElement) {
138138
@property({ type: Number }) minibarWidth = 88;
139139
@property({ type: Number }) sidebarWidth = 250;
140140
@property({ type: Number }) sidepanelWidth = 250;
141-
@property({ type: Object }) supports = Object();
142141
@property({ type: Array }) availablePages = [
143142
'start',
144143
'dashboard',
@@ -627,6 +626,14 @@ export default class BackendAIWebUI extends connect(store)(LitElement) {
627626
page: 'agent-summary',
628627
available: !this.isHideAgents,
629628
},
629+
{
630+
page: 'serving',
631+
available: !globalThis.backendaiclient.supports('deployment'),
632+
},
633+
{
634+
page: 'deployment',
635+
available: !!globalThis.backendaiclient.supports('deployment'),
636+
},
630637
];
631638

632639
if (this._page === 'start') {

src/lib/backend.ai-client-esm.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,9 @@ class Client {
807807
if (this.isManagerVersionCompatibleWith('25.13.0')) {
808808
this._features['pending-session-list'] = true;
809809
}
810+
if (this.isManagerVersionCompatibleWith('25.14.0')) {
811+
this._features['deployment'] = true;
812+
}
810813
}
811814

812815
/**

0 commit comments

Comments
 (0)