@appscode/design-system 1.1.0 → 2.0.1
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/_video-player.scss +65 -0
- package/base/utilities/_all.scss +7 -5
- package/base/utilities/_colors.scss +377 -0
- package/base/utilities/_customize-bulma.scss +23 -27
- package/base/utilities/_extended.scss +39 -0
- package/base/utilities/{_default.scss → _global.scss} +192 -333
- package/base/utilities/_layouts.scss +19 -0
- package/base/utilities/_mixin.scss +11 -11
- package/base/utilities/_spacing.scss +96 -0
- package/base/utilities/_typography.scss +56 -24
- package/components/_ac-alert-box.scss +205 -263
- package/components/_ac-calendar.scss +4 -4
- package/components/_ac-code-highlight.scss +13 -16
- package/components/_ac-content-layout.scss +165 -165
- package/components/_ac-drag.scss +13 -13
- package/components/_ac-modal.scss +212 -212
- package/components/_ac-options.scss +122 -123
- package/components/_ac-select-box.scss +10 -10
- package/components/_ac-table.scss +503 -502
- package/components/_ac-tabs.scss +65 -61
- package/components/_ac-tags.scss +116 -116
- package/components/_accordion.scss +117 -0
- package/components/_add-card.scss +3 -3
- package/components/_all.scss +35 -28
- package/components/_app-drawer.scss +0 -134
- package/components/_breadcumb.scss +0 -71
- package/components/_buttons.scss +779 -779
- package/components/_card-body-wrapper.scss +5 -5
- package/components/_dashboard-header.scss +0 -115
- package/components/_direct-deploy.scss +8 -8
- package/components/_getkeeper.scss +110 -0
- package/components/_go-to-top.scss +1 -1
- package/components/_graph.scss +10 -10
- package/components/_image-upload.scss +9 -9
- package/components/_input-card.scss +232 -0
- package/components/_input.scss +573 -0
- package/components/_left-sidebar-menu.scss +452 -587
- package/components/_monaco-editor.scss +2 -2
- package/components/{_ac-multi-select.scss → _multi-select.scss} +89 -251
- package/components/_navbar.scss +786 -752
- package/components/_nested-list.scss +3 -3
- package/components/_overview-info.scss +10 -10
- package/components/_overview-page.scss +4 -4
- package/components/_pagination.scss +106 -124
- package/components/_payment-card.scss +21 -21
- package/components/_preloader.scss +1 -1
- package/components/_preview-modal.scss +18 -18
- package/components/_pricing-table.scss +14 -14
- package/components/_progress-bar.scss +73 -86
- package/components/_subscription-card.scss +22 -24
- package/components/_table-of-content.scss +8 -8
- package/components/{_ac-terminal.scss → _terminal.scss} +114 -81
- package/components/_tfa.scss +9 -9
- package/components/_transitions.scss +35 -0
- package/components/_widget-menu.scss +252 -257
- package/components/_wizard.scss +518 -793
- package/components/ac-toaster/_ac-toasted.scss +11 -16
- package/components/bbum/_activities-header.scss +1 -1
- package/components/bbum/_card-team.scss +12 -12
- package/components/bbum/_information-center.scss +21 -23
- package/components/bbum/_left-sidebar.scss +8 -8
- package/components/bbum/_mobile-desktop.scss +16 -21
- package/components/bbum/_post.scss +5 -5
- package/components/bbum/_sign-up-notification.scss +10 -10
- package/components/bbum/_single-post-preview.scss +29 -29
- package/components/bbum/_user-profile.scss +10 -10
- package/components/ui-builder/_ui-builder.scss +221 -31
- package/components/ui-builder/_vue-open-api.scss +565 -7
- package/icons/close-icon.svg +3 -0
- package/layouts/_code-preview.scss +17 -18
- package/main.scss +26 -10
- package/package.json +1 -1
- package/plugins/theme.js +11 -9
- package/plugins/vue-toaster.js +1 -1
- package/vue-components/images/icons/cluster-icon.svg +10 -0
- package/vue-components/images/icons/org-icon.svg +10 -0
- package/vue-components/plugins/time-convert.js +49 -0
- package/vue-components/types/cluster.ts +6 -0
- package/vue-components/types/importFlow.ts +16 -0
- package/vue-components/types/notification.ts +6 -0
- package/vue-components/types/previewYaml.ts +8 -0
- package/vue-components/types/table.ts +55 -0
- package/vue-components/types/theme.ts +10 -0
- package/vue-components/types/user.ts +22 -0
- package/vue-components/v2/banner/Banner.vue +1 -1
- package/vue-components/v2/button/Buttons.vue +1 -1
- package/vue-components/v2/card/Card.vue +1 -1
- package/vue-components/v2/card/OverviewCards.vue +17 -2
- package/vue-components/v2/content/ContentTable.vue +14 -9
- package/vue-components/v2/editor/FilteredFileEditor.vue +2 -2
- package/vue-components/v2/editor/ResourceKeyValueEditor.vue +21 -21
- package/vue-components/v2/icons/Ellipsis.vue +2 -1
- package/vue-components/v2/modal/Modal.vue +2 -6
- package/vue-components/v2/navbar/Appdrawer.vue +37 -12
- package/vue-components/v2/navbar/Navbar.vue +3 -3
- package/vue-components/v2/navbar/NavbarItem.vue +3 -1
- package/vue-components/v2/navbar/NavbarItemContent.vue +1 -1
- package/vue-components/v2/navbar/User.vue +5 -22
- package/vue-components/v2/pagination/Pagination.vue +66 -0
- package/vue-components/v2/sidebar/SidebarItem.vue +10 -7
- package/{components/_ac-accordion.scss → vue-components/v3/accordion/Accordion.vue} +40 -6
- package/vue-components/v3/alert/Alert.vue +238 -0
- package/vue-components/v3/alert/Toast.vue +79 -0
- package/vue-components/v3/banner/Banner.vue +10 -0
- package/vue-components/v3/breadcrumbs/Breadcrumb.vue +166 -0
- package/vue-components/v3/button/Button.vue +110 -57
- package/vue-components/v3/button/Buttons.vue +22 -0
- package/vue-components/v3/button/DownloadBtn.vue +31 -0
- package/vue-components/v3/cards/Card.vue +32 -0
- package/vue-components/v3/cards/CardContent.vue +7 -0
- package/vue-components/v3/cards/CardHeader.vue +14 -0
- package/vue-components/v3/cards/Cards.vue +7 -0
- package/vue-components/v3/cards/Cluster.vue +159 -0
- package/vue-components/v3/cards/Counter.vue +39 -0
- package/vue-components/v3/cards/FeatureCard.vue +67 -0
- package/vue-components/v3/cards/FeatureCards.vue +6 -0
- package/vue-components/v3/cards/InfoCard.vue +242 -0
- package/vue-components/v3/cards/Monitoring.vue +90 -0
- package/vue-components/v3/cards/OrgClusterCard.vue +86 -0
- package/vue-components/v3/cards/OverviewCard.vue +28 -0
- package/vue-components/v3/cards/OverviewCards.vue +39 -0
- package/vue-components/v3/cards/Payment.vue +62 -0
- package/vue-components/v3/cards/Vendor.vue +89 -0
- package/vue-components/v3/content/ContentHeader.vue +39 -30
- package/vue-components/v3/content/ContentLayout.vue +20 -0
- package/vue-components/v3/content/ContentTable.vue +44 -58
- package/vue-components/v3/dropdown/DropdownAction.vue +95 -0
- package/vue-components/v3/dropdown/DropdownDivider.vue +2 -0
- package/vue-components/v3/dropdown/DropdownItem.vue +2 -0
- package/vue-components/v3/dropdown/DropdownMenu.vue +85 -91
- package/vue-components/v3/editor/Editor.vue +117 -115
- package/vue-components/v3/editor/FilteredFileEditor.vue +325 -128
- package/vue-components/v3/editor/ResourceKeyValueEditor.vue +73 -94
- package/vue-components/v3/footer/FooterArea.vue +40 -0
- package/vue-components/v3/footer/FooterItem.vue +32 -0
- package/vue-components/v3/footer/FooterItems.vue +15 -0
- package/vue-components/v3/footer/Info.vue +25 -0
- package/vue-components/v3/footer/Status.vue +43 -0
- package/vue-components/v3/footer/Usage.vue +34 -0
- package/vue-components/v3/form/Form.vue +24 -36
- package/vue-components/v3/form/FormFooter.vue +24 -0
- package/vue-components/v3/form/FormFooterControl.vue +7 -0
- package/vue-components/v3/form/FormFooterControls.vue +7 -0
- package/vue-components/v3/form-fields/AcSingleInput.vue +21 -0
- package/vue-components/v3/form-fields/FileUpload.vue +89 -0
- package/vue-components/v3/form-fields/Input.vue +19 -15
- package/vue-components/v3/header/Header.vue +120 -26
- package/vue-components/v3/header/HeaderItem.vue +18 -0
- package/vue-components/v3/header/HeaderItems.vue +4 -0
- package/vue-components/v3/icons/Ellipsis.vue +2 -0
- package/vue-components/v3/loaders/ClusterSwitcherLoader.vue +13 -0
- package/vue-components/v3/loaders/InfoCardLoader.vue +19 -0
- package/vue-components/v3/loaders/ResourceLoader.vue +4 -12
- package/vue-components/v3/loaders/SidebarLoader.vue +4 -12
- package/vue-components/v3/loaders/SingleInfoCardLoader.vue +24 -0
- package/vue-components/v3/modal/Modal.vue +294 -95
- package/vue-components/v3/modals/DeleteConfirmationModal.vue +37 -50
- package/vue-components/v3/modals/JsonShowModal.vue +63 -68
- package/vue-components/v3/navbar/Appdrawer.vue +198 -51
- package/vue-components/v3/navbar/Navbar.vue +139 -0
- package/vue-components/v3/navbar/NavbarItem.vue +103 -0
- package/vue-components/v3/navbar/NavbarItemContent.vue +282 -0
- package/vue-components/v3/navbar/Notification.vue +207 -0
- package/vue-components/v3/navbar/ThemeMode.vue +128 -112
- package/vue-components/v3/navbar/User.vue +431 -268
- package/vue-components/v3/notification/AlertBox.vue +266 -39
- package/vue-components/v3/notification/Notification.vue +50 -44
- package/vue-components/v3/notification/NotificationItem.vue +51 -19
- package/vue-components/v3/option-dots/Options.vue +197 -0
- package/vue-components/v3/pagination/Pagination.vue +216 -102
- package/vue-components/v3/preloader/Preloader.vue +23 -0
- package/vue-components/v3/searchbars/SearchBar.vue +50 -34
- package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +71 -86
- package/vue-components/v3/sidebar/Sidebar.vue +239 -0
- package/vue-components/v3/sidebar/SidebarBody.vue +14 -0
- package/vue-components/v3/sidebar/SidebarFooter.vue +89 -0
- package/vue-components/v3/sidebar/SidebarHeader.vue +131 -0
- package/vue-components/v3/sidebar/SidebarItem.vue +62 -0
- package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +101 -104
- package/vue-components/v3/sidebar/SidebarMenuList.vue +9 -0
- package/vue-components/v3/sidebar/Steps.vue +152 -0
- package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabs.vue +204 -0
- package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabsLayout.vue +44 -0
- package/vue-components/v3/sidebar/sidebar-tabs/TabsContent.vue +99 -0
- package/vue-components/v3/tab/TabItem.vue +10 -12
- package/vue-components/v3/tab/Tabs.vue +36 -0
- package/vue-components/v3/tab/TabsBody.vue +7 -0
- package/vue-components/v3/table/EmptyTableInfo.vue +8 -0
- package/vue-components/v3/table/FakeTableCell.vue +22 -31
- package/vue-components/v3/table/InfoTable.vue +89 -61
- package/vue-components/v3/table/MultiInfoTable.vue +72 -95
- package/vue-components/v3/table/Table.vue +596 -157
- package/vue-components/v3/table/TableCell.vue +13 -24
- package/vue-components/v3/table/TableContainer.vue +50 -28
- package/vue-components/v3/table/TableRow.vue +65 -87
- package/vue-components/v3/table/table-cell/ArrayCell.vue +94 -103
- package/vue-components/v3/table/table-cell/CellValue.vue +74 -106
- package/vue-components/v3/table/table-cell/GenericCell.vue +43 -42
- package/vue-components/v3/table/table-cell/ObjectCell.vue +91 -101
- package/vue-components/v3/table/table-cell/ValueWithModal.vue +22 -31
- package/vue-components/v3/tabs/EditorTabs.vue +18 -24
- package/vue-components/v3/tag/Tag.vue +16 -12
- package/vue-components/v3/tag/Tags.vue +7 -0
- package/base/utilities/_derived-variables.scss +0 -25
- package/base/utilities/_initial-variables.scss +0 -215
- package/base/utilities/dark-theme.scss +0 -26
- package/components/_ac-card.scss +0 -597
- package/components/_ac-input.scss +0 -876
- package/mixins/stickyContent.js +0 -141
- package/plugins/caching.ts +0 -243
- package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +0 -92
- package/vue-components/v3/modals/LongRunningTasksModal.vue +0 -400
- package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +0 -148
- /package/components/{_ac-report.scss → _report.scss} +0 -0
|
@@ -1,9 +1,78 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineAsyncComponent, ref } from "vue";
|
|
3
|
+
import { useElementSize } from "@vueuse/core";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
isLoaderActive?: boolean;
|
|
7
|
+
cellTitle?: string;
|
|
8
|
+
value?: unknown;
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
13
|
+
isLoaderActive: false,
|
|
14
|
+
cellTitle: "cell title",
|
|
15
|
+
tooltip: "",
|
|
16
|
+
value: () => ({}),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const ContentLoader = defineAsyncComponent(() =>
|
|
20
|
+
import("vue-content-loader").then(({ ContentLoader }) => ContentLoader)
|
|
21
|
+
);
|
|
22
|
+
const ObjectCell = defineAsyncComponent(
|
|
23
|
+
() => import("../../table/table-cell/ObjectCell.vue")
|
|
24
|
+
);
|
|
25
|
+
const ArrayCell = defineAsyncComponent(
|
|
26
|
+
() => import("../../table/table-cell/ArrayCell.vue")
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const loaderLightThemePrimaryColor = "#f5f7f9";
|
|
30
|
+
const loaderDarkThemePrimaryColor = "#2e323c";
|
|
31
|
+
const loaderLightThemeSecondaryColor = "#ecebeb";
|
|
32
|
+
const loaderDarkThemeSecondaryColor = "#21272e";
|
|
33
|
+
|
|
34
|
+
const cellLoaderDiv = ref<HTMLElement | null>(null);
|
|
35
|
+
const cellDiv = ref<HTMLElement | null>(null);
|
|
36
|
+
|
|
37
|
+
const valueType = computed(() => {
|
|
38
|
+
if (typeof props.value === "object") {
|
|
39
|
+
if (props.value === null) return "null";
|
|
40
|
+
else if (Array.isArray(props.value)) return "array";
|
|
41
|
+
else return "object";
|
|
42
|
+
} else return typeof props.value;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const { width: cellLoaderDivWidth } = useElementSize(cellLoaderDiv, {
|
|
46
|
+
width: 150,
|
|
47
|
+
height: 30,
|
|
48
|
+
});
|
|
49
|
+
const { width: cellDivWidth } = useElementSize(cellDiv, {
|
|
50
|
+
width: 150,
|
|
51
|
+
height: 30,
|
|
52
|
+
});
|
|
53
|
+
const maxCharacterLength = computed(() => {
|
|
54
|
+
return Math.ceil(cellDivWidth.value / 6);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const primaryColor = computed(() => {
|
|
58
|
+
return document.documentElement.classList.contains("is-dark-theme")
|
|
59
|
+
? loaderDarkThemePrimaryColor
|
|
60
|
+
: loaderLightThemePrimaryColor;
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const secondaryColor = computed(() => {
|
|
64
|
+
return document.documentElement.classList.contains("is-dark-theme")
|
|
65
|
+
? loaderDarkThemeSecondaryColor
|
|
66
|
+
: loaderLightThemeSecondaryColor;
|
|
67
|
+
});
|
|
68
|
+
</script>
|
|
69
|
+
|
|
1
70
|
<template>
|
|
2
71
|
<div v-if="isLoaderActive" ref="cellLoaderDiv" :style="{ maxWidth: '300px' }">
|
|
3
72
|
<content-loader
|
|
4
|
-
:view-box="`0 0 ${
|
|
73
|
+
:view-box="`0 0 ${cellLoaderDivWidth || 300} 10`"
|
|
5
74
|
:speed="2"
|
|
6
|
-
:key="
|
|
75
|
+
:key="cellLoaderDivWidth"
|
|
7
76
|
:primaryColor="primaryColor"
|
|
8
77
|
:secondaryColor="secondaryColor"
|
|
9
78
|
/>
|
|
@@ -11,123 +80,22 @@
|
|
|
11
80
|
<div v-else ref="cellDiv">
|
|
12
81
|
<object-cell
|
|
13
82
|
v-if="valueType === 'object'"
|
|
14
|
-
:obj="value"
|
|
83
|
+
:obj="value as Record<string, unknown>"
|
|
15
84
|
:cell-title="cellTitle"
|
|
16
85
|
:max-character-length="maxCharacterLength"
|
|
17
86
|
data-testid="object-cell-value"
|
|
18
87
|
/>
|
|
19
88
|
<array-cell
|
|
20
89
|
v-else-if="valueType === 'array'"
|
|
21
|
-
:items="value"
|
|
90
|
+
:items="value as Array<unknown>"
|
|
22
91
|
:cell-title="cellTitle"
|
|
23
92
|
:max-character-length="maxCharacterLength"
|
|
24
93
|
data-testid="array-cell-value"
|
|
25
94
|
/>
|
|
26
95
|
<template v-else>
|
|
27
|
-
<span
|
|
96
|
+
<span :title="tooltip" data-testid="cell-value">{{
|
|
28
97
|
value || (value === 0 ? 0 : "-")
|
|
29
98
|
}}</span>
|
|
30
99
|
</template>
|
|
31
100
|
</div>
|
|
32
101
|
</template>
|
|
33
|
-
|
|
34
|
-
<script>
|
|
35
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
36
|
-
import {
|
|
37
|
-
loaderLightThemePrimaryColor,
|
|
38
|
-
loaderDarkThemePrimaryColor,
|
|
39
|
-
loaderLightThemeSecondaryColor,
|
|
40
|
-
loaderDarkThemeSecondaryColor,
|
|
41
|
-
} from "@appscode/design-system/plugins/theme";
|
|
42
|
-
|
|
43
|
-
export default defineComponent({
|
|
44
|
-
props: {
|
|
45
|
-
isLoaderActive: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: false,
|
|
48
|
-
},
|
|
49
|
-
cellTitle: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: "Cell",
|
|
52
|
-
},
|
|
53
|
-
value: {
|
|
54
|
-
type: null,
|
|
55
|
-
default: "",
|
|
56
|
-
},
|
|
57
|
-
tooltip: {
|
|
58
|
-
type: String,
|
|
59
|
-
defualt: "",
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
components: {
|
|
63
|
-
ContentLoader: defineAsyncComponent(() =>
|
|
64
|
-
import("vue-content-loader").then(({ ContentLoader }) => ContentLoader)
|
|
65
|
-
),
|
|
66
|
-
ObjectCell: defineAsyncComponent(() =>
|
|
67
|
-
import("./ObjectCell.vue").then((module) => module.default)
|
|
68
|
-
),
|
|
69
|
-
ArrayCell: defineAsyncComponent(() =>
|
|
70
|
-
import("./ArrayCell.vue").then((module) => module.default)
|
|
71
|
-
),
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
computed: {
|
|
75
|
-
valueType() {
|
|
76
|
-
if (typeof this.value === "object") {
|
|
77
|
-
if (this.value === null) return "null";
|
|
78
|
-
else if (Array.isArray(this.value)) return "array";
|
|
79
|
-
else return "object";
|
|
80
|
-
} else return typeof this.value;
|
|
81
|
-
},
|
|
82
|
-
maxCharacterLength() {
|
|
83
|
-
return Math.ceil(this.computedCellWidth / 8);
|
|
84
|
-
},
|
|
85
|
-
primaryColor() {
|
|
86
|
-
return document.documentElement.classList.contains("is-dark-theme")
|
|
87
|
-
? loaderDarkThemePrimaryColor
|
|
88
|
-
: loaderLightThemePrimaryColor;
|
|
89
|
-
},
|
|
90
|
-
secondaryColor() {
|
|
91
|
-
return document.documentElement.classList.contains("is-dark-theme")
|
|
92
|
-
? loaderDarkThemeSecondaryColor
|
|
93
|
-
: loaderLightThemeSecondaryColor;
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
data() {
|
|
98
|
-
return {
|
|
99
|
-
computedCellWidth: null,
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
mounted() {
|
|
104
|
-
this.calcCellWidth();
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
watch: {
|
|
108
|
-
isLoaderActive() {
|
|
109
|
-
this.calcCellWidth();
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
methods: {
|
|
114
|
-
calcCellWidth() {
|
|
115
|
-
if (this.isLoaderActive) {
|
|
116
|
-
this.$nextTick(() => {
|
|
117
|
-
const cellLoaderDiv = this.$refs.cellLoaderDiv;
|
|
118
|
-
if (cellLoaderDiv) {
|
|
119
|
-
this.computedCellWidth = cellLoaderDiv.offsetWidth;
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
} else {
|
|
123
|
-
this.$nextTick(() => {
|
|
124
|
-
const cellDiv = this.$refs.cellDiv;
|
|
125
|
-
if (cellDiv) {
|
|
126
|
-
this.computedCellWidth = cellDiv.offsetWidth;
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
});
|
|
133
|
-
</script>
|
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { AcTableCell, AcTableCol } from "../../../types/table";
|
|
3
|
+
import { defineAsyncComponent } from "vue";
|
|
4
|
+
import { useRoute } from "vue-router";
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
cellDescriptor?: AcTableCol;
|
|
8
|
+
cellValue?: AcTableCell;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
+
cellValue: () => ({ data: "-" }),
|
|
13
|
+
cellDescriptor: () => ({
|
|
14
|
+
name: "-",
|
|
15
|
+
type: "string",
|
|
16
|
+
priority: 3,
|
|
17
|
+
pathTemplate: "-",
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const Tag = defineAsyncComponent(() => import("../../tag/Tag.vue"));
|
|
22
|
+
const CellValue = defineAsyncComponent(
|
|
23
|
+
() => import("../../table/table-cell/CellValue.vue")
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const route = useRoute();
|
|
27
|
+
function getCellLink(cell: AcTableCell) {
|
|
28
|
+
const inject = (str: string, obj: Record<string, string>) =>
|
|
29
|
+
str.replace(/\${(.*?)}/g, (x, g) => obj[g]);
|
|
30
|
+
const { user, cluster } = route.params;
|
|
31
|
+
const link = inject(cell.link || "", {
|
|
32
|
+
username: user as string,
|
|
33
|
+
clustername: cluster as string,
|
|
34
|
+
});
|
|
35
|
+
return link;
|
|
36
|
+
}
|
|
37
|
+
function redirectTo() {
|
|
38
|
+
const link = getCellLink(props.cellValue);
|
|
39
|
+
window.open(link, "_blank");
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
1
43
|
<template>
|
|
2
44
|
<span
|
|
3
45
|
:class="{
|
|
@@ -27,49 +69,8 @@
|
|
|
27
69
|
<cell-value
|
|
28
70
|
v-else
|
|
29
71
|
:cell-title="cellDescriptor.name"
|
|
30
|
-
:value="cellValue.data || '-'"
|
|
72
|
+
:value="cellValue.data as {} || '-'"
|
|
31
73
|
:tooltip="cellValue.tooltip || JSON.stringify(cellValue.data)"
|
|
32
74
|
/>
|
|
33
75
|
</span>
|
|
34
76
|
</template>
|
|
35
|
-
|
|
36
|
-
<script>
|
|
37
|
-
import { defineAsyncComponent, defineComponent } from "vue";
|
|
38
|
-
import { useRoute } from "vue-router";
|
|
39
|
-
|
|
40
|
-
export default defineComponent({
|
|
41
|
-
components: {
|
|
42
|
-
Tag: defineAsyncComponent(() => import("../../tag/Tag.vue")),
|
|
43
|
-
CellValue: defineAsyncComponent(() =>
|
|
44
|
-
import("../table-cell/CellValue.vue")
|
|
45
|
-
),
|
|
46
|
-
},
|
|
47
|
-
props: {
|
|
48
|
-
cellDescriptor: {
|
|
49
|
-
type: Object,
|
|
50
|
-
default: () => ({}),
|
|
51
|
-
},
|
|
52
|
-
cellValue: {
|
|
53
|
-
type: Object,
|
|
54
|
-
default: () => ({}),
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
setup() {
|
|
58
|
-
const route = useRoute();
|
|
59
|
-
function getCellLink(cell) {
|
|
60
|
-
const inject = (str, obj) => str.replace(/\${(.*?)}/g, (x, g) => obj[g]);
|
|
61
|
-
const { user, cluster } = route.params;
|
|
62
|
-
const link = inject(cell.link || "", {
|
|
63
|
-
username: user,
|
|
64
|
-
clustername: cluster,
|
|
65
|
-
});
|
|
66
|
-
return link;
|
|
67
|
-
}
|
|
68
|
-
function redirectTo() {
|
|
69
|
-
const link = getCellLink(this.cellValue);
|
|
70
|
-
window.open(link, "_blank");
|
|
71
|
-
}
|
|
72
|
-
return { getCellLink, redirectTo };
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
</script>
|
|
@@ -1,110 +1,100 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
<tag
|
|
4
|
-
v-for="printableStringOb in printableStringObjs.slice(
|
|
5
|
-
0,
|
|
6
|
-
indexOfCharacterLengthExceed
|
|
7
|
-
)"
|
|
8
|
-
:key="printableStringOb.key"
|
|
9
|
-
modifierClasses="is-info is-light"
|
|
10
|
-
>
|
|
11
|
-
<value-with-modal
|
|
12
|
-
v-if="printableStringOb.exceededLength"
|
|
13
|
-
:title="printableStringOb.key"
|
|
14
|
-
:value="printableStringOb.value"
|
|
15
|
-
:print="printableStringOb.print"
|
|
16
|
-
/>
|
|
17
|
-
<template v-else> {{ printableStringOb.print }} </template>
|
|
18
|
-
</tag>
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent, ref, computed } from "vue";
|
|
19
3
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
4
|
+
interface Props {
|
|
5
|
+
cellTitle?: string;
|
|
6
|
+
obj?: Record<string, unknown>;
|
|
7
|
+
maxCharacterLength?: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
11
|
+
cellTitle: "cell title",
|
|
12
|
+
maxCharacterLength: 64,
|
|
13
|
+
obj: () => ({}),
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const Tags = defineAsyncComponent(() => import("../../tag/Tags.vue"));
|
|
17
|
+
const Tag = defineAsyncComponent(() => import("../../tag/Tag.vue"));
|
|
18
|
+
const EllipsisIcon = defineAsyncComponent(
|
|
19
|
+
() => import("../../icons/Ellipsis.vue")
|
|
20
|
+
);
|
|
21
|
+
const JsonShowModal = defineAsyncComponent(
|
|
22
|
+
() => import("../../modals/JsonShowModal.vue")
|
|
23
|
+
);
|
|
24
|
+
const ValueWithModal = defineAsyncComponent(
|
|
25
|
+
() => import("../../table/table-cell/ValueWithModal.vue")
|
|
26
|
+
);
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
28
|
+
const showFullData = ref(false);
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
props
|
|
40
|
-
|
|
41
|
-
type: String,
|
|
42
|
-
default: "Object",
|
|
43
|
-
},
|
|
44
|
-
obj: {
|
|
45
|
-
type: Object,
|
|
46
|
-
default: () => ({}),
|
|
47
|
-
},
|
|
48
|
-
maxCharacterLength: {
|
|
49
|
-
type: Number,
|
|
50
|
-
default: undefined,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
components: {
|
|
54
|
-
Tags: defineAsyncComponent(() =>
|
|
55
|
-
import("../../../v2/tag/Tags.vue").then((module) => module.default)
|
|
56
|
-
),
|
|
57
|
-
Tag: defineAsyncComponent(() =>
|
|
58
|
-
import("../../tag/Tag.vue").then((module) => module.default)
|
|
59
|
-
),
|
|
60
|
-
EllipsisIcon: defineAsyncComponent(() =>
|
|
61
|
-
import("../../../v2/icons/Ellipsis.vue").then((module) => module.default)
|
|
62
|
-
),
|
|
63
|
-
JsonShowModal: defineAsyncComponent(() =>
|
|
64
|
-
import("../../modals/JsonShowModal.vue").then((module) => module.default)
|
|
65
|
-
),
|
|
66
|
-
ValueWithModal: defineAsyncComponent(() =>
|
|
67
|
-
import("./ValueWithModal.vue").then((module) => module.default)
|
|
68
|
-
),
|
|
69
|
-
},
|
|
30
|
+
const objKeys = computed(() => {
|
|
31
|
+
return Object.keys(props.obj) || [];
|
|
32
|
+
});
|
|
70
33
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
34
|
+
const printableStringObjs = computed(() => {
|
|
35
|
+
return objKeys.value.map((key) => {
|
|
36
|
+
let value: string = props.obj[key] as string;
|
|
37
|
+
if (typeof value === "object" && value !== null) {
|
|
38
|
+
value = JSON.stringify(value);
|
|
39
|
+
}
|
|
40
|
+
const keyValue = `${key}: ${value}`;
|
|
41
|
+
const exceededLength = keyValue.length > 30;
|
|
42
|
+
const print = exceededLength ? key : keyValue;
|
|
43
|
+
return { key, value, keyValue, exceededLength, print };
|
|
44
|
+
});
|
|
45
|
+
});
|
|
76
46
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
const exceededLength = keyValue.length > 30;
|
|
89
|
-
const print = exceededLength ? key : keyValue;
|
|
90
|
-
return { key, value, keyValue, exceededLength, print };
|
|
91
|
-
});
|
|
92
|
-
},
|
|
93
|
-
indexOfCharacterLengthExceed() {
|
|
94
|
-
let idx = -1;
|
|
95
|
-
let cumulativeLen = 0;
|
|
96
|
-
for (const [index, po] of this.printableStringObjs.entries()) {
|
|
97
|
-
const newLen = cumulativeLen + po.print.length;
|
|
98
|
-
if (newLen > this.maxCharacterLength) {
|
|
99
|
-
idx = index;
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
cumulativeLen = newLen;
|
|
103
|
-
}
|
|
47
|
+
const indexOfCharacterLengthExceed = computed(() => {
|
|
48
|
+
let idx = -1;
|
|
49
|
+
let cumulativeLen = 2;
|
|
50
|
+
for (const [index, po] of printableStringObjs.value.entries()) {
|
|
51
|
+
const newLen = cumulativeLen + po.print.length + 2;
|
|
52
|
+
if (newLen + 4 > props.maxCharacterLength) {
|
|
53
|
+
idx = index;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
cumulativeLen = newLen;
|
|
57
|
+
}
|
|
104
58
|
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
},
|
|
59
|
+
return idx === -1 ? printableStringObjs.value.length : idx;
|
|
108
60
|
});
|
|
109
61
|
</script>
|
|
110
62
|
|
|
63
|
+
<template>
|
|
64
|
+
<span>
|
|
65
|
+
<tags v-if="printableStringObjs.length">
|
|
66
|
+
<tag
|
|
67
|
+
v-for="printableStringOb in printableStringObjs.slice(
|
|
68
|
+
0,
|
|
69
|
+
indexOfCharacterLengthExceed
|
|
70
|
+
)"
|
|
71
|
+
:key="printableStringOb.key"
|
|
72
|
+
modifierClasses="is-primary is-light"
|
|
73
|
+
>
|
|
74
|
+
<value-with-modal
|
|
75
|
+
v-if="printableStringOb.exceededLength"
|
|
76
|
+
:title="printableStringOb.key"
|
|
77
|
+
:value="printableStringOb.value"
|
|
78
|
+
:print="printableStringOb.print"
|
|
79
|
+
/>
|
|
80
|
+
<template v-else> {{ printableStringOb.print }} </template>
|
|
81
|
+
</tag>
|
|
82
|
+
|
|
83
|
+
<tag
|
|
84
|
+
modifierClasses="is-info is-light"
|
|
85
|
+
v-if="indexOfCharacterLengthExceed !== printableStringObjs.length"
|
|
86
|
+
>
|
|
87
|
+
<a @click.prevent.stop="showFullData = true">
|
|
88
|
+
<ellipsis-icon />
|
|
89
|
+
<json-show-modal
|
|
90
|
+
:open="showFullData"
|
|
91
|
+
@closemodal="showFullData = false"
|
|
92
|
+
:editor-title="cellTitle"
|
|
93
|
+
:editor-content="obj"
|
|
94
|
+
/>
|
|
95
|
+
</a>
|
|
96
|
+
</tag>
|
|
97
|
+
</tags>
|
|
98
|
+
<p v-else>-</p>
|
|
99
|
+
</span>
|
|
100
|
+
</template>
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent, ref } from "vue";
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
title?: string;
|
|
6
|
+
value?: Record<string, unknown> | string;
|
|
7
|
+
print?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
withDefaults(defineProps<Props>(), {
|
|
11
|
+
title: "",
|
|
12
|
+
value: "",
|
|
13
|
+
print: "",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const JsonShowModal = defineAsyncComponent(
|
|
17
|
+
() => import("../../modals/JsonShowModal.vue")
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
const showModal = ref(false);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
1
23
|
<template>
|
|
2
24
|
<a @click.prevent.stop="showModal = true">
|
|
3
25
|
{{ print }}
|
|
@@ -10,34 +32,3 @@
|
|
|
10
32
|
/>
|
|
11
33
|
</a>
|
|
12
34
|
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
16
|
-
|
|
17
|
-
export default defineComponent({
|
|
18
|
-
props: {
|
|
19
|
-
title: {
|
|
20
|
-
type: String,
|
|
21
|
-
default: "",
|
|
22
|
-
},
|
|
23
|
-
value: {
|
|
24
|
-
type: null,
|
|
25
|
-
default: "",
|
|
26
|
-
},
|
|
27
|
-
print: {
|
|
28
|
-
type: String,
|
|
29
|
-
default: "",
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
components: {
|
|
33
|
-
JsonShowModal: defineAsyncComponent(() =>
|
|
34
|
-
import("../../modals/JsonShowModal.vue").then((module) => module.default)
|
|
35
|
-
),
|
|
36
|
-
},
|
|
37
|
-
data() {
|
|
38
|
-
return {
|
|
39
|
-
showModal: false,
|
|
40
|
-
};
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
</script>
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent } from "vue";
|
|
3
|
+
|
|
4
|
+
const TabsBody = defineAsyncComponent(() => import("../tab/TabsBody.vue"));
|
|
5
|
+
const Tabs = defineAsyncComponent(() => import("../tab/Tabs.vue"));
|
|
6
|
+
const TabItem = defineAsyncComponent(() => import("../tab/TabItem.vue"));
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
activeTab?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
withDefaults(defineProps<Props>(), {
|
|
13
|
+
activeTab: "",
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
defineEmits(["tabchange"]);
|
|
17
|
+
</script>
|
|
18
|
+
|
|
1
19
|
<template>
|
|
2
20
|
<tabs-body class="mt-10">
|
|
3
21
|
<tabs class="is-line">
|
|
@@ -10,27 +28,3 @@
|
|
|
10
28
|
</tabs>
|
|
11
29
|
</tabs-body>
|
|
12
30
|
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
16
|
-
export default defineComponent({
|
|
17
|
-
props: {
|
|
18
|
-
activeTab: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
emits: ["tabchange"],
|
|
24
|
-
components: {
|
|
25
|
-
TabsBody: defineAsyncComponent(() =>
|
|
26
|
-
import("../../v2/tab/TabsBody.vue").then((module) => module.default)
|
|
27
|
-
),
|
|
28
|
-
Tabs: defineAsyncComponent(() =>
|
|
29
|
-
import("../../v2/tab/Tabs.vue").then((module) => module.default)
|
|
30
|
-
),
|
|
31
|
-
TabItem: defineAsyncComponent(() =>
|
|
32
|
-
import("../tab/TabItem.vue").then((module) => module.default)
|
|
33
|
-
),
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
</script>
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
interface Props {
|
|
3
|
+
modifierClasses?: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
withDefaults(defineProps<Props>(), {
|
|
7
|
+
modifierClasses: "",
|
|
8
|
+
});
|
|
9
|
+
</script>
|
|
10
|
+
|
|
1
11
|
<template>
|
|
2
12
|
<div class="tag" :class="modifierClasses">
|
|
3
13
|
<slot />
|
|
4
14
|
</div>
|
|
5
15
|
</template>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
type: String,
|
|
13
|
-
default: "",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
</script>
|
|
16
|
+
<style lang="scss" scoped>
|
|
17
|
+
.tag {
|
|
18
|
+
line-height: 1;
|
|
19
|
+
font-size: 11px;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// color
|
|
2
|
-
$ac-info: $ac-blue;
|
|
3
|
-
$ac-success: $ac-primary;
|
|
4
|
-
$ac-warning: $ac-yellow;
|
|
5
|
-
$ac-danger: $ac-red;
|
|
6
|
-
|
|
7
|
-
// Text colors
|
|
8
|
-
$ac-color-text: var(--ac-text);
|
|
9
|
-
$ac-color-heading: var(--ac-text-heading);
|
|
10
|
-
|
|
11
|
-
// Link colors
|
|
12
|
-
$ac-link: $ac-blue;
|
|
13
|
-
$ac-link-visited: $ac-purple;
|
|
14
|
-
|
|
15
|
-
// Box Shadow
|
|
16
|
-
$ac-shadow-1: 0 1px 4px rgba(26, 80, 151, 0.16);
|
|
17
|
-
$ac-shadow-2: 0px 8px 57px rgba(0, 0, 0, 0.16);
|
|
18
|
-
$ac-shadow-3: 0 3px 4px 0 rgba(0, 0, 0, 0.18),
|
|
19
|
-
0 3px 3px -2px rgba(0, 0, 0, 0.16), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
|
|
20
|
-
|
|
21
|
-
$ac-shadow-sm: 0 1px 4px rgba(26, 80, 151, 0.16);
|
|
22
|
-
$ac-shadow-xl: 0px 8px 57px rgba(0, 0, 0, 0.16);
|
|
23
|
-
$ac-shadow-lg: 0 3px 4px 0 rgba(0, 0, 0, 0.18),
|
|
24
|
-
0 3px 3px -2px rgba(0, 0, 0, 0.16), 0 1px 6px 0 rgba(0, 0, 0, 0.12);
|
|
25
|
-
|