@rancher/shell 0.5.2 → 1.2.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/.DS_Store +0 -0
- package/assets/images/providers/aks-black.svg +28 -0
- package/assets/images/providers/aks.svg +31 -0
- package/assets/styles/global/_labeled-input.scss +1 -0
- package/assets/styles/global/_layout.scss +0 -99
- package/assets/translations/en-us.yaml +77 -71
- package/assets/translations/zh-hans.yaml +25 -23
- package/babel.config.js +1 -7
- package/chart/gatekeeper.vue +11 -2
- package/chart/istio.vue +10 -1
- package/chart/logging/index.vue +11 -2
- package/chart/monitoring/alerting/index.vue +21 -7
- package/chart/monitoring/grafana/index.vue +2 -57
- package/chart/monitoring/index.vue +26 -52
- package/chart/monitoring/prometheus/index.vue +43 -37
- package/chart/rancher-backup/index.vue +10 -3
- package/cloud-credential/azure.vue +17 -4
- package/components/AsyncButton.vue +0 -9
- package/components/Carousel.vue +0 -1
- package/components/ChartPsp.vue +76 -0
- package/components/CodeMirror.vue +21 -19
- package/components/CopyCode.vue +2 -6
- package/components/CopyToClipboard.vue +1 -2
- package/components/CopyToClipboardText.vue +9 -14
- package/components/CruResource.vue +0 -1
- package/components/EtcdInfoBanner.vue +5 -5
- package/components/ExplorerProjectsNamespaces.vue +1 -25
- package/components/IconOrSvg.vue +1 -1
- package/components/Markdown.vue +12 -16
- package/components/Questions/index.vue +1 -1
- package/components/ResourceDetail/Masthead.vue +9 -25
- package/components/ResourceList/Masthead.vue +18 -1
- package/components/ResourceTable.vue +2 -14
- package/components/ResourceYaml.vue +0 -5
- package/components/SideNav.vue +1 -1
- package/components/SortableTable/THead.vue +9 -7
- package/components/SortableTable/index.vue +3 -2
- package/components/StatusTable.vue +1 -5
- package/components/TabTitle.vue +84 -0
- package/components/Tabbed/index.vue +0 -12
- package/components/__tests__/ChartPsp.test.ts +75 -0
- package/components/__tests__/CopyCode.test.ts +4 -5
- package/components/fleet/FleetBundles.vue +11 -5
- package/components/fleet/FleetRepos.vue +27 -62
- package/components/fleet/FleetResources.vue +1 -6
- package/components/fleet/FleetStatus.vue +3 -3
- package/components/fleet/FleetSummary.vue +30 -35
- package/components/form/ArrayList.vue +8 -1
- package/components/form/ArrayListSelect.vue +9 -9
- package/components/form/KeyValue.vue +0 -1
- package/components/form/LabeledSelect.vue +0 -4
- package/components/form/Password.vue +1 -3
- package/components/form/Select.vue +1 -1
- package/components/form/SelectOrCreateAuthSecret.vue +4 -4
- package/components/form/__tests__/KeyValue.test.ts +1 -1
- package/components/formatter/Checked.vue +3 -11
- package/components/formatter/ClusterProvider.vue +18 -1
- package/components/formatter/FleetSummaryGraph.vue +11 -23
- package/components/formatter/LiveDate.vue +16 -0
- package/components/formatter/LiveDuration.vue +1 -1
- package/components/formatter/PercentageBar.vue +1 -1
- package/components/formatter/__tests__/ClusterProvider.test.ts +28 -0
- package/components/nav/Group.vue +2 -2
- package/components/nav/Header.vue +2 -1
- package/components/nav/TopLevelMenu.vue +3 -29
- package/components/nav/Type.vue +3 -1
- package/components/nav/WindowManager/ContainerLogs.vue +19 -120
- package/components/nav/WindowManager/ContainerShell.vue +1 -6
- package/components/nav/WindowManager/index.vue +10 -11
- package/components/nav/__tests__/TopLevelMenu.test.ts +0 -33
- package/components/nav/__tests__/Type.test.ts +1 -1
- package/components/nuxt/nuxt-child.js +78 -14
- package/components/nuxt/nuxt.js +1 -1
- package/components/user.retention/user-retention-header.vue +34 -0
- package/composables/useI18n.ts +26 -0
- package/composables/useStore.ts +16 -0
- package/config/harvester-manager-types.js +0 -2
- package/config/home-links.js +32 -2
- package/config/private-label.js +0 -22
- package/config/product/explorer.js +4 -4
- package/config/product/fleet.js +1 -6
- package/config/product/legacy.js +1 -84
- package/config/product/manager.js +15 -8
- package/config/query-params.js +0 -1
- package/config/router.js +368 -385
- package/config/settings.ts +9 -2
- package/config/store.js +1 -1
- package/config/system-namespaces.js +0 -3
- package/config/table-headers.js +27 -47
- package/config/types.js +5 -0
- package/config/uiplugins.js +1 -1
- package/core/plugin-helpers.js +5 -3
- package/core/plugin-routes.ts +114 -56
- package/core/plugin.ts +10 -16
- package/core/plugins-loader.js +9 -7
- package/core/plugins.js +3 -0
- package/core/types-provisioning.ts +0 -7
- package/creators/app/init +0 -19
- package/detail/fleet.cattle.io.cluster.vue +1 -11
- package/detail/node.vue +0 -42
- package/detail/pod.vue +1 -68
- package/detail/provisioning.cattle.io.cluster.vue +4 -6
- package/detail/workload/index.vue +1 -15
- package/dialog/ScaleMachineDownDialog.vue +17 -34
- package/edit/auth/googleoauth.vue +5 -1
- package/edit/catalog.cattle.io.clusterrepo.vue +7 -20
- package/edit/cloudcredential.vue +0 -2
- package/edit/fleet.cattle.io.gitrepo.vue +4 -3
- package/edit/management.cattle.io.project.vue +52 -1
- package/edit/management.cattle.io.setting.vue +2 -31
- package/edit/monitoring.coreos.com.prometheusrule/AlertingRule.vue +3 -12
- package/edit/monitoring.coreos.com.prometheusrule/GroupRules.vue +1 -2
- package/edit/networking.k8s.io.networkpolicy/__tests__/PolicyRuleTarget.spec.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/Basics.vue → Basics.vue} +126 -109
- package/edit/provisioning.cattle.io.cluster/{tabs/MachinePool.vue → MachinePool.vue} +7 -1
- package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryConfigs.vue → RegistryConfigs.vue} +3 -1
- package/edit/provisioning.cattle.io.cluster/SelectCredential.vue +7 -15
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.tests.ts +237 -0
- package/edit/provisioning.cattle.io.cluster/__tests__/{CustomCommand.test.ts → CustomCommand.tests.ts} +0 -6
- package/edit/provisioning.cattle.io.cluster/__tests__/DrainOptions.test.ts +1 -1
- package/edit/provisioning.cattle.io.cluster/__tests__/rke2.test.ts +1 -7
- package/edit/provisioning.cattle.io.cluster/import.vue +2 -2
- package/edit/provisioning.cattle.io.cluster/index.vue +37 -99
- package/edit/provisioning.cattle.io.cluster/rke2.vue +690 -181
- package/edit/service.vue +0 -12
- package/edit/workload/Upgrading.vue +2 -3
- package/edit/workload/index.vue +1 -2
- package/edit/workload/mixins/workload.js +1 -1
- package/initialize/App.js +71 -25
- package/initialize/client.js +162 -21
- package/initialize/index.js +124 -47
- package/initialize/layouts.ts +26 -0
- package/{components/templates → layouts}/blank.vue +1 -1
- package/{components/templates → layouts}/default.vue +98 -8
- package/{components/templates → layouts}/error.vue +19 -10
- package/{components/templates → layouts}/home.vue +1 -4
- package/{components/templates → layouts}/plain.vue +1 -4
- package/{components/templates → layouts}/standalone.vue +1 -1
- package/{components/templates → layouts}/unauthenticated.vue +1 -1
- package/list/management.cattle.io.feature.vue +7 -1
- package/list/management.cattle.io.user.vue +25 -1
- package/list/node.vue +0 -1
- package/machine-config/__tests__/vmwarevsphere.test.ts +161 -56
- package/machine-config/amazonec2.vue +1 -0
- package/machine-config/azure.vue +37 -21
- package/machine-config/vmwarevsphere.vue +47 -42
- package/middleware/authenticated.js +19 -14
- package/mixins/auth-config.js +7 -2
- package/mixins/brand.js +41 -29
- package/mixins/fetch.server.js +73 -0
- package/mixins/labeled-form-element.ts +1 -6
- package/models/__tests__/management.cattle.io.node.ts +0 -85
- package/models/__tests__/namespace.test.ts +9 -49
- package/models/cluster/node.js +4 -4
- package/models/cluster.x-k8s.io.machine.js +1 -1
- package/models/cluster.x-k8s.io.machinedeployment.js +0 -14
- package/models/fleet.cattle.io.cluster.js +0 -4
- package/models/fleet.cattle.io.gitrepo.js +13 -56
- package/models/management.cattle.io.cluster.js +3 -11
- package/models/management.cattle.io.kontainerdriver.js +0 -1
- package/models/management.cattle.io.node.js +14 -18
- package/models/management.cattle.io.nodepool.js +0 -17
- package/models/management.cattle.io.project.js +36 -0
- package/models/management.cattle.io.setting.js +7 -11
- package/models/management.cattle.io.user.js +65 -0
- package/models/namespace.js +1 -1
- package/models/pod.js +0 -20
- package/models/provisioning.cattle.io.cluster.js +8 -55
- package/models/secret.js +18 -117
- package/models/workload.js +0 -16
- package/models/workload.service.js +0 -18
- package/package.json +10 -12
- package/pages/about.vue +1 -0
- package/pages/account/create-key.vue +1 -0
- package/pages/account/index.vue +1 -0
- package/pages/auth/login.vue +1 -0
- package/pages/auth/logout.vue +2 -0
- package/pages/auth/setup.vue +4 -37
- package/pages/auth/verify.vue +8 -14
- package/pages/c/_cluster/apps/charts/__tests__/install.helper.test.ts +17 -2
- package/pages/c/_cluster/apps/charts/index.vue +58 -64
- package/pages/c/_cluster/apps/charts/install.helpers.js +13 -2
- package/pages/c/_cluster/apps/charts/install.vue +5 -5
- package/pages/c/_cluster/apps/index.vue +2 -0
- package/pages/c/_cluster/auth/index.vue +2 -0
- package/pages/c/_cluster/auth/user.retention/index.vue +384 -0
- package/pages/c/_cluster/ecm/index.vue +2 -0
- package/pages/c/_cluster/explorer/index.vue +53 -56
- package/pages/c/_cluster/explorer/tools/index.vue +3 -171
- package/pages/c/_cluster/fleet/index.vue +1 -1
- package/pages/c/_cluster/index.vue +2 -0
- package/pages/c/_cluster/manager/pages/_page.vue +5 -4
- package/pages/c/_cluster/monitoring/index.vue +1 -17
- package/pages/c/_cluster/settings/DefaultLinksEditor.vue +1 -0
- package/pages/c/_cluster/settings/banners.vue +2 -0
- package/pages/c/_cluster/settings/brand.vue +2 -0
- package/pages/c/_cluster/settings/index.vue +2 -0
- package/pages/c/_cluster/settings/links.vue +3 -2
- package/pages/c/_cluster/settings/performance.vue +1 -0
- package/pages/c/_cluster/uiplugins/AddExtensionRepos.vue +4 -4
- package/pages/c/_cluster/uiplugins/CatalogList/CatalogLoadDialog.vue +1 -2
- package/pages/c/_cluster/uiplugins/CatalogList/index.vue +46 -10
- package/pages/c/_cluster/uiplugins/SetupUIPlugins.vue +5 -2
- package/pages/c/_cluster/uiplugins/__tests__/AddExtensionRepos.test.ts +96 -0
- package/pages/c/_cluster/uiplugins/__tests__/SetupUIPlugins.test.ts +128 -0
- package/pages/c/_cluster/uiplugins/index.vue +2 -0
- package/pages/c/index.vue +9 -0
- package/pages/diagnostic.vue +2 -1
- package/pages/fail-whale.vue +1 -0
- package/pages/prefs.vue +1 -0
- package/pages/rio/mesh.vue +508 -0
- package/pages/support/index.vue +8 -2
- package/pkg/auto-import.js +1 -1
- package/plugins/axios.js +36 -0
- package/plugins/back-button.js +5 -3
- package/plugins/clean-html-directive.js +19 -1
- package/plugins/clean-tooltip-directive.js +1 -1
- package/plugins/codemirror-loader.js +1 -1
- package/plugins/codemirror.js +0 -41
- package/plugins/dashboard-store/__tests__/actions.spec.ts +250 -0
- package/plugins/dashboard-store/__tests__/{mutations.test.ts → mutations.spec.ts} +1 -1
- package/plugins/dashboard-store/actions.js +21 -22
- package/plugins/dashboard-store/classify.js +18 -1
- package/plugins/dashboard-store/getters.js +5 -10
- package/plugins/dashboard-store/index.js +12 -0
- package/plugins/dashboard-store/mutations.js +4 -0
- package/plugins/dashboard-store/resource-class.js +18 -59
- package/plugins/i18n.js +1 -1
- package/plugins/steve/__tests__/getters.spec.ts +56 -24
- package/plugins/steve/__tests__/subscribe.spec.ts +106 -0
- package/plugins/steve/getters.js +30 -7
- package/plugins/steve/mutations.js +5 -2
- package/plugins/steve/norman-class.js +0 -19
- package/plugins/steve/steve-class.js +0 -22
- package/plugins/steve/subscribe.js +34 -13
- package/plugins/transitions.js +4 -0
- package/plugins/vue-clipboard2.js +4 -0
- package/rancher-components/Accordion/Accordion.vue +3 -2
- package/rancher-components/BadgeState/BadgeState.vue +3 -3
- package/rancher-components/Banner/Banner.test.ts +1 -5
- package/rancher-components/Banner/Banner.vue +2 -2
- package/rancher-components/Card/Card.vue +4 -4
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -3
- package/rancher-components/Form/LabeledInput/LabeledInput.test.ts +1 -1
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +55 -24
- package/rancher-components/Form/Radio/RadioButton.test.ts +1 -3
- package/rancher-components/Form/Radio/RadioButton.vue +13 -7
- package/rancher-components/Form/Radio/RadioGroup.vue +4 -3
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +7 -5
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +7 -4
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +9 -4
- package/rancher-components/StringList/StringList.vue +8 -8
- package/rancher-components/components/Accordion/Accordion.vue +3 -2
- package/rancher-components/components/BadgeState/BadgeState.test.ts +12 -0
- package/rancher-components/components/Form/LabeledInput/LabeledInput.test.ts +2 -19
- package/rancher-components/components/Form/LabeledInput/LabeledInput.vue +14 -11
- package/rancher-components/components/Form/TextArea/TextAreaAutoGrow.vue +1 -1
- package/rancher-components/components/StringList/StringList.test.ts +0 -270
- package/rancher-components/components/StringList/StringList.vue +18 -57
- package/scripts/extension/bundle +7 -19
- package/scripts/extension/helm/scripts/package +3 -11
- package/scripts/extension/parse-tag-name +4 -4
- package/scripts/extension/publish +9 -20
- package/scripts/publish-shell.sh +1 -11
- package/scripts/test-plugins-build.sh +9 -85
- package/store/catalog.js +1 -1
- package/store/features.js +0 -1
- package/store/i18n.js +0 -11
- package/store/index.js +11 -8
- package/store/prefs.js +38 -33
- package/store/type-map.js +8 -13
- package/tsconfig.default.json +46 -0
- package/tsconfig.json +9 -35
- package/types/shell/index.d.ts +404 -463
- package/utils/__tests__/create-yaml.test.ts +10 -0
- package/utils/axios.js +19 -0
- package/utils/create-yaml.js +6 -6
- package/utils/custom-validators.js +2 -0
- package/utils/error.js +1 -16
- package/utils/monitoring.js +2 -37
- package/utils/nuxt.js +39 -18
- package/utils/object.js +0 -14
- package/utils/router.scrollBehavior.js +14 -12
- package/utils/socket.js +1 -0
- package/utils/time.js +1 -1
- package/utils/title.ts +3 -0
- package/utils/url.ts +1 -1
- package/utils/validators/formRules/__tests__/index.test.ts +4 -49
- package/utils/validators/formRules/index.ts +9 -12
- package/utils/validators/setting.js +10 -6
- package/vue.config.js +3 -24
- package/chart/monitoring/steps/uninstall-v1.vue +0 -135
- package/components/Certificates.vue +0 -164
- package/components/fleet/__tests__/FleetSummary.test.ts +0 -316
- package/components/formatter/FleetClusterSummaryGraph.vue +0 -27
- package/components/formatter/__tests__/Checked.test.ts +0 -19
- package/components/nav/WindowManager/__tests__/ContainerLogs.test.ts +0 -186
- package/composables/useCompactInput.ts +0 -20
- package/composables/useLabeledFormElement.ts +0 -138
- package/creators/app/files/.gitlab-ci.yml +0 -14
- package/edit/__tests__/service.test.ts +0 -89
- package/edit/provisioning.cattle.io.cluster/__tests__/Advanced.test.ts +0 -112
- package/edit/provisioning.cattle.io.cluster/__tests__/Basics.test.ts +0 -473
- package/edit/provisioning.cattle.io.cluster/__tests__/index.test.ts +0 -73
- package/edit/provisioning.cattle.io.cluster/__tests__/utils/cluster.ts +0 -386
- package/edit/provisioning.cattle.io.cluster/tabs/AddOnConfig.vue +0 -137
- package/edit/provisioning.cattle.io.cluster/tabs/Advanced.vue +0 -157
- package/edit/provisioning.cattle.io.cluster/tabs/etcd/index.vue +0 -135
- package/edit/provisioning.cattle.io.cluster/tabs/networking/index.vue +0 -189
- package/edit/provisioning.cattle.io.cluster/tabs/registries/index.vue +0 -144
- package/edit/provisioning.cattle.io.cluster/tabs/upgrade/index.vue +0 -76
- package/mixins/v1-workload-metrics.js +0 -43
- package/models/__tests__/management.cattle.io.cluster.test.ts +0 -23
- package/models/__tests__/management.cattle.io.nodepool.ts +0 -83
- package/models/__tests__/provisioning.cattle.io.cluster.test.ts +0 -90
- package/models/__tests__/workload.test.ts +0 -91
- package/plugins/clean-html.js +0 -53
- package/plugins/dashboard-store/__tests__/actions.test.ts +0 -165
- package/plugins/dashboard-store/__tests__/resource-class.test.ts +0 -49
- package/plugins/dashboard-store/__tests__/utils/store-mocks.ts +0 -7
- package/plugins/index.js +0 -11
- package/plugins/steve/__tests__/steve-class.spec.ts +0 -59
- package/plugins/steve/__tests__/utils/steve-mocks.ts +0 -31
- package/scripts/.gitlab/workflows/build-extension-catalog.gitlab-ci.yml +0 -50
- package/server/har-file.js +0 -183
- package/tsconfig.paths.json +0 -18
- package/utils/azure.js +0 -24
- package/utils/clipboard.js +0 -5
- /package/components/form/__tests__/{NameNsDescription.test.ts → NameNsDescription.ts} +0 -0
- /package/edit/networking.k8s.io.networkpolicy/__tests__/utils/{selectors.test.ts → selectors.ts} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/networking/ACE.vue → ACE.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/AgentConfiguration.vue → AgentConfiguration.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/upgrade/DrainOptions.vue → DrainOptions.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/MemberRoles.vue → MemberRoles.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/registries/RegistryMirrors.vue → RegistryMirrors.vue} +0 -0
- /package/edit/provisioning.cattle.io.cluster/{tabs/etcd/S3Config.vue → S3Config.vue} +0 -0
- /package/plugins/dashboard-store/__tests__/{getters.test.ts → getters.spec.ts} +0 -0
- /package/rancher-components/BadgeState/{BadgeState.spec.ts → BadgeState.test.ts} +0 -0
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { mapGetters } from 'vuex';
|
|
3
3
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
4
4
|
import { CHARSET, randomStr } from '@shell/utils/string';
|
|
5
|
-
import { copyTextToClipboard } from '@shell/utils/clipboard';
|
|
6
5
|
|
|
7
6
|
export default {
|
|
8
7
|
components: { LabeledInput },
|
|
@@ -76,7 +75,6 @@ export default {
|
|
|
76
75
|
}
|
|
77
76
|
},
|
|
78
77
|
methods: {
|
|
79
|
-
copyTextToClipboard,
|
|
80
78
|
generatePassword() {
|
|
81
79
|
this.password = randomStr(16, CHARSET.ALPHA_NUM);
|
|
82
80
|
},
|
|
@@ -111,7 +109,7 @@ export default {
|
|
|
111
109
|
>
|
|
112
110
|
<a
|
|
113
111
|
href="#"
|
|
114
|
-
@click.prevent.stop="
|
|
112
|
+
@click.prevent.stop="$copyText(password)"
|
|
115
113
|
>{{ t('action.copy') }}</a>
|
|
116
114
|
</div>
|
|
117
115
|
<div
|
|
@@ -246,7 +246,7 @@ export default {
|
|
|
246
246
|
>
|
|
247
247
|
<template #option="option">
|
|
248
248
|
<div @mousedown="(e) => onClickOption(option, e)">
|
|
249
|
-
{{ option.label }}
|
|
249
|
+
{{ getOptionLabel(option.label) }}
|
|
250
250
|
</div>
|
|
251
251
|
</template>
|
|
252
252
|
<!-- Pass down templates provided by the caller -->
|
|
@@ -207,7 +207,7 @@ export default {
|
|
|
207
207
|
types.push(SECRET_TYPES.RKE_AUTH_CONFIG);
|
|
208
208
|
}
|
|
209
209
|
|
|
210
|
-
|
|
210
|
+
let out = this.allSecrets
|
|
211
211
|
.filter((x) => this.namespace && this.limitToNamespace ? x.metadata.namespace === this.namespace : true)
|
|
212
212
|
.filter((x) => {
|
|
213
213
|
// Must match one of the types if given
|
|
@@ -254,7 +254,7 @@ export default {
|
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
if ( !this.limitToNamespace ) {
|
|
257
|
-
sortBy(out, 'group');
|
|
257
|
+
out = sortBy(out, 'group');
|
|
258
258
|
if ( out.length ) {
|
|
259
259
|
let lastGroup = '';
|
|
260
260
|
|
|
@@ -509,7 +509,7 @@ export default {
|
|
|
509
509
|
<div :class="moreCols">
|
|
510
510
|
<LabeledInput
|
|
511
511
|
v-model="publicKey"
|
|
512
|
-
data-testid="auth-secret-basic-
|
|
512
|
+
data-testid="auth-secret-basic-username"
|
|
513
513
|
:mode="mode"
|
|
514
514
|
label-key="selectOrCreateAuthSecret.basic.username"
|
|
515
515
|
/>
|
|
@@ -517,7 +517,7 @@ export default {
|
|
|
517
517
|
<div :class="moreCols">
|
|
518
518
|
<LabeledInput
|
|
519
519
|
v-model="privateKey"
|
|
520
|
-
data-testid="auth-secret-basic-
|
|
520
|
+
data-testid="auth-secret-basic-password"
|
|
521
521
|
:mode="mode"
|
|
522
522
|
type="password"
|
|
523
523
|
label-key="selectOrCreateAuthSecret.basic.password"
|
|
@@ -47,7 +47,7 @@ describe('component: KeyValue', () => {
|
|
|
47
47
|
stubs: { CodeMirror: true }
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
const inputFieldTextArea = wrapper.find('[data-testid="
|
|
50
|
+
const inputFieldTextArea = wrapper.find('[data-testid="value-multiline"]');
|
|
51
51
|
|
|
52
52
|
inputFieldTextArea.setValue('bar\n');
|
|
53
53
|
|
|
@@ -2,24 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
props: {
|
|
5
|
-
// When sortabletable calculates these values it converts null and undefined to ''
|
|
6
|
-
// passing '' to a prop typed as Boolean coerces it to true
|
|
7
5
|
value: {
|
|
8
|
-
type:
|
|
6
|
+
type: Boolean,
|
|
9
7
|
default: true
|
|
10
8
|
},
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
computed: {
|
|
14
|
-
checked() {
|
|
15
|
-
return this.value === true || this.value === 'true';
|
|
16
|
-
}
|
|
17
|
-
},
|
|
9
|
+
}
|
|
18
10
|
};
|
|
19
11
|
</script>
|
|
20
12
|
|
|
21
13
|
<template>
|
|
22
|
-
<span v-if="
|
|
14
|
+
<span v-if="value">
|
|
23
15
|
<i class="icon icon-checkmark" />
|
|
24
16
|
</span>
|
|
25
17
|
<span
|
|
@@ -6,6 +6,23 @@ export default {
|
|
|
6
6
|
required: true
|
|
7
7
|
},
|
|
8
8
|
},
|
|
9
|
+
data(props) {
|
|
10
|
+
const mgmt = props.row?.mgmt;
|
|
11
|
+
|
|
12
|
+
return {
|
|
13
|
+
// The isImported getter on the provisioning cluster
|
|
14
|
+
// model doesn't work for imported K3s clusters, in
|
|
15
|
+
// which case it returns 'k3s' instead of 'imported.'
|
|
16
|
+
// This is the workaround.
|
|
17
|
+
isImported: mgmt?.providerForEmberParam === 'import' ||
|
|
18
|
+
// when imported cluster is GKE
|
|
19
|
+
!!mgmt?.spec?.gkeConfig?.imported ||
|
|
20
|
+
// or AKS
|
|
21
|
+
!!mgmt?.spec?.aksConfig?.imported ||
|
|
22
|
+
// or EKS
|
|
23
|
+
!!mgmt?.spec?.eksConfig?.imported
|
|
24
|
+
};
|
|
25
|
+
},
|
|
9
26
|
};
|
|
10
27
|
</script>
|
|
11
28
|
|
|
@@ -28,7 +45,7 @@ export default {
|
|
|
28
45
|
<template v-else-if="row.isCustom">
|
|
29
46
|
{{ t('cluster.provider.custom') }}
|
|
30
47
|
</template>
|
|
31
|
-
<template v-else-if="
|
|
48
|
+
<template v-else-if="isImported">
|
|
32
49
|
{{ t('cluster.provider.imported') }}
|
|
33
50
|
</template>
|
|
34
51
|
<div class="text-muted">
|
|
@@ -12,22 +12,10 @@ export default {
|
|
|
12
12
|
type: Object,
|
|
13
13
|
required: true
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
clusterLabel: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: false,
|
|
19
|
-
default: null,
|
|
20
|
-
}
|
|
21
15
|
},
|
|
22
16
|
|
|
23
17
|
computed: {
|
|
24
18
|
summary() {
|
|
25
|
-
if (this.clusterLabel) {
|
|
26
|
-
return this.row.clusterResourceStatus.find((x) => {
|
|
27
|
-
return x.clusterLabel === this.clusterLabel;
|
|
28
|
-
})?.status.resourceCounts || {};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
19
|
return this.row.status?.resourceCounts || {};
|
|
32
20
|
},
|
|
33
21
|
|
|
@@ -85,7 +73,7 @@ export default {
|
|
|
85
73
|
>
|
|
86
74
|
<td
|
|
87
75
|
class="text-left pr-20"
|
|
88
|
-
:class="{
|
|
76
|
+
:class="{[obj.textColor]: true}"
|
|
89
77
|
>
|
|
90
78
|
{{ obj.label }}
|
|
91
79
|
</td>
|
|
@@ -106,17 +94,17 @@ export default {
|
|
|
106
94
|
</template>
|
|
107
95
|
|
|
108
96
|
<style lang="scss">
|
|
109
|
-
.col-scale {
|
|
110
|
-
|
|
97
|
+
.col-scale {
|
|
98
|
+
position: relative;
|
|
111
99
|
|
|
112
|
-
|
|
113
|
-
|
|
100
|
+
.trigger {
|
|
101
|
+
width: 100%;
|
|
102
|
+
}
|
|
114
103
|
}
|
|
115
|
-
}
|
|
116
104
|
|
|
117
|
-
.scale {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
105
|
+
.scale {
|
|
106
|
+
margin: 0;
|
|
107
|
+
padding: 0;
|
|
108
|
+
line-height: initial;
|
|
109
|
+
}
|
|
122
110
|
</style>
|
|
@@ -34,6 +34,16 @@ export default {
|
|
|
34
34
|
showTooltip: {
|
|
35
35
|
type: Boolean,
|
|
36
36
|
default: true
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Determines if the live date should behave like a countdown by comparing
|
|
41
|
+
* the provided value and the current date. When the countdown reaches 0, a
|
|
42
|
+
* "-" is rendered.
|
|
43
|
+
*/
|
|
44
|
+
isCountdown: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false,
|
|
37
47
|
}
|
|
38
48
|
},
|
|
39
49
|
|
|
@@ -104,6 +114,12 @@ export default {
|
|
|
104
114
|
return 300;
|
|
105
115
|
}
|
|
106
116
|
|
|
117
|
+
if (this.isCountdown && now.valueOf() > this.dayValue?.valueOf()) {
|
|
118
|
+
this.label = '-';
|
|
119
|
+
|
|
120
|
+
return 300;
|
|
121
|
+
}
|
|
122
|
+
|
|
107
123
|
const diff = diffFrom(this.dayValue, now);
|
|
108
124
|
const prefix = (diff.diff < 0 || !this.addPrefix ? '' : '-');
|
|
109
125
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { mount } from '@vue/test-utils';
|
|
2
|
+
import ClusterProvider from '@shell/components/formatter/ClusterProvider.vue';
|
|
3
|
+
|
|
4
|
+
describe('component: ClusterProvider', () => {
|
|
5
|
+
const importedGkeClusterInfo = { mgmt: { spec: { gkeConfig: { imported: true } } } };
|
|
6
|
+
const importedAksClusterInfo = { mgmt: { spec: { aksConfig: { imported: true } } } };
|
|
7
|
+
const importedEksClusterInfo = { mgmt: { spec: { eksConfig: { imported: true } } } };
|
|
8
|
+
const notImportedGkeClusterInfo = { mgmt: { spec: { gkeConfig: { imported: false } } } };
|
|
9
|
+
const importedClusterInfoWithProviderForEmberParam = { mgmt: { providerForEmberParam: 'import' } };
|
|
10
|
+
|
|
11
|
+
describe('isImported', () => {
|
|
12
|
+
const testCases = [
|
|
13
|
+
[importedGkeClusterInfo, true],
|
|
14
|
+
[importedAksClusterInfo, true],
|
|
15
|
+
[importedEksClusterInfo, true],
|
|
16
|
+
[notImportedGkeClusterInfo, false],
|
|
17
|
+
[importedClusterInfoWithProviderForEmberParam, true],
|
|
18
|
+
[{}, false],
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
it.each(testCases)('should return the isImported value properly based on the props data', (row, expected) => {
|
|
22
|
+
const wrapper = mount(ClusterProvider, { propsData: { row } });
|
|
23
|
+
|
|
24
|
+
expect(wrapper.vm.$data.isImported).toBe(expected);
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
});
|
package/components/nav/Group.vue
CHANGED
|
@@ -390,8 +390,8 @@ export default {
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
|
|
393
|
-
.body ::v-deep > .child.
|
|
394
|
-
.header ::v-deep > .child.
|
|
393
|
+
.body ::v-deep > .child.nuxt-link-active,
|
|
394
|
+
.header ::v-deep > .child.nuxt-link-exact-active {
|
|
395
395
|
padding: 0;
|
|
396
396
|
|
|
397
397
|
A, A I {
|
|
@@ -311,7 +311,7 @@ export default {
|
|
|
311
311
|
product: this.currentProduct.name,
|
|
312
312
|
cluster: this.currentCluster,
|
|
313
313
|
};
|
|
314
|
-
const enabled = action.enabled ? action.enabled.apply(this, [
|
|
314
|
+
const enabled = action.enabled ? action.enabled.apply(this, [opts]) : true;
|
|
315
315
|
|
|
316
316
|
if (fn && enabled) {
|
|
317
317
|
fn.apply(this, [opts, [], { $route: this.$route }]);
|
|
@@ -441,6 +441,7 @@ export default {
|
|
|
441
441
|
|
|
442
442
|
<div class="rd-header-right">
|
|
443
443
|
<component :is="navHeaderRight" />
|
|
444
|
+
|
|
444
445
|
<div
|
|
445
446
|
v-if="showFilter"
|
|
446
447
|
class="top"
|
|
@@ -13,7 +13,6 @@ import { getVersionInfo } from '@shell/utils/version';
|
|
|
13
13
|
import { LEGACY } from '@shell/store/features';
|
|
14
14
|
import { SETTING } from '@shell/config/settings';
|
|
15
15
|
import { filterOnlyKubernetesClusters, filterHiddenLocalCluster } from '@shell/utils/cluster';
|
|
16
|
-
import { getProductFromRoute } from '@shell/middleware/authenticated';
|
|
17
16
|
import { isRancherPrime } from '@shell/config/version';
|
|
18
17
|
import Pinned from '@shell/components/nav/Pinned';
|
|
19
18
|
|
|
@@ -75,7 +74,6 @@ export default {
|
|
|
75
74
|
const {
|
|
76
75
|
showFooter, showHeader, bannerFooter, bannerHeader, banner
|
|
77
76
|
} = parsed;
|
|
78
|
-
|
|
79
77
|
// add defaults to accomodate older JSON structures for banner definitions without breaking the UI
|
|
80
78
|
// https://github.com/rancher/dashboard/issues/10140
|
|
81
79
|
const bannerHeaderFontSize = bannerHeader?.fontSize || banner?.fontSize || '14px';
|
|
@@ -248,15 +246,7 @@ export default {
|
|
|
248
246
|
|
|
249
247
|
hasSupport() {
|
|
250
248
|
return isRancherPrime() || this.$store.getters['management/byId'](MANAGEMENT.SETTING, SETTING.SUPPORTED )?.value === 'true';
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
isCurrRouteClusterExplorer() {
|
|
254
|
-
return this.$route?.name?.startsWith('c-cluster');
|
|
255
|
-
},
|
|
256
|
-
|
|
257
|
-
productFromRoute() {
|
|
258
|
-
return getProductFromRoute(this.$route);
|
|
259
|
-
},
|
|
249
|
+
}
|
|
260
250
|
},
|
|
261
251
|
|
|
262
252
|
watch: {
|
|
@@ -287,16 +277,6 @@ export default {
|
|
|
287
277
|
return `${ lineHeightInEm }em`;
|
|
288
278
|
},
|
|
289
279
|
|
|
290
|
-
checkActiveRoute(obj, isClusterRoute) {
|
|
291
|
-
// for Cluster links in main nav: check if route is a cluster explorer one + check if route cluster matches cluster obj id + check if curr product matches route product
|
|
292
|
-
if (isClusterRoute) {
|
|
293
|
-
return this.isCurrRouteClusterExplorer && this.$route?.params?.cluster === obj?.id && this.productFromRoute === this.currentProduct?.name;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// for remaining main nav items, check if curr product matches route product is enough
|
|
297
|
-
return this.productFromRoute === obj?.value;
|
|
298
|
-
},
|
|
299
|
-
|
|
300
280
|
handler(e) {
|
|
301
281
|
if (e.keyCode === KEY.ESCAPE ) {
|
|
302
282
|
this.hide();
|
|
@@ -459,7 +439,6 @@ export default {
|
|
|
459
439
|
<nuxt-link
|
|
460
440
|
class="option"
|
|
461
441
|
:to="a.to"
|
|
462
|
-
:class="{'active-menu-link': checkActiveRoute(a) }"
|
|
463
442
|
>
|
|
464
443
|
<IconOrSvg
|
|
465
444
|
:icon="a.icon"
|
|
@@ -491,7 +470,6 @@ export default {
|
|
|
491
470
|
v-if="c.ready"
|
|
492
471
|
:data-testid="`menu-cluster-${ c.id }`"
|
|
493
472
|
class="cluster selector option"
|
|
494
|
-
:class="{'active-menu-link': checkActiveRoute(c, true) }"
|
|
495
473
|
:to="{ name: 'c-cluster-explorer', params: { cluster: c.id } }"
|
|
496
474
|
>
|
|
497
475
|
<ClusterIconMenu
|
|
@@ -541,7 +519,6 @@ export default {
|
|
|
541
519
|
v-if="c.ready"
|
|
542
520
|
:data-testid="`menu-cluster-${ c.id }`"
|
|
543
521
|
class="cluster selector option"
|
|
544
|
-
:class="{'active-menu-link': checkActiveRoute(c, true) }"
|
|
545
522
|
:to="{ name: 'c-cluster-explorer', params: { cluster: c.id } }"
|
|
546
523
|
>
|
|
547
524
|
<ClusterIconMenu
|
|
@@ -619,7 +596,6 @@ export default {
|
|
|
619
596
|
>
|
|
620
597
|
<nuxt-link
|
|
621
598
|
class="option"
|
|
622
|
-
:class="{'active-menu-link': checkActiveRoute(a) }"
|
|
623
599
|
:to="a.to"
|
|
624
600
|
>
|
|
625
601
|
<IconOrSvg
|
|
@@ -647,7 +623,6 @@ export default {
|
|
|
647
623
|
>
|
|
648
624
|
<nuxt-link
|
|
649
625
|
class="option"
|
|
650
|
-
:class="{'active-menu-link': checkActiveRoute(a) }"
|
|
651
626
|
:to="a.to"
|
|
652
627
|
>
|
|
653
628
|
<IconOrSvg
|
|
@@ -677,7 +652,6 @@ export default {
|
|
|
677
652
|
>
|
|
678
653
|
<nuxt-link
|
|
679
654
|
class="option"
|
|
680
|
-
:class="{'active-menu-link': checkActiveRoute(a) }"
|
|
681
655
|
:to="a.to"
|
|
682
656
|
>
|
|
683
657
|
<IconOrSvg
|
|
@@ -897,7 +871,7 @@ export default {
|
|
|
897
871
|
margin-right: 16px;
|
|
898
872
|
}
|
|
899
873
|
|
|
900
|
-
&.
|
|
874
|
+
&.nuxt-link-active {
|
|
901
875
|
background: var(--primary-hover-bg);
|
|
902
876
|
color: var(--primary-hover-text);
|
|
903
877
|
|
|
@@ -1021,7 +995,7 @@ export default {
|
|
|
1021
995
|
font-size: 14px;
|
|
1022
996
|
}
|
|
1023
997
|
|
|
1024
|
-
.
|
|
998
|
+
.nuxt-link-active {
|
|
1025
999
|
&:hover {
|
|
1026
1000
|
text-decoration: none;
|
|
1027
1001
|
}
|
package/components/nav/Type.vue
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import Favorite from '@shell/components/nav/Favorite';
|
|
3
3
|
import { FAVORITE, USED } from '@shell/store/type-map';
|
|
4
|
+
import { linkActiveClass } from '@shell/config/router';
|
|
4
5
|
|
|
5
6
|
const showFavoritesFor = [FAVORITE, USED];
|
|
6
7
|
|
|
@@ -30,6 +31,7 @@ export default {
|
|
|
30
31
|
near: false,
|
|
31
32
|
over: false,
|
|
32
33
|
menuPath: this.type.route ? this.$router.resolve(this.type.route)?.route?.path : undefined,
|
|
34
|
+
linkActiveClass
|
|
33
35
|
};
|
|
34
36
|
},
|
|
35
37
|
|
|
@@ -132,7 +134,7 @@ export default {
|
|
|
132
134
|
:to="type.route"
|
|
133
135
|
tag="li"
|
|
134
136
|
class="child nav-type"
|
|
135
|
-
:class="{'root': isRoot, [`depth-${depth}`]: true,
|
|
137
|
+
:class="{'root': isRoot, [`depth-${depth}`]: true, [linkActiveClass]: isCurrent}"
|
|
136
138
|
:exact="type.exact"
|
|
137
139
|
>
|
|
138
140
|
<a
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { saveAs } from 'file-saver';
|
|
3
3
|
import AnsiUp from 'ansi_up';
|
|
4
4
|
import { addParams } from '@shell/utils/url';
|
|
5
|
-
import {
|
|
5
|
+
import { base64Decode } from '@shell/utils/crypto';
|
|
6
6
|
import { LOGS_RANGE, LOGS_TIME, LOGS_WRAP } from '@shell/store/prefs';
|
|
7
7
|
import LabeledSelect from '@shell/components/form/LabeledSelect';
|
|
8
8
|
import { Checkbox } from '@components/Form/Checkbox';
|
|
@@ -25,61 +25,6 @@ import Window from './Window';
|
|
|
25
25
|
|
|
26
26
|
let lastId = 1;
|
|
27
27
|
const ansiup = new AnsiUp();
|
|
28
|
-
// Convert arrayBuffer(Uint8Array) to string
|
|
29
|
-
// ref: https://developer.mozilla.org/en-US/docs/Web/API/TextDecoder
|
|
30
|
-
// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/of
|
|
31
|
-
const ab2str = (input, outputEncoding = 'utf8') => {
|
|
32
|
-
const decoder = new TextDecoder(outputEncoding);
|
|
33
|
-
|
|
34
|
-
return decoder.decode(input);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// The utf-8 encoded messages pushed by websocket may truncate multi-byte utf-8 characters,
|
|
38
|
-
// which causes the front-end to be unable to parse the truncated multi-byte utf-8 characters in the previous and next messages when decoding.
|
|
39
|
-
// Therefore, we need to determine whether the last 4 bytes of the current pushed message contain incomplete utf-8 encoded characters.
|
|
40
|
-
// ref: https://en.wikipedia.org/wiki/UTF-8#Encoding
|
|
41
|
-
const isLogTruncated = (uint8ArrayBuffer) => {
|
|
42
|
-
const len = uint8ArrayBuffer.length;
|
|
43
|
-
const count = Math.min(4, len);
|
|
44
|
-
let isTruncated = false;
|
|
45
|
-
|
|
46
|
-
// Parses the last ${count} bytes of the array to determine if there are any truncated utf-8 characters.
|
|
47
|
-
for ( let i = 0; i < count; i++ ) {
|
|
48
|
-
const a = uint8ArrayBuffer[len - (1 + i)];
|
|
49
|
-
|
|
50
|
-
// 1 byte utf-8 character in binary form: 0xxxxxxxxx
|
|
51
|
-
if ((a & 0b10000000) === 0b00000000) {
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
// Multi-byte utf-8 character, intermediate binary form: 10xxxxxx
|
|
55
|
-
if ((a & 0b11000000) === 0b10000000) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
// 2 byte utf-8 character in binary form: 110xxxxx 10xxxxxx
|
|
59
|
-
if ((a & 0b11100000) === 0b11000000) {
|
|
60
|
-
if ( i !== 1) {
|
|
61
|
-
isTruncated = true;
|
|
62
|
-
}
|
|
63
|
-
break;
|
|
64
|
-
}
|
|
65
|
-
// 3 byte utf-8 character in binary form: 1110xxxx 10xxxxxx 10xxxxxx
|
|
66
|
-
if ((a & 0b11110000) === 0b11100000) {
|
|
67
|
-
if (i !== 2) {
|
|
68
|
-
isTruncated = true;
|
|
69
|
-
}
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
// 4 byte utf-8 character in binary form: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
|
|
73
|
-
if ((a & 0b11111000) === 0b11110000) {
|
|
74
|
-
if (i !== 3) {
|
|
75
|
-
isTruncated = true;
|
|
76
|
-
}
|
|
77
|
-
break;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return isTruncated;
|
|
82
|
-
};
|
|
83
28
|
|
|
84
29
|
export default {
|
|
85
30
|
components: {
|
|
@@ -328,80 +273,34 @@ export default {
|
|
|
328
273
|
console.error('Connect Error', e); // eslint-disable-line no-console
|
|
329
274
|
});
|
|
330
275
|
|
|
331
|
-
let logBuffer = [];
|
|
332
|
-
let truncatedLog = '';
|
|
333
|
-
|
|
334
276
|
this.socket.addEventListener(EVENT_MESSAGE, (e) => {
|
|
335
|
-
const
|
|
336
|
-
const replacedData = decodedData.replace(/[-_]/g, (char) => char === '-' ? '+' : '/');
|
|
337
|
-
const b = base64DecodeToBuffer(replacedData);
|
|
338
|
-
const isTruncated = isLogTruncated(b);
|
|
277
|
+
const line = base64Decode(e.detail.data);
|
|
339
278
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
return;
|
|
344
|
-
}
|
|
279
|
+
let msg = line;
|
|
280
|
+
let time = null;
|
|
345
281
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
// If the logBuffer is not empty,
|
|
349
|
-
// there are truncated utf-8 characters in the previous message
|
|
350
|
-
// that need to be merged with the current message before decoding.
|
|
351
|
-
if (logBuffer.length > 0) {
|
|
352
|
-
// Convert arrayBuffer(Uint8Array) to string
|
|
353
|
-
// ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/of
|
|
354
|
-
d = ab2str(Uint8Array.of(...logBuffer, ...b));
|
|
355
|
-
logBuffer = [];
|
|
356
|
-
} else {
|
|
357
|
-
d = b.toString();
|
|
358
|
-
}
|
|
359
|
-
let data = d;
|
|
360
|
-
|
|
361
|
-
if (truncatedLog) {
|
|
362
|
-
data = `${ truncatedLog }${ d }`;
|
|
363
|
-
truncatedLog = '';
|
|
364
|
-
}
|
|
282
|
+
const idx = line.indexOf(' ');
|
|
365
283
|
|
|
366
|
-
if (
|
|
367
|
-
const
|
|
284
|
+
if ( idx > 0 ) {
|
|
285
|
+
const timeStr = line.substr(0, idx);
|
|
286
|
+
const date = new Date(timeStr);
|
|
368
287
|
|
|
369
|
-
if (
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
return;
|
|
288
|
+
if ( !isNaN(date.getSeconds()) ) {
|
|
289
|
+
time = date.toISOString();
|
|
290
|
+
msg = line.substr(idx + 1);
|
|
373
291
|
}
|
|
374
|
-
data = lines.slice(0, -1).join('\n');
|
|
375
|
-
truncatedLog = lines.slice(-1);
|
|
376
292
|
}
|
|
377
|
-
// Websocket message may contain multiple lines - loop through each line, one by one
|
|
378
|
-
data.split('\n').filter((line) => line).forEach((line) => {
|
|
379
|
-
let msg = line;
|
|
380
|
-
let time = null;
|
|
381
|
-
|
|
382
|
-
const idx = line.indexOf(' ');
|
|
383
|
-
|
|
384
|
-
if ( idx > 0 ) {
|
|
385
|
-
const timeStr = line.substr(0, idx);
|
|
386
|
-
const date = new Date(timeStr);
|
|
387
293
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
const parsedLine = {
|
|
395
|
-
id: lastId++,
|
|
396
|
-
msg: ansiup.ansi_to_html(msg),
|
|
397
|
-
rawMsg: msg,
|
|
398
|
-
time,
|
|
399
|
-
};
|
|
294
|
+
const parsedLine = {
|
|
295
|
+
id: lastId++,
|
|
296
|
+
msg: ansiup.ansi_to_html(msg),
|
|
297
|
+
rawMsg: msg,
|
|
298
|
+
time,
|
|
299
|
+
};
|
|
400
300
|
|
|
401
|
-
|
|
301
|
+
Object.freeze(parsedLine);
|
|
402
302
|
|
|
403
|
-
|
|
404
|
-
});
|
|
303
|
+
this.backlog.push(parsedLine);
|
|
405
304
|
});
|
|
406
305
|
|
|
407
306
|
this.socket.connect();
|
|
@@ -79,7 +79,6 @@ export default {
|
|
|
79
79
|
fitAddon: null,
|
|
80
80
|
searchAddon: null,
|
|
81
81
|
webglAddon: null,
|
|
82
|
-
canvasAddon: null,
|
|
83
82
|
isOpen: false,
|
|
84
83
|
isOpening: false,
|
|
85
84
|
backlog: [],
|
|
@@ -156,7 +155,6 @@ export default {
|
|
|
156
155
|
webgl: import(/* webpackChunkName: "xterm" */ 'xterm-addon-webgl'),
|
|
157
156
|
weblinks: import(/* webpackChunkName: "xterm" */ 'xterm-addon-web-links'),
|
|
158
157
|
search: import(/* webpackChunkName: "xterm" */ 'xterm-addon-search'),
|
|
159
|
-
canvas: import(/* webpackChunkName: "xterm" */ 'xterm-addon-canvas')
|
|
160
158
|
});
|
|
161
159
|
|
|
162
160
|
const terminal = new xterm.Terminal({
|
|
@@ -173,11 +171,10 @@ export default {
|
|
|
173
171
|
this.searchAddon = new addons.search.SearchAddon();
|
|
174
172
|
|
|
175
173
|
try {
|
|
176
|
-
this.webglAddon = new addons.webgl.
|
|
174
|
+
this.webglAddon = new addons.webgl.WebGlAddon();
|
|
177
175
|
} catch (e) {
|
|
178
176
|
// Some browsers (Safari) don't support the webgl renderer, so don't use it.
|
|
179
177
|
this.webglAddon = null;
|
|
180
|
-
this.canvasAddon = new addons.canvas.CanvasAddon();
|
|
181
178
|
}
|
|
182
179
|
|
|
183
180
|
terminal.loadAddon(this.fitAddon);
|
|
@@ -187,8 +184,6 @@ export default {
|
|
|
187
184
|
|
|
188
185
|
if (this.webglAddon) {
|
|
189
186
|
terminal.loadAddon(this.webglAddon);
|
|
190
|
-
} else {
|
|
191
|
-
terminal.loadAddon(this.canvasAddon);
|
|
192
187
|
}
|
|
193
188
|
|
|
194
189
|
this.fit();
|