chore: test deploy snapshot
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
SyncOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { Alert, Button, Empty, Space, Tag, Typography, message } from 'antd';
|
||||
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react';
|
||||
import { useEffect, useEffectEvent, useMemo, useRef, useState, type ReactNode } from 'react';
|
||||
import { useTokenAccess } from '../../app/main/tokenAccess';
|
||||
import { DataStatePanel } from '../../components/dataStatePanel';
|
||||
import { copyText } from '../../app/main/mainChatPanel';
|
||||
@@ -802,6 +802,13 @@ export function ServerCommandPage({ sharedAccess = null }: ServerCommandPageProp
|
||||
}
|
||||
};
|
||||
|
||||
const refreshServerCommandState = useEffectEvent((options?: { silent?: boolean }) => Promise.all([
|
||||
loadItems(options),
|
||||
loadReservation({ silent: true }),
|
||||
loadWorkServerDeployment({ silent: true }),
|
||||
loadTestDeployment({ silent: true }),
|
||||
]));
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasAccess && !isSharedManageMode) {
|
||||
setItems([]);
|
||||
@@ -813,7 +820,7 @@ export function ServerCommandPage({ sharedAccess = null }: ServerCommandPageProp
|
||||
return;
|
||||
}
|
||||
|
||||
void Promise.all([loadItems(), loadReservation({ silent: true }), loadWorkServerDeployment({ silent: true }), loadTestDeployment({ silent: true })]);
|
||||
void refreshServerCommandState();
|
||||
}, [allowedKeysKey, hasAccess, isSharedManageMode, sharedAccess?.shareToken]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -834,12 +841,7 @@ export function ServerCommandPage({ sharedAccess = null }: ServerCommandPageProp
|
||||
|
||||
const refresh = async () => {
|
||||
try {
|
||||
await Promise.all([
|
||||
loadItems({ silent: true }),
|
||||
loadReservation({ silent: true }),
|
||||
loadWorkServerDeployment({ silent: true }),
|
||||
loadTestDeployment({ silent: true }),
|
||||
]);
|
||||
await refreshServerCommandState({ silent: true });
|
||||
} catch {
|
||||
if (!cancelled) {
|
||||
// ignore polling errors and keep the latest visible state
|
||||
@@ -858,6 +860,28 @@ export function ServerCommandPage({ sharedAccess = null }: ServerCommandPageProp
|
||||
};
|
||||
}, [hasAccess, isSharedManageMode, runningActionKey, sharedAccess?.shareToken, testDeployment?.status, workServerDeployment?.status]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!hasAccess && !isSharedManageMode) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const handleWindowAttention = () => {
|
||||
if (document.visibilityState !== 'visible') {
|
||||
return;
|
||||
}
|
||||
|
||||
void refreshServerCommandState({ silent: true });
|
||||
};
|
||||
|
||||
window.addEventListener('focus', handleWindowAttention);
|
||||
document.addEventListener('visibilitychange', handleWindowAttention);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener('focus', handleWindowAttention);
|
||||
document.removeEventListener('visibilitychange', handleWindowAttention);
|
||||
};
|
||||
}, [hasAccess, isSharedManageMode, refreshServerCommandState]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!workServerDeployment || workServerDeployment.status === 'idle' || workServerDeployment.status === 'running') {
|
||||
return;
|
||||
@@ -874,6 +898,7 @@ export function ServerCommandPage({ sharedAccess = null }: ServerCommandPageProp
|
||||
}
|
||||
|
||||
if (workServerDeployment.status === 'completed') {
|
||||
void refreshServerCommandState({ silent: true });
|
||||
void messageApi.success('WORK 서버 무중단 배포가 완료되었습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user