dashboard-shell-shell 3.0.5-test.6 → 3.0.5-test.9
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/assets/brand/harvester/favicon.png +0 -0
- package/assets/brand/suse/favicon.png +0 -0
- package/assets/icons/demo.css +539 -0
- package/assets/icons/demo.css:Zone.Identifier +0 -0
- package/assets/icons/demo_index.html +1131 -0
- package/assets/icons/demo_index.html:Zone.Identifier +0 -0
- package/assets/icons/iconfont.css +216 -0
- package/assets/icons/iconfont.css:Zone.Identifier +0 -0
- package/assets/icons/iconfont.js +1 -0
- package/assets/icons/iconfont.js:Zone.Identifier +0 -0
- package/assets/icons/iconfont.json +324 -0
- package/assets/icons/iconfont.json:Zone.Identifier +0 -0
- package/assets/icons/iconfont.ttf +0 -0
- package/assets/icons/iconfont.ttf:Zone.Identifier +0 -0
- package/assets/icons/iconfont.woff +0 -0
- package/assets/icons/iconfont.woff2 +0 -0
- package/assets/icons/iconfont.woff2:Zone.Identifier +0 -0
- package/assets/icons/iconfont.woff:Zone.Identifier +0 -0
- package/assets/images/API.svg +3 -0
- package/assets/images/action.svg +6 -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/half-logo.svg +2 -23
- package/assets/images/pl/harvester.png +0 -0
- package/assets/images/pl/logo.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 +4 -0
- package/assets/styles/base/_basic.scss +2 -2
- package/assets/styles/base/_mixins.scss +1 -1
- package/assets/styles/base/_typography.scss +2 -1
- package/assets/styles/base/_variables.scss +14 -7
- package/assets/styles/global/_button.scss +43 -25
- package/assets/styles/global/_columns.scss +3 -1
- package/assets/styles/global/_form.scss +45 -13
- package/assets/styles/global/_labeled-input.scss +54 -26
- package/assets/styles/global/_layout.scss +8 -3
- package/assets/styles/global/_select.scss +25 -17
- package/assets/styles/global/_table.scss +7 -1
- package/assets/styles/global/_tooltip.scss +56 -8
- package/assets/styles/themes/_dark.scss +3 -0
- package/assets/styles/themes/_light.scss +66 -43
- package/assets/styles/vendor/vue-select.scss +22 -9
- package/assets/translations/en-us.yaml +28 -4
- package/assets/translations/zh-hans.yaml +452 -189
- package/components/ActionDropdown.vue +2 -1
- package/components/ActionMenu.vue +2 -2
- package/components/ActionMenuShell.vue +2 -0
- package/components/AppModal.vue +46 -5
- package/components/BrandImage.vue +1 -0
- package/components/ButtonDropdown.vue +26 -4
- package/components/ButtonMultiAction.vue +1 -0
- package/components/ClusterIconMenu.vue +1 -1
- package/components/CodeMirror.vue +20 -6
- package/components/ConsumptionGauge.vue +24 -5
- package/components/CopyToClipboard.vue +15 -0
- package/components/CruResource.vue +9 -8
- package/components/CruResourceFooter.vue +2 -2
- package/components/DashboardOptions.vue +29 -17
- package/components/DotState.vue +84 -0
- package/components/Drawer/Chrome.vue +2 -2
- package/components/Drawer/ResourceDetailDrawer/ConfigTab.vue +22 -22
- package/components/Drawer/ResourceDetailDrawer/YamlTab.vue +1 -1
- package/components/Drawer/ResourceDetailDrawer/index.vue +2 -1
- package/components/ExplorerMembers.vue +18 -3
- package/components/ExplorerProjectsNamespaces.vue +19 -5
- package/components/GlobalRoleBindings.vue +112 -48
- package/components/GrafanaDashboard.vue +4 -4
- package/components/GrowlManager.vue +3 -1
- package/components/HardwareResourceGauge.vue +39 -3
- package/components/IndentedPanel.vue +4 -10
- package/components/InfoBox.vue +3 -3
- package/components/InputOrDisplay.vue +28 -2
- package/components/LabelValue.vue +20 -1
- package/components/ModalWithCard.vue +12 -3
- package/components/PodSecurityAdmission.vue +1 -1
- package/components/PromptModal.vue +1 -1
- package/components/PromptRemove.vue +30 -11
- package/components/Resource/Detail/Metadata/IdentifyingInformation/index.vue +1 -3
- package/components/Resource/Detail/Metadata/KeyValue.vue +8 -4
- package/components/Resource/Detail/Metadata/index.vue +3 -1
- package/components/Resource/Detail/TitleBar/Title.vue +4 -3
- package/components/Resource/Detail/TitleBar/Top.vue +2 -0
- package/components/Resource/Detail/TitleBar/index.vue +109 -24
- package/components/ResourceDetail/Masthead/legacy.vue +181 -38
- package/components/ResourceDetail/legacy.vue +32 -14
- package/components/ResourceList/Masthead.vue +226 -54
- package/components/ResourceList/ResourceLoadingIndicator.vue +5 -2
- package/components/ResourceTable.vue +24 -2
- package/components/SideNav.vue +74 -20
- package/components/SortableTable/THead.vue +33 -3
- package/components/SortableTable/index.vue +1016 -463
- package/components/SortableTable/paging.js +26 -16
- package/components/SortableTable/selection.js +2 -2
- package/components/Tabbed/Tab.vue +3 -3
- package/components/Tabbed/index.vue +47 -29
- package/components/YamlEditor.vue +0 -1
- package/components/auth/Principal.vue +37 -13
- package/components/auth/RoleDetailEdit.vue +58 -7
- package/components/auth/SelectPrincipal.vue +1 -0
- package/components/breadcrumb/index.vue +316 -0
- package/components/form/ArrayList.vue +41 -33
- package/components/form/ArrayListGrouped.vue +10 -2
- package/components/form/ArrayListSelect.vue +1 -1
- package/components/form/BannerSettings.vue +64 -59
- package/components/form/ChangePassword.vue +4 -4
- package/components/form/ColorInput.vue +32 -8
- package/components/form/Footer.vue +11 -8
- package/components/form/InputWithSelect.vue +8 -5
- package/components/form/KeyValue.vue +47 -7
- package/components/form/LabeledSelect.vue +214 -242
- package/components/form/Labels.vue +3 -3
- package/components/form/MatchExpressions.vue +24 -7
- package/components/form/Members/ClusterPermissionsEditor.vue +1 -2
- package/components/form/Members/MembershipEditor.vue +1 -1
- package/components/form/NameNsDescription.vue +59 -20
- package/components/form/Password.vue +16 -7
- package/components/form/PodAffinity.vue +4 -5
- package/components/form/ResourceQuota/Namespace.vue +4 -4
- package/components/form/ResourceQuota/NamespaceRow.vue +18 -17
- package/components/form/ResourceQuota/Project.vue +4 -4
- package/components/form/ResourceQuota/ProjectRow.vue +3 -6
- package/components/form/Select.vue +5 -2
- package/components/form/SimpleSecretSelector.vue +29 -9
- package/components/form/Taints.vue +2 -1
- package/components/form/UnitInput.vue +8 -3
- package/components/form/WorkloadPorts.vue +143 -123
- package/components/formatter/BadgeStateFormatter.vue +8 -5
- package/components/formatter/LiveDate.vue +3 -3
- package/components/nav/Favorite.vue +5 -1
- package/components/nav/Group.vue +132 -99
- package/components/nav/Header.vue +124 -27
- package/components/nav/HeaderPageActionMenu.vue +1 -0
- package/components/nav/NamespaceFilter.vue +20 -17
- package/components/nav/TopLevelMenu.vue +182 -119
- package/components/nav/Type.vue +63 -41
- package/composables/useClickOutside.ts +1 -1
- package/config/private-label.js +15 -11
- package/config/product/auth.js +17 -7
- package/config/product/settings.js +19 -9
- package/config/settings.ts +28 -0
- package/config/table-headers.js +3 -2
- package/dialog/ForceMachineRemoveDialog.vue +2 -2
- package/dialog/ScalePoolDownDialog.vue +2 -2
- package/edit/management.cattle.io.user.vue +17 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/auth.vue +19 -19
- package/edit/monitoring.coreos.com.alertmanagerconfig/receiverConfig.vue +31 -31
- package/edit/monitoring.coreos.com.alertmanagerconfig/routeConfig.vue +36 -12
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/email.vue +6 -6
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/opsgenie.vue +10 -10
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/pagerduty.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/slack.vue +4 -4
- package/edit/monitoring.coreos.com.alertmanagerconfig/types/webhook.vue +1 -1
- package/edit/monitoring.coreos.com.receiver/types/email.vue +6 -6
- package/edit/monitoring.coreos.com.receiver/types/opsgenie.vue +10 -10
- package/edit/monitoring.coreos.com.receiver/types/pagerduty.vue +5 -5
- package/edit/monitoring.coreos.com.receiver/types/slack.vue +4 -4
- package/edit/namespace.vue +1 -2
- package/edit/token.vue +31 -12
- package/edit/workload/index.vue +4 -4
- package/list/management.cattle.io.setting.vue +22 -13
- package/list/management.cattle.io.user.vue +7 -3
- package/list/namespace.vue +3 -0
- package/list/provisioning.cattle.io.cluster.vue +6 -7
- package/mixins/brand.js +17 -0
- package/package.json +1 -1
- package/pages/account/pri.vue +229 -0
- package/pages/auth/login.vue +220 -52
- package/pages/auth/setup.vue +142 -19
- package/pages/c/_cluster/_product/namespaces.vue +5 -5
- package/pages/c/_cluster/auth/roles/index.vue +56 -5
- package/pages/c/_cluster/monitoring/monitor/index.vue +2 -2
- package/pages/c/_cluster/settings/banners.vue +174 -102
- package/pages/c/_cluster/settings/brand.vue +350 -302
- package/pages/c/_cluster/settings/performance.vue +61 -38
- package/pages/home.vue +70 -30
- package/pages/prefs.vue +27 -25
- package/pkg/tsconfig.json +9 -9
- package/pkg/vue.config.js +1 -1
- package/plugins/dashboard-store/resource-class.js +28 -27
- package/promptRemove/mixin/roleDeletionCheck.js +2 -2
- package/public/index.html +4 -4
- package/rancher-components/BadgeState/BadgeState.vue +38 -55
- package/rancher-components/Banner/Banner.vue +12 -8
- package/rancher-components/Card/Card.vue +7 -8
- package/rancher-components/Form/Checkbox/Checkbox.vue +4 -0
- package/rancher-components/Form/LabeledInput/LabeledInput.vue +42 -3
- package/rancher-components/Form/Radio/RadioButton.vue +35 -11
- package/rancher-components/Form/Radio/RadioGroup.vue +13 -5
- package/rancher-components/Form/TextArea/TextAreaAutoGrow.vue +3 -3
- package/rancher-components/Form/ToggleSwitch/ToggleSwitch.vue +1 -0
- package/rancher-components/LabeledTooltip/LabeledTooltip.vue +12 -4
- package/rancher-components/RcDropdown/RcDropdown.vue +35 -7
- package/rancher-components/RcDropdown/RcDropdownItem.vue +2 -2
- package/rancher-components/RcDropdown/RcDropdownMenu.vue +12 -6
- package/rancher-components/RcDropdown/types.ts +1 -0
- package/rancher-components/StringList/StringList.vue +1 -1
- package/scripts/publish-shell.sh +1 -1
- package/static/favicon.ico +0 -0
- package/static/favicon.png +0 -0
- package/static/loading-indicator.html +3 -3
- package/store/i18n.js +5 -2
- package/store/modal.ts +3 -3
- package/store/prefs.js +11 -4
- package/store/type-map.js +32 -2
- package/types/shell/index.d.ts +78 -97
- package/utils/error.js +89 -8
- package/utils/errorTranslate.json +1351 -0
- package/utils/router.js +21 -0
- package/utils/select.js +26 -3
- package/utils/string.js +8 -5
- package/utils/title.ts +1 -1
- package/vue.config.js +1 -1
|
@@ -52,7 +52,7 @@ const {
|
|
|
52
52
|
|
|
53
53
|
provideDropdownContext();
|
|
54
54
|
|
|
55
|
-
const popperContainer = ref(null);
|
|
55
|
+
// const popperContainer = ref(null);
|
|
56
56
|
const dropdownTarget = ref(null);
|
|
57
57
|
|
|
58
58
|
useClickOutside(dropdownTarget, () => showMenu(false));
|
|
@@ -71,16 +71,30 @@ const applyShow = () => {
|
|
|
71
71
|
:triggers="[]"
|
|
72
72
|
:shown="isMenuOpen"
|
|
73
73
|
:auto-hide="false"
|
|
74
|
-
|
|
74
|
+
append-to-body
|
|
75
75
|
:placement="placement"
|
|
76
76
|
:distance="distance"
|
|
77
77
|
@apply-show="applyShow"
|
|
78
|
+
popper-class="custom-dropdown"
|
|
78
79
|
>
|
|
79
80
|
<slot name="default">
|
|
80
81
|
<!--Empty slot content Trigger-->
|
|
81
82
|
</slot>
|
|
82
83
|
|
|
83
84
|
<template #popper>
|
|
85
|
+
<!-- <div
|
|
86
|
+
ref="dropdownTarget"
|
|
87
|
+
class="dropdownTarget"
|
|
88
|
+
tabindex="-1"
|
|
89
|
+
role="menu"
|
|
90
|
+
aria-orientation="vertical"
|
|
91
|
+
dropdown-menu-collection
|
|
92
|
+
:aria-label="ariaLabel || 'Dropdown Menu'"
|
|
93
|
+
@keydown="handleKeydown"
|
|
94
|
+
@keydown.down.prevent="setFocus('down')"
|
|
95
|
+
@keydown.up.prevent="setFocus('up')"
|
|
96
|
+
|
|
97
|
+
> -->
|
|
84
98
|
<div
|
|
85
99
|
ref="dropdownTarget"
|
|
86
100
|
class="dropdownTarget"
|
|
@@ -92,6 +106,8 @@ const applyShow = () => {
|
|
|
92
106
|
@keydown="handleKeydown"
|
|
93
107
|
@keydown.down.prevent="setFocus('down')"
|
|
94
108
|
@keydown.up.prevent="setFocus('up')"
|
|
109
|
+
@keydown.tab="showMenu(false)"
|
|
110
|
+
@keydown.escape="returnFocus"
|
|
95
111
|
>
|
|
96
112
|
<slot name="dropdownCollection">
|
|
97
113
|
<!--Empty slot content-->
|
|
@@ -99,14 +115,13 @@ const applyShow = () => {
|
|
|
99
115
|
</div>
|
|
100
116
|
</template>
|
|
101
117
|
</v-dropdown>
|
|
102
|
-
<div
|
|
118
|
+
<!-- <div
|
|
103
119
|
ref="popperContainer"
|
|
104
120
|
class="popperContainer"
|
|
105
121
|
@keydown.tab="showMenu(false)"
|
|
106
122
|
@keydown.escape="returnFocus"
|
|
107
123
|
>
|
|
108
|
-
|
|
109
|
-
</div>
|
|
124
|
+
</div> -->
|
|
110
125
|
</template>
|
|
111
126
|
|
|
112
127
|
<style lang="scss" scoped>
|
|
@@ -115,7 +130,8 @@ const applyShow = () => {
|
|
|
115
130
|
&:deep(.v-popper__popper) {
|
|
116
131
|
|
|
117
132
|
.v-popper__wrapper {
|
|
118
|
-
box-shadow:
|
|
133
|
+
box-shadow: 0 5px 20px var(--shadow);
|
|
134
|
+
/* box-shadow: 0px 6px 18px 0px rgba(0, 0, 0, 0.25), 0px 4px 10px 0px rgba(0, 0, 0, 0.15); */
|
|
119
135
|
border-radius: var(--border-radius-lg);
|
|
120
136
|
|
|
121
137
|
.v-popper__arrow-container {
|
|
@@ -124,7 +140,9 @@ const applyShow = () => {
|
|
|
124
140
|
|
|
125
141
|
.v-popper__inner {
|
|
126
142
|
overflow: unset;
|
|
127
|
-
padding: 10px 0 10px 0;
|
|
143
|
+
/* padding: 10px 0 10px 0; */
|
|
144
|
+
padding: 0px;
|
|
145
|
+
/* min-width: 145px; */
|
|
128
146
|
}
|
|
129
147
|
}
|
|
130
148
|
}
|
|
@@ -138,4 +156,14 @@ const applyShow = () => {
|
|
|
138
156
|
outline: none;
|
|
139
157
|
}
|
|
140
158
|
}
|
|
159
|
+
|
|
160
|
+
.custom-dropdown{
|
|
161
|
+
.v-popper__wrapper{
|
|
162
|
+
.v-popper__inner {
|
|
163
|
+
padding: 0px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
141
168
|
</style>
|
|
169
|
+
|
|
@@ -11,6 +11,8 @@ import IconOrSvg from '@shell/components/IconOrSvg';
|
|
|
11
11
|
withDefaults(defineProps<RcDropdownMenuComponentProps>(), {
|
|
12
12
|
buttonRole: 'primary',
|
|
13
13
|
buttonSize: undefined,
|
|
14
|
+
isDetail: false,
|
|
15
|
+
showIcon: false
|
|
14
16
|
});
|
|
15
17
|
|
|
16
18
|
const emit = defineEmits(['update:open', 'select']);
|
|
@@ -31,7 +33,10 @@ const hasOptions = (options: DropdownOption[]) => {
|
|
|
31
33
|
:data-testid="dataTestid"
|
|
32
34
|
:aria-label="buttonAriaLabel"
|
|
33
35
|
>
|
|
34
|
-
|
|
36
|
+
<div v-if="showIcon">
|
|
37
|
+
<i data-v-5db2c2c7="" class="icon icon-actions" alt="More actions icon"></i>
|
|
38
|
+
</div>
|
|
39
|
+
<a v-else href="javascript:;">操作</a>
|
|
35
40
|
</rc-dropdown-trigger>
|
|
36
41
|
<template #dropdownCollection>
|
|
37
42
|
<template
|
|
@@ -42,7 +47,7 @@ const hasOptions = (options: DropdownOption[]) => {
|
|
|
42
47
|
v-if="!a.divider"
|
|
43
48
|
@click="(e: MouseEvent) => emit('select', e, a)"
|
|
44
49
|
>
|
|
45
|
-
<template #before>
|
|
50
|
+
<!-- <template #before>
|
|
46
51
|
<IconOrSvg
|
|
47
52
|
v-if="a.icon || a.svg"
|
|
48
53
|
:icon="a.icon"
|
|
@@ -50,18 +55,19 @@ const hasOptions = (options: DropdownOption[]) => {
|
|
|
50
55
|
class="icon"
|
|
51
56
|
color="header"
|
|
52
57
|
/>
|
|
53
|
-
</template>
|
|
58
|
+
</template> -->
|
|
54
59
|
{{ a.label }}
|
|
55
60
|
</rc-dropdown-item>
|
|
56
|
-
<rc-dropdown-separator
|
|
61
|
+
<!-- <rc-dropdown-separator
|
|
57
62
|
v-else
|
|
58
|
-
/>
|
|
63
|
+
/> -->
|
|
59
64
|
</template>
|
|
60
65
|
<rc-dropdown-item
|
|
61
66
|
v-if="!hasOptions(options)"
|
|
62
67
|
disabled
|
|
63
68
|
>
|
|
64
|
-
No actions available
|
|
69
|
+
<!-- No actions available -->
|
|
70
|
+
暂无可执行的操作。
|
|
65
71
|
</rc-dropdown-item>
|
|
66
72
|
</template>
|
|
67
73
|
</rc-dropdown>
|
package/scripts/publish-shell.sh
CHANGED
package/static/favicon.ico
CHANGED
|
Binary file
|
package/static/favicon.png
CHANGED
|
Binary file
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
animation: initial-load-animate 1s infinite linear;
|
|
16
16
|
background-color: transparent;
|
|
17
17
|
box-sizing: border-box;
|
|
18
|
-
border: 5px solid #
|
|
18
|
+
border: 5px solid #1890FF;
|
|
19
19
|
border-radius: 50%;
|
|
20
|
-
border-top-color:
|
|
20
|
+
border-top-color: transparent;
|
|
21
21
|
display: inline-block;
|
|
22
22
|
height: 80px;
|
|
23
23
|
margin: 0 auto;
|
|
24
24
|
width: 80px;
|
|
25
|
-
}
|
|
25
|
+
}}
|
|
26
26
|
|
|
27
27
|
@keyframes initial-load-animate {
|
|
28
28
|
0% {
|
package/store/i18n.js
CHANGED
|
@@ -18,7 +18,7 @@ export const state = function() {
|
|
|
18
18
|
// const available = translationContext.keys().map(path => path.replace(/^.*\/([^\/]+)\.[^.]+$/, '$1'));
|
|
19
19
|
// Using require.context() forces them to all be in the same webpack chunk name... just hardcode the list for now so zh-hans
|
|
20
20
|
// gets generated as it's own chunk instead of being loaded all the time.
|
|
21
|
-
const available = [
|
|
21
|
+
const available = ['zh-hans', DEFAULT_LOCALE];
|
|
22
22
|
|
|
23
23
|
const out = {
|
|
24
24
|
default: DEFAULT_LOCALE,
|
|
@@ -229,8 +229,11 @@ export const actions = {
|
|
|
229
229
|
const exists = !!state.available.find((loc) => loc === selected);
|
|
230
230
|
|
|
231
231
|
if ( !selected || !exists) {
|
|
232
|
-
selected =
|
|
232
|
+
selected = 'zh-hans';
|
|
233
233
|
}
|
|
234
|
+
|
|
235
|
+
// selected = 'none'
|
|
236
|
+
selected = 'zh-hans'
|
|
234
237
|
|
|
235
238
|
return dispatch('switchTo', selected);
|
|
236
239
|
},
|
package/store/modal.ts
CHANGED
|
@@ -17,7 +17,7 @@ const state = (): ModalState => ({
|
|
|
17
17
|
componentProps: {},
|
|
18
18
|
resources: [],
|
|
19
19
|
closeOnClickOutside: false,
|
|
20
|
-
modalWidth: '
|
|
20
|
+
modalWidth: '610px',
|
|
21
21
|
modalSticky: false
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -45,7 +45,7 @@ const mutations: MutationTree<ModalState> = {
|
|
|
45
45
|
state.componentProps = payload.componentProps || {};
|
|
46
46
|
state.resources = Array.isArray(payload.resources) ? payload.resources : (payload.resources ? [payload.resources] : []);
|
|
47
47
|
state.closeOnClickOutside = payload.closeOnClickOutside ?? false;
|
|
48
|
-
state.modalWidth = payload.modalWidth || '
|
|
48
|
+
state.modalWidth = payload.modalWidth || '610px';
|
|
49
49
|
state.modalSticky = payload.modalSticky ?? false;
|
|
50
50
|
},
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ const mutations: MutationTree<ModalState> = {
|
|
|
55
55
|
state.componentProps = {};
|
|
56
56
|
state.resources = [];
|
|
57
57
|
state.closeOnClickOutside = false;
|
|
58
|
-
state.modalWidth = '
|
|
58
|
+
state.modalWidth = '610px';
|
|
59
59
|
state.modalSticky = false;
|
|
60
60
|
}
|
|
61
61
|
};
|
package/store/prefs.js
CHANGED
|
@@ -57,14 +57,14 @@ export const PINNED_CLUSTERS = create('pinned-clusters', [], { parseJSON });
|
|
|
57
57
|
export const GROUP_RESOURCES = create('group-by', 'namespace');
|
|
58
58
|
export const DIFF = create('diff', 'unified', { options: ['unified', 'split'] });
|
|
59
59
|
export const THEME = create('theme', 'auto', {
|
|
60
|
-
options: ['light'
|
|
60
|
+
options: ['light'],
|
|
61
61
|
asCookie,
|
|
62
62
|
parseJSON,
|
|
63
63
|
mangleRead: (x) => x.replace(/^ui-/, ''),
|
|
64
|
-
mangleWrite: (x) => `ui
|
|
64
|
+
mangleWrite: (x) => `ui-light`, // 接口同时修改为 白色
|
|
65
65
|
});
|
|
66
66
|
export const PREFERS_SCHEME = create('pcs', '', { asCookie, asUserPreference: false });
|
|
67
|
-
export const LOCALE = create('locale', '
|
|
67
|
+
export const LOCALE = create('locale', 'zh-hans', { asCookie });
|
|
68
68
|
export const KEYMAP = create('keymap', 'sublime', { options: ['sublime', 'emacs', 'vim'] });
|
|
69
69
|
export const ROWS_PER_PAGE = create('per-page', 100, { options: [10, 25, 50, 100], parseJSON });
|
|
70
70
|
export const LOGS_WRAP = create('logs-wrap', true, { parseJSON });
|
|
@@ -149,6 +149,11 @@ export const getters = {
|
|
|
149
149
|
|
|
150
150
|
const def = clone(definition.def);
|
|
151
151
|
|
|
152
|
+
if (key === THEME) {
|
|
153
|
+
// 无论 state 里存的是什么,都强制返回 light
|
|
154
|
+
return 'light';
|
|
155
|
+
}
|
|
156
|
+
|
|
152
157
|
return def;
|
|
153
158
|
},
|
|
154
159
|
|
|
@@ -470,7 +475,9 @@ export const actions = {
|
|
|
470
475
|
try {
|
|
471
476
|
value = JSON.parse(value);
|
|
472
477
|
} catch (err) {
|
|
473
|
-
|
|
478
|
+
// 容错处理:如果后端返回 map[...] 这样的字符串,直接忽略或重置为空
|
|
479
|
+
console.warn(`Pref ${ key } has invalid JSON, resetting`, value);
|
|
480
|
+
value = definition.defaultValue || null;
|
|
474
481
|
continue;
|
|
475
482
|
}
|
|
476
483
|
}
|
package/store/type-map.js
CHANGED
|
@@ -395,6 +395,7 @@ export function productsLoaded() {
|
|
|
395
395
|
|
|
396
396
|
export const state = function() {
|
|
397
397
|
return {
|
|
398
|
+
actionsWidth: 0,
|
|
398
399
|
products: [],
|
|
399
400
|
virtualTypes: {},
|
|
400
401
|
spoofedTypes: {},
|
|
@@ -464,6 +465,8 @@ export const getters = {
|
|
|
464
465
|
};
|
|
465
466
|
},
|
|
466
467
|
|
|
468
|
+
actionsWidth: (state) => state.actionsWidth,
|
|
469
|
+
|
|
467
470
|
// Turns a group name into a display label (e.g. management.cattle.io.v3.cluster -> Cluster)
|
|
468
471
|
groupLabelFor(state) {
|
|
469
472
|
return (schemaOrName) => {
|
|
@@ -509,6 +512,12 @@ export const getters = {
|
|
|
509
512
|
return state.basicTypes?.[product]?.[schemaId];
|
|
510
513
|
};
|
|
511
514
|
},
|
|
515
|
+
|
|
516
|
+
groupsForVirTypes(state) {
|
|
517
|
+
return (product, name) => {
|
|
518
|
+
return state?.virtualTypes?.[product]?.find(item => item.name === name)?.icon;
|
|
519
|
+
};
|
|
520
|
+
},
|
|
512
521
|
|
|
513
522
|
optionsFor(state, getters, rootState, rootGetters) {
|
|
514
523
|
const def = {
|
|
@@ -661,7 +670,18 @@ export const getters = {
|
|
|
661
670
|
|
|
662
671
|
const label = typeObj.labelKey ? rootGetters['i18n/t'](typeObj.labelKey) || typeObj.label : typeObj.label;
|
|
663
672
|
|
|
664
|
-
|
|
673
|
+
const virtual = !!typeObj.virtual;
|
|
674
|
+
let icon = typeObj.icon;
|
|
675
|
+
|
|
676
|
+
if ( (!virtual || typeObj.isSpoofed ) && !icon ) {
|
|
677
|
+
if ( namespaced ) {
|
|
678
|
+
icon = 'folder';
|
|
679
|
+
} else {
|
|
680
|
+
icon = 'globe';
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
let labelDisplay = highlightLabel(label, icon, count, typeObj.schema);
|
|
665
685
|
|
|
666
686
|
// If we did not match on just the label, add the schema name and see if that matches
|
|
667
687
|
if (!labelDisplay && typeObj.schema?.attributes) {
|
|
@@ -778,7 +798,7 @@ export const getters = {
|
|
|
778
798
|
return group;
|
|
779
799
|
}
|
|
780
800
|
|
|
781
|
-
function highlightLabel(original, count, schema) {
|
|
801
|
+
function highlightLabel(original, icon, count, schema) {
|
|
782
802
|
let label = escapeHtml(original);
|
|
783
803
|
|
|
784
804
|
if ( searchRegex ) {
|
|
@@ -802,6 +822,12 @@ export const getters = {
|
|
|
802
822
|
}
|
|
803
823
|
}
|
|
804
824
|
|
|
825
|
+
if ( icon ) {
|
|
826
|
+
console.log(icon)
|
|
827
|
+
label = `<i class="icon icon-fw icon-${ icon }"></i>${ label }`;
|
|
828
|
+
console.log(label)
|
|
829
|
+
}
|
|
830
|
+
|
|
805
831
|
return label;
|
|
806
832
|
}
|
|
807
833
|
};
|
|
@@ -1471,6 +1497,10 @@ export const getters = {
|
|
|
1471
1497
|
};
|
|
1472
1498
|
|
|
1473
1499
|
export const mutations = {
|
|
1500
|
+
setActionsWidth(state, width) {
|
|
1501
|
+
state.actionsWidth = width
|
|
1502
|
+
},
|
|
1503
|
+
|
|
1474
1504
|
schemaChanged(state) {
|
|
1475
1505
|
state.schemaGeneration = state.schemaGeneration + 1;
|
|
1476
1506
|
},
|