@appscode/design-system 1.1.0-alpha.8 → 1.1.0-beta.2
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/_all.scss +1 -1
- package/base/utilities/_default.scss +41 -41
- package/base/utilities/_derived-variables.scss +8 -9
- package/base/utilities/_extended.scss +9 -5
- package/base/utilities/_initial-variables.scss +52 -50
- package/base/utilities/_mixin.scss +11 -11
- package/base/utilities/_typography.scss +22 -22
- package/base/utilities/dark-theme.scss +1 -1
- package/components/_ac-accordion.scss +6 -6
- package/components/_ac-alert-box.scss +27 -28
- package/components/_ac-calendar.scss +4 -4
- package/components/_ac-card.scss +55 -55
- package/components/_ac-code-highlight.scss +6 -6
- package/components/_ac-content-layout.scss +165 -165
- package/components/_ac-drag.scss +11 -11
- package/components/_ac-input.scss +85 -85
- package/components/_ac-modal.scss +8 -8
- package/components/_ac-multi-select.scss +751 -751
- package/components/_ac-options.scss +12 -13
- package/components/_ac-select-box.scss +5 -5
- package/components/_ac-table.scss +55 -55
- package/components/_ac-tabs.scss +36 -36
- package/components/_ac-tags.scss +22 -22
- package/components/_ac-terminal.scss +253 -253
- package/components/_add-card.scss +3 -3
- package/components/_app-drawer.scss +4 -4
- package/components/_basic-card.scss +108 -114
- package/components/_breadcumb.scss +5 -5
- package/components/_buttons.scss +64 -64
- package/components/_card-body-wrapper.scss +5 -5
- package/components/_dashboard-header.scss +29 -29
- package/components/_direct-deploy.scss +8 -8
- package/components/_go-to-top.scss +1 -1
- package/components/_image-upload.scss +3 -3
- package/components/_left-sidebar-menu.scss +374 -376
- package/components/_monaco-editor.scss +1 -1
- package/components/_navbar.scss +65 -65
- package/components/_nested-list.scss +1 -1
- package/components/_overview-info.scss +7 -7
- package/components/_overview-page.scss +4 -4
- package/components/_pagination.scss +110 -110
- package/components/_payment-card.scss +20 -20
- package/components/_preloader.scss +1 -1
- package/components/_preview-modal.scss +18 -18
- package/components/_pricing-table.scss +10 -10
- package/components/_progress-bar.scss +12 -12
- package/components/_subscription-card.scss +14 -14
- package/components/_table-of-content.scss +4 -4
- package/components/_tfa.scss +9 -9
- package/components/_widget-menu.scss +17 -17
- package/components/_wizard.scss +82 -82
- package/components/ac-toaster/_ac-toasted.scss +1 -1
- package/components/bbum/_activities-header.scss +1 -1
- package/components/bbum/_card-team.scss +12 -12
- package/components/bbum/_information-center.scss +13 -13
- package/components/bbum/_left-sidebar.scss +8 -8
- package/components/bbum/_mobile-desktop.scss +7 -7
- package/components/bbum/_post.scss +5 -5
- package/components/bbum/_sign-up-notification.scss +10 -10
- package/components/bbum/_single-post-preview.scss +21 -21
- package/components/bbum/_user-profile.scss +10 -10
- package/components/ui-builder/_ui-builder.scss +15 -15
- package/components/ui-builder/_vue-open-api.scss +2 -2
- package/layouts/_code-preview.scss +11 -11
- package/package.json +1 -1
- package/vue-components/plugins/time-convert.js +49 -0
- package/vue-components/text.vue +1 -0
- package/vue-components/types/cluster.ts +6 -0
- package/vue-components/types/longRunningTasks.ts +20 -0
- package/vue-components/types/notification.ts +6 -0
- package/vue-components/types/previewYaml.ts +8 -0
- package/vue-components/types/table.ts +54 -0
- package/vue-components/types/theme.ts +10 -0
- package/vue-components/types/user.ts +22 -0
- package/vue-components/v2/card/OverviewCards.vue +17 -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 +0 -5
- 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 +65 -0
- package/vue-components/v2/sidebar/SidebarItem.vue +10 -7
- package/vue-components/v3/accordion/Accordion.vue +151 -0
- 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 +104 -0
- package/vue-components/v3/button/Button.vue +831 -58
- package/vue-components/v3/button/Buttons.vue +6 -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 +150 -0
- package/vue-components/v3/cards/Counter.vue +27 -0
- package/vue-components/v3/cards/FeatureCard.vue +40 -0
- package/vue-components/v3/cards/FeatureCards.vue +6 -0
- package/vue-components/v3/cards/InfoCard.vue +248 -0
- package/vue-components/v3/cards/Monitoring.vue +94 -0
- package/vue-components/v3/cards/OverviewCard.vue +24 -0
- package/vue-components/v3/cards/OverviewCards.vue +31 -0
- package/vue-components/v3/cards/Payment.vue +62 -0
- package/vue-components/v3/cards/Vendor.vue +23 -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 +37 -61
- 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 +100 -113
- package/vue-components/v3/editor/FilteredFileEditor.vue +124 -127
- package/vue-components/v3/editor/ResourceKeyValueEditor.vue +70 -94
- package/vue-components/v3/footer/FooterArea.vue +34 -0
- package/vue-components/v3/footer/FooterItem.vue +29 -0
- package/vue-components/v3/footer/FooterItems.vue +15 -0
- package/vue-components/v3/footer/Info.vue +23 -0
- package/vue-components/v3/footer/Status.vue +42 -0
- package/vue-components/v3/footer/Usage.vue +44 -0
- package/vue-components/v3/form/Form.vue +24 -33
- 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 +520 -0
- package/vue-components/v3/form-fields/Input.vue +19 -14
- package/vue-components/v3/header/Header.vue +117 -24
- 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/ResourceLoader.vue +4 -12
- package/vue-components/v3/loaders/SidebarLoader.vue +4 -12
- package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +17 -15
- package/vue-components/v3/modal/Modal.vue +292 -96
- package/vue-components/v3/modals/DeleteConfirmationModal.vue +37 -50
- package/vue-components/v3/modals/JsonShowModal.vue +62 -68
- package/vue-components/v3/modals/LongRunningTasksModal.vue +145 -143
- package/vue-components/v3/navbar/Appdrawer.vue +196 -51
- package/vue-components/v3/navbar/Navbar.vue +296 -0
- package/vue-components/v3/navbar/NavbarItem.vue +81 -0
- package/vue-components/v3/navbar/NavbarItemContent.vue +284 -0
- package/vue-components/v3/navbar/Notification.vue +179 -0
- package/vue-components/v3/navbar/ThemeMode.vue +128 -112
- package/vue-components/v3/navbar/User.vue +383 -268
- package/vue-components/v3/notification/AlertBox.vue +39 -42
- package/vue-components/v3/notification/Notification.vue +49 -43
- package/vue-components/v3/notification/NotificationItem.vue +51 -19
- package/vue-components/v3/option-dots/Options.vue +188 -0
- package/vue-components/v3/pagination/Pagination.vue +203 -99
- package/vue-components/v3/preloader/Preloader.vue +23 -0
- package/vue-components/v3/searchbars/SearchBar.vue +51 -34
- package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
- package/vue-components/v3/sidebar/ClusterSwitcher.vue +834 -81
- package/vue-components/v3/sidebar/Sidebar.vue +271 -0
- package/vue-components/v3/sidebar/SidebarBody.vue +7 -0
- package/vue-components/v3/sidebar/SidebarFooter.vue +80 -0
- package/vue-components/v3/sidebar/SidebarHeader.vue +124 -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/sidebar-tabs/SidebarTabs.vue +128 -0
- package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabsLayout.vue +29 -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 +9 -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 +85 -59
- package/vue-components/v3/table/MultiInfoTable.vue +72 -95
- package/vue-components/v3/table/Table.vue +582 -151
- package/vue-components/v3/table/TableCell.vue +20 -23
- package/vue-components/v3/table/TableContainer.vue +50 -28
- package/vue-components/v3/table/TableRow.vue +63 -85
- package/vue-components/v3/table/table-cell/ArrayCell.vue +67 -79
- package/vue-components/v3/table/table-cell/CellValue.vue +97 -103
- package/vue-components/v3/table/table-cell/GenericCell.vue +43 -42
- package/vue-components/v3/table/table-cell/ObjectCell.vue +67 -79
- 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 +15 -12
- package/vue-components/v3/tag/Tags.vue +7 -0
- package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +26 -23
- package/mixins/stickyContent.js +0 -141
- package/plugins/caching.ts +0 -243
|
@@ -1,3 +1,65 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed, defineAsyncComponent } from "vue";
|
|
3
|
+
import { useToast } from "vue-toastification";
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
open?: boolean;
|
|
7
|
+
editorTitle?: string;
|
|
8
|
+
editorContent?: Record<string, unknown> | string | Array<any>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
12
|
+
open: false,
|
|
13
|
+
editorTitle: "",
|
|
14
|
+
editorContent: () => ({}),
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const emit = defineEmits(["closemodal"]);
|
|
18
|
+
|
|
19
|
+
const Modal = defineAsyncComponent(() => import("./../modal/Modal.vue"));
|
|
20
|
+
const AcButton = defineAsyncComponent(() => import("./../button/Button.vue"));
|
|
21
|
+
const HeaderItem = defineAsyncComponent(
|
|
22
|
+
() => import("./../header/HeaderItem.vue")
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const Preloader = defineAsyncComponent(
|
|
26
|
+
() => import("./../preloader/Preloader.vue")
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const Banner = defineAsyncComponent(() => import("./../banner/Banner.vue"));
|
|
30
|
+
|
|
31
|
+
const Editor = defineAsyncComponent({
|
|
32
|
+
loader: () =>
|
|
33
|
+
import("./../editor/Editor.vue").then((module) => module.default),
|
|
34
|
+
loadingComponent: Preloader,
|
|
35
|
+
delay: 200,
|
|
36
|
+
errorComponent: Banner,
|
|
37
|
+
timeout: 100000,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const toast = useToast();
|
|
41
|
+
|
|
42
|
+
const parsedContent = computed(() => {
|
|
43
|
+
try {
|
|
44
|
+
return JSON.parse(props.editorContent as string);
|
|
45
|
+
} catch (e) {
|
|
46
|
+
return props.editorContent;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
const onCopy = () => {
|
|
51
|
+
toast.success("Value copied successfully", { timeout: 1000 });
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const onError = () => {
|
|
55
|
+
toast.error("Copying failed", { timeout: 1000 });
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const closeModal = () => {
|
|
59
|
+
emit("closemodal", true);
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
|
|
1
63
|
<template>
|
|
2
64
|
<modal
|
|
3
65
|
:title="editorTitle"
|
|
@@ -26,71 +88,3 @@
|
|
|
26
88
|
/>
|
|
27
89
|
</modal>
|
|
28
90
|
</template>
|
|
29
|
-
|
|
30
|
-
<script>
|
|
31
|
-
import { defineComponent, defineAsyncComponent } from "vue";
|
|
32
|
-
import { useToast } from "vue-toastification";
|
|
33
|
-
import Preloader from "../../v2/preloader/Preloader.vue";
|
|
34
|
-
import Banner from "../../v2/banner/Banner.vue";
|
|
35
|
-
|
|
36
|
-
export default defineComponent({
|
|
37
|
-
props: {
|
|
38
|
-
open: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
editorTitle: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: ""
|
|
45
|
-
},
|
|
46
|
-
editorContent: {
|
|
47
|
-
type: null,
|
|
48
|
-
default: () => ({})
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
emits: ["closemodal"],
|
|
52
|
-
components: {
|
|
53
|
-
Modal: defineAsyncComponent(() =>
|
|
54
|
-
import("../modal/Modal.vue").then(module => module.default)
|
|
55
|
-
),
|
|
56
|
-
Editor: defineAsyncComponent({
|
|
57
|
-
loader: () =>
|
|
58
|
-
import("../editor/Editor.vue").then(module => module.default),
|
|
59
|
-
loadingComponent: Preloader,
|
|
60
|
-
delay: 200,
|
|
61
|
-
errorComponent: Banner,
|
|
62
|
-
timeout: 100000,
|
|
63
|
-
}),
|
|
64
|
-
AcButton: defineAsyncComponent(() =>
|
|
65
|
-
import("../button/Button.vue").then(module => module.default)
|
|
66
|
-
),
|
|
67
|
-
HeaderItem: defineAsyncComponent(() =>
|
|
68
|
-
import("../../v2/header/HeaderItem.vue").then(module => module.default)
|
|
69
|
-
)
|
|
70
|
-
},
|
|
71
|
-
computed: {
|
|
72
|
-
parsedContent() {
|
|
73
|
-
try {
|
|
74
|
-
return JSON.parse(this.editorContent);
|
|
75
|
-
} catch (e) {
|
|
76
|
-
return this.editorContent;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
setup() {
|
|
81
|
-
const toast = useToast();
|
|
82
|
-
return { toast };
|
|
83
|
-
},
|
|
84
|
-
methods: {
|
|
85
|
-
onCopy() {
|
|
86
|
-
this.toast.success("Value copied successfully", { timeout: 1000 });
|
|
87
|
-
},
|
|
88
|
-
onError() {
|
|
89
|
-
this.toast.error("Copying failed", { timeout: 1000 });
|
|
90
|
-
},
|
|
91
|
-
closeModal() {
|
|
92
|
-
this.$emit("closemodal", true);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
</script>
|
|
@@ -1,119 +1,16 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<modal
|
|
3
|
-
:open="open"
|
|
4
|
-
:title="title"
|
|
5
|
-
:is-close-option-disabled="!enableModalClose"
|
|
6
|
-
:ignore-outside-click="true"
|
|
7
|
-
:hide-action-footer="!enableModalFooter"
|
|
8
|
-
@closemodal="$emit('close')"
|
|
9
|
-
>
|
|
10
|
-
<div v-if="connectionError" class="task-simple-wrapper">
|
|
11
|
-
<div class="task-cogs-icon">
|
|
12
|
-
<i class="fa fa-times-circle has-text-danger fa-5x fa-fw"></i>
|
|
13
|
-
</div>
|
|
14
|
-
<div class="task-log">
|
|
15
|
-
<span class="task-title">
|
|
16
|
-
<i class="fa fa-times-circle mr-5 is-failed" />
|
|
17
|
-
<span> Connection error </span>
|
|
18
|
-
</span>
|
|
19
|
-
<span>{{ connectionError }}</span>
|
|
20
|
-
</div>
|
|
21
|
-
</div>
|
|
22
|
-
<div
|
|
23
|
-
v-else-if="isNatsConnectionLoading || !activeStepId"
|
|
24
|
-
class="is-justify-content-center"
|
|
25
|
-
:class="simple ? 'task-simple-wrapper' : 'task-complex-wrapper'"
|
|
26
|
-
>
|
|
27
|
-
<preloader
|
|
28
|
-
:style="{ height: '100%' }"
|
|
29
|
-
class="is-fullheight"
|
|
30
|
-
message="Connecting..."
|
|
31
|
-
/>
|
|
32
|
-
</div>
|
|
33
|
-
<div v-else-if="simple" class="task-simple-wrapper">
|
|
34
|
-
<div class="task-cogs-icon">
|
|
35
|
-
<i class="fa fa-cog fa-spin fa-5x fa-fw"></i>
|
|
36
|
-
<span class="is-flex is-flex-direction-column">
|
|
37
|
-
<i class="fa fa-cog fa-spin fa-3x fa-bw"></i>
|
|
38
|
-
<i class="fa fa-cog fa-spin fa-3x fa-bw"></i>
|
|
39
|
-
</span>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="task-log">
|
|
42
|
-
<span class="task-title">
|
|
43
|
-
<i
|
|
44
|
-
v-if="activeTask?.status === 'Running'"
|
|
45
|
-
class="fa fa-circle-o-notch fa-spin mr-5"
|
|
46
|
-
/>
|
|
47
|
-
<i
|
|
48
|
-
v-else-if="activeTask?.status === 'Success'"
|
|
49
|
-
class="fa fa-check-circle mr-5 is-success"
|
|
50
|
-
/>
|
|
51
|
-
<i
|
|
52
|
-
v-else-if="activeTask?.status === 'Failed'"
|
|
53
|
-
class="fa fa-times-circle mr-5 is-failed"
|
|
54
|
-
/>
|
|
55
|
-
<span>
|
|
56
|
-
{{ activeTask?.step }}
|
|
57
|
-
</span>
|
|
58
|
-
</span>
|
|
59
|
-
<span>{{ activeTask?.logs[activeTask?.logs.length - 1] }}</span>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
<div v-else class="task-complex-wrapper">
|
|
63
|
-
<ul class="task-list">
|
|
64
|
-
<li v-for="task in tasks" :key="task.step">
|
|
65
|
-
<long-running-task-item
|
|
66
|
-
:title="task.step"
|
|
67
|
-
:status="task.status"
|
|
68
|
-
:class="{ 'is-active': activeStepId === task.id }"
|
|
69
|
-
@click="activeStepId = task.id"
|
|
70
|
-
/>
|
|
71
|
-
</li>
|
|
72
|
-
</ul>
|
|
73
|
-
<long-running-task-terminal
|
|
74
|
-
:key="activeTask?.id"
|
|
75
|
-
:theme="theme"
|
|
76
|
-
:logs="activeTask?.logs"
|
|
77
|
-
class="task-log"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<template #modal-footer-controls>
|
|
82
|
-
<ac-button
|
|
83
|
-
title="Close"
|
|
84
|
-
modifier-classes="is-outlined"
|
|
85
|
-
@click.stop="$emit('close')"
|
|
86
|
-
/>
|
|
87
|
-
<ac-button
|
|
88
|
-
v-if="showSuccessButton"
|
|
89
|
-
:title="successCtx?.btnTitle"
|
|
90
|
-
:is-loader-active="successCtx?.isLoaderActive"
|
|
91
|
-
modifier-classes="is-primary"
|
|
92
|
-
icon-class="step-forward"
|
|
93
|
-
@click="successCtx.onSuccessBtnClick"
|
|
94
|
-
/>
|
|
95
|
-
<ac-button
|
|
96
|
-
v-if="showReportButton"
|
|
97
|
-
title="Report Issue"
|
|
98
|
-
modifier-classes="is-danger"
|
|
99
|
-
icon-class="external-link"
|
|
100
|
-
@click="onReportIssueClick"
|
|
101
|
-
/>
|
|
102
|
-
</template>
|
|
103
|
-
</modal>
|
|
104
|
-
</template>
|
|
105
1
|
<script setup lang="ts">
|
|
106
2
|
import {
|
|
107
3
|
computed,
|
|
108
4
|
getCurrentInstance,
|
|
109
5
|
onBeforeUnmount,
|
|
110
|
-
Ref,
|
|
111
6
|
toRefs,
|
|
112
7
|
watch,
|
|
113
8
|
} from "vue";
|
|
9
|
+
import type { Ref } from "vue";
|
|
114
10
|
import { defineAsyncComponent, ref } from "vue";
|
|
115
|
-
import { Task, TaskLog } from "
|
|
116
|
-
import {
|
|
11
|
+
import type { Task, TaskLog } from "../../types/longRunningTasks";
|
|
12
|
+
import { StringCodec } from "nats.ws";
|
|
13
|
+
import type { Subscription } from "nats.ws";
|
|
117
14
|
|
|
118
15
|
const Modal = defineAsyncComponent(() => import("../modal/Modal.vue"));
|
|
119
16
|
const LongRunningTaskItem = defineAsyncComponent(
|
|
@@ -129,36 +26,35 @@ const AcButton = defineAsyncComponent(() => import("../button/Button.vue"));
|
|
|
129
26
|
|
|
130
27
|
defineEmits(["close"]);
|
|
131
28
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
);
|
|
29
|
+
interface Props {
|
|
30
|
+
open?: boolean;
|
|
31
|
+
theme?: string;
|
|
32
|
+
title?: string;
|
|
33
|
+
simple?: boolean;
|
|
34
|
+
natsSubject?: string;
|
|
35
|
+
isNatsConnectionLoading?: boolean;
|
|
36
|
+
errorCtx?: {
|
|
37
|
+
connectionError: string;
|
|
38
|
+
onError: (msg: string) => void;
|
|
39
|
+
};
|
|
40
|
+
successCtx?: {
|
|
41
|
+
btnTitle?: string;
|
|
42
|
+
isLoaderActive?: boolean;
|
|
43
|
+
onSuccess: () => void;
|
|
44
|
+
onSuccessBtnClick?: () => void;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
49
|
+
open: true,
|
|
50
|
+
theme: "light",
|
|
51
|
+
simple: true,
|
|
52
|
+
title: "Sample title",
|
|
53
|
+
natsSubject: "",
|
|
54
|
+
isNatsConnectionLoading: false,
|
|
55
|
+
errorCtx: undefined,
|
|
56
|
+
successCtx: undefined,
|
|
57
|
+
});
|
|
162
58
|
|
|
163
59
|
const { natsSubject, open, errorCtx, successCtx } = toRefs(props);
|
|
164
60
|
const connectionError = computed(() => errorCtx.value?.connectionError);
|
|
@@ -189,7 +85,7 @@ function handleTaskLog(log: TaskLog) {
|
|
|
189
85
|
const latestStepIndex = tasks.value.length - 1;
|
|
190
86
|
|
|
191
87
|
// map taskid to stepIndex
|
|
192
|
-
idToStepIndex.value[log.id] = latestStepIndex;
|
|
88
|
+
idToStepIndex.value[log.id as string] = latestStepIndex;
|
|
193
89
|
|
|
194
90
|
// update active step index for first task
|
|
195
91
|
// or if current active step is in latest step
|
|
@@ -197,16 +93,16 @@ function handleTaskLog(log: TaskLog) {
|
|
|
197
93
|
latestStepIndex === 0 ||
|
|
198
94
|
latestStepIndex === idToStepIndex.value[activeStepId.value] + 1
|
|
199
95
|
) {
|
|
200
|
-
activeStepId.value = log.id;
|
|
96
|
+
activeStepId.value = log.id as string;
|
|
201
97
|
}
|
|
202
98
|
} else {
|
|
203
99
|
// get active task
|
|
204
|
-
const task = tasks.value[idToStepIndex.value[log.id]];
|
|
100
|
+
const task = tasks.value[idToStepIndex.value[log.id as string]];
|
|
205
101
|
if (task) {
|
|
206
102
|
task.status = log.status;
|
|
207
103
|
if (log.status === "Failed") {
|
|
208
104
|
task.logs.push(log.error || "");
|
|
209
|
-
errorCtx.value?.onError(log
|
|
105
|
+
errorCtx.value?.onError(log?.error || "");
|
|
210
106
|
} else {
|
|
211
107
|
task.logs.push(log.msg || "");
|
|
212
108
|
}
|
|
@@ -221,6 +117,7 @@ async function subscribeToChannel(channelId: string) {
|
|
|
221
117
|
|
|
222
118
|
if (subscription) {
|
|
223
119
|
// listen to channel events
|
|
120
|
+
//@ts-ignore
|
|
224
121
|
for await (const msg of subscription) {
|
|
225
122
|
console.log("Long Running Tasks Modal=>");
|
|
226
123
|
console.log({ data: StringCodec().decode(msg.data) });
|
|
@@ -295,7 +192,7 @@ const getReportIssueInfo = (): { title: string; body: string } => {
|
|
|
295
192
|
tasks.value.forEach((task) => {
|
|
296
193
|
// if this taskLog is error task, push it to array
|
|
297
194
|
if (task.error) {
|
|
298
|
-
stepTitlesFromErrorTasks.push(task?.step);
|
|
195
|
+
stepTitlesFromErrorTasks.push(task?.step || "");
|
|
299
196
|
stepLogsFromErrorTasks.push(task?.logs[task?.logs?.length - 1] || "");
|
|
300
197
|
}
|
|
301
198
|
});
|
|
@@ -328,13 +225,118 @@ const showSuccessButton = computed(
|
|
|
328
225
|
// execute on success and on error functions
|
|
329
226
|
watch(longRunningTaskStatus, (n) => {
|
|
330
227
|
if (n === "Success") {
|
|
331
|
-
successCtx.value
|
|
228
|
+
successCtx.value?.onSuccess();
|
|
332
229
|
} else if (n === "Failed") {
|
|
333
230
|
errorCtx.value?.onError("Operation Failed");
|
|
334
231
|
}
|
|
335
232
|
});
|
|
336
233
|
</script>
|
|
337
234
|
|
|
235
|
+
<template>
|
|
236
|
+
<modal
|
|
237
|
+
:open="open"
|
|
238
|
+
:title="title"
|
|
239
|
+
:is-close-option-disabled="!enableModalClose"
|
|
240
|
+
:ignore-outside-click="true"
|
|
241
|
+
:hide-action-footer="!enableModalFooter"
|
|
242
|
+
@closemodal="$emit('close')"
|
|
243
|
+
>
|
|
244
|
+
<div v-if="connectionError" class="task-simple-wrapper">
|
|
245
|
+
<div class="task-cogs-icon">
|
|
246
|
+
<i class="fa fa-times-circle has-text-danger fa-5x fa-fw"></i>
|
|
247
|
+
</div>
|
|
248
|
+
<div class="task-log">
|
|
249
|
+
<span class="task-title">
|
|
250
|
+
<i class="fa fa-times-circle mr-5 is-failed" />
|
|
251
|
+
<span> Connection error </span>
|
|
252
|
+
</span>
|
|
253
|
+
<span>{{ connectionError }}</span>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
<div
|
|
257
|
+
v-else-if="isNatsConnectionLoading || !activeStepId"
|
|
258
|
+
class="is-justify-content-center"
|
|
259
|
+
:class="simple ? 'task-simple-wrapper' : 'task-complex-wrapper'"
|
|
260
|
+
>
|
|
261
|
+
<preloader
|
|
262
|
+
:style="{ height: '100%' }"
|
|
263
|
+
class="is-fullheight"
|
|
264
|
+
message="Connecting..."
|
|
265
|
+
/>
|
|
266
|
+
</div>
|
|
267
|
+
<div v-else-if="simple" class="task-simple-wrapper">
|
|
268
|
+
<div class="task-cogs-icon">
|
|
269
|
+
<i class="fa fa-cog fa-spin fa-5x fa-fw"></i>
|
|
270
|
+
<span class="is-flex is-flex-direction-column">
|
|
271
|
+
<i class="fa fa-cog fa-spin fa-3x fa-bw"></i>
|
|
272
|
+
<i class="fa fa-cog fa-spin fa-3x fa-bw"></i>
|
|
273
|
+
</span>
|
|
274
|
+
</div>
|
|
275
|
+
<div class="task-log">
|
|
276
|
+
<span class="task-title">
|
|
277
|
+
<i
|
|
278
|
+
v-if="activeTask?.status === 'Running'"
|
|
279
|
+
class="fa fa-circle-o-notch fa-spin mr-5"
|
|
280
|
+
/>
|
|
281
|
+
<i
|
|
282
|
+
v-else-if="activeTask?.status === 'Success'"
|
|
283
|
+
class="fa fa-check-circle mr-5 is-success"
|
|
284
|
+
/>
|
|
285
|
+
<i
|
|
286
|
+
v-else-if="activeTask?.status === 'Failed'"
|
|
287
|
+
class="fa fa-times-circle mr-5 is-failed"
|
|
288
|
+
/>
|
|
289
|
+
<span>
|
|
290
|
+
{{ activeTask?.step }}
|
|
291
|
+
</span>
|
|
292
|
+
</span>
|
|
293
|
+
<span>{{ activeTask?.logs[activeTask?.logs.length - 1] }}</span>
|
|
294
|
+
</div>
|
|
295
|
+
</div>
|
|
296
|
+
<div v-else class="task-complex-wrapper">
|
|
297
|
+
<ul class="task-list">
|
|
298
|
+
<li v-for="task in tasks" :key="task.step">
|
|
299
|
+
<long-running-task-item
|
|
300
|
+
:title="task.step"
|
|
301
|
+
:status="task.status"
|
|
302
|
+
:class="{ 'is-active': activeStepId === task.id }"
|
|
303
|
+
@click="activeStepId = task.id as string"
|
|
304
|
+
/>
|
|
305
|
+
</li>
|
|
306
|
+
</ul>
|
|
307
|
+
<long-running-task-terminal
|
|
308
|
+
:key="activeTask?.id"
|
|
309
|
+
:theme="theme"
|
|
310
|
+
:logs="activeTask?.logs"
|
|
311
|
+
class="task-log"
|
|
312
|
+
/>
|
|
313
|
+
</div>
|
|
314
|
+
|
|
315
|
+
<template #modal-footer-controls>
|
|
316
|
+
<ac-button
|
|
317
|
+
title="Close"
|
|
318
|
+
modifier-classes="is-outlined"
|
|
319
|
+
@click.stop="$emit('close')"
|
|
320
|
+
/>
|
|
321
|
+
<ac-button
|
|
322
|
+
v-if="showSuccessButton"
|
|
323
|
+
:title="successCtx?.btnTitle"
|
|
324
|
+
:is-loader-active="successCtx?.isLoaderActive"
|
|
325
|
+
modifier-classes="is-primary"
|
|
326
|
+
icon-class="step-forward"
|
|
327
|
+
@click="successCtx?.onSuccessBtnClick"
|
|
328
|
+
/>
|
|
329
|
+
<ac-button
|
|
330
|
+
v-if="showReportButton"
|
|
331
|
+
title="Report Issue"
|
|
332
|
+
modifier-classes="is-danger"
|
|
333
|
+
icon-class="external-link"
|
|
334
|
+
@click="onReportIssueClick"
|
|
335
|
+
/>
|
|
336
|
+
</template>
|
|
337
|
+
</modal>
|
|
338
|
+
</template>
|
|
339
|
+
|
|
338
340
|
<style scoped lang="scss">
|
|
339
341
|
.task-simple-wrapper {
|
|
340
342
|
display: flex;
|