@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,157 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<editor-tabs
|
|
4
|
+
v-if="!readOnly"
|
|
5
|
+
@tabchange="activeTab = $event"
|
|
6
|
+
:active-tab="activeTab"
|
|
7
|
+
/>
|
|
8
|
+
<monaco-editor
|
|
9
|
+
v-if="activeTab === 'edit'"
|
|
10
|
+
ref="monacoEditor"
|
|
11
|
+
@editorDidMount="onEditorMount"
|
|
12
|
+
key="edit"
|
|
13
|
+
:class="`vh-${editorHeight} is-clipped`"
|
|
14
|
+
:value="editorContent"
|
|
15
|
+
@change="onChange"
|
|
16
|
+
:language="language"
|
|
17
|
+
:options="{
|
|
18
|
+
minimap: {
|
|
19
|
+
enabled: calcShowMinimap
|
|
20
|
+
},
|
|
21
|
+
theme: theme,
|
|
22
|
+
readOnly: readOnly,
|
|
23
|
+
wordWrap: wordWrap,
|
|
24
|
+
scrollBeyondLastLine: false
|
|
25
|
+
}"
|
|
26
|
+
/>
|
|
27
|
+
<monaco-editor
|
|
28
|
+
v-if="activeTab === 'preview'"
|
|
29
|
+
key="preview"
|
|
30
|
+
:class="`vh-${editorHeight} is-clipped`"
|
|
31
|
+
:value="editorContent"
|
|
32
|
+
:language="language"
|
|
33
|
+
:options="{
|
|
34
|
+
minimap: {
|
|
35
|
+
enabled: calcShowMinimap
|
|
36
|
+
},
|
|
37
|
+
theme: theme,
|
|
38
|
+
readOnly: true,
|
|
39
|
+
wordWrap: wordWrap,
|
|
40
|
+
scrollBeyondLastLine: false
|
|
41
|
+
}"
|
|
42
|
+
:original="originalEditorContent"
|
|
43
|
+
:diff-editor="true"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<script>
|
|
49
|
+
import { defineComponent, defineAsyncComponent, h } from "vue";
|
|
50
|
+
export default defineComponent({
|
|
51
|
+
props: {
|
|
52
|
+
value: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: ""
|
|
55
|
+
},
|
|
56
|
+
originalValue: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
readOnly: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
language: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "yaml"
|
|
67
|
+
},
|
|
68
|
+
showMinimap: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: true
|
|
71
|
+
},
|
|
72
|
+
editorHeight: {
|
|
73
|
+
type: Number,
|
|
74
|
+
default: 40
|
|
75
|
+
},
|
|
76
|
+
editorTheme: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: ""
|
|
79
|
+
},
|
|
80
|
+
wordWrap: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: "off"
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
emits: ["update:modelValue"],
|
|
87
|
+
|
|
88
|
+
components: {
|
|
89
|
+
EditorTabs: defineAsyncComponent(() =>
|
|
90
|
+
import("../tabs/EditorTabs.vue").then(module => module.default)
|
|
91
|
+
),
|
|
92
|
+
MonacoEditor: defineAsyncComponent(() =>
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
import("vue-monaco").then(module => {
|
|
96
|
+
module.default.render = () => h("div");
|
|
97
|
+
return module.default;
|
|
98
|
+
})
|
|
99
|
+
)
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
data() {
|
|
103
|
+
return {
|
|
104
|
+
activeTab: "edit",
|
|
105
|
+
editorContent: "",
|
|
106
|
+
originalEditorContent: ""
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
computed: {
|
|
111
|
+
calcShowMinimap() {
|
|
112
|
+
const noOfLines = this.editorContent.split("\n").length;
|
|
113
|
+
return this.showMinimap && noOfLines * 2 > this.editorHeight;
|
|
114
|
+
},
|
|
115
|
+
theme() {
|
|
116
|
+
return (
|
|
117
|
+
this.editorTheme ||
|
|
118
|
+
(document.documentElement.classList.contains("is-dark-theme")
|
|
119
|
+
? "vs-dark"
|
|
120
|
+
: "vs")
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
|
|
125
|
+
watch: {
|
|
126
|
+
value: {
|
|
127
|
+
immediate: true,
|
|
128
|
+
handler(n) {
|
|
129
|
+
if (this.editorContent !== n) {
|
|
130
|
+
this.editorContent = n;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
originalValue: {
|
|
135
|
+
immediate: true,
|
|
136
|
+
handler(n) {
|
|
137
|
+
if (this.originalEditorContent !== n) {
|
|
138
|
+
this.originalEditorContent = n;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
methods: {
|
|
145
|
+
onChange(e) {
|
|
146
|
+
if (typeof e === "string") this.editorContent = e;
|
|
147
|
+
},
|
|
148
|
+
onEditorMount() {
|
|
149
|
+
const editor = this.$refs.monacoEditor.getEditor();
|
|
150
|
+
// add event listeners
|
|
151
|
+
editor.onDidBlurEditorText(() => {
|
|
152
|
+
this.$emit("update:modelValue", this.editorContent);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<input class="ac-input" v-bind="inputListeners" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import { defineComponent } from "vue";
|
|
7
|
+
|
|
8
|
+
export default defineComponent({
|
|
9
|
+
inheritAttrs: false,
|
|
10
|
+
emits: ["update:modelValue"],
|
|
11
|
+
computed: {
|
|
12
|
+
inputListeners() {
|
|
13
|
+
return Object.assign({}, this.$attrs, {
|
|
14
|
+
onInput: (event) => {
|
|
15
|
+
this.$emit("update:modelValue", event.target.value);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="inner-header">
|
|
3
|
+
<div
|
|
4
|
+
class="is-flex is-justify-content-space-between"
|
|
5
|
+
:class="{ container: isContainer }"
|
|
6
|
+
>
|
|
7
|
+
<header-items>
|
|
8
|
+
<header-item>
|
|
9
|
+
<transition name="fade" mode="out-in" appear>
|
|
10
|
+
<h5 :key="title">{{ title }}</h5>
|
|
11
|
+
</transition>
|
|
12
|
+
</header-item>
|
|
13
|
+
<slot name="header-left-controls" />
|
|
14
|
+
</header-items>
|
|
15
|
+
<header-items>
|
|
16
|
+
<slot />
|
|
17
|
+
</header-items>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
24
|
+
|
|
25
|
+
export default defineComponent({
|
|
26
|
+
props: {
|
|
27
|
+
title: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "No Title",
|
|
30
|
+
},
|
|
31
|
+
isContainer: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
components: {
|
|
37
|
+
HeaderItems: defineAsyncComponent(() =>
|
|
38
|
+
import("../../v2/header/HeaderItems.vue").then((module) => module.default)
|
|
39
|
+
),
|
|
40
|
+
HeaderItem: defineAsyncComponent(() =>
|
|
41
|
+
import("../../v2/header/HeaderItem.vue").then((module) => module.default)
|
|
42
|
+
),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
</script>
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<teleport to="#modals">
|
|
3
|
+
<!-- for transition https://github.com/adamwathan/vue-tailwind-examples/blob/master/src/components/Modal.vue -->
|
|
4
|
+
<!-- modal start -->
|
|
5
|
+
<div
|
|
6
|
+
v-if="showModal"
|
|
7
|
+
class="ac-modal is-middle-alignment"
|
|
8
|
+
:class="modifierClasses"
|
|
9
|
+
@click.self="destroyModal"
|
|
10
|
+
>
|
|
11
|
+
<div class="ac-modal-inner">
|
|
12
|
+
<!-- modal header start -->
|
|
13
|
+
<div class="ac-modal-header">
|
|
14
|
+
<h6>{{ title }}</h6>
|
|
15
|
+
<header-items>
|
|
16
|
+
<slot name="modal-header-controls" />
|
|
17
|
+
<header-item>
|
|
18
|
+
<ac-button
|
|
19
|
+
modifier-classes="is-square is-transparent"
|
|
20
|
+
:disabled="isCloseOptionDisabled"
|
|
21
|
+
:icon-image="crossIcon"
|
|
22
|
+
@click.stop="destroyModal"
|
|
23
|
+
/>
|
|
24
|
+
</header-item>
|
|
25
|
+
</header-items>
|
|
26
|
+
</div>
|
|
27
|
+
<!-- modal header end -->
|
|
28
|
+
|
|
29
|
+
<!-- modal body start -->
|
|
30
|
+
<div class="ac-modal-body">
|
|
31
|
+
<div class="ac-modal-content">
|
|
32
|
+
<!-- freedom content start -->
|
|
33
|
+
<slot />
|
|
34
|
+
<!-- freedom content end -->
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<!-- modal body end -->
|
|
38
|
+
|
|
39
|
+
<!-- modal footer start -->
|
|
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>
|
|
44
|
+
<buttons class="has-text-right is-block">
|
|
45
|
+
<slot name="modal-footer-controls" />
|
|
46
|
+
</buttons>
|
|
47
|
+
<!-- modal footer end -->
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</teleport>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script>
|
|
55
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
56
|
+
|
|
57
|
+
export default defineComponent({
|
|
58
|
+
props: {
|
|
59
|
+
open: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false,
|
|
62
|
+
},
|
|
63
|
+
title: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "Modal",
|
|
66
|
+
},
|
|
67
|
+
modifierClasses: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "",
|
|
70
|
+
},
|
|
71
|
+
isCloseOptionDisabled: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
emits: ["closemodal"],
|
|
77
|
+
|
|
78
|
+
components: {
|
|
79
|
+
HeaderItems: defineAsyncComponent(() =>
|
|
80
|
+
import("../../v2/header/HeaderItems.vue").then((module) => module.default)
|
|
81
|
+
),
|
|
82
|
+
HeaderItem: defineAsyncComponent(() =>
|
|
83
|
+
import("../../v2/header/HeaderItem.vue").then((module) => module.default)
|
|
84
|
+
),
|
|
85
|
+
Buttons: defineAsyncComponent(() =>
|
|
86
|
+
import("../../v2/button/Buttons.vue").then((module) => module.default)
|
|
87
|
+
),
|
|
88
|
+
AcButton: defineAsyncComponent(() =>
|
|
89
|
+
import("../button/Button.vue").then((module) => module.default)
|
|
90
|
+
),
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
data() {
|
|
94
|
+
return {
|
|
95
|
+
showModal: false,
|
|
96
|
+
crossIcon: import.meta.globEager(
|
|
97
|
+
"/src/assets/icons/modal/close-icon.svg"
|
|
98
|
+
)["/src/assets/icons/modal/close-icon.svg"].default,
|
|
99
|
+
};
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
watch: {
|
|
103
|
+
open: {
|
|
104
|
+
immediate: true,
|
|
105
|
+
handler(n) {
|
|
106
|
+
if (n) {
|
|
107
|
+
this.initializeModal();
|
|
108
|
+
} else {
|
|
109
|
+
this.destroyModal();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
|
|
115
|
+
methods: {
|
|
116
|
+
onKeyDown(e) {
|
|
117
|
+
if (this.open && e.keyCode === 27) {
|
|
118
|
+
// escape key
|
|
119
|
+
this.destroyModal();
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
initializeModal() {
|
|
123
|
+
this.showModal = true;
|
|
124
|
+
document.addEventListener("keydown", this.onKeyDown);
|
|
125
|
+
},
|
|
126
|
+
destroyModal() {
|
|
127
|
+
if (this.isCloseOptionDisabled) return;
|
|
128
|
+
this.showModal = false;
|
|
129
|
+
document.removeEventListener("keydown", this.onKeyDown);
|
|
130
|
+
|
|
131
|
+
this.$emit("closemodal", true);
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
</script>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<modal
|
|
3
|
+
:title="editorTitle"
|
|
4
|
+
:open="open"
|
|
5
|
+
@closemodal="closeModal"
|
|
6
|
+
modifier-classes="is-medium"
|
|
7
|
+
>
|
|
8
|
+
<template #modal-header-controls>
|
|
9
|
+
<header-item>
|
|
10
|
+
<ac-button
|
|
11
|
+
modifier-classes="is-square is-primary"
|
|
12
|
+
icon-class="copy"
|
|
13
|
+
v-clipboard:copy="`${editorTitle}: "${editorContent}"`"
|
|
14
|
+
v-clipboard:success="onCopy"
|
|
15
|
+
v-clipboard:error="onError"
|
|
16
|
+
/>
|
|
17
|
+
</header-item>
|
|
18
|
+
</template>
|
|
19
|
+
<editor
|
|
20
|
+
:value="JSON.stringify(parsedContent, null, 4)"
|
|
21
|
+
:read-only="true"
|
|
22
|
+
language="json"
|
|
23
|
+
:show-minimap="false"
|
|
24
|
+
/>
|
|
25
|
+
</modal>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
30
|
+
import { useToast } from "vue-toastification";
|
|
31
|
+
|
|
32
|
+
export default defineComponent({
|
|
33
|
+
props: {
|
|
34
|
+
open: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false,
|
|
37
|
+
},
|
|
38
|
+
editorTitle: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "",
|
|
41
|
+
},
|
|
42
|
+
editorContent: {
|
|
43
|
+
type: null,
|
|
44
|
+
default: () => ({}),
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
emits: ["closemodal"],
|
|
48
|
+
components: {
|
|
49
|
+
Modal: defineAsyncComponent(() =>
|
|
50
|
+
import("../modal/Modal.vue").then((module) => module.default)
|
|
51
|
+
),
|
|
52
|
+
Editor: defineAsyncComponent(() =>
|
|
53
|
+
import("../editor/Editor.vue").then((module) => module.default)
|
|
54
|
+
),
|
|
55
|
+
AcButton: defineAsyncComponent(() =>
|
|
56
|
+
import("../button/Button.vue").then((module) => module.default)
|
|
57
|
+
),
|
|
58
|
+
HeaderItem: defineAsyncComponent(() =>
|
|
59
|
+
import("../../v2/header/HeaderItem.vue").then((module) => module.default)
|
|
60
|
+
),
|
|
61
|
+
},
|
|
62
|
+
computed: {
|
|
63
|
+
parsedContent() {
|
|
64
|
+
try {
|
|
65
|
+
return JSON.parse(this.editorContent);
|
|
66
|
+
} catch (e) {
|
|
67
|
+
return this.editorContent;
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
setup() {
|
|
72
|
+
const toast = useToast();
|
|
73
|
+
return { toast };
|
|
74
|
+
},
|
|
75
|
+
methods: {
|
|
76
|
+
onCopy() {
|
|
77
|
+
this.toast.success("Value copied successfully", { timeout: 1000 });
|
|
78
|
+
},
|
|
79
|
+
onError() {
|
|
80
|
+
this.toast.error("Copying failed", { timeout: 1000 });
|
|
81
|
+
},
|
|
82
|
+
closeModal() {
|
|
83
|
+
this.$emit("closemodal", true);
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
</script>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
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
|
+
>
|
|
6
|
+
<svg
|
|
7
|
+
class="gb_We"
|
|
8
|
+
focusable="false"
|
|
9
|
+
viewBox="0 0 24 24"
|
|
10
|
+
style="width: 22px;margin-top: 2px;"
|
|
11
|
+
:style="{ fill: 'white' }"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
d="M6,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM6,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM6,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM16,6c0,1.1 0.9,2 2,2s2,-0.9 2,-2 -0.9,-2 -2,-2 -2,0.9 -2,2zM12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,14c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM18,20c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2z"
|
|
15
|
+
></path>
|
|
16
|
+
</svg>
|
|
17
|
+
</div>
|
|
18
|
+
<!-- dropdown start -->
|
|
19
|
+
<div class="ac-menu-content app-drawer-dropdown is-active">
|
|
20
|
+
<ul>
|
|
21
|
+
<li v-for="app in apps" :key="app.url">
|
|
22
|
+
<a :href="app.url">
|
|
23
|
+
<article class="media">
|
|
24
|
+
<figure class="media-left">
|
|
25
|
+
<p class="image">
|
|
26
|
+
<img :src="app.icon_url" />
|
|
27
|
+
</p>
|
|
28
|
+
</figure>
|
|
29
|
+
<div class="media-content">
|
|
30
|
+
<div class="content">
|
|
31
|
+
<p>
|
|
32
|
+
<strong>{{ app.title }}</strong>
|
|
33
|
+
<span>{{ app.sub_title }}</span>
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
</article>
|
|
38
|
+
</a>
|
|
39
|
+
</li>
|
|
40
|
+
</ul>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
47
|
+
|
|
48
|
+
export default defineComponent({
|
|
49
|
+
props: {
|
|
50
|
+
apps: {
|
|
51
|
+
type: Array,
|
|
52
|
+
default: () => []
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
components: {
|
|
56
|
+
NavbarItemContent: defineAsyncComponent(() =>
|
|
57
|
+
import("../../v2/navbar/NavbarItemContent.vue").then(
|
|
58
|
+
module => module.default
|
|
59
|
+
)
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
</script>
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<button
|
|
4
|
+
v-if="themeMode"
|
|
5
|
+
class="button ac-nav-button"
|
|
6
|
+
@click="toggleTheme"
|
|
7
|
+
:title="themeModes[themeMode].displayName"
|
|
8
|
+
>
|
|
9
|
+
<i :class="`fa ${themeModes[themeMode].iconClass} width-15`" />
|
|
10
|
+
</button>
|
|
11
|
+
<div class="ac-menu-content theme-choice">
|
|
12
|
+
<ul class="is-flex is-flex-direction-row is-justify-content-space-around">
|
|
13
|
+
<li
|
|
14
|
+
v-for="theme of Object.keys(themeModes)"
|
|
15
|
+
:title="themeModes[theme].displayName"
|
|
16
|
+
@click="themeMode = theme"
|
|
17
|
+
:class="{'is-active': themeMode === theme}"
|
|
18
|
+
:key="theme"
|
|
19
|
+
>
|
|
20
|
+
<i :class="['fa', themeModes[theme].iconClass]" />
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<script>
|
|
27
|
+
import { defineComponent } from "vue";
|
|
28
|
+
|
|
29
|
+
export default defineComponent({
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
themeMode: "",
|
|
33
|
+
themeModes: {
|
|
34
|
+
system: {
|
|
35
|
+
displayName: "System Theme",
|
|
36
|
+
iconClass: "fa-desktop",
|
|
37
|
+
},
|
|
38
|
+
light: {
|
|
39
|
+
displayName: "Light Theme",
|
|
40
|
+
iconClass: "fa-sun-o",
|
|
41
|
+
},
|
|
42
|
+
dark: {
|
|
43
|
+
displayName: "Dark Theme",
|
|
44
|
+
iconClass: "fa-moon-o",
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
emits: ['set:theme'],
|
|
51
|
+
|
|
52
|
+
mounted() {
|
|
53
|
+
// get theme mode from localStorage or set default one
|
|
54
|
+
this.themeMode = localStorage.getItem("themeMode") || "light";
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
destroyed() {
|
|
58
|
+
this.removeColorSchemeEventListener();
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
watch: {
|
|
62
|
+
themeMode: {
|
|
63
|
+
handler(n) {
|
|
64
|
+
this.onThemeModeChange(n);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
methods: {
|
|
70
|
+
// handle theme mode button click
|
|
71
|
+
toggleTheme() {
|
|
72
|
+
if(this.themeMode === "light")
|
|
73
|
+
this.themeMode = "dark";
|
|
74
|
+
else if(this.themeMode === "dark")
|
|
75
|
+
this.themeMode = "system";
|
|
76
|
+
else if(this.themeMode === "system")
|
|
77
|
+
this.themeMode = "light";
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
// triggered when theme mode is updated
|
|
81
|
+
onThemeModeChange(n) {
|
|
82
|
+
localStorage.setItem("themeMode", n);
|
|
83
|
+
|
|
84
|
+
let theme = n;
|
|
85
|
+
if(n === "system") {
|
|
86
|
+
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
87
|
+
this.addColorSchemeEventListener();
|
|
88
|
+
theme = isDarkMode ? "dark" : "light";
|
|
89
|
+
} else {
|
|
90
|
+
this.removeColorSchemeEventListener();
|
|
91
|
+
}
|
|
92
|
+
this.$emit("set:theme", theme);
|
|
93
|
+
this.handleDarkThemeClass(theme);
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// add proper css class to update the ui theme
|
|
97
|
+
handleDarkThemeClass(currentTheme) {
|
|
98
|
+
if(currentTheme === "light") {
|
|
99
|
+
document.documentElement.classList.remove("is-dark-theme");
|
|
100
|
+
} else {
|
|
101
|
+
document.documentElement.classList.add("is-dark-theme");
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
// add system theme listener event
|
|
106
|
+
addColorSchemeEventListener() {
|
|
107
|
+
window
|
|
108
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
109
|
+
.addEventListener(
|
|
110
|
+
"change", this.handleSystemThemeChange
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
|
|
114
|
+
// remove system theme listener event
|
|
115
|
+
removeColorSchemeEventListener() {
|
|
116
|
+
window
|
|
117
|
+
.matchMedia("(prefers-color-scheme: dark)")
|
|
118
|
+
.removeEventListener(
|
|
119
|
+
"change", this.handleSystemThemeChange
|
|
120
|
+
);
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
handleSystemThemeChange() {
|
|
124
|
+
this.onThemeModeChange(this.themeMode);
|
|
125
|
+
},
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
</script>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<navbar-item>
|
|
3
|
+
<button class="button ac-nav-button ac-profile-button">
|
|
4
|
+
{{ user.full_name || user.username }}
|
|
5
|
+
<i class="fa fa-angle-down" aria-hidden="true"></i>
|
|
6
|
+
<div class="ac-user-profile">
|
|
7
|
+
<img :src="user.avatar_url" alt="User Photo" />
|
|
8
|
+
</div>
|
|
9
|
+
</button>
|
|
10
|
+
<navbar-item-content>
|
|
11
|
+
<div v-if="user.username" class="user-profile-wrapper">
|
|
12
|
+
<div class="profile-area">
|
|
13
|
+
<div class="profile-photo">
|
|
14
|
+
<img :src="user.avatar_url" alt="User Photo" />
|
|
15
|
+
<button class="camera-icon"></button>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="profile-info">
|
|
18
|
+
<p>{{ user.username.toUpperCase() }}</p>
|
|
19
|
+
<a :href="`mailto:${user.email}`"> {{ user.email }}</a>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
<ul>
|
|
23
|
+
<li>
|
|
24
|
+
<a :href="`${serverDomain}/user/settings/`">Settings</a>
|
|
25
|
+
</li>
|
|
26
|
+
<template v-if="user.is_admin">
|
|
27
|
+
<li>
|
|
28
|
+
<a :href="`${serverDomain}/admin`"> Site Administration </a>
|
|
29
|
+
</li>
|
|
30
|
+
</template>
|
|
31
|
+
<li>
|
|
32
|
+
<a :href="`${serverDomain}/user/logout`"> Sign out </a>
|
|
33
|
+
</li>
|
|
34
|
+
</ul>
|
|
35
|
+
</div>
|
|
36
|
+
</navbar-item-content>
|
|
37
|
+
</navbar-item>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { defineComponent, defineAsyncComponent } from "vue";
|
|
42
|
+
|
|
43
|
+
export default defineComponent({
|
|
44
|
+
props: {
|
|
45
|
+
user: {
|
|
46
|
+
type: Object,
|
|
47
|
+
default: () => ({}),
|
|
48
|
+
},
|
|
49
|
+
serverDomain: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
components: {
|
|
56
|
+
NavbarItem: defineAsyncComponent(() =>
|
|
57
|
+
import("../../v2/navbar/NavbarItem.vue").then((module) => module.default)
|
|
58
|
+
),
|
|
59
|
+
NavbarItemContent: defineAsyncComponent(() =>
|
|
60
|
+
import("../../v2/navbar/NavbarItemContent.vue").then((module) => module.default)
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
</script>
|