@postgres.ai/shared 3.5.1-pr-1027.0
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/.gitlab-ci.yml +60 -0
- package/components/AlertSnackbar/index.tsx +23 -0
- package/components/AlertSnackbar/useAlertSnackbar.tsx +65 -0
- package/components/Button/index.tsx +79 -0
- package/components/Button2/index.tsx +43 -0
- package/components/Button2/styles.module.scss +82 -0
- package/components/DestroyCloneModal/index.tsx +56 -0
- package/components/DestroyCloneRestrictionModal/index.tsx +50 -0
- package/components/ErrorStub/index.tsx +83 -0
- package/components/FormattedText/index.tsx +44 -0
- package/components/FormattedText/styles.module.scss +34 -0
- package/components/GatewayLink/index.tsx +33 -0
- package/components/HorizontalScrollContainer/index.tsx +131 -0
- package/components/HorizontalScrollContainer/types.ts +12 -0
- package/components/HorizontalScrollContainer/utils.ts +16 -0
- package/components/ImportantText/index.tsx +29 -0
- package/components/Link2/index.tsx +31 -0
- package/components/Link2/styles.module.scss +12 -0
- package/components/MenuButton/index.tsx +80 -0
- package/components/MenuButton/styles.module.scss +42 -0
- package/components/Modal/index.tsx +93 -0
- package/components/PageSpinner/index.tsx +18 -0
- package/components/PageSpinner/styles.module.scss +13 -0
- package/components/ResetCloneModal/index.tsx +154 -0
- package/components/SectionTitle/index.tsx +74 -0
- package/components/Select/index.tsx +42 -0
- package/components/SimpleModalControls/index.tsx +56 -0
- package/components/Spinner/icon.tsx +29 -0
- package/components/Spinner/index.tsx +16 -0
- package/components/Spinner/styles.module.scss +33 -0
- package/components/Status/index.tsx +61 -0
- package/components/Status/styles.module.scss +45 -0
- package/components/StubContainer/index.tsx +41 -0
- package/components/StubSpinner/index.tsx +49 -0
- package/components/StubSpinnerFlex/index.tsx +20 -0
- package/components/StubSpinnerFlex/styles.module.scss +20 -0
- package/components/SyntaxHighlight/index.tsx +107 -0
- package/components/Table/RowMenu/index.tsx +111 -0
- package/components/Table/index.tsx +140 -0
- package/components/Text/index.tsx +28 -0
- package/components/TextField/index.tsx +117 -0
- package/components/Tooltip/index.tsx +52 -0
- package/config/index.ts +32 -0
- package/config/links.ts +6 -0
- package/craco.config.js +80 -0
- package/helpers/getEntropy.ts +232 -0
- package/helpers/localStorage.ts +15 -0
- package/helpers/request.ts +47 -0
- package/hooks/useWindowDimensions.ts +16 -0
- package/icons/ArrowDropDown/index.tsx +29 -0
- package/icons/Circle/index.tsx +27 -0
- package/icons/External/index.tsx +14 -0
- package/icons/Info/index.tsx +12 -0
- package/icons/Renewable/index.tsx +65 -0
- package/icons/Shield/index.tsx +33 -0
- package/icons/Warning/index.tsx +29 -0
- package/meta.json +1 -0
- package/package.json +55 -0
- package/pages/Clone/Status/index.tsx +73 -0
- package/pages/Clone/context.ts +22 -0
- package/pages/Clone/index.tsx +634 -0
- package/pages/Clone/stores/Main.ts +206 -0
- package/pages/Clone/useCreatedStores.ts +11 -0
- package/pages/Configuration/Header/index.tsx +84 -0
- package/pages/Configuration/InputWithTooltip/index.tsx +240 -0
- package/pages/Configuration/ResponseMessage/index.tsx +71 -0
- package/pages/Configuration/configOptions.ts +60 -0
- package/pages/Configuration/index.tsx +1184 -0
- package/pages/Configuration/styles.module.scss +122 -0
- package/pages/Configuration/tooltipText.tsx +157 -0
- package/pages/Configuration/useForm.ts +108 -0
- package/pages/Configuration/utils/index.ts +153 -0
- package/pages/CreateClone/index.tsx +311 -0
- package/pages/CreateClone/stores/Main.ts +107 -0
- package/pages/CreateClone/styles.module.scss +71 -0
- package/pages/CreateClone/useCreatedStores.ts +11 -0
- package/pages/CreateClone/useForm.ts +36 -0
- package/pages/Instance/Clones/Header/Item/index.tsx +15 -0
- package/pages/Instance/Clones/Header/Item/styles.module.scss +17 -0
- package/pages/Instance/Clones/Header/index.tsx +74 -0
- package/pages/Instance/Clones/Header/styles.module.scss +11 -0
- package/pages/Instance/Clones/index.tsx +135 -0
- package/pages/Instance/ClonesModal/index.tsx +71 -0
- package/pages/Instance/ClonesModal/utils.ts +21 -0
- package/pages/Instance/InactiveInstance/index.tsx +165 -0
- package/pages/Instance/InactiveInstance/utils.ts +9 -0
- package/pages/Instance/Info/Connection/ConnectModal/Content/index.tsx +176 -0
- package/pages/Instance/Info/Connection/ConnectModal/Content/utils.ts +24 -0
- package/pages/Instance/Info/Connection/ConnectModal/index.tsx +36 -0
- package/pages/Instance/Info/Connection/index.tsx +81 -0
- package/pages/Instance/Info/Details/index.tsx +20 -0
- package/pages/Instance/Info/Disks/Disk/ActionsMenu/index.tsx +100 -0
- package/pages/Instance/Info/Disks/Disk/Marker/index.tsx +26 -0
- package/pages/Instance/Info/Disks/Disk/ProgressBar/PointerIcon.tsx +20 -0
- package/pages/Instance/Info/Disks/Disk/ProgressBar/index.tsx +73 -0
- package/pages/Instance/Info/Disks/Disk/Status/index.tsx +75 -0
- package/pages/Instance/Info/Disks/Disk/index.tsx +168 -0
- package/pages/Instance/Info/Disks/index.tsx +65 -0
- package/pages/Instance/Info/Icons/index.tsx +39 -0
- package/pages/Instance/Info/Retrieval/RefreshFailedAlert/index.tsx +32 -0
- package/pages/Instance/Info/Retrieval/RefreshFailedAlert/styles.module.scss +33 -0
- package/pages/Instance/Info/Retrieval/RetrievalModal/index.tsx +49 -0
- package/pages/Instance/Info/Retrieval/RetrievalModal/styles.module.scss +6 -0
- package/pages/Instance/Info/Retrieval/RetrievalTable/index.tsx +53 -0
- package/pages/Instance/Info/Retrieval/RetrievalTable/styles.module.scss +29 -0
- package/pages/Instance/Info/Retrieval/index.tsx +95 -0
- package/pages/Instance/Info/Retrieval/utils.ts +10 -0
- package/pages/Instance/Info/Snapshots/Calendar/Day/index.tsx +125 -0
- package/pages/Instance/Info/Snapshots/Calendar/index.tsx +133 -0
- package/pages/Instance/Info/Snapshots/Calendar/utils.ts +74 -0
- package/pages/Instance/Info/Snapshots/TimeLine/Day/index.tsx +79 -0
- package/pages/Instance/Info/Snapshots/TimeLine/index.tsx +57 -0
- package/pages/Instance/Info/Snapshots/index.tsx +97 -0
- package/pages/Instance/Info/Snapshots/utils.ts +18 -0
- package/pages/Instance/Info/Status/InstanceResponseModal/index.tsx +32 -0
- package/pages/Instance/Info/Status/InstanceResponseModal/styles.module.scss +3 -0
- package/pages/Instance/Info/Status/index.tsx +85 -0
- package/pages/Instance/Info/Status/styles.module.scss +12 -0
- package/pages/Instance/Info/Status/utils.ts +24 -0
- package/pages/Instance/Info/components/Property/index.tsx +32 -0
- package/pages/Instance/Info/components/Property/styles.module.scss +21 -0
- package/pages/Instance/Info/components/Section/index.tsx +50 -0
- package/pages/Instance/Info/components/ValueStatus/index.tsx +51 -0
- package/pages/Instance/Info/index.tsx +129 -0
- package/pages/Instance/SnapshotsModal/index.tsx +169 -0
- package/pages/Instance/SnapshotsModal/utils.ts +17 -0
- package/pages/Instance/Tabs/index.tsx +98 -0
- package/pages/Instance/components/ClonesList/ConnectionModal/index.tsx +196 -0
- package/pages/Instance/components/ClonesList/MenuCell/index.tsx +98 -0
- package/pages/Instance/components/ClonesList/MenuCell/utils.ts +21 -0
- package/pages/Instance/components/ClonesList/index.tsx +189 -0
- package/pages/Instance/components/ClonesList/styles.module.scss +32 -0
- package/pages/Instance/components/ErrorStub/index.tsx +77 -0
- package/pages/Instance/components/ModalReloadButton/index.tsx +43 -0
- package/pages/Instance/components/Tags/Tag/index.tsx +60 -0
- package/pages/Instance/components/Tags/index.tsx +42 -0
- package/pages/Instance/context.ts +39 -0
- package/pages/Instance/index.tsx +235 -0
- package/pages/Instance/stores/ClonesModal.ts +35 -0
- package/pages/Instance/stores/Main.ts +335 -0
- package/pages/Instance/stores/SnapshotsModal.ts +35 -0
- package/pages/Instance/styles.scss +40 -0
- package/pages/Instance/useCreatedStores.ts +14 -0
- package/pages/Logs/Icons/PlusIcon.tsx +8 -0
- package/pages/Logs/constants/index.ts +7 -0
- package/pages/Logs/hooks/useWsScroll.tsx +44 -0
- package/pages/Logs/index.tsx +267 -0
- package/pages/Logs/utils/index.ts +20 -0
- package/pages/Logs/wsLogs.ts +110 -0
- package/pages/Logs/wsSnackbar.ts +27 -0
- package/postgres.ai-shared-3.5.0.tgz +0 -0
- package/react-app-env.d.ts +71 -0
- package/scripts/copy-assets.js +30 -0
- package/scripts/pack.js +70 -0
- package/stores/Snapshots.ts +54 -0
- package/styles/colors.ts +67 -0
- package/styles/global.scss +29 -0
- package/styles/icons.tsx +1917 -0
- package/styles/mixins.scss +30 -0
- package/styles/styles.ts +87 -0
- package/styles/theme.ts +53 -0
- package/styles/vars.scss +43 -0
- package/styles/vars.ts +40 -0
- package/tsconfig.build.json +37 -0
- package/tsconfig.json +30 -0
- package/types/api/endpoints/createClone.ts +10 -0
- package/types/api/endpoints/destroyClone.ts +7 -0
- package/types/api/endpoints/getClone.ts +6 -0
- package/types/api/endpoints/getConfig.ts +6 -0
- package/types/api/endpoints/getEngine.ts +13 -0
- package/types/api/endpoints/getFullConfig.ts +4 -0
- package/types/api/endpoints/getInstance.ts +6 -0
- package/types/api/endpoints/getInstanceRetrieval.ts +6 -0
- package/types/api/endpoints/getSeImages.ts +22 -0
- package/types/api/endpoints/getSnapshots.ts +6 -0
- package/types/api/endpoints/getWSToken.ts +6 -0
- package/types/api/endpoints/initWS.ts +1 -0
- package/types/api/endpoints/refreshInstance.ts +4 -0
- package/types/api/endpoints/resetClone.ts +8 -0
- package/types/api/endpoints/testDbSource.ts +48 -0
- package/types/api/endpoints/updateClone.ts +10 -0
- package/types/api/endpoints/updateConfig.ts +6 -0
- package/types/api/entities/clone.ts +42 -0
- package/types/api/entities/config.ts +114 -0
- package/types/api/entities/dbSource.ts +13 -0
- package/types/api/entities/instance.ts +67 -0
- package/types/api/entities/instanceRetrieval.ts +46 -0
- package/types/api/entities/instanceState.ts +102 -0
- package/types/api/entities/pool.ts +27 -0
- package/types/api/entities/snapshot.ts +18 -0
- package/types/api/entities/wsToken.ts +7 -0
- package/types/byte-size/index.d.ts +22 -0
- package/utils/api.ts +30 -0
- package/utils/clone.ts +31 -0
- package/utils/connection.ts +38 -0
- package/utils/date.ts +87 -0
- package/utils/instance.ts +10 -0
- package/utils/numbers.ts +11 -0
- package/utils/react.ts +10 -0
- package/utils/snapshot.ts +4 -0
- package/utils/strings.ts +11 -0
- package/utils/units.ts +23 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2019-2021, Postgres.ai, Nikolay Samokhvalov nik@postgres.ai
|
|
3
|
+
* All Rights Reserved. Proprietary and confidential.
|
|
4
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited
|
|
5
|
+
*--------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { makeAutoObservable } from 'mobx'
|
|
9
|
+
|
|
10
|
+
import { Snapshot } from '@postgres.ai/shared/types/api/entities/snapshot'
|
|
11
|
+
import { GetSnapshots } from '@postgres.ai/shared/types/api/endpoints/getSnapshots'
|
|
12
|
+
|
|
13
|
+
export type SnapshotsApi = {
|
|
14
|
+
getSnapshots: GetSnapshots
|
|
15
|
+
}
|
|
16
|
+
export class SnapshotsStore {
|
|
17
|
+
data: Snapshot[] | null = null
|
|
18
|
+
error: string | null = null
|
|
19
|
+
isLoading = false
|
|
20
|
+
|
|
21
|
+
private readonly api: SnapshotsApi
|
|
22
|
+
|
|
23
|
+
constructor(api: SnapshotsApi) {
|
|
24
|
+
this.api = api
|
|
25
|
+
|
|
26
|
+
makeAutoObservable(this)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
load = (instanceId: string) => {
|
|
30
|
+
this.data = null
|
|
31
|
+
this.error = null
|
|
32
|
+
return this.loadData(instanceId)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
reload = (instanceId: string) => this.loadData(instanceId)
|
|
36
|
+
|
|
37
|
+
private loadData = async (instanceId: string) => {
|
|
38
|
+
this.isLoading = true
|
|
39
|
+
|
|
40
|
+
const { response, error } = await this.api.getSnapshots({ instanceId })
|
|
41
|
+
|
|
42
|
+
this.isLoading = false
|
|
43
|
+
|
|
44
|
+
if (response) this.data = response
|
|
45
|
+
|
|
46
|
+
if (error) {
|
|
47
|
+
this.error = await error
|
|
48
|
+
.json()
|
|
49
|
+
.then((error) => error.details?.split('"message": "')[1]?.split('"')[0])
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return !!response
|
|
53
|
+
}
|
|
54
|
+
}
|
package/styles/colors.ts
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) 2019-2021, Postgres.ai, Nikolay Samokhvalov nik@postgres.ai
|
|
3
|
+
* All Rights Reserved. Proprietary and confidential.
|
|
4
|
+
* Unauthorized copying of this file, via any medium is strictly prohibited
|
|
5
|
+
*--------------------------------------------------------------------------
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const colors = {
|
|
9
|
+
black: '#000',
|
|
10
|
+
white: '#fff',
|
|
11
|
+
blue: '#D7EEF2',
|
|
12
|
+
gray: '#D6D6D6',
|
|
13
|
+
pgaiLightGray: '#CCCCCC',
|
|
14
|
+
pgaiOrange: '#FF6212',
|
|
15
|
+
pgaiDarkGray: '#808080',
|
|
16
|
+
consoleMenuBackground: '#FBFBFB',
|
|
17
|
+
consoleStroke: '#CCD7DA',
|
|
18
|
+
consoleFadedFont: '#808080',
|
|
19
|
+
state: {
|
|
20
|
+
ok: '#0DB94D',
|
|
21
|
+
notice: '#FFAD5F',
|
|
22
|
+
warning: '#FD8411',
|
|
23
|
+
error: '#FF2020',
|
|
24
|
+
processing: '#FFAD5F',
|
|
25
|
+
unknown: '#808080',
|
|
26
|
+
},
|
|
27
|
+
primary: {
|
|
28
|
+
main: '#FF6212',
|
|
29
|
+
dark: '#BB3F00',
|
|
30
|
+
darkDark: '#6F2500',
|
|
31
|
+
light: '#FF955F',
|
|
32
|
+
lightLight: '#FFDAC7',
|
|
33
|
+
contrastText: '#FFFFFF',
|
|
34
|
+
darkContrastText: '#FFFFFF',
|
|
35
|
+
lightContrastText: '#000000',
|
|
36
|
+
},
|
|
37
|
+
secondary1: {
|
|
38
|
+
main: '#FF8612',
|
|
39
|
+
dark: '#BB5B00',
|
|
40
|
+
darkDark: '#6F3600',
|
|
41
|
+
light: '#FFAD5F',
|
|
42
|
+
lightLight: '#FFE3C7',
|
|
43
|
+
contrastText: '#FFFFFF',
|
|
44
|
+
darkContrastText: '#FFFFFF',
|
|
45
|
+
lightContrastText: '#000000',
|
|
46
|
+
},
|
|
47
|
+
secondary2: {
|
|
48
|
+
main: '#0F879D',
|
|
49
|
+
dark: '#026173',
|
|
50
|
+
darkDark: '#013A44',
|
|
51
|
+
light: '#439CAD',
|
|
52
|
+
lightLight: '#AFD6DE',
|
|
53
|
+
contrastText: '#FFFFFF',
|
|
54
|
+
darkContrastText: '#FFFFFF',
|
|
55
|
+
lightContrastText: '#000000',
|
|
56
|
+
},
|
|
57
|
+
complement: {
|
|
58
|
+
main: '#0CAA76',
|
|
59
|
+
dark: '#007C53',
|
|
60
|
+
darkDark: '#004A32',
|
|
61
|
+
light: '#44B792',
|
|
62
|
+
lightLight: '#B1E2D2',
|
|
63
|
+
contrastText: '#FFFFFF',
|
|
64
|
+
darkContrastText: '#FFFFFF',
|
|
65
|
+
lightContrastText: '#000000',
|
|
66
|
+
},
|
|
67
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
@import './vars';
|
|
2
|
+
|
|
3
|
+
* {
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
body {
|
|
10
|
+
font-family: $font-family-text;
|
|
11
|
+
font-size: $font-size-main;
|
|
12
|
+
-webkit-font-smoothing: antialiased;
|
|
13
|
+
-moz-osx-font-smoothing: grayscale;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
code {
|
|
17
|
+
font-family: $font-family-code;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
button {
|
|
21
|
+
font-family: inherit;
|
|
22
|
+
font-size: inherit;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#root {
|
|
26
|
+
height: 100vh;
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
}
|