@appscode/design-system 1.0.43-alpha.9 → 1.0.43-alpha.93
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 +281 -20
- package/base/utilities/_derived-variables.scss +0 -13
- package/base/utilities/_initial-variables.scss +78 -56
- package/base/utilities/_mixin.scss +10 -17
- 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 +18 -10
- 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 +80 -39
- package/components/_ac-modal.scss +5 -4
- package/components/_ac-multi-select.scss +196 -14
- package/components/_ac-options.scss +30 -16
- package/components/_ac-select-box.scss +15 -5
- package/components/_ac-table.scss +42 -33
- package/components/_ac-tabs.scss +72 -23
- package/components/_ac-tags.scss +2 -2
- package/components/_ac-terminal.scss +248 -0
- package/components/_app-drawer.scss +6 -6
- package/components/_breadcumb.scss +7 -2
- package/components/_buttons.scss +56 -27
- 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 +200 -46
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +103 -26
- package/components/_overview-info.scss +4 -4
- package/components/_overview-page.scss +1 -2
- package/components/_pagination.scss +10 -2
- package/components/_payment-card.scss +28 -12
- 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 +5 -5
- 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 +29 -10
- package/components/ui-builder/_vue-open-api.scss +98 -0
- package/layouts/_404.scss +2 -1
- package/layouts/_code-preview.scss +14 -7
- package/main.scss +4 -0
- package/package.json +2 -7
- package/plugins/theme.js +142 -0
- package/vue-components/v2/card/PaymentCards.vue +11 -2
- package/vue-components/v2/editor/Editor.vue +37 -17
- package/vue-components/v2/modal/Modal.vue +10 -1
- package/vue-components/v2/navbar/Appdrawer.vue +10 -9
- package/vue-components/v2/navbar/ThemeMode.vue +120 -0
- 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 +23 -1
- package/vue-components/v2/table/TableRow.vue +1 -1
- package/vue-components/v2/table/table-cell/CellValue.vue +10 -1
- package/vue-components/v2/tabs/EditorTabs.vue +1 -1
- package/vue-components/v3/dropdown/DropdownMenu.vue +1 -1
- package/vue-components/v3/editor/Editor.vue +39 -19
- package/vue-components/v3/modal/Modal.vue +10 -1
- package/vue-components/v3/navbar/Appdrawer.vue +12 -7
- package/vue-components/v3/navbar/ThemeMode.vue +128 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +133 -0
- package/vue-components/v3/table/TableRow.vue +1 -1
- package/vue-components/v3/table/table-cell/CellValue.vue +9 -0
- package/vue-components/v3/tabs/EditorTabs.vue +1 -1
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<content-loader
|
|
6
6
|
:height="235"
|
|
7
7
|
:speed="2"
|
|
8
|
-
:
|
|
9
|
-
:
|
|
8
|
+
:primaryColor="primaryColor"
|
|
9
|
+
:secondaryColor="secondaryColor"
|
|
10
10
|
/>
|
|
11
11
|
</div>
|
|
12
12
|
<!-- loader end -->
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
</template>
|
|
21
21
|
<script>
|
|
22
22
|
import { ContentLoader } from "vue-content-loader";
|
|
23
|
+
import {loaderLightThemePrimaryColor, loaderDarkThemePrimaryColor, loaderLightThemeSecondaryColor, loaderDarkThemeSecondaryColor} from "@appscode/design-system/plugins/theme";
|
|
23
24
|
|
|
24
25
|
export default {
|
|
25
26
|
components: {
|
|
@@ -31,5 +32,13 @@ export default {
|
|
|
31
32
|
default: false,
|
|
32
33
|
},
|
|
33
34
|
},
|
|
35
|
+
computed: {
|
|
36
|
+
primaryColor() {
|
|
37
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemePrimaryColor : loaderLightThemePrimaryColor;
|
|
38
|
+
},
|
|
39
|
+
secondaryColor() {
|
|
40
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemeSecondaryColor : loaderLightThemeSecondaryColor;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
34
43
|
};
|
|
35
44
|
</script>
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
:language="language"
|
|
16
16
|
:options="{
|
|
17
17
|
minimap: {
|
|
18
|
-
enabled: calcShowMinimap
|
|
18
|
+
enabled: calcShowMinimap
|
|
19
19
|
},
|
|
20
|
+
theme: theme,
|
|
20
21
|
readOnly: readOnly,
|
|
21
|
-
|
|
22
|
+
wordWrap: wordWrap,
|
|
23
|
+
scrollBeyondLastLine: false
|
|
22
24
|
}"
|
|
23
25
|
/>
|
|
24
26
|
<monaco-editor
|
|
@@ -29,10 +31,12 @@
|
|
|
29
31
|
:language="language"
|
|
30
32
|
:options="{
|
|
31
33
|
minimap: {
|
|
32
|
-
enabled: calcShowMinimap
|
|
34
|
+
enabled: calcShowMinimap
|
|
33
35
|
},
|
|
36
|
+
theme: theme,
|
|
34
37
|
readOnly: true,
|
|
35
|
-
|
|
38
|
+
wordWrap: wordWrap,
|
|
39
|
+
scrollBeyondLastLine: false
|
|
36
40
|
}"
|
|
37
41
|
:original="originalEditorContent"
|
|
38
42
|
:diff-editor="true"
|
|
@@ -45,39 +49,47 @@ export default {
|
|
|
45
49
|
props: {
|
|
46
50
|
value: {
|
|
47
51
|
type: String,
|
|
48
|
-
default: ""
|
|
52
|
+
default: ""
|
|
49
53
|
},
|
|
50
54
|
originalValue: {
|
|
51
55
|
type: String,
|
|
52
|
-
default: ""
|
|
56
|
+
default: ""
|
|
53
57
|
},
|
|
54
58
|
readOnly: {
|
|
55
59
|
type: Boolean,
|
|
56
|
-
default: false
|
|
60
|
+
default: false
|
|
57
61
|
},
|
|
58
62
|
language: {
|
|
59
63
|
type: String,
|
|
60
|
-
default: "yaml"
|
|
64
|
+
default: "yaml"
|
|
61
65
|
},
|
|
62
66
|
showMinimap: {
|
|
63
67
|
type: Boolean,
|
|
64
|
-
default: true
|
|
68
|
+
default: true
|
|
65
69
|
},
|
|
66
70
|
editorHeight: {
|
|
67
71
|
type: Number,
|
|
68
|
-
default: 40
|
|
72
|
+
default: 40
|
|
73
|
+
},
|
|
74
|
+
editorTheme: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ""
|
|
77
|
+
},
|
|
78
|
+
wordWrap: {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "off"
|
|
69
81
|
},
|
|
70
82
|
},
|
|
71
83
|
components: {
|
|
72
84
|
EditorTabs: () => import("../tabs/EditorTabs.vue"),
|
|
73
|
-
MonacoEditor: () => import("vue-monaco")
|
|
85
|
+
MonacoEditor: () => import("vue-monaco")
|
|
74
86
|
},
|
|
75
87
|
|
|
76
88
|
data() {
|
|
77
89
|
return {
|
|
78
90
|
activeTab: "edit",
|
|
79
91
|
editorContent: "",
|
|
80
|
-
originalEditorContent: ""
|
|
92
|
+
originalEditorContent: ""
|
|
81
93
|
};
|
|
82
94
|
},
|
|
83
95
|
|
|
@@ -86,6 +98,14 @@ export default {
|
|
|
86
98
|
const noOfLines = this.editorContent.split("\n").length;
|
|
87
99
|
return this.showMinimap && noOfLines * 2 > this.editorHeight;
|
|
88
100
|
},
|
|
101
|
+
theme() {
|
|
102
|
+
return (
|
|
103
|
+
this.editorTheme ||
|
|
104
|
+
(document.documentElement.classList.contains("is-dark-theme")
|
|
105
|
+
? "vs-dark"
|
|
106
|
+
: "vs")
|
|
107
|
+
);
|
|
108
|
+
}
|
|
89
109
|
},
|
|
90
110
|
|
|
91
111
|
watch: {
|
|
@@ -95,7 +115,7 @@ export default {
|
|
|
95
115
|
if (this.editorContent !== n) {
|
|
96
116
|
this.editorContent = n;
|
|
97
117
|
}
|
|
98
|
-
}
|
|
118
|
+
}
|
|
99
119
|
},
|
|
100
120
|
originalValue: {
|
|
101
121
|
immediate: true,
|
|
@@ -103,8 +123,8 @@ export default {
|
|
|
103
123
|
if (this.originalEditorContent !== n) {
|
|
104
124
|
this.originalEditorContent = n;
|
|
105
125
|
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
108
128
|
},
|
|
109
129
|
|
|
110
130
|
methods: {
|
|
@@ -114,7 +134,7 @@ export default {
|
|
|
114
134
|
editor.onDidBlurEditorText(() => {
|
|
115
135
|
this.$emit("input", this.editorContent);
|
|
116
136
|
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
119
139
|
};
|
|
120
140
|
</script>
|
|
@@ -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,10 @@
|
|
|
36
37
|
<!-- modal body end -->
|
|
37
38
|
|
|
38
39
|
<!-- modal footer start -->
|
|
39
|
-
<div class="ac-modal-footer action-footer">
|
|
40
|
+
<div class="ac-modal-footer action-footer is-flex is-align-items-center is-justify-content-space-between">
|
|
41
|
+
<div>
|
|
42
|
+
<slot name="modal-footer-left" />
|
|
43
|
+
</div>
|
|
40
44
|
<buttons class="has-text-right is-block">
|
|
41
45
|
<slot name="modal-footer-controls" />
|
|
42
46
|
</buttons>
|
|
@@ -62,6 +66,10 @@ export default {
|
|
|
62
66
|
type: String,
|
|
63
67
|
default: "",
|
|
64
68
|
},
|
|
69
|
+
isCloseOptionDisabled: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false,
|
|
72
|
+
}
|
|
65
73
|
},
|
|
66
74
|
|
|
67
75
|
components: {
|
|
@@ -102,6 +110,7 @@ export default {
|
|
|
102
110
|
document.addEventListener("keydown", this.onKeyDown);
|
|
103
111
|
},
|
|
104
112
|
destroyModal() {
|
|
113
|
+
if (this.isCloseOptionDisabled) return;
|
|
105
114
|
this.showModal = false;
|
|
106
115
|
document.removeEventListener("keydown", this.onKeyDown);
|
|
107
116
|
|
|
@@ -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
|
|
@@ -20,16 +23,14 @@
|
|
|
20
23
|
<article class="media">
|
|
21
24
|
<figure class="media-left">
|
|
22
25
|
<p class="image">
|
|
23
|
-
<img
|
|
24
|
-
:src="app.icon_url"
|
|
25
|
-
/>
|
|
26
|
+
<img :src="app.icon_url" />
|
|
26
27
|
</p>
|
|
27
28
|
</figure>
|
|
28
29
|
<div class="media-content">
|
|
29
30
|
<div class="content">
|
|
30
31
|
<p>
|
|
31
|
-
<strong>{{app.title}}</strong>
|
|
32
|
-
<span>{{app.sub_title}}</span>
|
|
32
|
+
<strong>{{ app.title }}</strong>
|
|
33
|
+
<span>{{ app.sub_title }}</span>
|
|
33
34
|
</p>
|
|
34
35
|
</div>
|
|
35
36
|
</div>
|
|
@@ -50,7 +51,7 @@ export default {
|
|
|
50
51
|
}
|
|
51
52
|
},
|
|
52
53
|
components: {
|
|
53
|
-
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
54
|
-
}
|
|
54
|
+
NavbarItemContent: () => import("./NavbarItemContent.vue")
|
|
55
|
+
}
|
|
55
56
|
};
|
|
56
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>
|
|
@@ -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>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<li>
|
|
2
|
+
<li ref="sidebarItem">
|
|
3
3
|
<router-link
|
|
4
4
|
:id="id"
|
|
5
5
|
:title="title"
|
|
@@ -38,5 +38,27 @@ export default {
|
|
|
38
38
|
default: "@/assets/images/icons/basic.svg",
|
|
39
39
|
},
|
|
40
40
|
},
|
|
41
|
+
watch: {
|
|
42
|
+
isActive: {
|
|
43
|
+
immediate: true,
|
|
44
|
+
handler(n) {
|
|
45
|
+
if (n) {
|
|
46
|
+
this.$nextTick(() => {
|
|
47
|
+
setTimeout(() => {
|
|
48
|
+
const top = (this.$refs.sidebarItem && this.$refs.sidebarItem.getBoundingClientRect().top) || 0;
|
|
49
|
+
// preventing scroll to options that are already visible
|
|
50
|
+
if (top > window.innerHeight - 200) {
|
|
51
|
+
// scroll to selected option item
|
|
52
|
+
this.$refs.sidebarItem.scrollIntoView({
|
|
53
|
+
behavior: 'smooth',
|
|
54
|
+
block: "center"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}, 500);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
41
63
|
};
|
|
42
64
|
</script>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div v-if="isLoaderActive" ref="cellLoaderDiv" :style="{ maxWidth: '300px' }">
|
|
3
|
-
<content-loader :height="10" :width="computedCellWidth || 300"
|
|
3
|
+
<content-loader :height="10" :width="computedCellWidth || 300" :primaryColor="primaryColor"
|
|
4
|
+
:secondaryColor="secondaryColor" />
|
|
4
5
|
</div>
|
|
5
6
|
<div v-else class="haha" ref="cellDiv">
|
|
6
7
|
<object-cell
|
|
@@ -24,6 +25,8 @@
|
|
|
24
25
|
</template>
|
|
25
26
|
|
|
26
27
|
<script>
|
|
28
|
+
import {loaderLightThemePrimaryColor, loaderDarkThemePrimaryColor, loaderLightThemeSecondaryColor, loaderDarkThemeSecondaryColor} from "@appscode/design-system/plugins/theme";
|
|
29
|
+
|
|
27
30
|
export default {
|
|
28
31
|
props: {
|
|
29
32
|
isLoaderActive: {
|
|
@@ -56,6 +59,12 @@ export default {
|
|
|
56
59
|
maxCharacterLength() {
|
|
57
60
|
return Math.ceil(this.computedCellWidth / 8);
|
|
58
61
|
},
|
|
62
|
+
primaryColor() {
|
|
63
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemePrimaryColor : loaderLightThemePrimaryColor;
|
|
64
|
+
},
|
|
65
|
+
secondaryColor() {
|
|
66
|
+
return document.documentElement.classList.contains("is-dark-theme") ? loaderDarkThemeSecondaryColor : loaderLightThemeSecondaryColor;
|
|
67
|
+
}
|
|
59
68
|
},
|
|
60
69
|
|
|
61
70
|
data() {
|
|
@@ -57,9 +57,9 @@ export default defineComponent({
|
|
|
57
57
|
|
|
58
58
|
// attach click event listener on window, and close the dropdown
|
|
59
59
|
function deactivateDropdown(e: Event) {
|
|
60
|
-
e.preventDefault();
|
|
61
60
|
const { target } = e;
|
|
62
61
|
if (
|
|
62
|
+
isDropdownActive.value &&
|
|
63
63
|
dropdown.value &&
|
|
64
64
|
dropdown.value !== target &&
|
|
65
65
|
!dropdown.value.contains(target as Node)
|