Merge branch 'feature/system_update_loader' into 'dev'

system update loader

See merge request spatial/postamates_frontend!47
dev
Anton Vlasov 3 years ago
commit c52972e36e

@ -1,6 +1,6 @@
import { startML, useLastMLRun } from "../api.js"; import { startML, useLastMLRun } from "../api.js";
import { Button, Popover, Spin, Tooltip } from "antd"; import { Button, Popover, Spin, Tooltip } from "antd";
import { InfoCircleOutlined } from "@ant-design/icons"; import { InfoCircleOutlined, LoadingOutlined } from "@ant-design/icons";
import { useMemo } from "react"; import { useMemo } from "react";
const TASK_STATUSES = { const TASK_STATUSES = {
@ -16,7 +16,7 @@ export function LastMLRun() {
if (hasFinishedUpdate) return ( if (hasFinishedUpdate) return (
<> <>
<div className="text-xs text-grey z-10 bg-white-background rounded-xl px-2 py-0.5 space-y-3"> <div className="text-xs text-grey z-10 bg-white-background rounded-xl px-2 py-0.5 space-y-3">
Последний запуск модели Последнее обновление системы
</div> </div>
<div className="text-xs text-grey z-10 bg-white-background rounded-xl px-2 py-0.5 space-y-3"> <div className="text-xs text-grey z-10 bg-white-background rounded-xl px-2 py-0.5 space-y-3">
{new Date(data?.last_time).toLocaleString('ru-RU')} {new Date(data?.last_time).toLocaleString('ru-RU')}
@ -45,7 +45,10 @@ export function LastMLRun() {
> >
<Tooltip title="Инфо"> <Tooltip title="Инфо">
<Button className="absolute bottom-[64px] right-[20px] flex items-center justify-center p-3"> <Button className="absolute bottom-[64px] right-[20px] flex items-center justify-center p-3">
<InfoCircleOutlined className="w-4 h-4" /> {hasFinishedUpdate
? <InfoCircleOutlined className="w-4 h-4" />
: <Spin indicator={<LoadingOutlined style={{ fontSize: 16, color: "#000000" }} spin />} />
}
</Button> </Button>
</Tooltip> </Tooltip>
</Popover> </Popover>

Loading…
Cancel
Save