dashboard-shell-shell 1.0.111 → 1.0.113
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/.DS_Store +0 -0
- package/assets/icons/demo.css +539 -0
- package/assets/icons/demo_index.html +1131 -0
- package/assets/icons/iconfont.css +200 -0
- package/assets/icons/iconfont.js +1 -0
- package/assets/icons/iconfont.json +296 -0
- package/assets/icons/iconfont.ttf +0 -0
- package/assets/icons/iconfont.woff +0 -0
- package/assets/icons/iconfont.woff2 +0 -0
- package/assets/images/API.svg +3 -0
- package/assets/images/login/password.svg +20 -0
- package/assets/images/login/user.svg +6 -0
- package/assets/images/login-bg.png +0 -0
- package/assets/images/login-left.png +0 -0
- package/assets/images/login-logo.svg +19 -0
- package/assets/images/logo.png +0 -0
- package/assets/images/pl/harvester.png +0 -0
- package/assets/images/promp-yellow.svg +5 -0
- package/assets/images/user.png +0 -0
- package/assets/styles/all.scss +63 -0
- package/assets/styles/app.scss +2 -0
- package/assets/styles/base/_basic.scss +8 -2
- package/assets/styles/base/_helpers.scss +4 -0
- package/assets/styles/base/_typography.scss +2 -1
- package/assets/styles/base/_variables.scss +10 -2
- package/assets/styles/global/_button.scss +37 -25
- package/assets/styles/global/_columns.scss +3 -1
- package/assets/styles/global/_form.scss +45 -13
- package/assets/styles/global/_labeled-input.scss +50 -25
- package/assets/styles/global/_layout.scss +9 -3
- package/assets/styles/global/_select.scss +20 -13
- package/assets/styles/global/_table.scss +1 -1
- package/assets/styles/global/_tooltip.scss +47 -6
- package/assets/styles/themes/_dark.scss +1 -0
- package/assets/styles/themes/_light.scss +59 -46
- package/assets/styles/themes/_suse.scss +1 -0
- package/assets/styles/vendor/vue-select.scss +18 -7
- package/assets/translations/en-us.yaml +93 -12
- package/assets/translations/zh-hans.yaml +278 -141
- package/components/ActionDropdown.vue +1 -1
- package/components/ActionDropdownShell.vue +71 -0
- package/components/ActionMenu.vue +2 -2
- package/components/ActionMenuShell.vue +1 -0
- package/components/AppModal.vue +78 -6
- package/components/AssignTo.vue +25 -11
- package/components/AsyncButton.vue +24 -7
- package/components/BannerGraphic.vue +1 -0
- package/components/ButtonDropdown.vue +26 -4
- package/components/ButtonGroup.vue +4 -0
- package/components/ButtonMultiAction.vue +1 -0
- package/components/CommunityLinks.vue +3 -3
- package/components/ConsumptionGauge.vue +24 -5
- package/components/CopyToClipboardText.vue +2 -1
- package/components/CruResource.vue +12 -7
- package/components/CruResourceFooter.vue +2 -2
- package/components/DashboardOptions.vue +21 -15
- package/components/DetailText.vue +5 -0
- package/components/DisableAuthProviderModal.vue +1 -0
- package/components/DotState.vue +84 -0
- package/components/ExplorerMembers.vue +1 -1
- package/components/ExplorerProjectsNamespaces.vue +56 -14
- package/components/FixedBanner.vue +19 -12
- package/components/GlobalRoleBindings.vue +5 -1
- package/components/GrafanaDashboard.vue +4 -4
- package/components/GrowlManager.vue +4 -1
- package/components/HardwareResourceGauge.vue +39 -3
- package/components/InfoBox.vue +3 -3
- package/components/InputOrDisplay.vue +28 -2
- package/components/LabelValue.vue +16 -1
- package/components/LandingPagePreference.vue +5 -3
- package/components/LocaleSelector.vue +39 -93
- package/components/ModalManager.vue +55 -0
- package/components/ModalWithCard.vue +2 -0
- package/components/MoveModal.vue +1 -0
- package/components/PromptChangePassword.vue +1 -1
- package/components/PromptModal.vue +15 -2
- package/components/PromptRemove.vue +28 -8
- package/components/PromptRestore.vue +1 -0
- package/components/ResourceCancelModal.vue +1 -0
- package/components/ResourceDetail/Masthead.vue +188 -43
- package/components/ResourceDetail/__tests__/Masthead.test.ts +5 -1
- package/components/ResourceDetail/index.vue +49 -14
- package/components/ResourceList/Masthead.vue +80 -18
- package/components/ResourceTable.vue +60 -19
- package/components/SideNav.vue +32 -12
- package/components/SlideInPanelManager.vue +126 -0
- package/components/SortableTable/THead.vue +34 -5
- package/components/SortableTable/actions.js +1 -1
- package/components/SortableTable/index.vue +649 -142
- package/components/SortableTable/paging.js +36 -28
- package/components/SortableTable/selection.js +0 -11
- package/components/StatusBadge.vue +77 -0
- package/components/Tabbed/Tab.vue +3 -3
- package/components/Tabbed/index.vue +44 -26
- package/components/Wizard.vue +2 -2
- package/components/__tests__/AsyncButton.test.ts +2 -2
- package/components/__tests__/FixedBanner.test.ts +3 -3
- package/components/__tests__/ModalManager.spec.ts +176 -0
- package/components/__tests__/SlideInPanelManager.spec.ts +166 -0
- package/components/auth/Principal.vue +10 -3
- package/components/auth/__tests__/RoleDetailEdit.test.ts +3 -2
- package/components/form/ArrayList.vue +123 -85
- package/components/form/ArrayListGrouped.vue +10 -2
- package/components/form/Command.vue +6 -15
- package/components/form/EnvVars.vue +16 -8
- package/components/form/Footer.vue +8 -5
- package/components/form/HealthCheck.vue +3 -3
- package/components/form/HookOption.vue +11 -16
- package/components/form/KeyValue.vue +16 -7
- package/components/form/LabeledSelect.vue +59 -76
- package/components/form/LifecycleHooks.vue +3 -3
- package/components/form/MatchExpressions.vue +35 -12
- package/components/form/NameNsDescription.vue +147 -115
- package/components/form/Networking.vue +20 -12
- package/components/form/NodeAffinity.vue +31 -23
- package/components/form/NodeScheduling.vue +13 -3
- package/components/form/Password.vue +11 -5
- package/components/form/PodAffinity.vue +43 -44
- package/components/form/Probe.vue +68 -66
- package/components/form/ResourceQuota/Project.vue +5 -1
- package/components/form/ResourceSelector.vue +7 -9
- package/components/form/SSHKnownHosts/KnownHostsEditDialog.vue +6 -3
- package/components/form/SSHKnownHosts/__tests__/KnownHostsEditDialog.test.ts +12 -1
- package/components/form/SSHKnownHosts/index.vue +16 -2
- package/components/form/Security.vue +54 -56
- package/components/form/Select.vue +41 -7
- package/components/form/ShellInput.vue +5 -1
- package/components/form/Tolerations.vue +5 -1
- package/components/form/UnitInput.vue +2 -2
- package/components/form/ValueFromResource.vue +134 -121
- package/components/form/WorkloadPorts.vue +18 -18
- package/components/form/__tests__/ArrayList.test.ts +5 -2
- package/components/form/__tests__/MatchExpressions.test.ts +12 -12
- package/components/form/__tests__/NameNsDescription.test.ts +115 -14
- package/components/form/__tests__/Probe.test.ts +12 -8
- package/components/form/__tests__/SSHKnownHosts.test.ts +11 -0
- package/components/form/__tests__/Select.test.ts +37 -0
- package/components/form/__tests__/UnitInput.test.ts +4 -5
- package/components/formatter/BadgeStateFormatter.vue +8 -5
- package/components/formatter/InternalExternalIP.vue +2 -0
- package/components/formatter/SecretData.vue +20 -7
- package/components/nav/Favorite.vue +5 -1
- package/components/nav/Group.vue +60 -27
- package/components/nav/Header.vue +39 -13
- package/components/nav/Jump.vue +7 -0
- package/components/nav/NamespaceFilter.vue +14 -8
- package/components/nav/Pinned.vue +1 -1
- package/components/nav/TopLevelMenu.vue +5 -17
- package/components/nav/Type.vue +32 -35
- package/components/nav/__tests__/TopLevelMenu.test.ts +0 -40
- package/components/templates/blank.vue +4 -1
- package/components/templates/default.vue +8 -0
- package/components/templates/home.vue +10 -1
- package/components/templates/plain.vue +10 -1
- package/package.json +1 -1
- package/rancher-components/Banner/Banner.vue +6 -4
- package/rancher-components/Card/Card.vue +6 -4
- package/rancher-components/Form/Checkbox/Checkbox.vue +20 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +46 -5
- package/rancher-components/Form/Radio/RadioButton.vue +32 -8
- package/rancher-components/Form/Radio/RadioGroup.vue +31 -24
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.test.ts +17 -0
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +8 -3
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +15 -3
- package/rancher-components/RcButton/RcButton.vue +1 -0
- package/rancher-components/RcButton/types.ts +1 -0
- package/rancher-components/RcDropdown/RcDropdown.vue +54 -15
- package/rancher-components/RcDropdown/RcDropdownItem.vue +5 -4
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +11 -7
- package/rancher-components/RcDropdown/RcDropdownTrigger.vue +12 -2
- package/rancher-components/RcDropdown/useDropdownCollection.ts +8 -0
- package/rancher-components/RcDropdown/useDropdownContext.ts +9 -3
- package/rancher-components/StringList/StringList.vue +1 -1
- package/store/type-map.js +29 -2
- package/utils/error.js +30 -8
- package/utils/errorTranslate.json +916 -0
- package/vue.config.js +1 -1
- package/components/formatter/ExtensionCache.vue +0 -74
- package/components/formatter/Port.vue +0 -24
- package/components/formatter/SecretType.vue +0 -41
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { RcDropdown, RcDropdownTrigger, RcDropdownItem } from '@components/RcDropdown';
|
|
3
|
+
type HiddenAction = {
|
|
4
|
+
action: string;
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
icon: string;
|
|
7
|
+
label: string;
|
|
8
|
+
bulkable: boolean;
|
|
9
|
+
bulkAction: string;
|
|
10
|
+
allEnabled: boolean;
|
|
11
|
+
anyEnabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
defineProps<{
|
|
15
|
+
disabled: boolean,
|
|
16
|
+
hiddenActions: HiddenAction[],
|
|
17
|
+
actionTooltip: unknown,
|
|
18
|
+
}>();
|
|
19
|
+
|
|
20
|
+
const emit = defineEmits(['click', 'mouseover', 'mouseleave']);
|
|
21
|
+
|
|
22
|
+
const applyTableAction = (act: HiddenAction, args: unknown, event: Event) => {
|
|
23
|
+
emit('click', act, args, event);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const setBulkActionOfInterest = (act: HiddenAction | null, event: 'mouseover' | 'mouseleave' = 'mouseover') => {
|
|
27
|
+
emit(event, act);
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<rc-dropdown
|
|
33
|
+
:distance="14"
|
|
34
|
+
placement="bottom"
|
|
35
|
+
>
|
|
36
|
+
<rc-dropdown-trigger
|
|
37
|
+
class="bulk-actions-dropdown"
|
|
38
|
+
:disabled="disabled"
|
|
39
|
+
>
|
|
40
|
+
<template #before>
|
|
41
|
+
<i class="icon icon-gear" />
|
|
42
|
+
</template>
|
|
43
|
+
<span>{{ t('sortableTable.bulkActions.collapsed.label') }}</span>
|
|
44
|
+
<template #after>
|
|
45
|
+
<i class="ml-10 icon icon-chevron-down" />
|
|
46
|
+
</template>
|
|
47
|
+
</rc-dropdown-trigger>
|
|
48
|
+
<template #dropdownCollection>
|
|
49
|
+
<rc-dropdown-item
|
|
50
|
+
v-for="(act, i) in hiddenActions"
|
|
51
|
+
:key="i"
|
|
52
|
+
v-clean-tooltip="{
|
|
53
|
+
content: actionTooltip,
|
|
54
|
+
placement: 'right'
|
|
55
|
+
}"
|
|
56
|
+
:disabled="!act.enabled"
|
|
57
|
+
@click="applyTableAction(act, null, $event)"
|
|
58
|
+
@mouseover="setBulkActionOfInterest(act)"
|
|
59
|
+
@mouseleave="setBulkActionOfInterest(null, 'mouseleave')"
|
|
60
|
+
>
|
|
61
|
+
<template #before>
|
|
62
|
+
<i
|
|
63
|
+
v-if="act.icon"
|
|
64
|
+
:class="act.icon"
|
|
65
|
+
/>
|
|
66
|
+
</template>
|
|
67
|
+
<span v-clean-html="act.label" />
|
|
68
|
+
</rc-dropdown-item>
|
|
69
|
+
</template>
|
|
70
|
+
</rc-dropdown>
|
|
71
|
+
</template>
|
|
@@ -305,7 +305,7 @@ export default {
|
|
|
305
305
|
color: var(--dropdown-text);
|
|
306
306
|
background-color: var(--dropdown-bg);
|
|
307
307
|
border: 1px solid var(--dropdown-border);
|
|
308
|
-
border-radius:
|
|
308
|
+
border-radius: 3px;
|
|
309
309
|
box-shadow: 0 5px 20px var(--shadow);
|
|
310
310
|
|
|
311
311
|
LI {
|
|
@@ -326,7 +326,7 @@ export default {
|
|
|
326
326
|
|
|
327
327
|
&.divider {
|
|
328
328
|
padding: 0;
|
|
329
|
-
border-bottom:
|
|
329
|
+
border-bottom: 0px solid var(--dropdown-divider);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
&:not(.divider):hover {
|
package/components/AppModal.vue
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { defineComponent } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
DEFAULT_FOCUS_TRAP_OPTS,
|
|
5
|
+
useBasicSetupFocusTrap,
|
|
6
|
+
getFirstFocusableElement,
|
|
7
|
+
useWatcherBasedSetupFocusTrapWithDestroyIncluded
|
|
8
|
+
} from '@shell/composables/focusTrap';
|
|
4
9
|
|
|
5
10
|
export const DEFAULT_ITERABLE_NODE_SELECTOR = 'body;';
|
|
6
11
|
|
|
@@ -80,7 +85,21 @@ export default defineComponent({
|
|
|
80
85
|
returnFocusFirstIterableNodeSelector: {
|
|
81
86
|
type: String,
|
|
82
87
|
default: DEFAULT_ITERABLE_NODE_SELECTOR,
|
|
83
|
-
}
|
|
88
|
+
},
|
|
89
|
+
/**
|
|
90
|
+
* trigger focus trap - but watcher based
|
|
91
|
+
*/
|
|
92
|
+
triggerFocusTrapWatcherBased: {
|
|
93
|
+
type: Boolean,
|
|
94
|
+
default: false,
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* watcher-based focus trap variable to watch
|
|
98
|
+
*/
|
|
99
|
+
focusTrapWatcherBasedVariable: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: false,
|
|
102
|
+
},
|
|
84
103
|
},
|
|
85
104
|
computed: {
|
|
86
105
|
modalWidth(): string {
|
|
@@ -131,7 +150,19 @@ export default defineComponent({
|
|
|
131
150
|
};
|
|
132
151
|
}
|
|
133
152
|
|
|
134
|
-
|
|
153
|
+
if (!props.triggerFocusTrapWatcherBased) {
|
|
154
|
+
useBasicSetupFocusTrap('#modal-container-element', opts);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
created() {
|
|
159
|
+
// This usecase is to cover the PromptModal scenario where it's renders a generic component inside.
|
|
160
|
+
// Due to the architecture of the PromptModal it needs to be handled with a watcher based focus trap
|
|
161
|
+
// but with a dedicated unmount hook
|
|
162
|
+
if (this.triggerFocusTrapWatcherBased) {
|
|
163
|
+
const opts:any = DEFAULT_FOCUS_TRAP_OPTS;
|
|
164
|
+
|
|
165
|
+
useWatcherBasedSetupFocusTrapWithDestroyIncluded(() => this.focusTrapWatcherBasedVariable, '#modal-container-element', opts, true);
|
|
135
166
|
}
|
|
136
167
|
},
|
|
137
168
|
mounted() {
|
|
@@ -150,6 +181,14 @@ export default defineComponent({
|
|
|
150
181
|
this.$emit('close');
|
|
151
182
|
}
|
|
152
183
|
},
|
|
184
|
+
close(event: MouseEvent) {
|
|
185
|
+
if (
|
|
186
|
+
this.$refs.modalRef
|
|
187
|
+
) {
|
|
188
|
+
this.$emit('close');
|
|
189
|
+
}
|
|
190
|
+
// this.$emit('close');
|
|
191
|
+
},
|
|
153
192
|
handleEscapeKey(event: KeyboardEvent) {
|
|
154
193
|
if (this.clickToClose && event.key === 'Escape') {
|
|
155
194
|
this.$emit('close');
|
|
@@ -190,8 +229,20 @@ export default defineComponent({
|
|
|
190
229
|
:style="modalStyles"
|
|
191
230
|
@click.stop
|
|
192
231
|
>
|
|
232
|
+
<div
|
|
233
|
+
class="close-dailog-icon"
|
|
234
|
+
>
|
|
235
|
+
<button
|
|
236
|
+
class="btn btn-sm role-link hide-bar"
|
|
237
|
+
@click="close"
|
|
238
|
+
>
|
|
239
|
+
<i class="icon icon-x" />
|
|
240
|
+
</button>
|
|
241
|
+
</div>
|
|
242
|
+
<div>
|
|
193
243
|
<slot><!--Empty content--></slot>
|
|
194
244
|
</div>
|
|
245
|
+
</div>
|
|
195
246
|
</div>
|
|
196
247
|
</transition>
|
|
197
248
|
</teleport>
|
|
@@ -204,18 +255,21 @@ export default defineComponent({
|
|
|
204
255
|
left: 0;
|
|
205
256
|
width: 100vw;
|
|
206
257
|
height: 100vh;
|
|
207
|
-
background-color: var(--overlay-bg);
|
|
258
|
+
/* background-color: var(--overlay-bg); */
|
|
259
|
+
background-color: var(--overlay-model-bg);
|
|
208
260
|
display: flex;
|
|
209
261
|
justify-content: center;
|
|
210
262
|
align-items: center;
|
|
211
|
-
z-index: z-index('modalOverlay');
|
|
263
|
+
/* z-index: z-index('modalOverlay'); */
|
|
264
|
+
z-index: 50;
|
|
212
265
|
|
|
213
266
|
.modal-container {
|
|
214
267
|
background-color: var(--modal-bg);
|
|
215
268
|
border-radius: var(--border-radius);
|
|
216
269
|
max-height: 95vh;
|
|
217
270
|
overflow: auto;
|
|
218
|
-
border:
|
|
271
|
+
border: 0px;
|
|
272
|
+
position: relative;
|
|
219
273
|
}
|
|
220
274
|
}
|
|
221
275
|
|
|
@@ -228,4 +282,22 @@ export default defineComponent({
|
|
|
228
282
|
.modal-fade-leave-to {
|
|
229
283
|
opacity: 0;
|
|
230
284
|
}
|
|
285
|
+
.hide-bar{
|
|
286
|
+
width: 32px;
|
|
287
|
+
min-width: 32px !important;
|
|
288
|
+
}
|
|
289
|
+
.close-dailog-icon{
|
|
290
|
+
position: absolute;
|
|
291
|
+
right: 13px;
|
|
292
|
+
top: 18px;
|
|
293
|
+
& > button{
|
|
294
|
+
color:var(--body-text) !important;
|
|
295
|
+
min-width: 32px !important;
|
|
296
|
+
width: 32px !important;
|
|
297
|
+
& > button:hover{
|
|
298
|
+
color:var(--body-text) !important;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
}
|
|
231
303
|
</style>
|
package/components/AssignTo.vue
CHANGED
|
@@ -115,6 +115,7 @@ export default {
|
|
|
115
115
|
styles="background-color: var(--nav-bg); border-radius: var(--border-radius); max-height: 100vh;"
|
|
116
116
|
height="auto"
|
|
117
117
|
:scrollable="true"
|
|
118
|
+
:trigger-focus-trap="true"
|
|
118
119
|
@close="close"
|
|
119
120
|
>
|
|
120
121
|
<Card
|
|
@@ -157,17 +158,20 @@ export default {
|
|
|
157
158
|
</template>
|
|
158
159
|
|
|
159
160
|
<template #actions>
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
<div class="actions-container">
|
|
162
|
+
<button
|
|
163
|
+
class="btn role-secondary"
|
|
164
|
+
@click="close"
|
|
165
|
+
>
|
|
166
|
+
{{ t('generic.cancel') }}
|
|
167
|
+
</button>
|
|
168
|
+
|
|
169
|
+
<AsyncButton
|
|
170
|
+
class="apply-btn"
|
|
171
|
+
mode="apply"
|
|
172
|
+
@click="apply"
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
171
175
|
</template>
|
|
172
176
|
</Card>
|
|
173
177
|
</app-modal>
|
|
@@ -181,5 +185,15 @@ export default {
|
|
|
181
185
|
& ::-webkit-scrollbar-corner {
|
|
182
186
|
background: rgba(0,0,0,0);
|
|
183
187
|
}
|
|
188
|
+
|
|
189
|
+
.actions-container {
|
|
190
|
+
display: flex;
|
|
191
|
+
justify-content: flex-end;
|
|
192
|
+
width: 100%;
|
|
193
|
+
|
|
194
|
+
.apply-btn {
|
|
195
|
+
margin-left: 20px;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
184
198
|
}
|
|
185
199
|
</style>
|
|
@@ -11,6 +11,7 @@ export const ASYNC_BUTTON_STATES = {
|
|
|
11
11
|
|
|
12
12
|
const TEXT = 'text';
|
|
13
13
|
const TOOLTIP = 'tooltip';
|
|
14
|
+
const DISABLED_CLASS_STYLE = 'btn-disabled';
|
|
14
15
|
|
|
15
16
|
export type AsyncButtonCallback = (success: boolean) => void;
|
|
16
17
|
|
|
@@ -152,9 +153,29 @@ export default defineComponent({
|
|
|
152
153
|
out[`btn-${ this.size }`] = true;
|
|
153
154
|
}
|
|
154
155
|
|
|
156
|
+
// while we are waiting for the async button to get
|
|
157
|
+
// it's callback we want to the button to appear as disabled
|
|
158
|
+
// but not being actually disabled as need it to be
|
|
159
|
+
// able to return the keyboard navigation focus back to it
|
|
160
|
+
// which can't be done while actually disabled, as per
|
|
161
|
+
// https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#focusabilityofdisabledcontrols
|
|
162
|
+
if (this.phase === ASYNC_BUTTON_STATES.WAITING) {
|
|
163
|
+
out[DISABLED_CLASS_STYLE] = true;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// used to assist e2e testing mostly when waiting for button to return
|
|
167
|
+
// to it's normal state/phase
|
|
168
|
+
if (this.phase === ASYNC_BUTTON_STATES.ACTION) {
|
|
169
|
+
out['ready-for-action'] = true;
|
|
170
|
+
}
|
|
171
|
+
|
|
155
172
|
return out;
|
|
156
173
|
},
|
|
157
174
|
|
|
175
|
+
appearsDisabled(): boolean {
|
|
176
|
+
return this.disabled || this.phase === ASYNC_BUTTON_STATES.WAITING;
|
|
177
|
+
},
|
|
178
|
+
|
|
158
179
|
displayIcon(): string {
|
|
159
180
|
const exists = this.$store.getters['i18n/exists'];
|
|
160
181
|
const t = this.$store.getters['i18n/t'];
|
|
@@ -204,10 +225,6 @@ export default defineComponent({
|
|
|
204
225
|
return this.phase === ASYNC_BUTTON_STATES.WAITING;
|
|
205
226
|
},
|
|
206
227
|
|
|
207
|
-
isDisabled(): boolean {
|
|
208
|
-
return this.disabled || this.phase === ASYNC_BUTTON_STATES.WAITING;
|
|
209
|
-
},
|
|
210
|
-
|
|
211
228
|
isManualRefresh() {
|
|
212
229
|
return this.mode === 'manual-refresh';
|
|
213
230
|
},
|
|
@@ -232,7 +249,7 @@ export default defineComponent({
|
|
|
232
249
|
|
|
233
250
|
methods: {
|
|
234
251
|
clicked() {
|
|
235
|
-
if ( this.
|
|
252
|
+
if ( this.appearsDisabled ) {
|
|
236
253
|
return;
|
|
237
254
|
}
|
|
238
255
|
|
|
@@ -283,8 +300,8 @@ export default defineComponent({
|
|
|
283
300
|
:class="classes"
|
|
284
301
|
:name="name"
|
|
285
302
|
:type="type"
|
|
286
|
-
:disabled="
|
|
287
|
-
:aria-disabled="
|
|
303
|
+
:disabled="disabled"
|
|
304
|
+
:aria-disabled="appearsDisabled"
|
|
288
305
|
:tab-index="tabIndex"
|
|
289
306
|
:data-testid="componentTestid + '-async-button'"
|
|
290
307
|
@click="clicked"
|
|
@@ -196,7 +196,8 @@ export default {
|
|
|
196
196
|
@update:modelValue="$emit('click-action', $event)"
|
|
197
197
|
>
|
|
198
198
|
<template #no-options>
|
|
199
|
-
|
|
199
|
+
暂无数据
|
|
200
|
+
<!-- <slot name="no-options" /> -->
|
|
200
201
|
</template>
|
|
201
202
|
|
|
202
203
|
<template #selected-option="option">
|
|
@@ -247,16 +248,35 @@ export default {
|
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
250
|
.button-dropdown {
|
|
250
|
-
background: var(--accent-btn);
|
|
251
|
+
/* background: var(--accent-btn); */
|
|
252
|
+
background: var(--accent-btn-hover);
|
|
251
253
|
border: solid 1px var(--link);
|
|
252
254
|
color: var(--link);
|
|
253
255
|
padding: 0;
|
|
254
256
|
|
|
257
|
+
&{
|
|
258
|
+
:deep() .vs__dropdown-toggle .vs__actions,
|
|
259
|
+
:deep() .vs__selected-options {
|
|
260
|
+
background: var(--accent-btn-hover);
|
|
261
|
+
}
|
|
262
|
+
:deep() .vs__selected-options .vs__selected button {
|
|
263
|
+
background-color: transparent;
|
|
264
|
+
color: var(--accent-btn-hover-text);
|
|
265
|
+
}
|
|
266
|
+
:deep() .vs__dropdown-toggle .vs__actions {
|
|
267
|
+
&:after {
|
|
268
|
+
color: var(--accent-btn-hover-text);
|
|
269
|
+
padding-top: 10px;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
255
274
|
&.vs--open :deep() {
|
|
256
275
|
outline: none;
|
|
257
276
|
box-shadow: none;
|
|
258
277
|
}
|
|
259
278
|
|
|
279
|
+
|
|
260
280
|
&:hover {
|
|
261
281
|
:deep() .vs__dropdown-toggle .vs__actions,
|
|
262
282
|
:deep() .vs__selected-options {
|
|
@@ -275,6 +295,7 @@ export default {
|
|
|
275
295
|
|
|
276
296
|
:deep() > .vs__dropdown-toggle {
|
|
277
297
|
width: 100%;
|
|
298
|
+
width: 100px;
|
|
278
299
|
display: grid;
|
|
279
300
|
grid-template-columns: 75% 25%;
|
|
280
301
|
border: none;
|
|
@@ -283,7 +304,7 @@ export default {
|
|
|
283
304
|
.vs__actions {
|
|
284
305
|
|
|
285
306
|
&:after {
|
|
286
|
-
color: var(--
|
|
307
|
+
color: var(--accent-btn-hover-text);
|
|
287
308
|
line-height: 1;
|
|
288
309
|
}
|
|
289
310
|
}
|
|
@@ -297,7 +318,8 @@ export default {
|
|
|
297
318
|
button {
|
|
298
319
|
border: none;
|
|
299
320
|
background: transparent;
|
|
300
|
-
color: var(--
|
|
321
|
+
color: var(--accent-btn-hover-text);
|
|
322
|
+
min-width: 83px;
|
|
301
323
|
}
|
|
302
324
|
}
|
|
303
325
|
.vs__search {
|
|
@@ -77,6 +77,9 @@ export default {
|
|
|
77
77
|
const tooltip = opt.tooltipKey ? this.t(opt.tooltipKey) : opt.tooltip;
|
|
78
78
|
|
|
79
79
|
return ariaLabel || tooltip || label || undefined;
|
|
80
|
+
},
|
|
81
|
+
isPressed(opt) {
|
|
82
|
+
return this.value === opt.value;
|
|
80
83
|
}
|
|
81
84
|
}
|
|
82
85
|
};
|
|
@@ -97,6 +100,7 @@ export default {
|
|
|
97
100
|
:disabled="disabled || opt.disabled"
|
|
98
101
|
role="button"
|
|
99
102
|
:aria-label="actionAriaLabel(opt)"
|
|
103
|
+
:aria-pressed="isPressed(opt)"
|
|
100
104
|
@click="change(opt.value)"
|
|
101
105
|
>
|
|
102
106
|
<slot
|
|
@@ -140,7 +140,7 @@ export default {
|
|
|
140
140
|
:aria-label="t('footer.wechat.title')"
|
|
141
141
|
role="link"
|
|
142
142
|
@click="show"
|
|
143
|
-
@
|
|
143
|
+
@keydown.enter="show"
|
|
144
144
|
>
|
|
145
145
|
{{ t('footer.wechat.title') }}
|
|
146
146
|
</a>
|
|
@@ -151,6 +151,7 @@ export default {
|
|
|
151
151
|
name="wechat-modal"
|
|
152
152
|
height="auto"
|
|
153
153
|
:width="640"
|
|
154
|
+
:trigger-focus-trap="true"
|
|
154
155
|
@close="close"
|
|
155
156
|
>
|
|
156
157
|
<div class="wechat-modal">
|
|
@@ -164,8 +165,7 @@ export default {
|
|
|
164
165
|
:aria-label="t('generic.close')"
|
|
165
166
|
role="button"
|
|
166
167
|
@click="close"
|
|
167
|
-
@
|
|
168
|
-
@keyup.space="close"
|
|
168
|
+
@keydown.enter.stop
|
|
169
169
|
>
|
|
170
170
|
{{ t('generic.close') }}
|
|
171
171
|
</button>
|
|
@@ -59,7 +59,11 @@ export default {
|
|
|
59
59
|
usedAsResourceName: {
|
|
60
60
|
type: Boolean,
|
|
61
61
|
defaut: false
|
|
62
|
-
}
|
|
62
|
+
},
|
|
63
|
+
reserveText: {
|
|
64
|
+
type: String,
|
|
65
|
+
defaut: '预留'
|
|
66
|
+
},
|
|
63
67
|
},
|
|
64
68
|
computed: {
|
|
65
69
|
displayUnits() {
|
|
@@ -91,13 +95,13 @@ export default {
|
|
|
91
95
|
</script>
|
|
92
96
|
|
|
93
97
|
<template>
|
|
94
|
-
<div class="consumption-gauge">
|
|
98
|
+
<!-- <div class="consumption-gauge">
|
|
95
99
|
<h3 v-if="resourceName && !usedAsResourceName">
|
|
96
100
|
{{ resourceName }}
|
|
97
101
|
</h3>
|
|
98
|
-
<div class="numbers">
|
|
102
|
+
<div class="numbers"> -->
|
|
99
103
|
<!-- @slot Optional slot to use as the title rather than showing the resource name -->
|
|
100
|
-
<slot
|
|
104
|
+
<!-- <slot
|
|
101
105
|
name="title"
|
|
102
106
|
:amountTemplateValues="amountTemplateValues"
|
|
103
107
|
:formattedPercentage="formattedPercentage"
|
|
@@ -118,7 +122,22 @@ export default {
|
|
|
118
122
|
:color-stops="colorStops"
|
|
119
123
|
/>
|
|
120
124
|
</div>
|
|
121
|
-
</div>
|
|
125
|
+
</div> -->
|
|
126
|
+
<div class="consumption-gauge">
|
|
127
|
+
<div
|
|
128
|
+
v-if="resourceName && !usedAsResourceName"
|
|
129
|
+
class="mb-20"
|
|
130
|
+
>
|
|
131
|
+
{{ resourceName }}
|
|
132
|
+
</div>
|
|
133
|
+
<slot
|
|
134
|
+
name="content"
|
|
135
|
+
:amountTemplateValues="amountTemplateValues"
|
|
136
|
+
:formattedPercentage="formattedPercentage"
|
|
137
|
+
>
|
|
138
|
+
<p>{{ formattedPercentage + '(共' + amountTemplateValues.total + ' ' + amountTemplateValues.unit + ',' + reserveText + ' ' + amountTemplateValues.used + ' ' + amountTemplateValues.unit + ')' }}</p>
|
|
139
|
+
</slot>
|
|
140
|
+
</div>
|
|
122
141
|
</template>
|
|
123
142
|
|
|
124
143
|
<style lang="scss">
|
|
@@ -49,9 +49,10 @@ export default {
|
|
|
49
49
|
v-if="text"
|
|
50
50
|
class="copy-to-clipboard-text"
|
|
51
51
|
role="button"
|
|
52
|
-
:aria-label="t('generic.copyToClipboard')"
|
|
53
52
|
:class="{ 'copied': copied, 'plain': plain}"
|
|
54
53
|
href="#"
|
|
54
|
+
:aria-label="t('generic.copyToClipboard')"
|
|
55
|
+
v-bind="$attrs"
|
|
55
56
|
@click="clicked"
|
|
56
57
|
@keyup.space="clicked"
|
|
57
58
|
>
|
|
@@ -544,7 +544,10 @@ export default {
|
|
|
544
544
|
class="flex-right"
|
|
545
545
|
>{{ t('generic.moreInfo') }} <i class="icon icon-external-link" /></a>
|
|
546
546
|
</div>
|
|
547
|
-
<hr
|
|
547
|
+
<hr
|
|
548
|
+
v-if="subtype.description"
|
|
549
|
+
role="none"
|
|
550
|
+
>
|
|
548
551
|
<div
|
|
549
552
|
v-if="subtype.description"
|
|
550
553
|
class="description"
|
|
@@ -621,14 +624,14 @@ export default {
|
|
|
621
624
|
</template>
|
|
622
625
|
</template>
|
|
623
626
|
<div class="controls-steps">
|
|
624
|
-
<button
|
|
627
|
+
<!-- <button
|
|
625
628
|
v-if="showYaml"
|
|
626
629
|
type="button"
|
|
627
630
|
class="btn role-secondary"
|
|
628
631
|
@click="showPreviewYaml"
|
|
629
632
|
>
|
|
630
633
|
<t k="cruResource.previewYaml" />
|
|
631
|
-
</button>
|
|
634
|
+
</button> -->
|
|
632
635
|
<template
|
|
633
636
|
v-if="showPrevious"
|
|
634
637
|
name="back"
|
|
@@ -708,7 +711,7 @@ export default {
|
|
|
708
711
|
#default
|
|
709
712
|
>
|
|
710
713
|
<div>
|
|
711
|
-
<button
|
|
714
|
+
<!-- <button
|
|
712
715
|
v-if="showYaml"
|
|
713
716
|
:data-testid="componentTestid + '-yaml'"
|
|
714
717
|
type="button"
|
|
@@ -716,7 +719,7 @@ export default {
|
|
|
716
719
|
@click="showPreviewYaml"
|
|
717
720
|
>
|
|
718
721
|
<t k="cruResource.previewYaml" />
|
|
719
|
-
</button>
|
|
722
|
+
</button> -->
|
|
720
723
|
<AsyncButton
|
|
721
724
|
v-if="!showSubtypeSelection"
|
|
722
725
|
ref="save"
|
|
@@ -732,7 +735,7 @@ export default {
|
|
|
732
735
|
</template>
|
|
733
736
|
<!------ YAML ------>
|
|
734
737
|
<!-- Hide this section until it's needed. This means we don't need to upfront create initialYaml -->
|
|
735
|
-
<section
|
|
738
|
+
<!-- <section
|
|
736
739
|
v-else-if="showYaml && !showAsForm"
|
|
737
740
|
class="cru-resource-yaml-container resource-container cru__content"
|
|
738
741
|
>
|
|
@@ -806,7 +809,7 @@ export default {
|
|
|
806
809
|
</slot>
|
|
807
810
|
</template>
|
|
808
811
|
</ResourceYaml>
|
|
809
|
-
</section>
|
|
812
|
+
</section> -->
|
|
810
813
|
</component>
|
|
811
814
|
</section>
|
|
812
815
|
</template>
|
|
@@ -906,6 +909,8 @@ form.create-resource-container .cru {
|
|
|
906
909
|
position: sticky;
|
|
907
910
|
bottom: 0;
|
|
908
911
|
background-color: var(--header-bg);
|
|
912
|
+
height: $footer-height;
|
|
913
|
+
box-sizing: border-box;
|
|
909
914
|
|
|
910
915
|
// Overrides outlet padding
|
|
911
916
|
margin-left: -$space-m;
|
|
@@ -115,12 +115,12 @@ export default {
|
|
|
115
115
|
<style lang="scss">
|
|
116
116
|
.cru-resource-footer {
|
|
117
117
|
display: flex;
|
|
118
|
-
justify-content: flex-
|
|
118
|
+
justify-content: flex-start;
|
|
119
119
|
margin-top: 20px;
|
|
120
120
|
z-index: z-index('cruFooter');
|
|
121
121
|
|
|
122
122
|
.btn {
|
|
123
|
-
margin-
|
|
123
|
+
margin-right: 10px;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|