@rancher/shell 3.0.12-rc.5 → 3.0.12-rc.7
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/apis/intf/resources-api/resource-base.ts +42 -2
- package/apis/intf/resources-api/resource-instance.ts +101 -0
- package/apis/intf/resources-api/resources-api.ts +177 -23
- package/apis/intf/resources.ts +8 -6
- package/apis/intf/shell-api/slide-in.ts +46 -17
- package/apis/resources/__tests__/resources-api-class.test.ts +309 -28
- package/apis/resources/resources-api-class.ts +232 -43
- package/apis/shell/__tests__/slide-in.test.ts +83 -2
- package/apis/shell/slide-in.ts +20 -0
- package/assets/images/providers/traefik.png +0 -0
- package/assets/translations/en-us.yaml +10 -4
- package/chart/__tests__/rancher-monitoring-dashboards-index.test.ts +269 -0
- package/chart/rancher-monitoring-dashboards/index.vue +155 -0
- package/cloud-credential/__tests__/generic.test.ts +132 -0
- package/cloud-credential/generic.vue +33 -3
- package/components/EtcdInfoBanner.vue +2 -12
- package/components/ExplorerProjectsNamespaces.vue +2 -2
- package/components/GrafanaDashboard.vue +2 -8
- package/components/Resource/Detail/Masthead/__tests__/index.test.ts +68 -14
- package/components/Resource/Detail/Masthead/index.vue +8 -3
- package/components/Resource/Detail/Metadata/IdentifyingInformation/__tests__/identifying-fields.test.ts +9 -0
- package/components/Resource/Detail/Metadata/IdentifyingInformation/identifying-fields.ts +5 -1
- package/components/SlideInPanelManager.vue +103 -25
- package/components/__tests__/SlideInPanelManager.spec.ts +153 -10
- package/components/auth/AuthBanner.vue +1 -1
- package/components/form/Security.vue +1 -1
- package/components/formatter/Translate.vue +22 -1
- package/components/nav/Group.vue +5 -10
- package/components/nav/TopLevelMenu.vue +1 -30
- package/components/nav/__tests__/Group.test.ts +61 -0
- package/config/labels-annotations.js +1 -0
- package/config/table-headers.js +5 -2
- package/core/__tests__/plugin-products-apply.test.ts +787 -0
- package/core/__tests__/plugin-products-extend.test.ts +189 -0
- package/core/__tests__/plugin-products-helpers.test.ts +81 -78
- package/core/__tests__/plugin-products-new.test.ts +389 -0
- package/core/__tests__/plugin-products-scenarios.test.ts +980 -0
- package/core/__tests__/plugin-products-side-menu.test.ts +1935 -0
- package/core/plugin-products-base.ts +201 -93
- package/core/plugin-products-extending.ts +1 -1
- package/core/plugin-products-external.ts +380 -0
- package/core/plugin-products-helpers.ts +28 -24
- package/core/plugin-products-internal.ts +207 -0
- package/core/plugin-products-top-level.ts +10 -5
- package/core/plugin-products-type-guards.ts +17 -6
- package/core/plugin-products.ts +5 -7
- package/core/plugin-types.ts +1 -389
- package/core/plugin.ts +10 -11
- package/core/plugins-loader.js +2 -0
- package/core/types.ts +6 -202
- package/detail/__tests__/provisioning.cattle.io.cluster.test.ts +52 -0
- package/detail/pod.vue +1 -1
- package/detail/provisioning.cattle.io.cluster.vue +0 -2
- package/edit/auth/AuthProviderWarningBanners.vue +12 -0
- package/edit/auth/__tests__/AuthProviderWarningBanners.test.ts +10 -1
- package/edit/auth/__tests__/azuread.test.ts +1 -0
- package/edit/auth/__tests__/github.test.ts +1 -0
- package/edit/auth/__tests__/oidc.test.ts +1 -0
- package/edit/auth/__tests__/saml.test.ts +1 -0
- package/edit/auth/ldap/__tests__/index.test.ts +1 -0
- package/edit/provisioning.cattle.io.cluster/index.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/rke2.vue +1 -1
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +2 -2
- package/list/management.cattle.io.user.vue +24 -5
- package/list/utils/management.cattle.io.cluster.utils.ts +1 -1
- package/machine-config/__tests__/generic.test.ts +163 -0
- package/machine-config/components/EC2Networking.vue +31 -7
- package/machine-config/components/__tests__/EC2Networking.test.ts +38 -15
- package/machine-config/generic.vue +32 -5
- package/mixins/resource-fetch.js +1 -1
- package/models/__tests__/namespace.test.ts +133 -8
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +57 -1
- package/models/__tests__/rke-machine.cattle.io.vmwarevspheremachinetemplate.test.ts +22 -0
- package/models/namespace.js +34 -2
- package/models/pod.js +12 -10
- package/models/provisioning.cattle.io.cluster.js +20 -13
- package/models/rke-machine.cattle.io.vmwarevspheremachinetemplate.js +9 -0
- package/package.json +1 -1
- package/pages/auth/login.vue +1 -1
- package/pages/c/_cluster/apps/charts/__tests__/install.test.ts +110 -0
- package/pages/c/_cluster/apps/charts/install.vue +29 -0
- package/pages/c/_cluster/auth/config/index.vue +11 -4
- package/pages/c/_cluster/explorer/workload-dashboard/__tests__/composable.test.ts +136 -1
- package/pages/c/_cluster/explorer/workload-dashboard/composable.ts +69 -1
- package/pages/c/_cluster/fleet/index.vue +5 -9
- package/pages/c/_cluster/monitoring/index.vue +6 -1
- package/pkg/vue.config.js +4 -3
- package/plugins/codemirror.js +2 -0
- package/plugins/dashboard-store/resource-class.js +13 -9
- package/plugins/steve/__tests__/steve-class-resource-api.test.ts +147 -0
- package/plugins/steve/steve-class.js +43 -0
- package/plugins/steve/subscribe.js +11 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +115 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +83 -3
- package/store/__tests__/action-menu.test.ts +622 -0
- package/store/__tests__/auth.test.ts +18 -0
- package/store/__tests__/notifications.test.ts +466 -1
- package/store/__tests__/slideInPanel.test.ts +143 -43
- package/store/__tests__/ui-context.test.ts +255 -0
- package/store/__tests__/wm.test.ts +503 -0
- package/store/auth.js +11 -1
- package/store/aws.js +19 -4
- package/store/features.js +1 -0
- package/store/plugins.js +6 -0
- package/store/slideInPanel.ts +15 -3
- package/types/rancher/steve.api.ts +2 -2
- package/types/shell/index.d.ts +84 -2
- package/types/store/dashboard-store.types.ts +2 -2
- package/types/store/type-map.ts +262 -1
- package/utils/__tests__/fleet-appco.test.ts +23 -0
- package/utils/async.ts +2 -0
- package/utils/fleet-appco.ts +6 -1
- package/utils/grafana.js +2 -17
- package/utils/monitoring.js +38 -1
- package/utils/sort.js +1 -1
- package/core/__tests__/plugin-products.test.ts +0 -4694
|
@@ -29,7 +29,11 @@ export default defineComponent({
|
|
|
29
29
|
...labeledFormElementProps,
|
|
30
30
|
/**
|
|
31
31
|
* The type of the Labeled Input.
|
|
32
|
-
*
|
|
32
|
+
*
|
|
33
|
+
* Any native HTML input type is passed through to the underlying input
|
|
34
|
+
* (e.g. text, password, number, email). A few custom values change the
|
|
35
|
+
* rendering or behaviour:
|
|
36
|
+
* @values cron (renders as text), multiline, multiline-password, integer (renders as text with inputmode="numeric", blocks non-integer input)
|
|
33
37
|
*/
|
|
34
38
|
type: {
|
|
35
39
|
type: String,
|
|
@@ -150,6 +154,23 @@ export default defineComponent({
|
|
|
150
154
|
});
|
|
151
155
|
|
|
152
156
|
const effectiveStatus = computed(() => props.status);
|
|
157
|
+
const isInteger = computed(() => props.type === 'integer');
|
|
158
|
+
const nativeType = computed(() => {
|
|
159
|
+
if (props.type === 'cron') {
|
|
160
|
+
return 'text';
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (props.type === 'integer') {
|
|
164
|
+
return 'text';
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return props.type;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Hints the mobile keyboard to show a numeric layout, since the
|
|
171
|
+
// integer type renders as type="text" to avoid browser number
|
|
172
|
+
// formatting quirks (e.g. scientific notation for large values).
|
|
173
|
+
const inputMode = computed(() => (isInteger.value ? 'numeric' : undefined));
|
|
153
174
|
|
|
154
175
|
return {
|
|
155
176
|
focused,
|
|
@@ -163,6 +184,9 @@ export default defineComponent({
|
|
|
163
184
|
veeHandleBlur,
|
|
164
185
|
veeValidate,
|
|
165
186
|
effectiveStatus,
|
|
187
|
+
isInteger,
|
|
188
|
+
nativeType,
|
|
189
|
+
inputMode,
|
|
166
190
|
};
|
|
167
191
|
},
|
|
168
192
|
|
|
@@ -325,6 +349,59 @@ export default defineComponent({
|
|
|
325
349
|
}
|
|
326
350
|
},
|
|
327
351
|
|
|
352
|
+
isValidIntegerInput(inputValue: string): boolean {
|
|
353
|
+
const integer = /^-?[0-9]*$/;
|
|
354
|
+
const nonNegativeInteger = /^[0-9]*$/;
|
|
355
|
+
const pattern = Number(this.$attrs.min) >= 0 ? nonNegativeInteger : integer;
|
|
356
|
+
|
|
357
|
+
if (!pattern.test(inputValue)) {
|
|
358
|
+
return false;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const numeric = Number(inputValue);
|
|
362
|
+
|
|
363
|
+
// Safe integer is primarily here to validate that the number fits in the datatype
|
|
364
|
+
// used for numbers in the browser, if we exceed this safe number the browser automatically converts the number to scientific notation.
|
|
365
|
+
if (inputValue !== '' && inputValue !== '-' && !Number.isSafeInteger(numeric)) {
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
return true;
|
|
370
|
+
},
|
|
371
|
+
|
|
372
|
+
prospectiveValue(input: HTMLInputElement, inserted: string): string {
|
|
373
|
+
const start = input.selectionStart ?? 0;
|
|
374
|
+
const end = input.selectionEnd ?? 0;
|
|
375
|
+
|
|
376
|
+
return input.value.slice(0, start) + inserted + input.value.slice(end);
|
|
377
|
+
},
|
|
378
|
+
|
|
379
|
+
onKeydown(event: KeyboardEvent): void {
|
|
380
|
+
// Skip named keys (Backspace, Arrow, etc.) and modifier shortcuts (Ctrl+A, Cmd+C).
|
|
381
|
+
if (!this.isInteger || event.key.length !== 1 || event.ctrlKey || event.metaKey) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const next = this.prospectiveValue(event.target as HTMLInputElement, event.key);
|
|
386
|
+
|
|
387
|
+
if (!this.isValidIntegerInput(next)) {
|
|
388
|
+
event.preventDefault();
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
|
|
392
|
+
onPaste(event: ClipboardEvent): void {
|
|
393
|
+
if (!this.isInteger) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
const paste = event.clipboardData?.getData('text/plain') ?? '';
|
|
398
|
+
const next = this.prospectiveValue(event.target as HTMLInputElement, paste);
|
|
399
|
+
|
|
400
|
+
if (!this.isValidIntegerInput(next)) {
|
|
401
|
+
event.preventDefault();
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
|
|
328
405
|
/**
|
|
329
406
|
* Emit on input change
|
|
330
407
|
*/
|
|
@@ -435,14 +512,15 @@ export default defineComponent({
|
|
|
435
512
|
:id="inputId"
|
|
436
513
|
ref="value"
|
|
437
514
|
v-stripped-aria-label="!hasLabel && ariaLabel ? ariaLabel : undefined"
|
|
438
|
-
:role="
|
|
515
|
+
:role="nativeType === 'number' ? undefined : 'textbox'"
|
|
439
516
|
:class="{ 'no-label': !hasLabel }"
|
|
440
517
|
v-bind="$attrs"
|
|
441
518
|
:name="name || undefined"
|
|
442
519
|
:maxlength="_maxlength"
|
|
443
520
|
:disabled="isDisabled"
|
|
444
521
|
:aria-disabled="isDisabled"
|
|
445
|
-
:type="
|
|
522
|
+
:type="nativeType"
|
|
523
|
+
:inputmode="inputMode"
|
|
446
524
|
:value="value"
|
|
447
525
|
:placeholder="_placeholder"
|
|
448
526
|
autocomplete="off"
|
|
@@ -451,6 +529,8 @@ export default defineComponent({
|
|
|
451
529
|
:aria-describedby="ariaDescribedBy"
|
|
452
530
|
:aria-required="requiredField"
|
|
453
531
|
@input="onInput"
|
|
532
|
+
@keydown="onKeydown"
|
|
533
|
+
@paste="onPaste"
|
|
454
534
|
@focus="onFocus"
|
|
455
535
|
@blur="onBlur"
|
|
456
536
|
@change="onChange"
|