@postgres.ai/shared 3.5.1-pr-1027.0 → 4.0.0-pr-1028
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AlertSnackbar/index.d.ts +2 -0
- package/components/AlertSnackbar/index.js +8 -0
- package/components/AlertSnackbar/useAlertSnackbar.d.ts +16 -0
- package/components/AlertSnackbar/useAlertSnackbar.js +37 -0
- package/components/Button/index.d.ts +7 -0
- package/components/Button/index.js +40 -0
- package/components/Button2/index.d.ts +13 -0
- package/components/Button2/index.js +10 -0
- package/components/DestroyCloneModal/index.d.ts +9 -0
- package/components/DestroyCloneModal/index.js +23 -0
- package/components/DestroyCloneRestrictionModal/index.d.ts +11 -0
- package/components/DestroyCloneRestrictionModal/index.js +16 -0
- package/components/ErrorStub/index.d.ts +11 -0
- package/components/ErrorStub/index.js +42 -0
- package/components/FormattedText/index.d.ts +7 -0
- package/components/FormattedText/index.js +23 -0
- package/components/GatewayLink/index.d.ts +4 -0
- package/components/GatewayLink/index.js +13 -0
- package/components/HorizontalScrollContainer/index.d.ts +13 -0
- package/components/HorizontalScrollContainer/index.js +72 -0
- package/components/HorizontalScrollContainer/types.d.ts +5 -0
- package/components/HorizontalScrollContainer/{types.ts → types.js} +1 -6
- package/components/HorizontalScrollContainer/utils.d.ts +3 -0
- package/components/HorizontalScrollContainer/utils.js +12 -0
- package/components/ImportantText/index.d.ts +6 -0
- package/components/ImportantText/index.js +12 -0
- package/components/Link2/index.d.ts +7 -0
- package/components/Link2/index.js +17 -0
- package/components/MenuButton/index.d.ts +26 -0
- package/components/MenuButton/index.js +16 -0
- package/components/Modal/index.d.ts +15 -0
- package/components/Modal/index.js +35 -0
- package/components/PageSpinner/index.d.ts +2 -0
- package/components/PageSpinner/{index.tsx → index.js} +5 -11
- package/components/ResetCloneModal/index.d.ts +13 -0
- package/components/ResetCloneModal/index.js +89 -0
- package/components/SectionTitle/index.d.ts +12 -0
- package/components/SectionTitle/index.js +31 -0
- package/components/Select/index.d.ts +18 -0
- package/components/Select/index.js +9 -0
- package/components/SimpleModalControls/index.d.ts +11 -0
- package/components/SimpleModalControls/index.js +19 -0
- package/components/Spinner/icon.d.ts +4 -0
- package/components/Spinner/icon.js +2 -0
- package/components/Spinner/index.d.ts +7 -0
- package/components/Spinner/index.js +8 -0
- package/components/Status/index.d.ts +12 -0
- package/components/Status/index.js +23 -0
- package/components/StubContainer/index.d.ts +7 -0
- package/components/StubContainer/index.js +14 -0
- package/components/StubSpinner/index.d.ts +8 -0
- package/components/StubSpinner/index.js +29 -0
- package/components/StubSpinnerFlex/index.d.ts +9 -0
- package/components/StubSpinnerFlex/index.js +8 -0
- package/components/SyntaxHighlight/index.d.ts +7 -0
- package/components/SyntaxHighlight/index.js +65 -0
- package/components/Table/RowMenu/index.d.ts +14 -0
- package/components/Table/RowMenu/index.js +50 -0
- package/components/Table/index.d.ts +12 -0
- package/components/Table/index.js +58 -0
- package/components/Text/index.d.ts +6 -0
- package/components/Text/index.js +11 -0
- package/components/TextField/index.d.ts +27 -0
- package/components/TextField/index.js +43 -0
- package/components/Tooltip/index.d.ts +12 -0
- package/components/Tooltip/index.js +19 -0
- package/config/index.d.ts +8 -0
- package/config/index.js +23 -0
- package/config/links.d.ts +6 -0
- package/config/links.js +6 -0
- package/helpers/getEntropy.d.ts +3 -0
- package/helpers/getEntropy.js +212 -0
- package/helpers/localStorage.d.ts +6 -0
- package/helpers/localStorage.js +13 -0
- package/helpers/request.d.ts +7 -0
- package/helpers/request.js +35 -0
- package/hooks/useWindowDimensions.d.ts +1 -0
- package/hooks/useWindowDimensions.js +12 -0
- package/icons/ArrowDropDown/index.d.ts +7 -0
- package/icons/ArrowDropDown/index.js +6 -0
- package/icons/Circle/index.d.ts +6 -0
- package/icons/Circle/index.js +5 -0
- package/icons/External/index.d.ts +4 -0
- package/icons/External/index.js +2 -0
- package/icons/Info/index.d.ts +4 -0
- package/icons/Info/index.js +2 -0
- package/icons/PostgresSQL/index.d.ts +2 -0
- package/icons/PostgresSQL/index.js +40 -0
- package/icons/Renewable/index.d.ts +6 -0
- package/icons/Renewable/index.js +12 -0
- package/icons/Shield/index.d.ts +6 -0
- package/icons/Shield/index.js +12 -0
- package/icons/Warning/index.d.ts +6 -0
- package/icons/Warning/index.js +6 -0
- package/package.json +5 -13
- package/pages/Branches/Branch/context.d.ts +22 -0
- package/pages/Branches/Branch/context.js +3 -0
- package/pages/Branches/Branch/index.d.ts +9 -0
- package/pages/Branches/Branch/index.js +172 -0
- package/pages/Branches/Branch/stores/Main.d.ts +37 -0
- package/pages/Branches/Branch/stores/Main.js +90 -0
- package/pages/Branches/Branch/useCreatedStores.d.ts +6 -0
- package/pages/Branches/Branch/useCreatedStores.js +5 -0
- package/pages/Branches/components/BranchesTable/index.d.ts +10 -0
- package/pages/Branches/components/BranchesTable/index.js +107 -0
- package/pages/Branches/components/Modals/DeleteBranchModal/index.d.ts +11 -0
- package/pages/Branches/components/Modals/DeleteBranchModal/index.js +49 -0
- package/pages/Branches/components/Modals/types.d.ts +4 -0
- package/pages/Branches/components/Modals/types.js +1 -0
- package/pages/Branches/index.d.ts +6 -0
- package/pages/Branches/index.js +60 -0
- package/pages/Clone/Status/index.d.ts +8 -0
- package/pages/Clone/Status/index.js +38 -0
- package/pages/Clone/context.d.ts +21 -0
- package/pages/Clone/context.js +3 -0
- package/pages/Clone/index.d.ts +9 -0
- package/pages/Clone/index.js +252 -0
- package/pages/Clone/stores/Main.d.ts +47 -0
- package/pages/Clone/stores/Main.js +141 -0
- package/pages/Clone/useCreatedStores.d.ts +6 -0
- package/pages/Clone/useCreatedStores.js +5 -0
- package/pages/Clone/utils/index.d.ts +4 -0
- package/pages/Clone/utils/index.js +12 -0
- package/pages/CreateBranch/index.d.ts +17 -0
- package/pages/CreateBranch/index.js +135 -0
- package/pages/CreateBranch/stores/Main.d.ts +43 -0
- package/pages/CreateBranch/stores/Main.js +59 -0
- package/pages/CreateBranch/useCreatedStores.d.ts +6 -0
- package/pages/CreateBranch/useCreatedStores.js +5 -0
- package/pages/CreateBranch/useForm.d.ts +51 -0
- package/pages/CreateBranch/useForm.js +30 -0
- package/pages/CreateBranch/utils/index.d.ts +2 -0
- package/pages/CreateBranch/utils/index.js +10 -0
- package/pages/CreateClone/index.d.ts +19 -0
- package/pages/CreateClone/index.js +142 -0
- package/pages/CreateClone/stores/Main.d.ts +49 -0
- package/pages/CreateClone/stores/Main.js +85 -0
- package/pages/CreateClone/styles.module.scss +47 -4
- package/pages/CreateClone/useCreatedStores.d.ts +6 -0
- package/pages/CreateClone/useCreatedStores.js +5 -0
- package/pages/CreateClone/useForm.d.ts +55 -0
- package/pages/CreateClone/useForm.js +26 -0
- package/pages/CreateClone/utils/index.d.ts +3 -0
- package/pages/CreateClone/utils/index.js +17 -0
- package/pages/CreateSnapshot/index.d.ts +17 -0
- package/pages/CreateSnapshot/index.js +117 -0
- package/pages/CreateSnapshot/stores/Main.d.ts +21 -0
- package/pages/CreateSnapshot/stores/Main.js +31 -0
- package/pages/CreateSnapshot/useCreatedStores.d.ts +6 -0
- package/pages/CreateSnapshot/useCreatedStores.js +5 -0
- package/pages/CreateSnapshot/useForm.d.ts +53 -0
- package/pages/CreateSnapshot/useForm.js +25 -0
- package/pages/CreateSnapshot/utils/index.d.ts +1 -0
- package/pages/CreateSnapshot/utils/index.js +3 -0
- package/pages/Instance/Clones/ClonesList/ConnectionModal/index.d.ts +10 -0
- package/pages/Instance/Clones/ClonesList/ConnectionModal/index.js +74 -0
- package/pages/Instance/Clones/ClonesList/MenuCell/index.d.ts +11 -0
- package/pages/Instance/Clones/ClonesList/MenuCell/index.js +49 -0
- package/pages/Instance/Clones/ClonesList/MenuCell/utils.d.ts +3 -0
- package/pages/Instance/Clones/ClonesList/MenuCell/utils.js +18 -0
- package/pages/Instance/Clones/ClonesList/index.d.ts +9 -0
- package/pages/Instance/Clones/ClonesList/index.js +96 -0
- package/pages/Instance/{components → Clones}/ClonesList/styles.module.scss +10 -0
- package/pages/Instance/Clones/ClonesModal/index.d.ts +4 -0
- package/pages/Instance/Clones/ClonesModal/index.js +38 -0
- package/pages/Instance/Clones/ClonesModal/utils.d.ts +7 -0
- package/pages/Instance/Clones/ClonesModal/utils.js +14 -0
- package/pages/Instance/Clones/Header/Item/index.d.ts +7 -0
- package/pages/Instance/Clones/Header/Item/index.js +5 -0
- package/pages/Instance/Clones/Header/index.d.ts +9 -0
- package/pages/Instance/Clones/Header/index.js +16 -0
- package/pages/Instance/Clones/Header/styles.module.scss +4 -1
- package/pages/Instance/Clones/index.d.ts +8 -0
- package/pages/Instance/Clones/index.js +64 -0
- package/pages/Instance/Configuration/Header/index.d.ts +11 -0
- package/pages/Instance/Configuration/Header/index.js +17 -0
- package/pages/Instance/Configuration/InputWithTooltip/index.d.ts +32 -0
- package/pages/Instance/Configuration/InputWithTooltip/index.js +64 -0
- package/pages/Instance/Configuration/ResponseMessage/index.d.ts +5 -0
- package/pages/Instance/Configuration/ResponseMessage/index.js +43 -0
- package/pages/Instance/Configuration/configOptions.d.ts +9 -0
- package/pages/Instance/Configuration/configOptions.js +59 -0
- package/pages/Instance/Configuration/index.d.ts +10 -0
- package/pages/Instance/Configuration/index.js +547 -0
- package/pages/Instance/Configuration/tooltipText.d.ts +20 -0
- package/pages/Instance/Configuration/tooltipText.js +21 -0
- package/pages/Instance/Configuration/useForm.d.ts +82 -0
- package/pages/Instance/Configuration/useForm.js +74 -0
- package/pages/Instance/Configuration/utils/index.d.ts +22 -0
- package/pages/Instance/Configuration/utils/index.js +105 -0
- package/pages/Instance/InactiveInstance/index.d.ts +6 -0
- package/pages/Instance/InactiveInstance/index.js +65 -0
- package/pages/Instance/InactiveInstance/utils.d.ts +2 -0
- package/pages/Instance/InactiveInstance/utils.js +7 -0
- package/pages/Instance/Info/Connection/ConnectModal/Content/index.d.ts +4 -0
- package/pages/Instance/Info/Connection/ConnectModal/Content/index.js +73 -0
- package/pages/Instance/Info/Connection/ConnectModal/Content/utils.d.ts +3 -0
- package/pages/Instance/Info/Connection/ConnectModal/Content/utils.js +20 -0
- package/pages/Instance/Info/Connection/ConnectModal/index.d.ts +6 -0
- package/pages/Instance/Info/Connection/ConnectModal/index.js +17 -0
- package/pages/Instance/Info/Connection/index.d.ts +4 -0
- package/pages/Instance/Info/Connection/index.js +44 -0
- package/pages/Instance/Info/Details/index.d.ts +2 -0
- package/pages/Instance/Info/Details/index.js +6 -0
- package/pages/Instance/Info/Disks/Disk/ActionsMenu/index.d.ts +8 -0
- package/pages/Instance/Info/Disks/Disk/ActionsMenu/index.js +47 -0
- package/pages/Instance/Info/Disks/Disk/Marker/index.d.ts +6 -0
- package/pages/Instance/Info/Disks/Disk/Marker/index.js +15 -0
- package/pages/Instance/Info/Disks/Disk/ProgressBar/PointerIcon.d.ts +5 -0
- package/pages/Instance/Info/Disks/Disk/ProgressBar/PointerIcon.js +2 -0
- package/pages/Instance/Info/Disks/Disk/ProgressBar/index.d.ts +8 -0
- package/pages/Instance/Info/Disks/Disk/ProgressBar/index.js +45 -0
- package/pages/Instance/Info/Disks/Disk/Status/index.d.ts +6 -0
- package/pages/Instance/Info/Disks/Disk/Status/index.js +52 -0
- package/pages/Instance/Info/Disks/Disk/index.d.ts +15 -0
- package/pages/Instance/Info/Disks/Disk/index.js +71 -0
- package/pages/Instance/Info/Disks/index.d.ts +4 -0
- package/pages/Instance/Info/Disks/index.js +24 -0
- package/pages/Instance/Info/Icons/index.d.ts +7 -0
- package/pages/Instance/Info/Icons/index.js +3 -0
- package/pages/Instance/Info/Retrieval/RefreshFailedAlert/index.d.ts +4 -0
- package/pages/Instance/Info/Retrieval/RefreshFailedAlert/index.js +15 -0
- package/pages/Instance/Info/Retrieval/RetrievalModal/index.d.ts +10 -0
- package/pages/Instance/Info/Retrieval/RetrievalModal/index.js +11 -0
- package/pages/Instance/Info/Retrieval/RetrievalTable/index.d.ts +6 -0
- package/pages/Instance/Info/Retrieval/RetrievalTable/index.js +6 -0
- package/pages/Instance/Info/Retrieval/index.d.ts +4 -0
- package/pages/Instance/Info/Retrieval/index.js +47 -0
- package/pages/Instance/Info/Retrieval/utils.d.ts +2 -0
- package/pages/Instance/Info/Retrieval/utils.js +12 -0
- package/pages/Instance/Info/Snapshots/Calendar/Day/index.d.ts +11 -0
- package/pages/Instance/Info/Snapshots/Calendar/Day/index.js +71 -0
- package/pages/Instance/Info/Snapshots/Calendar/index.d.ts +8 -0
- package/pages/Instance/Info/Snapshots/Calendar/index.js +67 -0
- package/pages/Instance/Info/Snapshots/Calendar/utils.d.ts +27 -0
- package/pages/Instance/Info/Snapshots/Calendar/utils.js +41 -0
- package/pages/Instance/Info/Snapshots/TimeLine/Day/index.d.ts +6 -0
- package/pages/Instance/Info/Snapshots/TimeLine/Day/index.js +58 -0
- package/pages/Instance/Info/Snapshots/TimeLine/index.d.ts +2 -0
- package/pages/Instance/Info/Snapshots/TimeLine/index.js +32 -0
- package/pages/Instance/Info/Snapshots/index.d.ts +4 -0
- package/pages/Instance/Info/Snapshots/index.js +40 -0
- package/pages/Instance/Info/Snapshots/utils.d.ts +34 -0
- package/pages/Instance/Info/Snapshots/utils.js +26 -0
- package/pages/Instance/Info/Status/InstanceResponseModal/index.d.ts +9 -0
- package/pages/Instance/Info/Status/InstanceResponseModal/index.js +12 -0
- package/pages/Instance/Info/Status/index.d.ts +4 -0
- package/pages/Instance/Info/Status/index.js +31 -0
- package/pages/Instance/Info/Status/utils.d.ts +8 -0
- package/pages/Instance/Info/Status/utils.js +23 -0
- package/pages/Instance/Info/components/Property/index.d.ts +11 -0
- package/pages/Instance/Info/components/Property/index.js +14 -0
- package/pages/Instance/Info/components/Section/index.d.ts +8 -0
- package/pages/Instance/Info/components/Section/index.js +18 -0
- package/pages/Instance/Info/components/ValueStatus/index.d.ts +9 -0
- package/pages/Instance/Info/components/ValueStatus/index.js +18 -0
- package/pages/Instance/Info/index.d.ts +2 -0
- package/pages/Instance/Info/index.js +76 -0
- package/pages/Instance/Snapshots/components/SnapshotHeader/index.d.ts +11 -0
- package/pages/Instance/Snapshots/components/SnapshotHeader/index.js +36 -0
- package/pages/Instance/Snapshots/components/SnapshotsList/index.d.ts +11 -0
- package/pages/Instance/Snapshots/components/SnapshotsList/index.js +157 -0
- package/pages/Instance/Snapshots/components/SnapshotsModal/utils.d.ts +7 -0
- package/{components/HorizontalScrollContainer/utils.ts → pages/Instance/Snapshots/components/SnapshotsModal/utils.js} +8 -9
- package/pages/Instance/Snapshots/components/SnapshotsTable/index.d.ts +6 -0
- package/pages/Instance/Snapshots/components/SnapshotsTable/index.js +125 -0
- package/pages/Instance/Snapshots/index.d.ts +6 -0
- package/pages/Instance/Snapshots/index.js +92 -0
- package/pages/Instance/Snapshots/utils/index.d.ts +16 -0
- package/pages/Instance/Snapshots/utils/index.js +30 -0
- package/pages/Instance/SnapshotsModal/index.d.ts +4 -0
- package/pages/Instance/SnapshotsModal/index.js +81 -0
- package/pages/Instance/Tabs/PlatformTabs.d.ts +10 -0
- package/pages/Instance/Tabs/PlatformTabs.js +51 -0
- package/pages/Instance/Tabs/index.d.ts +26 -0
- package/pages/Instance/Tabs/index.js +75 -0
- package/pages/Instance/Tabs/styles.d.ts +1 -0
- package/pages/Instance/Tabs/styles.js +62 -0
- package/pages/Instance/components/ErrorStub/index.d.ts +9 -0
- package/pages/Instance/components/ErrorStub/index.js +42 -0
- package/pages/Instance/components/ModalReloadButton/index.d.ts +7 -0
- package/pages/Instance/components/ModalReloadButton/index.js +22 -0
- package/pages/Instance/components/Tags/Tag/index.d.ts +7 -0
- package/pages/Instance/components/Tags/Tag/index.js +35 -0
- package/pages/Instance/components/Tags/index.d.ts +8 -0
- package/pages/Instance/components/Tags/index.js +16 -0
- package/pages/Instance/context.d.ts +38 -0
- package/pages/Instance/{ClonesModal/utils.ts → context.js} +5 -15
- package/pages/Instance/index.d.ts +8 -0
- package/pages/Instance/index.js +94 -0
- package/pages/Instance/stores/ClonesModal.d.ts +13 -0
- package/pages/Instance/stores/ClonesModal.js +24 -0
- package/pages/Instance/stores/Main.d.ts +141 -0
- package/pages/Instance/stores/Main.js +302 -0
- package/pages/Instance/stores/SnapshotsModal.d.ts +13 -0
- package/pages/Instance/stores/SnapshotsModal.js +24 -0
- package/pages/Instance/styles.scss +1 -4
- package/pages/Instance/useCreatedStores.d.ts +10 -0
- package/pages/Instance/useCreatedStores.js +9 -0
- package/pages/Logs/Icons/PlusIcon.d.ts +2 -0
- package/pages/Logs/Icons/PlusIcon.js +2 -0
- package/pages/Logs/constants/index.d.ts +5 -0
- package/pages/Logs/constants/index.js +5 -0
- package/pages/Logs/hooks/useWsScroll.d.ts +1 -0
- package/pages/Logs/hooks/useWsScroll.js +37 -0
- package/pages/Logs/index.d.ts +6 -0
- package/pages/Logs/index.js +200 -0
- package/pages/Logs/utils/index.d.ts +2 -0
- package/pages/Logs/utils/index.js +15 -0
- package/pages/Logs/wsLogs.d.ts +3 -0
- package/pages/Logs/wsLogs.js +92 -0
- package/pages/Logs/wsSnackbar.d.ts +1 -0
- package/pages/Logs/wsSnackbar.js +25 -0
- package/pages/Snapshots/Snapshot/DestorySnapshotModal/index.d.ts +12 -0
- package/pages/Snapshots/Snapshot/DestorySnapshotModal/index.js +69 -0
- package/pages/Snapshots/Snapshot/context.d.ts +23 -0
- package/pages/Snapshots/Snapshot/context.js +3 -0
- package/pages/Snapshots/Snapshot/index.d.ts +9 -0
- package/pages/Snapshots/Snapshot/index.js +171 -0
- package/pages/Snapshots/Snapshot/stores/Main.d.ts +33 -0
- package/pages/Snapshots/Snapshot/stores/Main.js +71 -0
- package/pages/Snapshots/Snapshot/useCreatedStores.d.ts +6 -0
- package/pages/Snapshots/Snapshot/useCreatedStores.js +5 -0
- package/stores/Snapshots.d.ts +24 -0
- package/stores/Snapshots.js +59 -0
- package/styles/colors.d.ts +60 -0
- package/styles/colors.js +66 -0
- package/styles/icons.d.ts +63 -0
- package/styles/icons.js +69 -0
- package/styles/styles.d.ts +1 -0
- package/styles/styles.js +83 -0
- package/styles/theme.d.ts +1 -0
- package/styles/theme.js +50 -0
- package/styles/vars.d.ts +25 -0
- package/styles/{vars.ts → vars.js} +20 -28
- package/types/api/endpoints/createBranch.d.ts +12 -0
- package/types/api/endpoints/createBranch.js +1 -0
- package/types/api/endpoints/createClone.d.ts +13 -0
- package/types/api/endpoints/createClone.js +1 -0
- package/types/api/endpoints/createSnapshot.d.ts +5 -0
- package/types/api/endpoints/createSnapshot.js +1 -0
- package/types/api/endpoints/deleteBranch.d.ts +4 -0
- package/types/api/endpoints/deleteBranch.js +1 -0
- package/types/api/endpoints/destroyClone.d.ts +7 -0
- package/types/api/endpoints/destroyClone.js +1 -0
- package/types/api/endpoints/destroySnapshot.d.ts +4 -0
- package/types/api/endpoints/destroySnapshot.js +1 -0
- package/types/api/endpoints/getBranchSnapshot.d.ts +5 -0
- package/types/api/endpoints/getBranchSnapshot.js +1 -0
- package/types/api/endpoints/getBranches.d.ts +18 -0
- package/types/api/endpoints/getBranches.js +5 -0
- package/types/api/endpoints/getClone.d.ts +8 -0
- package/types/api/endpoints/getClone.js +1 -0
- package/types/api/endpoints/getConfig.d.ts +5 -0
- package/types/api/endpoints/getConfig.js +1 -0
- package/types/api/endpoints/getEngine.d.ts +10 -0
- package/types/api/endpoints/getEngine.js +1 -0
- package/types/api/endpoints/getFullConfig.d.ts +4 -0
- package/types/api/endpoints/getFullConfig.js +1 -0
- package/types/api/endpoints/getInstance.d.ts +7 -0
- package/types/api/endpoints/getInstance.js +1 -0
- package/types/api/endpoints/getInstanceRetrieval.d.ts +7 -0
- package/types/api/endpoints/getInstanceRetrieval.js +1 -0
- package/types/api/endpoints/getSeImages.d.ts +19 -0
- package/types/api/endpoints/getSeImages.js +1 -0
- package/types/api/endpoints/getSnapshotList.d.ts +10 -0
- package/types/api/endpoints/getSnapshotList.js +1 -0
- package/types/api/endpoints/getSnapshots.d.ts +8 -0
- package/types/api/endpoints/getSnapshots.js +1 -0
- package/types/api/endpoints/getWSToken.d.ts +7 -0
- package/types/api/endpoints/getWSToken.js +1 -0
- package/types/api/endpoints/initWS.d.ts +1 -0
- package/types/api/endpoints/initWS.js +1 -0
- package/types/api/endpoints/refreshInstance.d.ts +6 -0
- package/types/api/endpoints/refreshInstance.js +1 -0
- package/types/api/endpoints/resetClone.d.ts +8 -0
- package/types/api/endpoints/resetClone.js +1 -0
- package/types/api/endpoints/testDbSource.d.ts +22 -0
- package/types/api/endpoints/testDbSource.js +23 -0
- package/types/api/endpoints/updateClone.d.ts +10 -0
- package/types/api/endpoints/updateClone.js +1 -0
- package/types/api/endpoints/updateConfig.d.ts +5 -0
- package/types/api/endpoints/updateConfig.js +1 -0
- package/types/api/entities/branchSnapshot.d.ts +6 -0
- package/types/api/entities/branchSnapshot.js +1 -0
- package/types/api/entities/branchSnapshots.d.ts +15 -0
- package/types/api/entities/branchSnapshots.js +7 -0
- package/types/api/entities/clone.d.ts +56 -0
- package/{components/Text/index.tsx → types/api/entities/clone.js} +8 -22
- package/types/api/entities/config.d.ts +72 -0
- package/types/api/entities/config.js +35 -0
- package/types/api/entities/createBranch.d.ts +5 -0
- package/types/api/entities/createBranch.js +1 -0
- package/types/api/entities/createSnapshot.d.ts +5 -0
- package/types/api/entities/createSnapshot.js +1 -0
- package/types/api/entities/dbSource.d.ts +13 -0
- package/types/api/entities/dbSource.js +1 -0
- package/types/api/entities/instance.d.ts +114 -0
- package/types/api/entities/instance.js +31 -0
- package/types/api/entities/instanceRetrieval.d.ts +42 -0
- package/types/api/entities/instanceRetrieval.js +19 -0
- package/types/api/entities/instanceState.d.ts +114 -0
- package/types/api/entities/instanceState.js +42 -0
- package/types/api/entities/pool.d.ts +18 -0
- package/{utils/numbers.ts → types/api/entities/pool.js} +1 -5
- package/types/api/entities/snapshot.d.ts +27 -0
- package/types/api/entities/snapshot.js +6 -0
- package/types/api/entities/wsToken.d.ts +5 -0
- package/types/api/entities/wsToken.js +1 -0
- package/utils/api.d.ts +1 -0
- package/utils/api.js +28 -0
- package/utils/clone.d.ts +13 -0
- package/utils/clone.js +21 -0
- package/utils/connection.d.ts +5 -0
- package/utils/connection.js +28 -0
- package/utils/date.d.ts +18 -0
- package/utils/date.js +40 -0
- package/utils/instance.d.ts +5 -0
- package/utils/instance.js +11 -0
- package/utils/numbers.d.ts +1 -0
- package/utils/{strings.ts → numbers.js} +4 -5
- package/utils/react.d.ts +5 -0
- package/utils/react.js +8 -0
- package/utils/snapshot.d.ts +5 -0
- package/utils/snapshot.js +6 -0
- package/utils/strings.d.ts +1 -0
- package/utils/strings.js +10 -0
- package/utils/units.d.ts +5 -0
- package/utils/units.js +15 -0
- package/.gitlab-ci.yml +0 -60
- package/components/AlertSnackbar/index.tsx +0 -23
- package/components/AlertSnackbar/useAlertSnackbar.tsx +0 -65
- package/components/Button/index.tsx +0 -79
- package/components/Button2/index.tsx +0 -43
- package/components/DestroyCloneModal/index.tsx +0 -56
- package/components/DestroyCloneRestrictionModal/index.tsx +0 -50
- package/components/ErrorStub/index.tsx +0 -83
- package/components/FormattedText/index.tsx +0 -44
- package/components/GatewayLink/index.tsx +0 -33
- package/components/HorizontalScrollContainer/index.tsx +0 -131
- package/components/ImportantText/index.tsx +0 -29
- package/components/Link2/index.tsx +0 -31
- package/components/MenuButton/index.tsx +0 -80
- package/components/Modal/index.tsx +0 -93
- package/components/ResetCloneModal/index.tsx +0 -154
- package/components/SectionTitle/index.tsx +0 -74
- package/components/Select/index.tsx +0 -42
- package/components/SimpleModalControls/index.tsx +0 -56
- package/components/Spinner/icon.tsx +0 -29
- package/components/Spinner/index.tsx +0 -16
- package/components/Status/index.tsx +0 -61
- package/components/StubContainer/index.tsx +0 -41
- package/components/StubSpinner/index.tsx +0 -49
- package/components/StubSpinnerFlex/index.tsx +0 -20
- package/components/SyntaxHighlight/index.tsx +0 -107
- package/components/Table/RowMenu/index.tsx +0 -111
- package/components/Table/index.tsx +0 -140
- package/components/TextField/index.tsx +0 -117
- package/components/Tooltip/index.tsx +0 -52
- package/config/index.ts +0 -32
- package/config/links.ts +0 -6
- package/craco.config.js +0 -80
- package/helpers/getEntropy.ts +0 -232
- package/helpers/localStorage.ts +0 -15
- package/helpers/request.ts +0 -47
- package/hooks/useWindowDimensions.ts +0 -16
- package/icons/ArrowDropDown/index.tsx +0 -29
- package/icons/Circle/index.tsx +0 -27
- package/icons/External/index.tsx +0 -14
- package/icons/Info/index.tsx +0 -12
- package/icons/Renewable/index.tsx +0 -65
- package/icons/Shield/index.tsx +0 -33
- package/icons/Warning/index.tsx +0 -29
- package/pages/Clone/Status/index.tsx +0 -73
- package/pages/Clone/context.ts +0 -22
- package/pages/Clone/index.tsx +0 -634
- package/pages/Clone/stores/Main.ts +0 -206
- package/pages/Clone/useCreatedStores.ts +0 -11
- package/pages/Configuration/Header/index.tsx +0 -84
- package/pages/Configuration/InputWithTooltip/index.tsx +0 -240
- package/pages/Configuration/ResponseMessage/index.tsx +0 -71
- package/pages/Configuration/configOptions.ts +0 -60
- package/pages/Configuration/index.tsx +0 -1184
- package/pages/Configuration/tooltipText.tsx +0 -157
- package/pages/Configuration/useForm.ts +0 -108
- package/pages/Configuration/utils/index.ts +0 -153
- package/pages/CreateClone/index.tsx +0 -311
- package/pages/CreateClone/stores/Main.ts +0 -107
- package/pages/CreateClone/useCreatedStores.ts +0 -11
- package/pages/CreateClone/useForm.ts +0 -36
- package/pages/Instance/Clones/Header/Item/index.tsx +0 -15
- package/pages/Instance/Clones/Header/index.tsx +0 -74
- package/pages/Instance/Clones/index.tsx +0 -135
- package/pages/Instance/ClonesModal/index.tsx +0 -71
- package/pages/Instance/InactiveInstance/index.tsx +0 -165
- package/pages/Instance/InactiveInstance/utils.ts +0 -9
- package/pages/Instance/Info/Connection/ConnectModal/Content/index.tsx +0 -176
- package/pages/Instance/Info/Connection/ConnectModal/Content/utils.ts +0 -24
- package/pages/Instance/Info/Connection/ConnectModal/index.tsx +0 -36
- package/pages/Instance/Info/Connection/index.tsx +0 -81
- package/pages/Instance/Info/Details/index.tsx +0 -20
- package/pages/Instance/Info/Disks/Disk/ActionsMenu/index.tsx +0 -100
- package/pages/Instance/Info/Disks/Disk/Marker/index.tsx +0 -26
- package/pages/Instance/Info/Disks/Disk/ProgressBar/PointerIcon.tsx +0 -20
- package/pages/Instance/Info/Disks/Disk/ProgressBar/index.tsx +0 -73
- package/pages/Instance/Info/Disks/Disk/Status/index.tsx +0 -75
- package/pages/Instance/Info/Disks/Disk/index.tsx +0 -168
- package/pages/Instance/Info/Disks/index.tsx +0 -65
- package/pages/Instance/Info/Icons/index.tsx +0 -39
- package/pages/Instance/Info/Retrieval/RefreshFailedAlert/index.tsx +0 -32
- package/pages/Instance/Info/Retrieval/RetrievalModal/index.tsx +0 -49
- package/pages/Instance/Info/Retrieval/RetrievalTable/index.tsx +0 -53
- package/pages/Instance/Info/Retrieval/index.tsx +0 -95
- package/pages/Instance/Info/Retrieval/utils.ts +0 -10
- package/pages/Instance/Info/Snapshots/Calendar/Day/index.tsx +0 -125
- package/pages/Instance/Info/Snapshots/Calendar/index.tsx +0 -133
- package/pages/Instance/Info/Snapshots/Calendar/utils.ts +0 -74
- package/pages/Instance/Info/Snapshots/TimeLine/Day/index.tsx +0 -79
- package/pages/Instance/Info/Snapshots/TimeLine/index.tsx +0 -57
- package/pages/Instance/Info/Snapshots/index.tsx +0 -97
- package/pages/Instance/Info/Snapshots/utils.ts +0 -18
- package/pages/Instance/Info/Status/InstanceResponseModal/index.tsx +0 -32
- package/pages/Instance/Info/Status/index.tsx +0 -85
- package/pages/Instance/Info/Status/utils.ts +0 -24
- package/pages/Instance/Info/components/Property/index.tsx +0 -32
- package/pages/Instance/Info/components/Section/index.tsx +0 -50
- package/pages/Instance/Info/components/ValueStatus/index.tsx +0 -51
- package/pages/Instance/Info/index.tsx +0 -129
- package/pages/Instance/SnapshotsModal/index.tsx +0 -169
- package/pages/Instance/SnapshotsModal/utils.ts +0 -17
- package/pages/Instance/Tabs/index.tsx +0 -98
- package/pages/Instance/components/ClonesList/ConnectionModal/index.tsx +0 -196
- package/pages/Instance/components/ClonesList/MenuCell/index.tsx +0 -98
- package/pages/Instance/components/ClonesList/MenuCell/utils.ts +0 -21
- package/pages/Instance/components/ClonesList/index.tsx +0 -189
- package/pages/Instance/components/ErrorStub/index.tsx +0 -77
- package/pages/Instance/components/ModalReloadButton/index.tsx +0 -43
- package/pages/Instance/components/Tags/Tag/index.tsx +0 -60
- package/pages/Instance/components/Tags/index.tsx +0 -42
- package/pages/Instance/context.ts +0 -39
- package/pages/Instance/index.tsx +0 -235
- package/pages/Instance/stores/ClonesModal.ts +0 -35
- package/pages/Instance/stores/Main.ts +0 -335
- package/pages/Instance/stores/SnapshotsModal.ts +0 -35
- package/pages/Instance/useCreatedStores.ts +0 -14
- package/pages/Logs/Icons/PlusIcon.tsx +0 -8
- package/pages/Logs/constants/index.ts +0 -7
- package/pages/Logs/hooks/useWsScroll.tsx +0 -44
- package/pages/Logs/index.tsx +0 -267
- package/pages/Logs/utils/index.ts +0 -20
- package/pages/Logs/wsLogs.ts +0 -110
- package/pages/Logs/wsSnackbar.ts +0 -27
- package/postgres.ai-shared-3.5.0.tgz +0 -0
- package/scripts/copy-assets.js +0 -30
- package/scripts/pack.js +0 -70
- package/stores/Snapshots.ts +0 -54
- package/styles/colors.ts +0 -67
- package/styles/icons.tsx +0 -1917
- package/styles/styles.ts +0 -87
- package/styles/theme.ts +0 -53
- package/types/api/endpoints/createClone.ts +0 -10
- package/types/api/endpoints/destroyClone.ts +0 -7
- package/types/api/endpoints/getClone.ts +0 -6
- package/types/api/endpoints/getConfig.ts +0 -6
- package/types/api/endpoints/getEngine.ts +0 -13
- package/types/api/endpoints/getFullConfig.ts +0 -4
- package/types/api/endpoints/getInstance.ts +0 -6
- package/types/api/endpoints/getInstanceRetrieval.ts +0 -6
- package/types/api/endpoints/getSeImages.ts +0 -22
- package/types/api/endpoints/getSnapshots.ts +0 -6
- package/types/api/endpoints/getWSToken.ts +0 -6
- package/types/api/endpoints/initWS.ts +0 -1
- package/types/api/endpoints/refreshInstance.ts +0 -4
- package/types/api/endpoints/resetClone.ts +0 -8
- package/types/api/endpoints/testDbSource.ts +0 -48
- package/types/api/endpoints/updateClone.ts +0 -10
- package/types/api/endpoints/updateConfig.ts +0 -6
- package/types/api/entities/clone.ts +0 -42
- package/types/api/entities/config.ts +0 -114
- package/types/api/entities/dbSource.ts +0 -13
- package/types/api/entities/instance.ts +0 -67
- package/types/api/entities/instanceRetrieval.ts +0 -46
- package/types/api/entities/instanceState.ts +0 -102
- package/types/api/entities/pool.ts +0 -27
- package/types/api/entities/snapshot.ts +0 -18
- package/types/api/entities/wsToken.ts +0 -7
- package/types/byte-size/index.d.ts +0 -22
- package/utils/api.ts +0 -30
- package/utils/clone.ts +0 -31
- package/utils/connection.ts +0 -38
- package/utils/date.ts +0 -87
- package/utils/instance.ts +0 -10
- package/utils/react.ts +0 -10
- package/utils/snapshot.ts +0 -4
- package/utils/units.ts +0 -23
- /package/pages/{Configuration → Instance/Configuration}/styles.module.scss +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@material-ui/core';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { CircleIcon } from '@postgres.ai/shared/icons/Circle';
|
|
5
|
+
const useStyles = makeStyles({
|
|
6
|
+
root: {
|
|
7
|
+
display: 'inline',
|
|
8
|
+
verticalAlign: 'middle',
|
|
9
|
+
width: '10px',
|
|
10
|
+
},
|
|
11
|
+
}, { index: 1 });
|
|
12
|
+
export const Marker = (props) => {
|
|
13
|
+
const classes = useStyles();
|
|
14
|
+
return _jsx(CircleIcon, { className: clsx(classes.root, props.className) });
|
|
15
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const PoinerIcon = ({ className, style, }) => (_jsx("svg", { width: "5", height: "14", viewBox: "0 0 5 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: style, className: className, children: _jsx("path", { d: "M2.5 14L-2.06593e-07 -4.37114e-07L5 0L2.5 14Z", fill: "#EE0202" }) }));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@material-ui/core';
|
|
3
|
+
import { colors } from '@postgres.ai/shared/styles/colors';
|
|
4
|
+
import { Tooltip } from '@postgres.ai/shared/components/Tooltip';
|
|
5
|
+
import { PoinerIcon } from './PointerIcon';
|
|
6
|
+
const useStyles = makeStyles((theme) => ({
|
|
7
|
+
'@keyframes grow': {
|
|
8
|
+
'0%': {
|
|
9
|
+
transform: 'scaleX(0)',
|
|
10
|
+
},
|
|
11
|
+
'100%': {
|
|
12
|
+
transform: 'scaleX(1)',
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
root: {
|
|
16
|
+
height: '12px',
|
|
17
|
+
position: 'relative',
|
|
18
|
+
borderRadius: '4px',
|
|
19
|
+
background: colors.gray,
|
|
20
|
+
overflow: 'hidden',
|
|
21
|
+
marginTop: '8px',
|
|
22
|
+
},
|
|
23
|
+
indicator: {
|
|
24
|
+
position: 'absolute',
|
|
25
|
+
top: 0,
|
|
26
|
+
left: 0,
|
|
27
|
+
height: '100%',
|
|
28
|
+
width: '30%',
|
|
29
|
+
background: colors.primary.light,
|
|
30
|
+
animation: `$grow 500ms ${theme.transitions.easing.easeOut}`,
|
|
31
|
+
transformOrigin: 0,
|
|
32
|
+
},
|
|
33
|
+
pointer: {
|
|
34
|
+
position: 'absolute',
|
|
35
|
+
height: '100%',
|
|
36
|
+
top: 0,
|
|
37
|
+
transform: 'translateX(-50%)',
|
|
38
|
+
},
|
|
39
|
+
}), { index: 1 });
|
|
40
|
+
export const ProgressBar = (props) => {
|
|
41
|
+
const classes = useStyles();
|
|
42
|
+
return (_jsxs("div", { className: classes.root, children: [_jsx("div", { className: classes.indicator, style: { width: `${(props.value / props.total) * 100}%` } }), _jsx(Tooltip, { content: `+${props.thresholdPercent}% disk usage may result in performance degradation`, children: _jsx(PoinerIcon, { className: classes.pointer, style: {
|
|
43
|
+
left: `${props.thresholdPercent}%`,
|
|
44
|
+
} }) })] }));
|
|
45
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@material-ui/core';
|
|
3
|
+
import { WarningIcon } from '@postgres.ai/shared/icons/Warning';
|
|
4
|
+
import { Tooltip } from '@postgres.ai/shared/components/Tooltip';
|
|
5
|
+
import { colors } from '@postgres.ai/shared/styles/colors';
|
|
6
|
+
const VALUE_TO_NAME = {
|
|
7
|
+
refreshing: 'Data refreshing',
|
|
8
|
+
active: 'Active',
|
|
9
|
+
empty: 'Empty',
|
|
10
|
+
};
|
|
11
|
+
const VALUE_TO_DESC = {
|
|
12
|
+
refreshing: 'Data retrieval is in progress',
|
|
13
|
+
active: 'Disk is ready to provision clones',
|
|
14
|
+
empty: 'Disk is emptied and ready for a data retrieval',
|
|
15
|
+
};
|
|
16
|
+
const useStyles = makeStyles({
|
|
17
|
+
root: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
color: colors.white,
|
|
20
|
+
},
|
|
21
|
+
warning: {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flex: '0 0 16px',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
marginRight: '4px',
|
|
27
|
+
height: '16px',
|
|
28
|
+
background: colors.state.warning,
|
|
29
|
+
borderRadius: '3px',
|
|
30
|
+
},
|
|
31
|
+
icon: {
|
|
32
|
+
height: '10px',
|
|
33
|
+
},
|
|
34
|
+
label: {
|
|
35
|
+
fontSize: '12px',
|
|
36
|
+
padding: '1px 6px',
|
|
37
|
+
borderRadius: '3px',
|
|
38
|
+
flex: '0 0 auto',
|
|
39
|
+
background: (props) => {
|
|
40
|
+
if (props.value === 'refreshing')
|
|
41
|
+
return colors.state.notice;
|
|
42
|
+
if (props.value === 'active')
|
|
43
|
+
return colors.state.ok;
|
|
44
|
+
return colors.state.unknown;
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
}, { index: 1 });
|
|
48
|
+
export const Status = (props) => {
|
|
49
|
+
const { value, hasWarning } = props;
|
|
50
|
+
const classes = useStyles(props);
|
|
51
|
+
return (_jsxs("div", { className: classes.root, children: [hasWarning && (_jsx("div", { className: classes.warning, children: _jsx(WarningIcon, { className: classes.icon }) })), _jsx(Tooltip, { content: VALUE_TO_DESC[value], children: _jsx("div", { className: classes.label, children: VALUE_TO_NAME[value] }) })] }));
|
|
52
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare type Props = {
|
|
3
|
+
id: string | null;
|
|
4
|
+
name: string;
|
|
5
|
+
totalDataSize: number;
|
|
6
|
+
mode: string;
|
|
7
|
+
refreshingStartDate: Date | null;
|
|
8
|
+
clonesCount: number;
|
|
9
|
+
snapshotsCount: number;
|
|
10
|
+
usedDataSize: number;
|
|
11
|
+
freeDataSize: number;
|
|
12
|
+
status: 'refreshing' | 'active' | 'empty';
|
|
13
|
+
};
|
|
14
|
+
export declare const Disk: (props: Props) => JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@material-ui/core';
|
|
3
|
+
import { formatDistanceToNowStrict } from 'date-fns';
|
|
4
|
+
import { colors } from '@postgres.ai/shared/styles/colors';
|
|
5
|
+
import { formatBytesIEC } from '@postgres.ai/shared/utils/units';
|
|
6
|
+
import { Status as PerformanceStatus } from '@postgres.ai/shared/components/Status';
|
|
7
|
+
import { formatUTC, isValidDate } from '@postgres.ai/shared/utils/date';
|
|
8
|
+
import { Property } from '../../components/Property';
|
|
9
|
+
import { ActionsMenu } from './ActionsMenu';
|
|
10
|
+
import { Status } from './Status';
|
|
11
|
+
import { Marker } from './Marker';
|
|
12
|
+
import { ProgressBar } from './ProgressBar';
|
|
13
|
+
const WARNING_THRESHOLD_PERCENT = 80;
|
|
14
|
+
const useStyles = makeStyles({
|
|
15
|
+
root: {
|
|
16
|
+
border: `1px solid ${colors.consoleStroke}`,
|
|
17
|
+
padding: '6px 8px 8px',
|
|
18
|
+
borderRadius: '4px',
|
|
19
|
+
'& + $root': {
|
|
20
|
+
marginTop: '8px',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
header: {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
justifyContent: 'space-between',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
},
|
|
28
|
+
titleWrapper: {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flex: '1 1 auto',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
marginRight: '16px',
|
|
33
|
+
minWidth: 0,
|
|
34
|
+
},
|
|
35
|
+
title: {
|
|
36
|
+
fontWeight: 700,
|
|
37
|
+
fontSize: '14px',
|
|
38
|
+
margin: '0 4px 0 0',
|
|
39
|
+
whiteSpace: 'nowrap',
|
|
40
|
+
textOverflow: 'ellipsis',
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
},
|
|
43
|
+
content: {
|
|
44
|
+
marginTop: '8px',
|
|
45
|
+
},
|
|
46
|
+
markerUsed: {
|
|
47
|
+
color: colors.primary.light,
|
|
48
|
+
},
|
|
49
|
+
markerFree: {
|
|
50
|
+
color: colors.gray,
|
|
51
|
+
},
|
|
52
|
+
warningMessage: {
|
|
53
|
+
fontSize: '10px',
|
|
54
|
+
marginTop: '6px',
|
|
55
|
+
},
|
|
56
|
+
uppercaseContent: {
|
|
57
|
+
textTransform: 'uppercase',
|
|
58
|
+
},
|
|
59
|
+
}, { index: 1 });
|
|
60
|
+
const getPercent = (value, total) => Math.round((value / total) * 100);
|
|
61
|
+
export const Disk = (props) => {
|
|
62
|
+
const classes = useStyles();
|
|
63
|
+
const shouldShowWarning = props.status === 'active' &&
|
|
64
|
+
getPercent(props.usedDataSize, props.totalDataSize) >
|
|
65
|
+
WARNING_THRESHOLD_PERCENT;
|
|
66
|
+
return (_jsxs("div", { className: classes.root, children: [_jsxs("div", { className: classes.header, children: [_jsxs("div", { className: classes.titleWrapper, children: [_jsx("h6", { title: props.name, className: classes.title, children: props.name }), _jsx(ActionsMenu, { poolId: props.id, poolName: props.name, isActive: props.status === 'active' })] }), _jsx(Status, { value: props.status, hasWarning: shouldShowWarning })] }), _jsx(Property, { name: "Mode", classes: { content: classes.uppercaseContent }, children: props.mode }), props.status === 'refreshing' && props.refreshingStartDate && (_jsx("div", { className: classes.content, children: _jsxs(Property, { name: "Refreshing started at", children: [formatUTC(props.refreshingStartDate, 'yyyy-MM-dd HH:mm:ss'), " UTC (", isValidDate(props.refreshingStartDate)
|
|
67
|
+
? formatDistanceToNowStrict(props.refreshingStartDate, {
|
|
68
|
+
addSuffix: true,
|
|
69
|
+
})
|
|
70
|
+
: '-', ")"] }) })), _jsxs("div", { className: classes.content, children: [_jsx(Property, { name: "Clones", children: props.clonesCount }), _jsx(Property, { name: "Snapshots", children: props.snapshotsCount })] }), _jsxs("div", { className: classes.content, children: [_jsx(Property, { name: "Size", children: formatBytesIEC(props.totalDataSize) }), _jsxs(Property, { name: _jsxs(_Fragment, { children: ["Used\u00A0", _jsx(Marker, { className: classes.markerUsed })] }), children: [formatBytesIEC(props.usedDataSize), " /", ' ', getPercent(props.usedDataSize, props.totalDataSize), " %"] }), _jsxs(Property, { name: _jsxs(_Fragment, { children: ["Free\u00A0", _jsx(Marker, { className: classes.markerFree })] }), children: [formatBytesIEC(props.freeDataSize), " /", ' ', getPercent(props.freeDataSize, props.totalDataSize), " %"] })] }), _jsx(ProgressBar, { value: props.usedDataSize, total: props.totalDataSize, thresholdPercent: WARNING_THRESHOLD_PERCENT }), shouldShowWarning && (_jsxs(PerformanceStatus, { type: "warning", className: classes.warningMessage, children: ["+", WARNING_THRESHOLD_PERCENT, "% disk usage may result in performance degradation"] }))] }));
|
|
71
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) 2019-2021, Postgres.ai, Nikolay Samokhvalov nik@postgres.ai
|
|
4
|
+
* All Rights Reserved. Proprietary and confidential.
|
|
5
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited
|
|
6
|
+
*--------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { observer } from 'mobx-react-lite';
|
|
9
|
+
import { useStores } from '@postgres.ai/shared/pages/Instance/context';
|
|
10
|
+
import { Section } from '../components/Section';
|
|
11
|
+
import { Disk } from './Disk';
|
|
12
|
+
export const Disks = observer(() => {
|
|
13
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
14
|
+
const stores = useStores();
|
|
15
|
+
const { instance, snapshots } = stores.main;
|
|
16
|
+
if (!instance)
|
|
17
|
+
return null;
|
|
18
|
+
if (!snapshots)
|
|
19
|
+
return null;
|
|
20
|
+
return (_jsx(Section, { title: "Disks", children: (_k = (_c = (_b = (_a = instance.state) === null || _a === void 0 ? void 0 : _a.pools) === null || _b === void 0 ? void 0 : _b.map((pool) => {
|
|
21
|
+
var _a, _b, _c, _d, _e;
|
|
22
|
+
return (_jsx(Disk, { status: pool.status, name: pool.name, id: pool.name, mode: pool.mode, clonesCount: pool.cloneList.length, snapshotsCount: (_b = (_a = snapshots.data) === null || _a === void 0 ? void 0 : _a.filter((snapshot) => snapshot.pool === pool.name).length) !== null && _b !== void 0 ? _b : 0, totalDataSize: pool.fileSystem.size, usedDataSize: pool.fileSystem.used, freeDataSize: pool.fileSystem.free, refreshingStartDate: (_e = (_d = (_c = instance.state) === null || _c === void 0 ? void 0 : _c.retrieving) === null || _d === void 0 ? void 0 : _d.lastRefresh) !== null && _e !== void 0 ? _e : null }, pool.name));
|
|
23
|
+
})) !== null && _c !== void 0 ? _c : (((_d = instance.state) === null || _d === void 0 ? void 0 : _d.fileSystem) && (_jsx(Disk, { status: 'active', name: 'Main', id: null, mode: "ZFS", clonesCount: (_g = (_f = (_e = instance.state) === null || _e === void 0 ? void 0 : _e.clones) === null || _f === void 0 ? void 0 : _f.length) !== null && _g !== void 0 ? _g : instance.state.cloning.clones.length, snapshotsCount: (_j = (_h = snapshots.data) === null || _h === void 0 ? void 0 : _h.length) !== null && _j !== void 0 ? _j : 0, totalDataSize: instance.state.fileSystem.size, usedDataSize: instance.state.fileSystem.used, freeDataSize: instance.state.fileSystem.free, refreshingStartDate: null })))) !== null && _k !== void 0 ? _k : (_jsxs(_Fragment, { children: ["Disk information is ", _jsx("strong", { children: "unavailable" }), "."] })) }));
|
|
24
|
+
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export const ArrowLeft = ({ className }) => (_jsxs("svg", { width: "20", height: "21", viewBox: "0 0 20 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: [_jsx("path", { d: "M0.307554 9.50891L9.50896 0.307513C9.91902 -0.102504 10.583 -0.102504 10.9931 0.307513C11.4031 0.7172 11.4031 1.38195 10.9931 1.79163L2.53369 10.251L10.993 18.7103C11.403 19.12 11.403 19.7847 10.993 20.1944C10.788 20.3995 10.5196 20.502 10.251 20.502C9.98229 20.502 9.71356 20.3995 9.50891 20.1944L0.307507 10.993C-0.102512 10.5833 -0.10251 9.9186 0.307554 9.50891Z", fill: "white" }), _jsx("path", { d: "M9.00696 9.50891L18.2084 0.307513C18.6181 -0.102504 19.2828 -0.102504 19.6925 0.307513C20.1025 0.7172 20.1025 1.38195 19.6925 1.79163L11.2335 10.251L19.6924 18.7103C20.1025 19.12 20.1025 19.7847 19.6924 20.1944C19.4878 20.3995 19.2191 20.502 18.9504 20.502C18.6817 20.502 18.413 20.3995 18.2083 20.1944L9.00692 10.993C8.59695 10.5833 8.59695 9.9186 9.00696 9.50891Z", fill: "white" })] }));
|
|
3
|
+
export const ArrowRight = ({ className }) => (_jsxs("svg", { width: "21", height: "21", viewBox: "0 0 21 21", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: [_jsx("path", { d: "M20.211 9.5089L10.8896 0.307513C10.4742 -0.102504 9.80151 -0.102504 9.38609 0.307513C8.97073 0.717199 8.97073 1.38195 9.38609 1.79163L17.9558 10.251L9.38614 18.7103C8.97078 19.12 8.97078 19.7847 9.38614 20.1944C9.59385 20.3994 9.8657 20.502 10.1379 20.502C10.4101 20.502 10.6823 20.3994 10.8896 20.1944L20.211 10.993C20.6264 10.5833 20.6264 9.91859 20.211 9.5089Z", fill: "white" }), _jsx("path", { d: "M11.3981 9.5089L2.07672 0.307513C1.66169 -0.102504 0.988271 -0.102504 0.573242 0.307513C0.157878 0.717199 0.157878 1.38195 0.573242 1.79163L9.14256 10.251L0.57329 18.7103C0.157926 19.12 0.157926 19.7847 0.57329 20.1944C0.780613 20.3994 1.05284 20.502 1.32503 20.502C1.59721 20.502 1.86944 20.3994 2.07677 20.1944L11.3982 10.993C11.8135 10.5833 11.8135 9.91859 11.3981 9.5089Z", fill: "white" })] }));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { observer } from 'mobx-react-lite';
|
|
3
|
+
import { useStores } from '@postgres.ai/shared/pages/Instance/context';
|
|
4
|
+
import { WarningIcon } from '@postgres.ai/shared/icons/Warning';
|
|
5
|
+
import { formatDateStd } from '@postgres.ai/shared/utils/date';
|
|
6
|
+
import { Property } from '../../components/Property';
|
|
7
|
+
import styles from './styles.module.scss';
|
|
8
|
+
export const RefreshFailedAlert = observer(() => {
|
|
9
|
+
var _a, _b, _c, _d;
|
|
10
|
+
const stores = useStores();
|
|
11
|
+
const refreshFailed = (_d = (_c = (_b = (_a = stores.main.instance) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.retrieving) === null || _c === void 0 ? void 0 : _c.alerts) === null || _d === void 0 ? void 0 : _d.refreshFailed;
|
|
12
|
+
if (!refreshFailed)
|
|
13
|
+
return null;
|
|
14
|
+
return (_jsxs("div", { className: styles.root, children: [_jsxs("div", { className: styles.header, children: [_jsx("h6", { className: styles.title, children: refreshFailed.message }), _jsx(WarningIcon, { className: styles.icon })] }), _jsx(Property, { classes: { name: styles.propertyName }, name: "Last seen", children: formatDateStd(refreshFailed.lastSeen, { withDistance: true }) }), _jsx(Property, { classes: { name: styles.propertyName }, name: "Count", children: refreshFailed.count })] }));
|
|
15
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ActivityType } from '@postgres.ai/shared/types/api/entities/instanceRetrieval';
|
|
3
|
+
export declare const RetrievalModal: ({ isOpen, onClose, data, }: {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
data: {
|
|
7
|
+
source: ActivityType[];
|
|
8
|
+
target: ActivityType[];
|
|
9
|
+
};
|
|
10
|
+
}) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Modal } from '@postgres.ai/shared/components/Modal';
|
|
3
|
+
import { useStores } from '@postgres.ai/shared/pages/Instance/context';
|
|
4
|
+
import { ModalReloadButton } from '@postgres.ai/shared/pages/Instance/components/ModalReloadButton';
|
|
5
|
+
import { RetrievalTable } from '../RetrievalTable';
|
|
6
|
+
import styles from './styles.module.scss';
|
|
7
|
+
export const RetrievalModal = ({ isOpen, onClose, data, }) => {
|
|
8
|
+
const stores = useStores();
|
|
9
|
+
const { isReloadingInstanceRetrieval, reloadInstanceRetrieval } = stores.main;
|
|
10
|
+
return (_jsx(Modal, { title: "Retrieval activity details", isOpen: isOpen, onClose: onClose, size: "md", titleRightContent: _jsx(ModalReloadButton, { isReloading: isReloadingInstanceRetrieval, onReload: reloadInstanceRetrieval }), children: _jsxs("div", { className: styles.tableContainer, children: [_jsx(RetrievalTable, { data: data === null || data === void 0 ? void 0 : data.source, activity: "source" }), _jsx(RetrievalTable, { data: data === null || data === void 0 ? void 0 : data.target, activity: "target" })] }) }));
|
|
11
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Table, TableHead, TableRow, TableCell, TableBody, } from '@material-ui/core';
|
|
3
|
+
import styles from './styles.module.scss';
|
|
4
|
+
export const RetrievalTable = ({ data, activity, }) => {
|
|
5
|
+
return (_jsxs(Table, { children: [_jsx(TableHead, { children: _jsx(TableRow, { children: _jsxs(TableCell, { className: styles.tableSubtitle, children: ["Activity on the ", activity] }) }) }), _jsx(TableBody, { className: styles.tableBody, children: data && data.length > 0 ? (data.map((item, index) => (_jsx("div", { children: Object.entries(item).map((val, index) => (_jsx(TableRow, { hover: true, className: styles.tableRow, children: _jsxs(TableCell, { children: [val[0], ": ", val[1]] }) }, index))) }, index)))) : (_jsx(TableBody, { className: styles.tableBody, children: _jsx("div", { children: _jsx(TableRow, { className: styles.tableRow, children: _jsxs(TableCell, { children: ["No activity on the ", activity] }) }) }) })) })] }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { observer } from 'mobx-react-lite';
|
|
4
|
+
import { makeStyles } from '@material-ui/core';
|
|
5
|
+
import { useStores } from '@postgres.ai/shared/pages/Instance/context';
|
|
6
|
+
import { Status } from '@postgres.ai/shared/components/Status';
|
|
7
|
+
import { capitalize } from '@postgres.ai/shared/utils/strings';
|
|
8
|
+
import { formatDateStd } from '@postgres.ai/shared/utils/date';
|
|
9
|
+
import { Button } from '@postgres.ai/shared/components/Button2';
|
|
10
|
+
import { Section } from '../components/Section';
|
|
11
|
+
import { Property } from '../components/Property';
|
|
12
|
+
import { RefreshFailedAlert } from './RefreshFailedAlert';
|
|
13
|
+
import { getTypeByStatus, isRetrievalUnknown } from './utils';
|
|
14
|
+
import { RetrievalModal } from './RetrievalModal';
|
|
15
|
+
const useStyles = makeStyles(() => ({
|
|
16
|
+
infoIcon: {
|
|
17
|
+
height: '12px',
|
|
18
|
+
width: '12px',
|
|
19
|
+
marginLeft: '8px',
|
|
20
|
+
color: '#808080',
|
|
21
|
+
},
|
|
22
|
+
detailsButton: {
|
|
23
|
+
marginLeft: '8px',
|
|
24
|
+
},
|
|
25
|
+
}), { index: 1 });
|
|
26
|
+
export const Retrieval = observer(() => {
|
|
27
|
+
var _a;
|
|
28
|
+
const stores = useStores();
|
|
29
|
+
const classes = useStyles();
|
|
30
|
+
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
31
|
+
const { instance, instanceRetrieval } = stores.main;
|
|
32
|
+
if (!instance)
|
|
33
|
+
return null;
|
|
34
|
+
const retrieving = (_a = instance.state) === null || _a === void 0 ? void 0 : _a.retrieving;
|
|
35
|
+
if (!retrieving)
|
|
36
|
+
return null;
|
|
37
|
+
if (!instanceRetrieval)
|
|
38
|
+
return null;
|
|
39
|
+
const { mode, status, activity } = instanceRetrieval;
|
|
40
|
+
const isVisible = mode !== 'physical' && !isRetrievalUnknown(mode);
|
|
41
|
+
const isActive = mode === 'logical' && status === 'refreshing';
|
|
42
|
+
return (_jsxs(Section, { title: "Retrieval", children: [_jsx(Property, { name: "Status", children: _jsxs(Status, { type: getTypeByStatus(retrieving.status), children: [capitalize(retrieving.status), isVisible && (_jsx(_Fragment, { children: _jsx(Button, { theme: "primary", onClick: () => setIsModalOpen(true), isDisabled: !isActive, className: classes.detailsButton, children: "Show details" }) }))] }) }), _jsx(Property, { name: "Mode", children: retrieving.mode }), _jsx(Property, { name: "Last refresh", children: retrieving.lastRefresh
|
|
43
|
+
? formatDateStd(retrieving.lastRefresh, { withDistance: true })
|
|
44
|
+
: '-' }), _jsx(Property, { name: "Next refresh", children: retrieving.nextRefresh
|
|
45
|
+
? formatDateStd(retrieving.nextRefresh, { withDistance: true })
|
|
46
|
+
: 'Not scheduled' }), _jsx(RefreshFailedAlert, {}), _jsx(RetrievalModal, { data: activity, isOpen: isModalOpen, onClose: () => setIsModalOpen(false) })] }));
|
|
47
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const getTypeByStatus = (status) => {
|
|
2
|
+
if (status === 'finished')
|
|
3
|
+
return 'ok';
|
|
4
|
+
if (status === 'refreshing')
|
|
5
|
+
return 'waiting';
|
|
6
|
+
if (status === 'failed')
|
|
7
|
+
return 'error';
|
|
8
|
+
return 'unknown';
|
|
9
|
+
};
|
|
10
|
+
export const isRetrievalUnknown = (mode) => {
|
|
11
|
+
return mode === 'unknown' || mode === '';
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Snapshot } from '@postgres.ai/shared/types/api/entities/snapshot';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
date: Date;
|
|
5
|
+
snapshots: Snapshot[];
|
|
6
|
+
isBreak: boolean;
|
|
7
|
+
isDisabled: boolean;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
};
|
|
10
|
+
export declare const Day: (props: Props) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) 2019-2021, Postgres.ai, Nikolay Samokhvalov nik@postgres.ai
|
|
4
|
+
* All Rights Reserved. Proprietary and confidential.
|
|
5
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited
|
|
6
|
+
*--------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { makeStyles } from '@material-ui/core';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import { isSameDayUTC, formatUTC } from '@postgres.ai/shared/utils/date';
|
|
11
|
+
import { colors } from '@postgres.ai/shared/styles/colors';
|
|
12
|
+
import { Tooltip } from '@postgres.ai/shared/components/Tooltip';
|
|
13
|
+
const CELL_SIZE = 28;
|
|
14
|
+
const useStyles = makeStyles({
|
|
15
|
+
root: {
|
|
16
|
+
position: 'relative',
|
|
17
|
+
cursor: 'default',
|
|
18
|
+
flex: `0 0 ${CELL_SIZE}px`,
|
|
19
|
+
background: '#f4f4f4',
|
|
20
|
+
height: `${CELL_SIZE}px`,
|
|
21
|
+
display: 'flex',
|
|
22
|
+
borderRadius: `${CELL_SIZE / 2}px`,
|
|
23
|
+
alignItems: 'center',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
marginTop: '16px',
|
|
26
|
+
fontSize: '12px',
|
|
27
|
+
},
|
|
28
|
+
rootHasSnapshots: {
|
|
29
|
+
background: colors.secondary2.lightLight,
|
|
30
|
+
cursor: 'pointer',
|
|
31
|
+
},
|
|
32
|
+
rootCurrent: {
|
|
33
|
+
border: `1px solid ${colors.secondary2.main}`,
|
|
34
|
+
},
|
|
35
|
+
rootDisabled: {
|
|
36
|
+
opacity: '0.25',
|
|
37
|
+
pointerEvents: 'none',
|
|
38
|
+
},
|
|
39
|
+
itemsCount: {
|
|
40
|
+
top: '-8px',
|
|
41
|
+
right: '-6px',
|
|
42
|
+
position: 'absolute',
|
|
43
|
+
fontSize: '8px',
|
|
44
|
+
backgroundColor: colors.white,
|
|
45
|
+
border: `1px solid ${colors.secondary2.lightLight}`,
|
|
46
|
+
borderRadius: '8px',
|
|
47
|
+
height: '16px',
|
|
48
|
+
padding: '2px',
|
|
49
|
+
minWidth: '16px',
|
|
50
|
+
display: 'flex',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
},
|
|
54
|
+
break: {
|
|
55
|
+
flex: '0 0 100%',
|
|
56
|
+
},
|
|
57
|
+
}, { index: 1 });
|
|
58
|
+
export const Day = (props) => {
|
|
59
|
+
const { date, isBreak, snapshots, isDisabled, onClick } = props;
|
|
60
|
+
const classes = useStyles();
|
|
61
|
+
const today = new Date();
|
|
62
|
+
const breakRendered = isBreak && _jsx("div", { className: classes.break });
|
|
63
|
+
const dayRendered = (_jsxs("div", { className: clsx(classes.root, snapshots.length && classes.rootHasSnapshots, isDisabled && classes.rootDisabled, isSameDayUTC(today, date) && classes.rootCurrent), onClick: snapshots.length ? onClick : void 0, children: [!!snapshots.length && (_jsx("div", { className: classes.itemsCount, children: snapshots.length })), formatUTC(date, 'd')] }));
|
|
64
|
+
if (snapshots.length) {
|
|
65
|
+
const contentRendered = (_jsx(_Fragment, { children: snapshots.map((snapshot) => {
|
|
66
|
+
return _jsx("div", { children: snapshot.dataStateAt }, snapshot.id);
|
|
67
|
+
}) }));
|
|
68
|
+
return (_jsxs(_Fragment, { children: [_jsx(Tooltip, { content: contentRendered, disableTouchListener: true, children: dayRendered }), breakRendered] }));
|
|
69
|
+
}
|
|
70
|
+
return (_jsxs(_Fragment, { children: [dayRendered, breakRendered] }));
|
|
71
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Snapshot } from '@postgres.ai/shared/types/api/entities/snapshot';
|
|
3
|
+
declare type Props = {
|
|
4
|
+
snapshots: Snapshot[];
|
|
5
|
+
onSelectDate: (date: Date) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare const Calendar: (props: Props) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/*--------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) 2019-2021, Postgres.ai, Nikolay Samokhvalov nik@postgres.ai
|
|
4
|
+
* All Rights Reserved. Proprietary and confidential.
|
|
5
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited
|
|
6
|
+
*--------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { useState } from 'react';
|
|
9
|
+
import { makeStyles, IconButton } from '@material-ui/core';
|
|
10
|
+
import { ArrowLeft, ArrowRight } from '@material-ui/icons';
|
|
11
|
+
import { colors } from '@postgres.ai/shared/styles/colors';
|
|
12
|
+
import { formatUTC } from '@postgres.ai/shared/utils/date';
|
|
13
|
+
import { Day } from './Day';
|
|
14
|
+
import { getPrevMonthStartDate, getNextMonthStartDate, canGetNextMonthStartDate, getMonthStartDate, getCalendar, } from './utils';
|
|
15
|
+
const useStyles = makeStyles({
|
|
16
|
+
root: {
|
|
17
|
+
marginTop: '8px',
|
|
18
|
+
},
|
|
19
|
+
header: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
justifyContent: 'space-between',
|
|
23
|
+
},
|
|
24
|
+
title: {
|
|
25
|
+
fontWeight: 700,
|
|
26
|
+
fontSize: '12px',
|
|
27
|
+
},
|
|
28
|
+
button: {
|
|
29
|
+
padding: '8px',
|
|
30
|
+
'&:disabled': {
|
|
31
|
+
pointerEvents: 'auto',
|
|
32
|
+
cursor: 'not-allowed',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
buttonIcon: {
|
|
36
|
+
fontSize: '20px',
|
|
37
|
+
},
|
|
38
|
+
days: {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
flexWrap: 'wrap',
|
|
41
|
+
justifyContent: 'space-between',
|
|
42
|
+
},
|
|
43
|
+
weekDay: {
|
|
44
|
+
fontSize: '12px',
|
|
45
|
+
flex: '0 0 24px',
|
|
46
|
+
textAlign: 'center',
|
|
47
|
+
color: colors.pgaiDarkGray,
|
|
48
|
+
marginTop: '12px',
|
|
49
|
+
},
|
|
50
|
+
}, { index: 1 });
|
|
51
|
+
export const Calendar = (props) => {
|
|
52
|
+
const { snapshots, onSelectDate } = props;
|
|
53
|
+
const [monthStartDate, setMonthStartDate] = useState(getMonthStartDate);
|
|
54
|
+
const classes = useStyles();
|
|
55
|
+
const nextMonth = () => {
|
|
56
|
+
const nextMonthStartDate = getNextMonthStartDate(monthStartDate);
|
|
57
|
+
setMonthStartDate(nextMonthStartDate);
|
|
58
|
+
};
|
|
59
|
+
const prevMonth = () => {
|
|
60
|
+
const prevMonthStartDate = getPrevMonthStartDate(monthStartDate);
|
|
61
|
+
setMonthStartDate(prevMonthStartDate);
|
|
62
|
+
};
|
|
63
|
+
const calendar = getCalendar(monthStartDate, snapshots);
|
|
64
|
+
return (_jsxs("div", { className: classes.root, children: [_jsxs("div", { className: classes.header, children: [_jsxs("span", { className: classes.title, children: [formatUTC(monthStartDate, 'MMMM y'), " UTC"] }), _jsxs("div", { children: [_jsx(IconButton, { onClick: prevMonth, className: classes.button, children: _jsx(ArrowLeft, { className: classes.buttonIcon }) }), _jsx(IconButton, { onClick: nextMonth, disabled: !canGetNextMonthStartDate(monthStartDate), className: classes.button, children: _jsx(ArrowRight, { className: classes.buttonIcon }) })] })] }), _jsx("div", { className: classes.days, children: calendar.weekDays.map((weekDay) => {
|
|
65
|
+
return (_jsx("div", { className: classes.weekDay, children: weekDay }, weekDay));
|
|
66
|
+
}) }), _jsx("div", { className: classes.days, children: calendar.days.map((day) => (_jsx(Day, { onClick: () => onSelectDate(day.date), isBreak: day.isBreak, isDisabled: day.isDisabled, date: day.date, snapshots: day.snapshots }, day.date.getTime()))) })] }));
|
|
67
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Snapshot } from '@postgres.ai/shared/types/api/entities/snapshot';
|
|
2
|
+
export declare const getMonthStartDate: () => Date;
|
|
3
|
+
export declare const getCalendar: (monthStartDate: Date, snapshots: Snapshot[]) => {
|
|
4
|
+
weekDays: string[];
|
|
5
|
+
days: {
|
|
6
|
+
date: Date;
|
|
7
|
+
snapshots: {
|
|
8
|
+
createdAtDate: Date;
|
|
9
|
+
dataStateAtDate: Date;
|
|
10
|
+
numClones: string | number;
|
|
11
|
+
clones: string[];
|
|
12
|
+
createdAt: string;
|
|
13
|
+
dataStateAt: string;
|
|
14
|
+
id: string;
|
|
15
|
+
pool: string;
|
|
16
|
+
physicalSize: number;
|
|
17
|
+
logicalSize: number;
|
|
18
|
+
message: string;
|
|
19
|
+
branch: string;
|
|
20
|
+
}[];
|
|
21
|
+
isBreak: boolean;
|
|
22
|
+
isDisabled: boolean;
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
export declare const getPrevMonthStartDate: (monthStartDate: Date) => Date;
|
|
26
|
+
export declare const getNextMonthStartDate: (monthStartDate: Date) => Date;
|
|
27
|
+
export declare const canGetNextMonthStartDate: (monthStartDate: Date) => boolean;
|