@appscode/design-system 2.1.8 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/vue-components/v3/form-fields/Switch.vue +1 -1
- package/vue-components/v2/banner/Banner.vue +0 -12
- package/vue-components/v2/breadcrumbs/Breadcrumb.vue +0 -84
- package/vue-components/v2/button/Button.vue +0 -70
- package/vue-components/v2/button/Buttons.vue +0 -5
- package/vue-components/v2/button/DownloadBtn.vue +0 -45
- package/vue-components/v2/card/Card.vue +0 -37
- package/vue-components/v2/card/CardContent.vue +0 -5
- package/vue-components/v2/card/CardHeader.vue +0 -10
- package/vue-components/v2/card/Cards.vue +0 -5
- package/vue-components/v2/card/OverviewCard.vue +0 -10
- package/vue-components/v2/card/OverviewCards.vue +0 -20
- package/vue-components/v2/card/PaymentCard.vue +0 -69
- package/vue-components/v2/card/PaymentCardOptionButtons.vue +0 -35
- package/vue-components/v2/card/PaymentCards.vue +0 -48
- package/vue-components/v2/content/ContentHeader.vue +0 -50
- package/vue-components/v2/content/ContentLayout.vue +0 -9
- package/vue-components/v2/content/ContentTable.vue +0 -62
- package/vue-components/v2/editor/Editor.vue +0 -144
- package/vue-components/v2/editor/FilteredFileEditor.vue +0 -177
- package/vue-components/v2/editor/MonacoEditor.vue +0 -118
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +0 -199
- package/vue-components/v2/form/Form.vue +0 -54
- package/vue-components/v2/form/FormFooterControl.vue +0 -5
- package/vue-components/v2/form/FormFooterControls.vue +0 -5
- package/vue-components/v2/form-fields/AcSingleInput.vue +0 -20
- package/vue-components/v2/form-fields/Input.vue +0 -17
- package/vue-components/v2/header/Header.vue +0 -34
- package/vue-components/v2/header/HeaderItem.vue +0 -5
- package/vue-components/v2/header/HeaderItems.vue +0 -5
- package/vue-components/v2/icons/Ellipsis.vue +0 -4
- package/vue-components/v2/loaders/ResourceLoader.vue +0 -101
- package/vue-components/v2/loaders/SidebarLoader.vue +0 -43
- package/vue-components/v2/modal/Modal.vue +0 -137
- package/vue-components/v2/modals/DeleteConfirmationModal.vue +0 -74
- package/vue-components/v2/modals/JsonShowModal.vue +0 -69
- package/vue-components/v2/navbar/Appdrawer.vue +0 -74
- package/vue-components/v2/navbar/Navbar.vue +0 -29
- package/vue-components/v2/navbar/NavbarItem.vue +0 -7
- package/vue-components/v2/navbar/NavbarItemContent.vue +0 -5
- package/vue-components/v2/navbar/ThemeMode.vue +0 -114
- package/vue-components/v2/navbar/User.vue +0 -190
- package/vue-components/v2/notification/Notification.vue +0 -92
- package/vue-components/v2/notification/NotificationItem.vue +0 -42
- package/vue-components/v2/pagination/Pagination.vue +0 -214
- package/vue-components/v2/preloader/Preloader.vue +0 -26
- package/vue-components/v2/searchbars/SearchBar.vue +0 -31
- package/vue-components/v2/sidebar/ClusterSwitcher.vue +0 -126
- package/vue-components/v2/sidebar/Sidebar.vue +0 -5
- package/vue-components/v2/sidebar/SidebarItem.vue +0 -59
- package/vue-components/v2/sidebar/SidebarItemWithDropDown.vue +0 -114
- package/vue-components/v2/tab/TabItem.vue +0 -16
- package/vue-components/v2/tab/Tabs.vue +0 -7
- package/vue-components/v2/tab/TabsBody.vue +0 -5
- package/vue-components/v2/table/EmptyTableImage.vue +0 -3
- package/vue-components/v2/table/EmptyTableInfo.vue +0 -6
- package/vue-components/v2/table/FakeTableCell.vue +0 -35
- package/vue-components/v2/table/InfoTable.vue +0 -91
- package/vue-components/v2/table/NarrowTable.vue +0 -17
- package/vue-components/v2/table/Table.vue +0 -212
- package/vue-components/v2/table/TableCell.vue +0 -26
- package/vue-components/v2/table/TableContainer.vue +0 -5
- package/vue-components/v2/table/TableRow.vue +0 -50
- package/vue-components/v2/table/table-cell/ArrayCell.vue +0 -94
- package/vue-components/v2/table/table-cell/CellValue.vue +0 -125
- package/vue-components/v2/table/table-cell/GenericCell.vue +0 -56
- package/vue-components/v2/table/table-cell/ObjectCell.vue +0 -93
- package/vue-components/v2/table/table-cell/ValueWithModal.vue +0 -34
- package/vue-components/v2/tabs/EditorTabs.vue +0 -28
- package/vue-components/v2/tag/Tag.vue +0 -16
- package/vue-components/v2/tag/Tags.vue +0 -5
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<editor-tabs v-if="!readOnly" @tabchange="activeTab = $event" :active-tab="activeTab" />
|
|
4
|
-
<monaco-editor
|
|
5
|
-
v-if="activeTab === 'edit'"
|
|
6
|
-
@editorDidMount="onEditorMount"
|
|
7
|
-
key="edit"
|
|
8
|
-
:class="`vh-${editorHeight} is-clipped`"
|
|
9
|
-
:value="editorContent"
|
|
10
|
-
@change="onChange"
|
|
11
|
-
:language="language"
|
|
12
|
-
:options="{
|
|
13
|
-
minimap: {
|
|
14
|
-
enabled: calcShowMinimap,
|
|
15
|
-
},
|
|
16
|
-
theme: theme,
|
|
17
|
-
readOnly: readOnly,
|
|
18
|
-
wordWrap: wordWrap,
|
|
19
|
-
scrollBeyondLastLine: false,
|
|
20
|
-
}"
|
|
21
|
-
data-testid="monaco-editor-edit-section"
|
|
22
|
-
/>
|
|
23
|
-
<monaco-editor
|
|
24
|
-
v-if="activeTab === 'preview'"
|
|
25
|
-
key="preview"
|
|
26
|
-
:class="`vh-${editorHeight} is-clipped`"
|
|
27
|
-
:value="editorContent"
|
|
28
|
-
:language="language"
|
|
29
|
-
:options="{
|
|
30
|
-
minimap: {
|
|
31
|
-
enabled: calcShowMinimap,
|
|
32
|
-
},
|
|
33
|
-
theme: theme,
|
|
34
|
-
readOnly: true,
|
|
35
|
-
wordWrap: wordWrap,
|
|
36
|
-
scrollBeyondLastLine: false,
|
|
37
|
-
}"
|
|
38
|
-
:original="originalEditorContent"
|
|
39
|
-
:diff-editor="true"
|
|
40
|
-
data-testid="monaco-editor-preview-section"
|
|
41
|
-
/>
|
|
42
|
-
</div>
|
|
43
|
-
</template>
|
|
44
|
-
|
|
45
|
-
<script>
|
|
46
|
-
import Preloader from "../preloader/Preloader.vue";
|
|
47
|
-
import Banner from "../banner/Banner.vue";
|
|
48
|
-
export default {
|
|
49
|
-
props: {
|
|
50
|
-
value: {
|
|
51
|
-
type: String,
|
|
52
|
-
default: "",
|
|
53
|
-
},
|
|
54
|
-
originalValue: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: "",
|
|
57
|
-
},
|
|
58
|
-
readOnly: {
|
|
59
|
-
type: Boolean,
|
|
60
|
-
default: false,
|
|
61
|
-
},
|
|
62
|
-
language: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: "yaml",
|
|
65
|
-
},
|
|
66
|
-
showMinimap: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: true,
|
|
69
|
-
},
|
|
70
|
-
editorHeight: {
|
|
71
|
-
type: Number,
|
|
72
|
-
default: 40,
|
|
73
|
-
},
|
|
74
|
-
editorTheme: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: "",
|
|
77
|
-
},
|
|
78
|
-
wordWrap: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: "off",
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
components: {
|
|
85
|
-
EditorTabs: () => import("../tabs/EditorTabs.vue"),
|
|
86
|
-
MonacoEditor: () => ({
|
|
87
|
-
component: import("./MonacoEditor.vue"),
|
|
88
|
-
loading: Preloader,
|
|
89
|
-
delay: 200,
|
|
90
|
-
error: Banner,
|
|
91
|
-
timeout: 100000,
|
|
92
|
-
}),
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
data() {
|
|
96
|
-
return {
|
|
97
|
-
activeTab: "edit",
|
|
98
|
-
editorContent: "",
|
|
99
|
-
originalEditorContent: "",
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
computed: {
|
|
104
|
-
calcShowMinimap() {
|
|
105
|
-
const noOfLines = this.editorContent.split("\n").length;
|
|
106
|
-
return this.showMinimap && noOfLines * 2 > this.editorHeight;
|
|
107
|
-
},
|
|
108
|
-
theme() {
|
|
109
|
-
return this.editorTheme || (document.documentElement.classList.contains("is-dark-theme") ? "vs-dark" : "vs");
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
watch: {
|
|
114
|
-
value: {
|
|
115
|
-
immediate: true,
|
|
116
|
-
handler(n) {
|
|
117
|
-
if (this.editorContent !== n) {
|
|
118
|
-
this.editorContent = n;
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
originalValue: {
|
|
123
|
-
immediate: true,
|
|
124
|
-
handler(n) {
|
|
125
|
-
if (this.originalEditorContent !== n) {
|
|
126
|
-
this.originalEditorContent = n;
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
|
|
132
|
-
methods: {
|
|
133
|
-
onChange(e) {
|
|
134
|
-
if (typeof e === "string") this.editorContent = e;
|
|
135
|
-
},
|
|
136
|
-
onEditorMount(editor) {
|
|
137
|
-
// add event listeners
|
|
138
|
-
editor.onDidBlurEditorText(() => {
|
|
139
|
-
this.$emit("input", this.editorContent);
|
|
140
|
-
});
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
</script>
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="ac-preview is-active is-not-fixed">
|
|
3
|
-
<div class="ac-preview-inner">
|
|
4
|
-
<!-- preview body start -->
|
|
5
|
-
<div class="ac-preview-body mt-0 pt-15 pl-20">
|
|
6
|
-
<div v-if="isPreviewLoading || (!isPreviewLoading && previewYamls)" class="left-content">
|
|
7
|
-
<div class="ac-files ac-hscrollbar ac-vscrollbar pt-0">
|
|
8
|
-
<ul v-if="!isPreviewLoading">
|
|
9
|
-
<li
|
|
10
|
-
v-for="(previewYaml, idx) in filteredYamls"
|
|
11
|
-
:key="previewYaml.name + idx"
|
|
12
|
-
:class="{ 'is-active': activeKey === previewYaml.uid }"
|
|
13
|
-
data-testid="filtered-file-editor-file-name"
|
|
14
|
-
>
|
|
15
|
-
<a @click.prevent="setActivePreview(previewYaml.uid)">
|
|
16
|
-
<span>
|
|
17
|
-
<img src="~@appscode/design-system-images/icons/file-icon.svg" alt="" />
|
|
18
|
-
</span>
|
|
19
|
-
<span>{{ previewYaml.name }}</span>
|
|
20
|
-
</a>
|
|
21
|
-
</li>
|
|
22
|
-
</ul>
|
|
23
|
-
<sidebar-loader
|
|
24
|
-
v-else
|
|
25
|
-
:primaryLoaderColor="primaryLoaderColor"
|
|
26
|
-
:secondaryLoaderColor="secondaryLoaderColor"
|
|
27
|
-
/>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="right-content" data-testid="filtered-file-editor-content">
|
|
31
|
-
<div class="right-content">
|
|
32
|
-
<resource-loader
|
|
33
|
-
v-if="isPreviewLoading"
|
|
34
|
-
:primaryLoaderColor="primaryLoaderColor"
|
|
35
|
-
:secondaryLoaderColor="secondaryLoaderColor"
|
|
36
|
-
/>
|
|
37
|
-
<editor
|
|
38
|
-
v-else-if="!isPreviewLoading && !hideValue"
|
|
39
|
-
v-model="activeFile.content"
|
|
40
|
-
:original-value="originalValue"
|
|
41
|
-
:language="activeFile.format"
|
|
42
|
-
:read-only="isEditorReadOnly"
|
|
43
|
-
:editor-height="editorHeight"
|
|
44
|
-
:show-minimap="showMinimap"
|
|
45
|
-
:editor-theme="editorTheme"
|
|
46
|
-
:key="editorTheme"
|
|
47
|
-
/>
|
|
48
|
-
<span v-else> *************** </span>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
55
|
-
<script>
|
|
56
|
-
import Banner from "../banner/Banner.vue";
|
|
57
|
-
import Preloader from "../preloader/Preloader.vue";
|
|
58
|
-
export default {
|
|
59
|
-
components: {
|
|
60
|
-
Editor: () => ({
|
|
61
|
-
component: import("./Editor.vue"),
|
|
62
|
-
loading: Preloader,
|
|
63
|
-
delay: 200,
|
|
64
|
-
error: Banner,
|
|
65
|
-
timeout: 100000,
|
|
66
|
-
}),
|
|
67
|
-
ResourceLoader: () => import("./../loaders/ResourceLoader.vue"),
|
|
68
|
-
SidebarLoader: () => import("./../loaders/SidebarLoader.vue"),
|
|
69
|
-
},
|
|
70
|
-
props: {
|
|
71
|
-
searchText: {
|
|
72
|
-
type: String,
|
|
73
|
-
default: "",
|
|
74
|
-
},
|
|
75
|
-
toggleHideValue: {
|
|
76
|
-
type: Boolean,
|
|
77
|
-
default: true,
|
|
78
|
-
},
|
|
79
|
-
isPreviewLoading: {
|
|
80
|
-
type: Boolean,
|
|
81
|
-
default: false,
|
|
82
|
-
},
|
|
83
|
-
isEditorReadOnly: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
default: false,
|
|
86
|
-
},
|
|
87
|
-
previewYamls: {
|
|
88
|
-
type: Array,
|
|
89
|
-
default: () => {
|
|
90
|
-
[];
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
showMinimap: {
|
|
94
|
-
type: Boolean,
|
|
95
|
-
default: false,
|
|
96
|
-
},
|
|
97
|
-
editorHeight: {
|
|
98
|
-
type: Number,
|
|
99
|
-
default: 60,
|
|
100
|
-
},
|
|
101
|
-
loaderColor: {
|
|
102
|
-
type: Object,
|
|
103
|
-
default: () => {
|
|
104
|
-
return {};
|
|
105
|
-
},
|
|
106
|
-
},
|
|
107
|
-
theme: {
|
|
108
|
-
type: String,
|
|
109
|
-
default: "light",
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
data() {
|
|
113
|
-
return {
|
|
114
|
-
activeKey: "",
|
|
115
|
-
hideValue: "",
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
computed: {
|
|
119
|
-
activeFile() {
|
|
120
|
-
const activeFile = this.filteredYamls.find((element) => element.uid === this.activeKey);
|
|
121
|
-
return activeFile || { content: "", format: "yaml" };
|
|
122
|
-
},
|
|
123
|
-
originalValue() {
|
|
124
|
-
const activeFile = this.filteredYamls.find((element) => element.uid === this.activeKey);
|
|
125
|
-
return (activeFile && activeFile.initContent) || "";
|
|
126
|
-
},
|
|
127
|
-
editorTheme() {
|
|
128
|
-
return this.theme === "dark" ? "vs-dark" : "vs";
|
|
129
|
-
},
|
|
130
|
-
primaryLoaderColor() {
|
|
131
|
-
return this.loaderColor.primaryLoaderColor;
|
|
132
|
-
},
|
|
133
|
-
secondaryLoaderColor() {
|
|
134
|
-
return this.loaderColor.secondaryLoaderColor;
|
|
135
|
-
},
|
|
136
|
-
filteredYamls() {
|
|
137
|
-
if (this.searchText) {
|
|
138
|
-
return this.previewYamls.filter((element) => JSON.stringify(element).search(this.searchText) > -1);
|
|
139
|
-
} else return this.previewYamls;
|
|
140
|
-
},
|
|
141
|
-
isKeyAvailable() {
|
|
142
|
-
const val = this.previewYamls.find((element) => {
|
|
143
|
-
return element.uid === this.activeKey;
|
|
144
|
-
});
|
|
145
|
-
return val === undefined ? false : true;
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
methods: {
|
|
149
|
-
initActivePreview() {
|
|
150
|
-
if (!this.isKeyAvailable) {
|
|
151
|
-
this.activeKey = this.previewYamls[0].uid;
|
|
152
|
-
this.hideValue = this.activeFile.isSecret;
|
|
153
|
-
this.$emit("setActiveKey", this.activeKey);
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
setActivePreview(uid) {
|
|
157
|
-
this.activeKey = uid;
|
|
158
|
-
this.hideValue = this.activeFile.isSecret;
|
|
159
|
-
this.$emit("setActiveKey", this.activeKey);
|
|
160
|
-
},
|
|
161
|
-
},
|
|
162
|
-
watch: {
|
|
163
|
-
previewYamls: {
|
|
164
|
-
deep: true,
|
|
165
|
-
immediate: true,
|
|
166
|
-
handler(n) {
|
|
167
|
-
if (n.length) {
|
|
168
|
-
this.initActivePreview();
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
},
|
|
172
|
-
toggleHideValue(n) {
|
|
173
|
-
this.hideValue = n;
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
};
|
|
177
|
-
</script>
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="monaco-editor-vue2" :style="style"></div>
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script>
|
|
6
|
-
import * as monaco from "monaco-editor";
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
name: "MonacoEditor",
|
|
10
|
-
props: {
|
|
11
|
-
diffEditor: { type: Boolean, default: false },
|
|
12
|
-
width: { type: [String, Number], default: "100%" },
|
|
13
|
-
height: { type: [String, Number], default: "100%" },
|
|
14
|
-
original: String,
|
|
15
|
-
value: String,
|
|
16
|
-
language: { type: String, default: "javascript" },
|
|
17
|
-
theme: { type: String, default: "vs" },
|
|
18
|
-
options: {
|
|
19
|
-
type: Object,
|
|
20
|
-
default() {
|
|
21
|
-
return {};
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
computed: {
|
|
26
|
-
style() {
|
|
27
|
-
const fixedWidth = this.width.toString().includes("%") ? this.width : `${this.width}px`;
|
|
28
|
-
const fixedHeight = this.height.toString().includes("%") ? this.height : `${this.height}px`;
|
|
29
|
-
return {
|
|
30
|
-
width: fixedWidth,
|
|
31
|
-
height: fixedHeight,
|
|
32
|
-
"text-align": "left",
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
mounted() {
|
|
37
|
-
this.initMonaco();
|
|
38
|
-
},
|
|
39
|
-
beforeDestroy() {
|
|
40
|
-
this.editor && this.editor.dispose();
|
|
41
|
-
},
|
|
42
|
-
methods: {
|
|
43
|
-
initMonaco() {
|
|
44
|
-
this.$emit("editorWillMount", this.monaco);
|
|
45
|
-
const { value, language, theme, options } = this;
|
|
46
|
-
this.editor = monaco.editor[this.diffEditor ? "createDiffEditor" : "create"](this.$el, {
|
|
47
|
-
value: value,
|
|
48
|
-
language: language,
|
|
49
|
-
theme: theme,
|
|
50
|
-
...options,
|
|
51
|
-
});
|
|
52
|
-
this.diffEditor && this._setModel(this.value, this.original);
|
|
53
|
-
|
|
54
|
-
// @event `change`
|
|
55
|
-
const editor = this._getEditor();
|
|
56
|
-
editor.onDidChangeModelContent((event) => {
|
|
57
|
-
const value = editor.getValue();
|
|
58
|
-
if (this.value !== value) {
|
|
59
|
-
this.$emit("change", value, event);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
this.$emit("editorDidMount", this.editor);
|
|
64
|
-
},
|
|
65
|
-
_setModel(value, original) {
|
|
66
|
-
const { language } = this;
|
|
67
|
-
const originalModel = monaco.editor.createModel(original, language);
|
|
68
|
-
const modifiedModel = monaco.editor.createModel(value, language);
|
|
69
|
-
this.editor.setModel({
|
|
70
|
-
original: originalModel,
|
|
71
|
-
modified: modifiedModel,
|
|
72
|
-
});
|
|
73
|
-
},
|
|
74
|
-
_setValue(value) {
|
|
75
|
-
let editor = this._getEditor();
|
|
76
|
-
if (editor) return editor.setValue(value);
|
|
77
|
-
},
|
|
78
|
-
_getValue() {
|
|
79
|
-
let editor = this._getEditor();
|
|
80
|
-
if (!editor) return "";
|
|
81
|
-
return editor.getValue();
|
|
82
|
-
},
|
|
83
|
-
_getEditor() {
|
|
84
|
-
if (!this.editor) return null;
|
|
85
|
-
return this.diffEditor ? this.editor.getModifiedEditor() : this.editor;
|
|
86
|
-
},
|
|
87
|
-
_setOriginal() {
|
|
88
|
-
const { original } = this.editor.getModel();
|
|
89
|
-
original.setValue(this.original);
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
watch: {
|
|
93
|
-
options: {
|
|
94
|
-
deep: true,
|
|
95
|
-
handler(options) {
|
|
96
|
-
this.editor.updateOptions(options);
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
value() {
|
|
100
|
-
this.value !== this._getValue() && this._setValue(this.value);
|
|
101
|
-
},
|
|
102
|
-
original() {
|
|
103
|
-
this._setOriginal();
|
|
104
|
-
},
|
|
105
|
-
language() {
|
|
106
|
-
if (!this.editor) return;
|
|
107
|
-
if (this.diffEditor) {
|
|
108
|
-
const { original, modified } = this.editor.getModel();
|
|
109
|
-
monaco.editor.setModelLanguage(original, this.language);
|
|
110
|
-
monaco.editor.setModelLanguage(modified, this.language);
|
|
111
|
-
} else monaco.editor.setModelLanguage(this.editor.getModel(), this.language);
|
|
112
|
-
},
|
|
113
|
-
theme() {
|
|
114
|
-
monaco.editor.setTheme(this.theme);
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
</script>
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<content-table :table-title="title" :searchable="isSearchable" :hide-header="hideHeader">
|
|
3
|
-
<template #content-controls>
|
|
4
|
-
<header-item v-if="showHideBtn">
|
|
5
|
-
<ac-button
|
|
6
|
-
modifier-classes="is-square is-primary"
|
|
7
|
-
:icon-class="toggleHideValue ? 'eye-slash' : 'eye'"
|
|
8
|
-
@click.prevent="toggleHideValue = !toggleHideValue"
|
|
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(activeFile)"
|
|
16
|
-
v-clipboard:success="onCopy"
|
|
17
|
-
v-clipboard:error="onError"
|
|
18
|
-
/>
|
|
19
|
-
</header-item>
|
|
20
|
-
<header-item v-if="showDownloadBtn">
|
|
21
|
-
<download-btn :file-data="decode(activeFile)" :file-name="activeFile.name" />
|
|
22
|
-
</header-item>
|
|
23
|
-
<header-item v-if="showUpdateBtn && !isEditorReadOnly">
|
|
24
|
-
<ac-button
|
|
25
|
-
modifier-classes="is-square is-primary"
|
|
26
|
-
icon-class="floppy-o"
|
|
27
|
-
:class="{ 'is-loading': isUpdateActive }"
|
|
28
|
-
@click.prevent="$emit('updateData', activeKey, activeFile)"
|
|
29
|
-
/>
|
|
30
|
-
</header-item>
|
|
31
|
-
<header-item v-if="showDeleteBtn">
|
|
32
|
-
<ac-button
|
|
33
|
-
modifier-classes="is-square is-danger"
|
|
34
|
-
icon-class="trash"
|
|
35
|
-
@click.prevent="showDeleteDataModal = true"
|
|
36
|
-
/>
|
|
37
|
-
<delete-confirmation-modal
|
|
38
|
-
title="Delete Resource"
|
|
39
|
-
message="Do you want to delete "
|
|
40
|
-
:item-name="activeFile.name"
|
|
41
|
-
:open="showDeleteDataModal"
|
|
42
|
-
:is-delete-active="deleteModalStatus === 'loading'"
|
|
43
|
-
@delete-confirmation-modal$confirm="confirmDelete"
|
|
44
|
-
@closemodal="showDeleteDataModal = false"
|
|
45
|
-
/>
|
|
46
|
-
</header-item>
|
|
47
|
-
<slot name="content-action" />
|
|
48
|
-
</template>
|
|
49
|
-
<template #content="{ searchText }">
|
|
50
|
-
<filtered-file-editor
|
|
51
|
-
:search-text="searchText"
|
|
52
|
-
:toggle-hide-value="toggleHideValue"
|
|
53
|
-
:is-preview-loading="isPreviewLoading"
|
|
54
|
-
:is-editor-read-only="isEditorReadOnly"
|
|
55
|
-
:preview-yamls="previewYamls"
|
|
56
|
-
:show-minimap="showMinimap"
|
|
57
|
-
:editor-height="editorHeight"
|
|
58
|
-
:loader-color="loaderColor"
|
|
59
|
-
:theme="theme"
|
|
60
|
-
:key="theme"
|
|
61
|
-
@setActiveKey="setActiveKey"
|
|
62
|
-
/>
|
|
63
|
-
</template>
|
|
64
|
-
</content-table>
|
|
65
|
-
</template>
|
|
66
|
-
<script>
|
|
67
|
-
export default {
|
|
68
|
-
components: {
|
|
69
|
-
AcButton: () => import("./../button/Button.vue"),
|
|
70
|
-
Editor: () => import("./../editor/Editor.vue"),
|
|
71
|
-
ContentTable: () => import("./../content/ContentTable.vue"),
|
|
72
|
-
HeaderItem: () => import("./../header/HeaderItem.vue"),
|
|
73
|
-
DownloadBtn: () => import("./../button/DownloadBtn.vue"),
|
|
74
|
-
DeleteConfirmationModal: () => import("./../modals/DeleteConfirmationModal.vue"),
|
|
75
|
-
FilteredFileEditor: () => import("./FilteredFileEditor.vue"),
|
|
76
|
-
},
|
|
77
|
-
props: {
|
|
78
|
-
title: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: "Title",
|
|
81
|
-
},
|
|
82
|
-
isSearchable: {
|
|
83
|
-
type: Boolean,
|
|
84
|
-
default: false,
|
|
85
|
-
},
|
|
86
|
-
isPreviewLoading: {
|
|
87
|
-
type: Boolean,
|
|
88
|
-
default: false,
|
|
89
|
-
},
|
|
90
|
-
isEditorReadOnly: {
|
|
91
|
-
type: Boolean,
|
|
92
|
-
default: false,
|
|
93
|
-
},
|
|
94
|
-
previewYamls: {
|
|
95
|
-
type: Array,
|
|
96
|
-
default: () => {
|
|
97
|
-
[];
|
|
98
|
-
},
|
|
99
|
-
},
|
|
100
|
-
visibleBtn: {
|
|
101
|
-
type: Object,
|
|
102
|
-
default: () => {
|
|
103
|
-
return {};
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
showMinimap: {
|
|
107
|
-
type: Boolean,
|
|
108
|
-
default: false,
|
|
109
|
-
},
|
|
110
|
-
isUpdateActive: {
|
|
111
|
-
type: Boolean,
|
|
112
|
-
default: false,
|
|
113
|
-
},
|
|
114
|
-
deleteModalStatus: {
|
|
115
|
-
type: String,
|
|
116
|
-
default: "closed",
|
|
117
|
-
},
|
|
118
|
-
editorHeight: {
|
|
119
|
-
type: Number,
|
|
120
|
-
default: 60,
|
|
121
|
-
},
|
|
122
|
-
hideHeader: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: false,
|
|
125
|
-
},
|
|
126
|
-
loaderColor: {
|
|
127
|
-
type: Object,
|
|
128
|
-
default: () => {
|
|
129
|
-
return {};
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
theme: {
|
|
133
|
-
type: String,
|
|
134
|
-
default: "light",
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
data() {
|
|
138
|
-
return {
|
|
139
|
-
activeKey: 0,
|
|
140
|
-
toggleHideValue: "",
|
|
141
|
-
showDeleteDataModal: false,
|
|
142
|
-
};
|
|
143
|
-
},
|
|
144
|
-
computed: {
|
|
145
|
-
activeFile() {
|
|
146
|
-
const activeFile = this.previewYamls.find((element) => element.uid === this.activeKey);
|
|
147
|
-
return activeFile || { content: "", format: "yaml" };
|
|
148
|
-
},
|
|
149
|
-
showCopyBtn() {
|
|
150
|
-
if (this.visibleBtn.showCopyBtn) return true;
|
|
151
|
-
else return false;
|
|
152
|
-
},
|
|
153
|
-
showHideBtn() {
|
|
154
|
-
if (this.visibleBtn.showHideBtn) return true;
|
|
155
|
-
else return false;
|
|
156
|
-
},
|
|
157
|
-
showUpdateBtn() {
|
|
158
|
-
if (this.visibleBtn.showUpdateBtn) return true;
|
|
159
|
-
else return false;
|
|
160
|
-
},
|
|
161
|
-
showDownloadBtn() {
|
|
162
|
-
if (this.visibleBtn.showDownloadBtn) return true;
|
|
163
|
-
else return false;
|
|
164
|
-
},
|
|
165
|
-
showDeleteBtn() {
|
|
166
|
-
if (this.visibleBtn.showDeleteBtn) return true;
|
|
167
|
-
else return false;
|
|
168
|
-
},
|
|
169
|
-
},
|
|
170
|
-
methods: {
|
|
171
|
-
onCopy() {
|
|
172
|
-
this.$toasted.global.success("Value copied successfully").goAway(1000);
|
|
173
|
-
},
|
|
174
|
-
onError() {
|
|
175
|
-
this.$toasted.global.error("Copying failed").goAway(1000);
|
|
176
|
-
},
|
|
177
|
-
decode(str) {
|
|
178
|
-
if (str) return str.content;
|
|
179
|
-
else return "";
|
|
180
|
-
},
|
|
181
|
-
encode(str) {
|
|
182
|
-
if (str) return str.content;
|
|
183
|
-
else return "";
|
|
184
|
-
},
|
|
185
|
-
confirmDelete(flag) {
|
|
186
|
-
if (flag) this.$emit("deleteResource", this.activeKey);
|
|
187
|
-
},
|
|
188
|
-
setActiveKey(key) {
|
|
189
|
-
this.activeKey = key;
|
|
190
|
-
this.toggleHideValue = this.activeFile.isSecret;
|
|
191
|
-
},
|
|
192
|
-
},
|
|
193
|
-
watch: {
|
|
194
|
-
deleteModalStatus(n) {
|
|
195
|
-
if (n === "closed") this.showDeleteDataModal = false;
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
</script>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="form-wrapper">
|
|
3
|
-
<div
|
|
4
|
-
:class="{
|
|
5
|
-
'pt-20': !reducePaddingTop,
|
|
6
|
-
'pt-10': reducePaddingTop,
|
|
7
|
-
'pl-20': !isContainer,
|
|
8
|
-
'form-content': !isContainer,
|
|
9
|
-
container: isContainer,
|
|
10
|
-
}"
|
|
11
|
-
>
|
|
12
|
-
<slot />
|
|
13
|
-
</div>
|
|
14
|
-
<div class="form-footer b-t-1 pt-10 pb-10 pl-20 pr-20 mt-15" v-if="hasFooter">
|
|
15
|
-
<div
|
|
16
|
-
class="ac-vcentered"
|
|
17
|
-
:class="{
|
|
18
|
-
'form-content': !isContainer,
|
|
19
|
-
container: isContainer,
|
|
20
|
-
}"
|
|
21
|
-
>
|
|
22
|
-
<form-footer-controls>
|
|
23
|
-
<slot name="form-left-controls" />
|
|
24
|
-
</form-footer-controls>
|
|
25
|
-
<form-footer-controls>
|
|
26
|
-
<slot name="form-right-controls" />
|
|
27
|
-
</form-footer-controls>
|
|
28
|
-
</div>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
31
|
-
</template>
|
|
32
|
-
|
|
33
|
-
<script>
|
|
34
|
-
export default {
|
|
35
|
-
props: {
|
|
36
|
-
isContainer: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false,
|
|
39
|
-
},
|
|
40
|
-
hasFooter: {
|
|
41
|
-
type: Boolean,
|
|
42
|
-
default: true,
|
|
43
|
-
},
|
|
44
|
-
reducePaddingTop: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
components: {
|
|
51
|
-
FormFooterControls: () => import("./FormFooterControls.vue"),
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
</script>
|