-
Notifications
You must be signed in to change notification settings - Fork 235
Expand file tree
/
Copy pathshared-configs.tsx
More file actions
151 lines (139 loc) · 4.33 KB
/
Copy pathshared-configs.tsx
File metadata and controls
151 lines (139 loc) · 4.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import * as React from 'react';
import Checkbox from '~components/checkbox';
import { CollectionPreferencesProps } from '~components/collection-preferences';
export const baseProperties: CollectionPreferencesProps<boolean> = {
title: 'Preferences',
confirmLabel: 'Confirm',
cancelLabel: 'Cancel',
onConfirm: () => {},
preferences: {
wrapLines: true,
pageSize: 10,
visibleContent: ['id', 'sslCertificate', 'origin'],
custom: true,
},
};
export const pageSizePreference: CollectionPreferencesProps.PageSizePreference = {
title: 'Select page size',
options: [
{ value: 10, label: '10 resources' },
{ value: 20, label: '20 resources' },
],
};
export const wrapLinesPreference: CollectionPreferencesProps.WrapLinesPreference = {
label: 'Wrap lines',
description: 'Wrap lines description',
};
export const contentDensityPreference: CollectionPreferencesProps.ContentDensityPreference = {
label: 'Compact mode',
description: 'Content density description',
};
export const visibleContentPreference: CollectionPreferencesProps.VisibleContentPreference = {
title: 'Content Selection',
options: [
{
label: 'Main distribution properties',
options: [
{ id: 'id', label: 'Distribution ID', editable: false },
{
id: 'domainName',
label:
'Domain name Domain name Domain name Domain name Domain name Domain name Domain name Domain name Domain name Domain name Domain name Domain name',
},
],
},
{
label: 'Secondary distribution properties',
options: [
{
id: 'deliveryMethod',
label: 'Deliverymethod',
editable: true,
},
{ id: 'priceClass', label: 'Price class', editable: false },
{ id: 'sslCertificate', label: 'SSL certificate' },
{
id: 'origin',
label:
'OriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOriginOrigin',
},
],
},
],
};
export const stickyColumnsPreference: CollectionPreferencesProps.StickyColumnsPreference = {
firstColumns: {
title: 'Stick first column(s)',
description: 'Keep the first column(s) visible while horizontally scrolling the table content.',
options: [
{ label: 'None', value: 0 },
{ label: 'First column', value: 1 },
{ label: 'First two columns', value: 2 },
],
},
lastColumns: {
title: 'Stick last column',
description: 'Keep the last column visible while horizontally scrolling the table content.',
options: [
{ label: 'None', value: 0 },
{ label: 'Last column', value: 1 },
],
},
};
export const customPreference = (customState: boolean) => (
<Checkbox checked={customState} onChange={() => {}}>
View as
</Checkbox>
);
export const groupedContentDisplayOptions: CollectionPreferencesProps.ContentDisplayOption[] = [
{ id: 'id', label: 'Instance ID', alwaysVisible: true },
{ id: 'name', label: 'Name' },
{ id: 'type', label: 'Instance type' },
{ id: 'az', label: 'Availability zone' },
{ id: 'state', label: 'State' },
{ id: 'cpu', label: 'CPU (%)' },
{ id: 'memory', label: 'Memory (%)' },
{ id: 'netIn', label: 'Network in (MB/s)' },
{ id: 'netOut', label: 'Network out (MB/s)' },
{ id: 'cost', label: 'Monthly cost ($)' },
];
export const contentDisplayGroups: CollectionPreferencesProps.ContentDisplayOptionGroup[] = [
{ id: 'config', label: 'Configuration' },
{ id: 'performance', label: 'Performance' },
{ id: 'network', label: 'Network' },
];
export const groupedContentDisplay: CollectionPreferencesProps.ContentDisplayItem[] = [
{ id: 'id', visible: true },
{ id: 'name', visible: true },
{
type: 'group',
id: 'config',
visible: true,
children: [
{ id: 'type', visible: true },
{ id: 'az', visible: true },
{ id: 'state', visible: true },
],
},
{
type: 'group',
id: 'performance',
visible: true,
children: [
{ id: 'cpu', visible: true },
{ id: 'memory', visible: true },
],
},
{
type: 'group',
id: 'network',
visible: true,
children: [
{ id: 'netIn', visible: true },
{ id: 'netOut', visible: true },
],
},
{ id: 'cost', visible: true },
];