Skip to content

Commit 4521fe6

Browse files
committed
feat(FR-2830): show deployment-ready alert with chat shortcut on deployment detail
1 parent 4276682 commit 4521fe6

22 files changed

Lines changed: 92 additions & 0 deletions

react/src/components/DeploymentConfigurationSection.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
*/
55
import { DeploymentConfigurationSectionQuery } from '../__generated__/DeploymentConfigurationSectionQuery.graphql';
66
import type { DeploymentRevisionDetail_revision$key } from '../__generated__/DeploymentRevisionDetail_revision.graphql';
7+
import { useWebUINavigate } from '../hooks';
78
import DeploymentAddRevisionModal from './DeploymentAddRevisionModal';
89
import DeploymentRevisionDetail from './DeploymentRevisionDetail';
910
import DeploymentRevisionDetailDrawer from './DeploymentRevisionDetailDrawer';
@@ -38,6 +39,7 @@ import {
3839
useFetchKey,
3940
useInterval,
4041
} from 'backend.ai-ui';
42+
import { BotMessageSquareIcon } from 'lucide-react';
4143
import { parseAsStringLiteral, useQueryState } from 'nuqs';
4244
import React, { Suspense, useState, useTransition } from 'react';
4345
import { useTranslation } from 'react-i18next';
@@ -261,6 +263,7 @@ const DeploymentConfigurationCards: React.FC<{
261263
'use memo';
262264
const { t } = useTranslation();
263265
const { token } = theme.useToken();
266+
const webuiNavigate = useWebUINavigate();
264267

265268
const [activeRevisionTab, setActiveRevisionTab] = useQueryState(
266269
'revisionTab',
@@ -291,6 +294,7 @@ const DeploymentConfigurationCards: React.FC<{
291294
name
292295
projectId
293296
domainName
297+
status
294298
projectV2 @since(version: "26.4.3") {
295299
basicInfo {
296300
name
@@ -332,6 +336,7 @@ const DeploymentConfigurationCards: React.FC<{
332336
const deployingRevision = deployment?.deployingRevision;
333337
const isDeployingDifferentRevision =
334338
!!deployingRevision && deployingRevision.id !== currentRevision?.id;
339+
const isDeploymentReady = deployment?.metadata.status === 'READY';
335340

336341
// While a different revision is being applied, poll so the UI moves off
337342
// the "applying" state once the deployment finishes rolling out. We don't
@@ -341,6 +346,30 @@ const DeploymentConfigurationCards: React.FC<{
341346

342347
return (
343348
<>
349+
{isDeploymentReady && (
350+
<Alert
351+
type="success"
352+
showIcon
353+
title={t('deployment.DeploymentReady')}
354+
description={t('deployment.DeploymentReadyDescription')}
355+
action={
356+
<Button
357+
type="primary"
358+
icon={<BotMessageSquareIcon size={token.fontSizeLG} />}
359+
onClick={() => {
360+
webuiNavigate({
361+
pathname: '/chat',
362+
search: new URLSearchParams({
363+
endpointId: deploymentId,
364+
}).toString(),
365+
});
366+
}}
367+
>
368+
{t('deployment.StartChat')}
369+
</Button>
370+
}
371+
/>
372+
)}
344373
{hasNoRevision && (
345374
<Alert
346375
type="info"

resources/i18n/de.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "Bereitstellungsdetail",
917917
"DeploymentId": "Bereitstellungs-ID",
918918
"DeploymentName": "Bereitstellungsname",
919+
"DeploymentReady": "Bereitstellung ist bereit",
920+
"DeploymentReadyDescription": "Ihre Bereitstellung ist bereit. Dieses Modell unterstützt Chat.",
919921
"DeploymentUpdated": "Bereitstellung wurde aktualisiert.",
920922
"Deployments": "Bereitstellungen",
921923
"DesiredReplicas": "Gewünschte Replikate",
@@ -977,6 +979,7 @@
977979
"Running": "Läuft",
978980
"RuntimeVariant": "Laufzeit",
979981
"SessionId": "Sitzungs-ID",
982+
"StartChat": "Chat starten",
980983
"Tags": "Tags",
981984
"TagsPlaceholder": "Tags eingeben, durch Kommas getrennt",
982985
"TrafficRatio": "Datenverkehrsanteil",

resources/i18n/el.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "Λεπτομέρειες ανάπτυξης",
917917
"DeploymentId": "ID ανάπτυξης",
918918
"DeploymentName": "Όνομα ανάπτυξης",
919+
"DeploymentReady": "Η ανάπτυξη είναι έτοιμη",
920+
"DeploymentReadyDescription": "Η ανάπτυξή σας είναι έτοιμη. Αυτό το μοντέλο υποστηρίζει συνομιλία.",
919921
"DeploymentUpdated": "Η ανάπτυξη ενημερώθηκε.",
920922
"Deployments": "Αναπτύξεις",
921923
"DesiredReplicas": "Επιθυμητά αντίγραφα",
@@ -977,6 +979,7 @@
977979
"Running": "Σε εκτέλεση",
978980
"RuntimeVariant": "Χρόνος εκτέλεσης",
979981
"SessionId": "ID συνεδρίας",
982+
"StartChat": "Έναρξη συνομιλίας",
980983
"Tags": "Ετικέτες",
981984
"TagsPlaceholder": "Εισαγάγετε ετικέτες, χωρισμένες με κόμματα",
982985
"TrafficRatio": "Αναλογία κίνησης",

resources/i18n/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,8 @@
917917
"DeploymentDetail": "Deployment Detail",
918918
"DeploymentId": "Deployment ID",
919919
"DeploymentName": "Deployment Name",
920+
"DeploymentReady": "Deployment is ready",
921+
"DeploymentReadyDescription": "Your deployment is ready. This model supports chat.",
920922
"DeploymentUpdated": "Deployment has been updated.",
921923
"Deployments": "Deployments",
922924
"DesiredReplicas": "Desired Replicas",
@@ -979,6 +981,7 @@
979981
"Running": "Running",
980982
"RuntimeVariant": "Runtime",
981983
"SessionId": "Session ID",
984+
"StartChat": "Start Chat",
982985
"Tags": "Tags",
983986
"TagsPlaceholder": "Enter tags, separated by commas",
984987
"TrafficRatio": "Traffic Ratio",

resources/i18n/es.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "Detalle del despliegue",
917917
"DeploymentId": "ID de despliegue",
918918
"DeploymentName": "Nombre del despliegue",
919+
"DeploymentReady": "El despliegue está listo",
920+
"DeploymentReadyDescription": "Su despliegue está listo. Este modelo admite chat.",
919921
"DeploymentUpdated": "El despliegue ha sido actualizado.",
920922
"Deployments": "Despliegues",
921923
"DesiredReplicas": "Réplicas deseadas",
@@ -977,6 +979,7 @@
977979
"Running": "En ejecución",
978980
"RuntimeVariant": "Tiempo de ejecución",
979981
"SessionId": "ID de sesión",
982+
"StartChat": "Iniciar chat",
980983
"Tags": "Etiquetas",
981984
"TagsPlaceholder": "Ingrese etiquetas, separadas por comas",
982985
"TrafficRatio": "Proporción de tráfico",

resources/i18n/fi.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "Käyttöönoton tiedot",
917917
"DeploymentId": "Käyttöönoton ID",
918918
"DeploymentName": "Käyttöönoton nimi",
919+
"DeploymentReady": "Käyttöönotto on valmis",
920+
"DeploymentReadyDescription": "Käyttöönottosi on valmis. Tämä malli tukee chatia.",
919921
"DeploymentUpdated": "Käyttöönotto on päivitetty.",
920922
"Deployments": "Käyttöönotot",
921923
"DesiredReplicas": "Halutut replikat",
@@ -977,6 +979,7 @@
977979
"Running": "Käynnissä",
978980
"RuntimeVariant": "Suoritusaika",
979981
"SessionId": "Istunnon ID",
982+
"StartChat": "Aloita chat",
980983
"Tags": "Tunnisteet",
981984
"TagsPlaceholder": "Syötä tunnisteet, pilkuilla erotettuna",
982985
"TrafficRatio": "Liikennesuhde",

resources/i18n/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "Détail du déploiement",
917917
"DeploymentId": "ID de déploiement",
918918
"DeploymentName": "Nom du déploiement",
919+
"DeploymentReady": "Le déploiement est prêt",
920+
"DeploymentReadyDescription": "Votre déploiement est prêt. Ce modèle prend en charge le chat.",
919921
"DeploymentUpdated": "Le déploiement a été mis à jour.",
920922
"Deployments": "Déploiements",
921923
"DesiredReplicas": "Répliques souhaitées",
@@ -977,6 +979,7 @@
977979
"Running": "En cours d'exécution",
978980
"RuntimeVariant": "Runtime",
979981
"SessionId": "ID de session",
982+
"StartChat": "Démarrer le chat",
980983
"Tags": "Étiquettes",
981984
"TagsPlaceholder": "Saisir des étiquettes, séparées par des virgules",
982985
"TrafficRatio": "Rapport de trafic",

resources/i18n/id.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "Detail Penerapan",
917917
"DeploymentId": "ID Penerapan",
918918
"DeploymentName": "Nama Penerapan",
919+
"DeploymentReady": "Penerapan siap digunakan",
920+
"DeploymentReadyDescription": "Penerapan Anda siap digunakan. Model ini mendukung obrolan.",
919921
"DeploymentUpdated": "Penerapan telah diperbarui.",
920922
"Deployments": "Penerapan",
921923
"DesiredReplicas": "Replika yang Diinginkan",
@@ -977,6 +979,7 @@
977979
"Running": "Berjalan",
978980
"RuntimeVariant": "Runtime",
979981
"SessionId": "ID Sesi",
982+
"StartChat": "Mulai Obrolan",
980983
"Tags": "Tag",
981984
"TagsPlaceholder": "Masukkan tag, dipisahkan dengan koma",
982985
"TrafficRatio": "Rasio Lalu Lintas",

resources/i18n/it.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "Dettaglio distribuzione",
917917
"DeploymentId": "ID distribuzione",
918918
"DeploymentName": "Nome distribuzione",
919+
"DeploymentReady": "La distribuzione è pronta",
920+
"DeploymentReadyDescription": "La distribuzione è pronta. Questo modello supporta la chat.",
919921
"DeploymentUpdated": "La distribuzione è stata aggiornata.",
920922
"Deployments": "Distribuzioni",
921923
"DesiredReplicas": "Repliche desiderate",
@@ -977,6 +979,7 @@
977979
"Running": "In esecuzione",
978980
"RuntimeVariant": "Runtime",
979981
"SessionId": "ID sessione",
982+
"StartChat": "Avvia chat",
980983
"Tags": "Tag",
981984
"TagsPlaceholder": "Inserisci i tag, separati da virgole",
982985
"TrafficRatio": "Rapporto traffico",

resources/i18n/ja.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,8 @@
916916
"DeploymentDetail": "デプロイ詳細",
917917
"DeploymentId": "デプロイID",
918918
"DeploymentName": "デプロイ名",
919+
"DeploymentReady": "デプロイの準備が完了しました",
920+
"DeploymentReadyDescription": "デプロイの準備が完了しました。このモデルはチャットをサポートしています。",
919921
"DeploymentUpdated": "デプロイが更新されました。",
920922
"Deployments": "デプロイ",
921923
"DesiredReplicas": "希望レプリカ数",
@@ -977,6 +979,7 @@
977979
"Running": "実行中",
978980
"RuntimeVariant": "ランタイム",
979981
"SessionId": "セッションID",
982+
"StartChat": "チャットを開始",
980983
"Tags": "タグ",
981984
"TagsPlaceholder": "タグをカンマ区切りで入力してください",
982985
"TrafficRatio": "トラフィック比率",

0 commit comments

Comments
 (0)