@appscode/design-system 1.0.3-alpha.8 → 1.0.43-alpha.101
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/base/utilities/_default.scss +285 -23
- package/base/utilities/_derived-variables.scss +2 -15
- package/base/utilities/_initial-variables.scss +99 -64
- package/base/utilities/_mixin.scss +90 -10
- package/base/utilities/_typography.scss +23 -7
- package/base/utilities/dark-theme.scss +25 -0
- package/components/_ac-accordion.scss +1 -0
- package/components/_ac-alert-box.scss +47 -11
- package/components/_ac-card.scss +55 -20
- package/components/_ac-code-highlight.scss +7 -1
- package/components/_ac-content-layout.scss +4 -4
- package/components/_ac-drag.scss +6 -6
- package/components/_ac-input.scss +140 -38
- package/components/_ac-modal.scss +5 -4
- package/components/_ac-multi-select.scss +220 -18
- package/components/_ac-options.scss +31 -16
- package/components/_ac-select-box.scss +15 -5
- package/components/_ac-table.scss +88 -47
- package/components/_ac-tabs.scss +72 -23
- package/components/_ac-tags.scss +2 -2
- package/components/_ac-terminal.scss +272 -0
- package/components/_app-drawer.scss +6 -6
- package/components/_breadcumb.scss +8 -3
- package/components/_buttons.scss +86 -33
- package/components/_card-body-wrapper.scss +3 -3
- package/components/_dashboard-header.scss +1 -1
- package/components/_direct-deploy.scss +69 -0
- package/components/_go-to-top.scss +1 -1
- package/components/_graph.scss +45 -0
- package/components/_image-upload.scss +6 -4
- package/components/_left-sidebar-menu.scss +206 -46
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +104 -27
- package/components/_overview-info.scss +4 -4
- package/components/_overview-page.scss +1 -2
- package/components/_pagination.scss +45 -7
- package/components/_payment-card.scss +28 -12
- package/components/_preloader.scss +1 -1
- package/components/_preview-modal.scss +8 -8
- package/components/_pricing-table.scss +1 -1
- package/components/_progress-bar.scss +5 -5
- package/components/_subscription-card.scss +15 -8
- package/components/_table-of-content.scss +1 -1
- package/components/_tfa.scss +69 -0
- package/components/_widget-menu.scss +9 -9
- package/components/_wizard.scss +32 -20
- package/components/ac-toaster/_ac-toasted.scss +40 -8
- package/components/bbum/_card-team.scss +18 -10
- package/components/bbum/_information-center.scss +19 -5
- package/components/bbum/_mobile-desktop.scss +6 -6
- package/components/bbum/_post.scss +5 -4
- package/components/bbum/_sign-up-notification.scss +6 -6
- package/components/bbum/_single-post-preview.scss +9 -9
- package/components/bbum/_user-profile.scss +97 -90
- package/components/ui-builder/_ui-builder.scss +31 -12
- package/components/ui-builder/_vue-open-api.scss +98 -0
- package/layouts/_404.scss +2 -1
- package/layouts/_code-preview.scss +14 -6
- package/main.scss +4 -0
- package/package.json +2 -7
- package/plugins/theme.js +142 -0
- package/plugins/vue-toaster.js +7 -6
- package/vue-components/v2/breadcrumbs/Breadcrumb.vue +95 -0
- package/vue-components/v2/card/CardContent.vue +5 -0
- package/vue-components/v2/card/CardHeader.vue +12 -0
- package/vue-components/v2/card/OverviewCard.vue +10 -0
- package/vue-components/v2/card/OverviewCards.vue +5 -0
- package/vue-components/v2/card/PaymentCards.vue +16 -10
- package/vue-components/v2/content/ContentHeader.vue +1 -1
- package/vue-components/v2/editor/Editor.vue +37 -17
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +232 -0
- package/vue-components/v2/header/Header.vue +0 -1
- package/vue-components/v2/modal/Modal.vue +32 -14
- package/vue-components/v2/modals/JsonShowModal.vue +0 -1
- package/vue-components/v2/navbar/Appdrawer.vue +9 -6
- package/vue-components/v2/navbar/ThemeMode.vue +120 -0
- package/vue-components/v2/pagination/Pagination.vue +8 -1
- package/vue-components/v2/preloader/Preloader.vue +5 -5
- package/vue-components/v2/sidebar/ClusterSwitcher.vue +126 -0
- package/vue-components/v2/sidebar/SidebarItem.vue +24 -2
- package/vue-components/v2/table/InfoTable.vue +13 -3
- package/vue-components/v2/table/Table.vue +75 -5
- package/vue-components/v2/table/TableRow.vue +17 -8
- package/vue-components/v2/table/table-cell/CellValue.vue +10 -1
- package/vue-components/v2/tabs/EditorTabs.vue +1 -1
- package/vue-components/v3/button/Button.vue +73 -0
- package/vue-components/v3/content/ContentHeader.vue +54 -0
- package/vue-components/v3/content/ContentTable.vue +65 -0
- package/vue-components/v3/dropdown/DropdownDivider.vue +3 -0
- package/vue-components/v3/dropdown/DropdownItem.vue +5 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +111 -0
- package/vue-components/v3/editor/Editor.vue +157 -0
- package/vue-components/v3/form-fields/Input.vue +21 -0
- package/vue-components/v3/header/Header.vue +45 -0
- package/vue-components/v3/modal/Modal.vue +135 -0
- package/vue-components/v3/modals/JsonShowModal.vue +87 -0
- package/vue-components/v3/navbar/Appdrawer.vue +63 -0
- package/vue-components/v3/navbar/ThemeMode.vue +128 -0
- package/vue-components/v3/navbar/User.vue +64 -0
- package/vue-components/v3/pagination/Pagination.vue +159 -0
- package/vue-components/v3/searchbars/SearchBar.vue +47 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
- package/vue-components/v3/tab/TabItem.vue +17 -0
- package/vue-components/v3/table/FakeTableCell.vue +39 -0
- package/vue-components/v3/table/InfoTable.vue +105 -0
- package/vue-components/v3/table/Table.vue +238 -0
- package/vue-components/v3/table/TableCell.vue +28 -0
- package/vue-components/v3/table/TableRow.vue +60 -0
- package/vue-components/v3/table/table-cell/ArrayCell.vue +111 -0
- package/vue-components/v3/table/table-cell/CellValue.vue +117 -0
- package/vue-components/v3/table/table-cell/ObjectCell.vue +105 -0
- package/vue-components/v3/table/table-cell/ValueWithModal.vue +43 -0
- package/vue-components/v3/tabs/EditorTabs.vue +36 -0
- package/vue-components/v3/tag/Tag.vue +17 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<content-table :table-title="title" :searchable="isSearchable">
|
|
3
|
+
<template #content-controls>
|
|
4
|
+
<header-item v-if="showHideBtn">
|
|
5
|
+
<ac-button
|
|
6
|
+
modifier-classes="is-square is-primary"
|
|
7
|
+
:icon-class="hideValue ? 'eye-slash' : 'eye'"
|
|
8
|
+
@click.prevent="hideValue = !hideValue"
|
|
9
|
+
/>
|
|
10
|
+
</header-item>
|
|
11
|
+
<header-item v-if="showCopyBtn">
|
|
12
|
+
<ac-button
|
|
13
|
+
modifier-classes="is-square is-primary"
|
|
14
|
+
icon-class="copy"
|
|
15
|
+
v-clipboard:copy="decode(previewYamls[activeKey])"
|
|
16
|
+
v-clipboard:success="onCopy"
|
|
17
|
+
v-clipboard:error="onError"
|
|
18
|
+
/>
|
|
19
|
+
</header-item>
|
|
20
|
+
<header-item v-if="showDownloadBtn">
|
|
21
|
+
<download-btn
|
|
22
|
+
:file-data="decode(previewYamls[activeKey])"
|
|
23
|
+
:file-name="activePreview"
|
|
24
|
+
/>
|
|
25
|
+
</header-item>
|
|
26
|
+
<header-item v-if="showUpdateBtn && !isEditorReadOnly">
|
|
27
|
+
<ac-button
|
|
28
|
+
modifier-classes="is-square is-primary"
|
|
29
|
+
icon-class="pencil-square-o"
|
|
30
|
+
@click.prevent="
|
|
31
|
+
$emit('updateData', activeKey, previewYamls[activeKey])
|
|
32
|
+
"
|
|
33
|
+
/>
|
|
34
|
+
</header-item>
|
|
35
|
+
<header-item v-if="showDeleteBtn">
|
|
36
|
+
<ac-button
|
|
37
|
+
modifier-classes="is-square is-danger"
|
|
38
|
+
icon-class="trash"
|
|
39
|
+
@click.prevent="showDeleteDataModal = true"
|
|
40
|
+
/>
|
|
41
|
+
<delete-confirmation-modal
|
|
42
|
+
title="Delete Resource"
|
|
43
|
+
message="Do you want to delete "
|
|
44
|
+
:itemName="activePreview"
|
|
45
|
+
:open="showDeleteDataModal"
|
|
46
|
+
@delete-confirmation-modal$confirm="confirmDelete"
|
|
47
|
+
@closemodal="showDeleteDataModal = false"
|
|
48
|
+
/>
|
|
49
|
+
</header-item>
|
|
50
|
+
<slot name="content-action" />
|
|
51
|
+
</template>
|
|
52
|
+
<template #content>
|
|
53
|
+
<div class="ac-preview is-active is-not-fixed">
|
|
54
|
+
<div class="ac-preview-inner">
|
|
55
|
+
<!-- preview body start -->
|
|
56
|
+
<div class="ac-preview-body mt-0 pt-15 pl-20">
|
|
57
|
+
<div
|
|
58
|
+
v-if="isPreviewLoading || (!isPreviewLoading && previewYamls)"
|
|
59
|
+
class="left-content"
|
|
60
|
+
>
|
|
61
|
+
<div class="ac-files">
|
|
62
|
+
<ul v-if="!isPreviewLoading">
|
|
63
|
+
<li
|
|
64
|
+
v-for="(previewYaml, idx) in previewYamls"
|
|
65
|
+
:key="previewYaml.name + idx"
|
|
66
|
+
:class="{ 'is-active': activePreview === previewYaml.name }"
|
|
67
|
+
>
|
|
68
|
+
<a @click.prevent="setActivePreview(previewYaml, idx)">
|
|
69
|
+
<span>
|
|
70
|
+
<img
|
|
71
|
+
src="~@appscode/design-system-images/icons/file-icon.svg"
|
|
72
|
+
alt=""
|
|
73
|
+
/>
|
|
74
|
+
</span>
|
|
75
|
+
<span>{{ previewYaml.name }}</span>
|
|
76
|
+
</a>
|
|
77
|
+
</li>
|
|
78
|
+
</ul>
|
|
79
|
+
<sidebar-loader v-else />
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
<div class="right-content">
|
|
83
|
+
<div class="right-content">
|
|
84
|
+
<resource-loader v-if="isPreviewLoading" />
|
|
85
|
+
<editor
|
|
86
|
+
v-else-if="!isPreviewLoading && !hideValue"
|
|
87
|
+
v-model="activeFile.content"
|
|
88
|
+
:original-value="activeFile.content"
|
|
89
|
+
:language="activeFile.format"
|
|
90
|
+
:read-only="isEditorReadOnly"
|
|
91
|
+
:editor-height="60"
|
|
92
|
+
:show-minimap="false"
|
|
93
|
+
/>
|
|
94
|
+
<span v-else> *************** </span>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
</template>
|
|
101
|
+
</content-table>
|
|
102
|
+
</template>
|
|
103
|
+
<script>
|
|
104
|
+
export default {
|
|
105
|
+
components: {
|
|
106
|
+
AcButton: () =>
|
|
107
|
+
import("@appscode/design-system/vue-components/v2/button/Button"),
|
|
108
|
+
Editor: () =>
|
|
109
|
+
import("@appscode/design-system/vue-components/v2/editor/Editor.vue"),
|
|
110
|
+
ContentTable: () =>
|
|
111
|
+
import(
|
|
112
|
+
"@appscode/design-system/vue-components/v2/content/ContentTable.vue"
|
|
113
|
+
),
|
|
114
|
+
HeaderItem: () =>
|
|
115
|
+
import("@appscode/design-system/vue-components/v2/header/HeaderItem.vue"),
|
|
116
|
+
AcButton: () =>
|
|
117
|
+
import("@appscode/design-system/vue-components/v2/button/Button"),
|
|
118
|
+
DownloadBtn: () => import("@/components/buttons/DownloadBtn.vue"),
|
|
119
|
+
DeleteConfirmationModal: () =>
|
|
120
|
+
import("@/components/modals/DeleteConfirmationModal.vue"),
|
|
121
|
+
ResourceLoader: () => import("@/components/loaders/ResourceLoader.vue"),
|
|
122
|
+
SidebarLoader: () => import("@/components/loaders/SidebarLoader.vue"),
|
|
123
|
+
},
|
|
124
|
+
props: {
|
|
125
|
+
title: {
|
|
126
|
+
type: String,
|
|
127
|
+
default: "Title",
|
|
128
|
+
},
|
|
129
|
+
isSearchable: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: false,
|
|
132
|
+
},
|
|
133
|
+
isPreviewLoading: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
default: false,
|
|
136
|
+
},
|
|
137
|
+
isEditorReadOnly: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: false,
|
|
140
|
+
},
|
|
141
|
+
previewYamls: {
|
|
142
|
+
type: Array,
|
|
143
|
+
default: () => {
|
|
144
|
+
[];
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
visibleBtn: {
|
|
148
|
+
type: Object,
|
|
149
|
+
default: () => {
|
|
150
|
+
return {};
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
},
|
|
154
|
+
data() {
|
|
155
|
+
return {
|
|
156
|
+
activePreview: "",
|
|
157
|
+
activeKey: 0,
|
|
158
|
+
hideValue: "",
|
|
159
|
+
showDeleteDataModal: false,
|
|
160
|
+
};
|
|
161
|
+
},
|
|
162
|
+
computed: {
|
|
163
|
+
activeFile() {
|
|
164
|
+
const activeFile = this.previewYamls.find(
|
|
165
|
+
(p) => p.name === this.activePreview
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
return activeFile || { content: "", format: "yaml" };
|
|
169
|
+
},
|
|
170
|
+
showCopyBtn() {
|
|
171
|
+
if (this.visibleBtn.showCopyBtn) return true;
|
|
172
|
+
else return false;
|
|
173
|
+
},
|
|
174
|
+
showHideBtn() {
|
|
175
|
+
if (this.visibleBtn.showHideBtn) return true;
|
|
176
|
+
else return false;
|
|
177
|
+
},
|
|
178
|
+
showUpdateBtn() {
|
|
179
|
+
if (this.visibleBtn.showUpdateBtn) return true;
|
|
180
|
+
else return false;
|
|
181
|
+
},
|
|
182
|
+
showDownloadBtn() {
|
|
183
|
+
if (this.visibleBtn.showDownloadBtn) return true;
|
|
184
|
+
else return false;
|
|
185
|
+
},
|
|
186
|
+
showDeleteBtn() {
|
|
187
|
+
if (this.visibleBtn.showDeleteBtn) return true;
|
|
188
|
+
else return false;
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
methods: {
|
|
192
|
+
initActivePreview() {
|
|
193
|
+
this.activePreview = this.previewYamls[0] && this.previewYamls[0].name;
|
|
194
|
+
this.hideValue = this.previewYamls[0].isSecret;
|
|
195
|
+
this.activeKey = 0;
|
|
196
|
+
},
|
|
197
|
+
setActivePreview(previewYaml, idx) {
|
|
198
|
+
this.activePreview = previewYaml.name;
|
|
199
|
+
this.hideValue = previewYaml.isSecret;
|
|
200
|
+
this.activeKey = idx;
|
|
201
|
+
},
|
|
202
|
+
onCopy() {
|
|
203
|
+
this.$toasted.global.success("Value copied successfully").goAway(1000);
|
|
204
|
+
},
|
|
205
|
+
onError() {
|
|
206
|
+
this.$toasted.global.error("Copying failed").goAway(1000);
|
|
207
|
+
},
|
|
208
|
+
decode(str) {
|
|
209
|
+
if (this.hideValue === false) return str.content;
|
|
210
|
+
else return "";
|
|
211
|
+
},
|
|
212
|
+
encode(str) {
|
|
213
|
+
if (this.hideValue === false) return str.content;
|
|
214
|
+
else return "";
|
|
215
|
+
},
|
|
216
|
+
confirmDelete(flag) {
|
|
217
|
+
if (flag) this.$emit("deleteResource", this.activeKey);
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
watch: {
|
|
221
|
+
previewYamls: {
|
|
222
|
+
deep: true,
|
|
223
|
+
immediate: true,
|
|
224
|
+
handler(n) {
|
|
225
|
+
if (n.length) {
|
|
226
|
+
this.initActivePreview();
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
};
|
|
232
|
+
</script>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- for transition https://github.com/adamwathan/vue-tailwind-examples/blob/master/src/components/Modal.vue -->
|
|
3
|
-
<!-- modal start -->
|
|
4
2
|
<portal to="modal">
|
|
3
|
+
<!-- for transition https://github.com/adamwathan/vue-tailwind-examples/blob/master/src/components/Modal.vue -->
|
|
4
|
+
<!-- modal start -->
|
|
5
5
|
<div
|
|
6
6
|
v-if="showModal"
|
|
7
7
|
class="ac-modal is-middle-alignment"
|
|
8
8
|
:class="modifierClasses"
|
|
9
|
-
@click.self="
|
|
9
|
+
@click.self="onModalOutsideClick"
|
|
10
10
|
>
|
|
11
11
|
<div class="ac-modal-inner">
|
|
12
12
|
<!-- modal header start -->
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
<header-item>
|
|
18
18
|
<ac-button
|
|
19
19
|
modifier-classes="is-square is-transparent"
|
|
20
|
+
:disabled="isCloseOptionDisabled"
|
|
20
21
|
:icon-image="require('@/assets/images/icons/close-icon.svg')"
|
|
21
22
|
@click.stop="destroyModal"
|
|
22
23
|
/>
|
|
@@ -36,7 +37,12 @@
|
|
|
36
37
|
<!-- modal body end -->
|
|
37
38
|
|
|
38
39
|
<!-- modal footer start -->
|
|
39
|
-
<div
|
|
40
|
+
<div
|
|
41
|
+
class="ac-modal-footer action-footer is-flex is-align-items-center is-justify-content-space-between"
|
|
42
|
+
>
|
|
43
|
+
<div>
|
|
44
|
+
<slot name="modal-footer-left" />
|
|
45
|
+
</div>
|
|
40
46
|
<buttons class="has-text-right is-block">
|
|
41
47
|
<slot name="modal-footer-controls" />
|
|
42
48
|
</buttons>
|
|
@@ -45,7 +51,6 @@
|
|
|
45
51
|
</div>
|
|
46
52
|
</div>
|
|
47
53
|
</portal>
|
|
48
|
-
<!-- modal end -->
|
|
49
54
|
</template>
|
|
50
55
|
|
|
51
56
|
<script>
|
|
@@ -53,28 +58,36 @@ export default {
|
|
|
53
58
|
props: {
|
|
54
59
|
open: {
|
|
55
60
|
type: Boolean,
|
|
56
|
-
default: false
|
|
61
|
+
default: false
|
|
57
62
|
},
|
|
58
63
|
title: {
|
|
59
64
|
type: String,
|
|
60
|
-
default: "Modal"
|
|
65
|
+
default: "Modal"
|
|
61
66
|
},
|
|
62
67
|
modifierClasses: {
|
|
63
68
|
type: String,
|
|
64
|
-
default: ""
|
|
69
|
+
default: ""
|
|
70
|
+
},
|
|
71
|
+
isCloseOptionDisabled: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false
|
|
65
74
|
},
|
|
75
|
+
ignoreOutsideClick: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
78
|
+
}
|
|
66
79
|
},
|
|
67
80
|
|
|
68
81
|
components: {
|
|
69
82
|
HeaderItems: () => import("../header/HeaderItems.vue"),
|
|
70
83
|
HeaderItem: () => import("../header/HeaderItem.vue"),
|
|
71
84
|
Buttons: () => import("../button/Buttons.vue"),
|
|
72
|
-
AcButton: () => import("../button/Button.vue")
|
|
85
|
+
AcButton: () => import("../button/Button.vue")
|
|
73
86
|
},
|
|
74
87
|
|
|
75
88
|
data() {
|
|
76
89
|
return {
|
|
77
|
-
showModal: false
|
|
90
|
+
showModal: false
|
|
78
91
|
};
|
|
79
92
|
},
|
|
80
93
|
|
|
@@ -87,8 +100,8 @@ export default {
|
|
|
87
100
|
} else {
|
|
88
101
|
this.destroyModal();
|
|
89
102
|
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
92
105
|
},
|
|
93
106
|
|
|
94
107
|
methods: {
|
|
@@ -98,16 +111,21 @@ export default {
|
|
|
98
111
|
this.destroyModal();
|
|
99
112
|
}
|
|
100
113
|
},
|
|
114
|
+
onModalOutsideClick() {
|
|
115
|
+
if (this.ignoreOutsideClick) return;
|
|
116
|
+
this.destroyModal();
|
|
117
|
+
},
|
|
101
118
|
initializeModal() {
|
|
102
119
|
this.showModal = true;
|
|
103
120
|
document.addEventListener("keydown", this.onKeyDown);
|
|
104
121
|
},
|
|
105
122
|
destroyModal() {
|
|
123
|
+
if (this.isCloseOptionDisabled) return;
|
|
106
124
|
this.showModal = false;
|
|
107
125
|
document.removeEventListener("keydown", this.onKeyDown);
|
|
108
126
|
|
|
109
127
|
this.$emit("closemodal", true);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
112
130
|
};
|
|
113
131
|
</script>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="app-drawer-wrapper">
|
|
3
|
-
<div
|
|
2
|
+
<div class="app-drawer-wrapper is-flex">
|
|
3
|
+
<div
|
|
4
|
+
class="drawer-icon is-flex is-justify-content-center is-align-items-center"
|
|
5
|
+
>
|
|
4
6
|
<svg
|
|
5
7
|
class="gb_We"
|
|
6
8
|
focusable="false"
|
|
7
9
|
viewBox="0 0 24 24"
|
|
10
|
+
style="width: 22px;margin-top: 2px;"
|
|
8
11
|
:style="{ fill: 'white' }"
|
|
9
12
|
>
|
|
10
13
|
<path
|
|
@@ -44,11 +47,11 @@ export default {
|
|
|
44
47
|
props: {
|
|
45
48
|
apps: {
|
|
46
49
|
type: Array,
|
|
47
|
-
default: () => []
|
|
48
|
-
}
|
|
50
|
+
default: () => []
|
|
51
|
+
}
|
|
49
52
|
},
|
|
50
53
|
components: {
|
|
51
|
-
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
52
|
-
}
|
|
54
|
+
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
55
|
+
}
|
|
53
56
|
};
|
|
54
57
|
</script>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button
|
|
4
|
+
v-if="themeMode"
|
|
5
|
+
class="button ac-nav-button"
|
|
6
|
+
style="color: #ffffff; font-size: 15px;"
|
|
7
|
+
@click="toggleTheme"
|
|
8
|
+
:title="themeModes[themeMode].displayName"
|
|
9
|
+
>
|
|
10
|
+
<i :class="`fa ${themeModes[themeMode].iconClass}`" />
|
|
11
|
+
</button>
|
|
12
|
+
<div class="ac-menu-content theme-choice">
|
|
13
|
+
<ul class="is-flex is-flex-direction-row is-justify-content-space-around">
|
|
14
|
+
<li
|
|
15
|
+
v-for="theme of Object.keys(themeModes)"
|
|
16
|
+
:title="themeModes[theme].displayName"
|
|
17
|
+
@click="themeMode = theme"
|
|
18
|
+
:class="{'is-active': themeMode === theme}"
|
|
19
|
+
:key="theme"
|
|
20
|
+
>
|
|
21
|
+
<i :class="['fa', themeModes[theme].iconClass]" />
|
|
22
|
+
</li>
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
export default {
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
themeMode: "",
|
|
32
|
+
themeModes: {
|
|
33
|
+
system: {
|
|
34
|
+
displayName: "System Theme",
|
|
35
|
+
iconClass: "fa-desktop",
|
|
36
|
+
},
|
|
37
|
+
light: {
|
|
38
|
+
displayName: "Light Theme",
|
|
39
|
+
iconClass: "fa-sun-o",
|
|
40
|
+
},
|
|
41
|
+
dark: {
|
|
42
|
+
displayName: "Dark Theme",
|
|
43
|
+
iconClass: "fa-moon-o",
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
mounted() {
|
|
50
|
+
// get theme mode from localStorage or set default one
|
|
51
|
+
this.themeMode = localStorage.getItem("themeMode") || "light";
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
destroyed() {
|
|
55
|
+
this.removeColorSchemeEventListener();
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
watch: {
|
|
59
|
+
themeMode: {
|
|
60
|
+
handler(n) {
|
|
61
|
+
this.onThemeModeChange(n);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
methods: {
|
|
67
|
+
// handle theme mode button click
|
|
68
|
+
toggleTheme() {
|
|
69
|
+
if (this.themeMode === "light") this.themeMode = "dark";
|
|
70
|
+
else if (this.themeMode === "dark") this.themeMode = "system";
|
|
71
|
+
else if (this.themeMode === "system") this.themeMode = "light";
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
// triggered when theme mode is updated
|
|
75
|
+
onThemeModeChange(n) {
|
|
76
|
+
localStorage.setItem("themeMode", n);
|
|
77
|
+
|
|
78
|
+
let theme = n;
|
|
79
|
+
if (n === "system") {
|
|
80
|
+
const isDarkMode =
|
|
81
|
+
window.matchMedia &&
|
|
82
|
+
window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
83
|
+
this.addColorSchemeEventListener();
|
|
84
|
+
theme = isDarkMode ? "dark" : "light";
|
|
85
|
+
} else {
|
|
86
|
+
this.removeColorSchemeEventListener();
|
|
87
|
+
}
|
|
88
|
+
this.$emit("set:theme", theme);
|
|
89
|
+
this.handleDarkThemeClass(theme);
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
// add proper css class to update the ui theme
|
|
93
|
+
handleDarkThemeClass(currentTheme) {
|
|
94
|
+
if (currentTheme === "light") {
|
|
95
|
+
document.documentElement.classList.remove("is-dark-theme");
|
|
96
|
+
} else {
|
|
97
|
+
document.documentElement.classList.add("is-dark-theme");
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
|
|
101
|
+
// add system theme listener event
|
|
102
|
+
addColorSchemeEventListener() {
|
|
103
|
+
window
|
|
104
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
105
|
+
.addEventListener("change", this.handleSystemThemeChange);
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// remove system theme listener event
|
|
109
|
+
removeColorSchemeEventListener() {
|
|
110
|
+
window
|
|
111
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
112
|
+
.removeEventListener("change", this.handleSystemThemeChange);
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
handleSystemThemeChange() {
|
|
116
|
+
this.onThemeModeChange(this.themeMode);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
</script>
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
<div class="pagination-filter level-left">
|
|
4
4
|
<div
|
|
5
5
|
class="level-item"
|
|
6
|
-
v-show="
|
|
6
|
+
v-show="
|
|
7
|
+
!hideRowsPerPageSelection &&
|
|
8
|
+
totalNoOfItems > preSelectedItemsCountPerPage
|
|
9
|
+
"
|
|
7
10
|
>
|
|
8
11
|
<label>Rows per page</label>
|
|
9
12
|
<select v-model="selectedItemCountPerPage" name="page">
|
|
@@ -52,6 +55,10 @@
|
|
|
52
55
|
<script>
|
|
53
56
|
export default {
|
|
54
57
|
props: {
|
|
58
|
+
hideRowsPerPageSelection: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
55
62
|
totalNoOfItems: {
|
|
56
63
|
type: Number,
|
|
57
64
|
default: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="is-flex is-justify-content-center is-align-items-center is-flex-direction-column"
|
|
3
|
+
class="is-flex is-justify-content-center is-align-items-center is-flex-direction-column ac-preloader"
|
|
4
4
|
style="height: calc(100vh - 200px);"
|
|
5
5
|
>
|
|
6
6
|
<span v-if="showSpinner" class="spinner"></span>
|
|
@@ -15,12 +15,12 @@ export default {
|
|
|
15
15
|
props: {
|
|
16
16
|
showSpinner: {
|
|
17
17
|
type: Boolean,
|
|
18
|
-
default: true
|
|
18
|
+
default: true
|
|
19
19
|
},
|
|
20
20
|
message: {
|
|
21
21
|
type: String,
|
|
22
|
-
default: "Fetching! Please wait for sometime..."
|
|
23
|
-
}
|
|
24
|
-
}
|
|
22
|
+
default: "Fetching! Please wait for sometime..."
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
25
|
};
|
|
26
26
|
</script>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="is-cluster-logo" v-if="sidebarCollapsed">
|
|
3
|
+
<img
|
|
4
|
+
width="40"
|
|
5
|
+
:src="getProviderIcon(selectedCluster && selectedCluster.provider)"
|
|
6
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
7
|
+
alt="provider-icon"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
<multiselect
|
|
11
|
+
v-else
|
|
12
|
+
v-model="selectedCluster"
|
|
13
|
+
placeholder="Selected Cluster"
|
|
14
|
+
label="name"
|
|
15
|
+
track-by="name"
|
|
16
|
+
:options="clusterOptions"
|
|
17
|
+
:allow-empty="false"
|
|
18
|
+
deselectLabel=""
|
|
19
|
+
selectLabel=""
|
|
20
|
+
selectedLabel=""
|
|
21
|
+
>
|
|
22
|
+
<template slot="singleLabel" slot-scope="props">
|
|
23
|
+
<div class="is-flex is-align-items-center">
|
|
24
|
+
<img
|
|
25
|
+
:src="getProviderIcon(props.option.provider)"
|
|
26
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
27
|
+
alt="No cluster selected"
|
|
28
|
+
/><span
|
|
29
|
+
><span>{{ props.option.displayName }}</span></span
|
|
30
|
+
>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
<template slot="option" slot-scope="props">
|
|
34
|
+
<div class="is-flex is-align-items-center">
|
|
35
|
+
<img
|
|
36
|
+
class="mr-15"
|
|
37
|
+
:src="getProviderIcon(props.option.provider)"
|
|
38
|
+
onerror="this.onerror=null;this.src='https://cdn.appscode.com/images/cloud-provider-icons/Generic.png';"
|
|
39
|
+
alt="No cluster selected"
|
|
40
|
+
/>
|
|
41
|
+
<div>
|
|
42
|
+
<p>{{ props.option.displayName }}</p>
|
|
43
|
+
<p class="location">{{ props.option.location }}</p>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
</multiselect>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
export default {
|
|
52
|
+
props: {
|
|
53
|
+
sidebarCollapsed: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
mouseHover: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false,
|
|
60
|
+
},
|
|
61
|
+
clusterOptions: {
|
|
62
|
+
type: Array,
|
|
63
|
+
default: [],
|
|
64
|
+
},
|
|
65
|
+
value: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "",
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
components: {
|
|
72
|
+
Multiselect: () => import("vue-multiselect"),
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
selectedCluster: null,
|
|
78
|
+
selectedClusterName: "",
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
methods: {
|
|
83
|
+
getProviderIcon(provider) {
|
|
84
|
+
return `https://cdn.appscode.com/images/cloud-provider-icons/${provider}.png`;
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
watch: {
|
|
89
|
+
value: {
|
|
90
|
+
immediate: true,
|
|
91
|
+
handler(n) {
|
|
92
|
+
this.selectedClusterName = n;
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
selectedCluster: {
|
|
96
|
+
deep: true,
|
|
97
|
+
handler(n) {
|
|
98
|
+
this.selectedClusterName = n.name;
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
selectedClusterName(n) {
|
|
102
|
+
if (this.selectedCluster && n !== this.selectedCluster.name) {
|
|
103
|
+
this.clusterOptions.forEach((item) => {
|
|
104
|
+
if (this.selectedClusterName === item.name) {
|
|
105
|
+
this.selectedCluster = item;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
this.$emit("input", n);
|
|
110
|
+
},
|
|
111
|
+
clusterOptions: {
|
|
112
|
+
deep: true,
|
|
113
|
+
immediate: true,
|
|
114
|
+
async handler(list) {
|
|
115
|
+
if (list) {
|
|
116
|
+
list.forEach(async (item) => {
|
|
117
|
+
if(item.name === this.selectedClusterName) {
|
|
118
|
+
this.selectedCluster = item;
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
</script>
|