fix(ui): align telemetry and laboratory navigation
This commit is contained in:
@@ -2,6 +2,7 @@ interface TelemetrySeriesProps {
|
||||
label: string;
|
||||
values: Array<number | null>;
|
||||
value: string;
|
||||
resource?: string | null;
|
||||
ceiling?: number;
|
||||
}
|
||||
|
||||
@@ -24,13 +25,17 @@ export function TelemetrySeries({
|
||||
label,
|
||||
values,
|
||||
value,
|
||||
resource,
|
||||
ceiling,
|
||||
}: TelemetrySeriesProps) {
|
||||
const points = linePoints(values, ceiling);
|
||||
return (
|
||||
<div className="system-telemetry-series">
|
||||
<div>
|
||||
<span>{label}</span>
|
||||
<span className="system-telemetry-series__label">
|
||||
<span>{label}</span>
|
||||
{resource ? <small>{resource}</small> : null}
|
||||
</span>
|
||||
<strong>{value}</strong>
|
||||
</div>
|
||||
<svg
|
||||
|
||||
@@ -8,7 +8,7 @@ interface ComputeContourSettingsController {
|
||||
canEdit: boolean;
|
||||
openCreate: () => void;
|
||||
openEdit: () => void;
|
||||
utilityAction: ApplicationPanelUtilityAction;
|
||||
utilityActions: readonly ApplicationPanelUtilityAction[];
|
||||
window: ReactNode;
|
||||
}
|
||||
|
||||
@@ -24,18 +24,30 @@ export function useComputeContourSettings(): ComputeContourSettingsController {
|
||||
setMode("edit");
|
||||
setOpen(true);
|
||||
}, []);
|
||||
const utilityAction = useMemo<ApplicationPanelUtilityAction>(() => ({
|
||||
label: "Настроить выбранный вычислительный контур",
|
||||
icon: "settings",
|
||||
disabled: contours.selectedContour === null,
|
||||
onClick: openEdit,
|
||||
}), [contours.selectedContour, openEdit]);
|
||||
const utilityActions = useMemo<readonly ApplicationPanelUtilityAction[]>(() => [
|
||||
{
|
||||
label: "Обновить телеметрию выбранного контура",
|
||||
icon: "refresh",
|
||||
disabled: contours.selectedContour?.contour_id !== "worker-006",
|
||||
onClick: contours.refreshTelemetry,
|
||||
},
|
||||
{
|
||||
label: "Настроить выбранный вычислительный контур",
|
||||
icon: "settings",
|
||||
disabled: contours.selectedContour === null,
|
||||
onClick: openEdit,
|
||||
},
|
||||
], [
|
||||
contours.refreshTelemetry,
|
||||
contours.selectedContour,
|
||||
openEdit,
|
||||
]);
|
||||
|
||||
return {
|
||||
canEdit: contours.selectedContour !== null,
|
||||
openCreate,
|
||||
openEdit,
|
||||
utilityAction,
|
||||
utilityActions,
|
||||
window: (
|
||||
<ComputeContourSettingsWindow
|
||||
open={open}
|
||||
|
||||
Reference in New Issue
Block a user