@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.
Files changed (186) hide show
  1. package/base/utilities/_all.scss +1 -1
  2. package/base/utilities/_default.scss +41 -41
  3. package/base/utilities/_derived-variables.scss +8 -9
  4. package/base/utilities/_extended.scss +9 -5
  5. package/base/utilities/_initial-variables.scss +52 -50
  6. package/base/utilities/_mixin.scss +11 -11
  7. package/base/utilities/_typography.scss +22 -22
  8. package/base/utilities/dark-theme.scss +1 -1
  9. package/components/_ac-accordion.scss +6 -6
  10. package/components/_ac-alert-box.scss +27 -28
  11. package/components/_ac-calendar.scss +4 -4
  12. package/components/_ac-card.scss +55 -55
  13. package/components/_ac-code-highlight.scss +6 -6
  14. package/components/_ac-content-layout.scss +165 -165
  15. package/components/_ac-drag.scss +11 -11
  16. package/components/_ac-input.scss +85 -85
  17. package/components/_ac-modal.scss +8 -8
  18. package/components/_ac-multi-select.scss +751 -751
  19. package/components/_ac-options.scss +12 -13
  20. package/components/_ac-select-box.scss +5 -5
  21. package/components/_ac-table.scss +55 -55
  22. package/components/_ac-tabs.scss +36 -36
  23. package/components/_ac-tags.scss +22 -22
  24. package/components/_ac-terminal.scss +253 -253
  25. package/components/_add-card.scss +3 -3
  26. package/components/_app-drawer.scss +4 -4
  27. package/components/_basic-card.scss +108 -114
  28. package/components/_breadcumb.scss +5 -5
  29. package/components/_buttons.scss +64 -64
  30. package/components/_card-body-wrapper.scss +5 -5
  31. package/components/_dashboard-header.scss +29 -29
  32. package/components/_direct-deploy.scss +8 -8
  33. package/components/_go-to-top.scss +1 -1
  34. package/components/_image-upload.scss +3 -3
  35. package/components/_left-sidebar-menu.scss +374 -376
  36. package/components/_monaco-editor.scss +1 -1
  37. package/components/_navbar.scss +65 -65
  38. package/components/_nested-list.scss +1 -1
  39. package/components/_overview-info.scss +7 -7
  40. package/components/_overview-page.scss +4 -4
  41. package/components/_pagination.scss +110 -110
  42. package/components/_payment-card.scss +20 -20
  43. package/components/_preloader.scss +1 -1
  44. package/components/_preview-modal.scss +18 -18
  45. package/components/_pricing-table.scss +10 -10
  46. package/components/_progress-bar.scss +12 -12
  47. package/components/_subscription-card.scss +14 -14
  48. package/components/_table-of-content.scss +4 -4
  49. package/components/_tfa.scss +9 -9
  50. package/components/_widget-menu.scss +17 -17
  51. package/components/_wizard.scss +82 -82
  52. package/components/ac-toaster/_ac-toasted.scss +1 -1
  53. package/components/bbum/_activities-header.scss +1 -1
  54. package/components/bbum/_card-team.scss +12 -12
  55. package/components/bbum/_information-center.scss +13 -13
  56. package/components/bbum/_left-sidebar.scss +8 -8
  57. package/components/bbum/_mobile-desktop.scss +7 -7
  58. package/components/bbum/_post.scss +5 -5
  59. package/components/bbum/_sign-up-notification.scss +10 -10
  60. package/components/bbum/_single-post-preview.scss +21 -21
  61. package/components/bbum/_user-profile.scss +10 -10
  62. package/components/ui-builder/_ui-builder.scss +15 -15
  63. package/components/ui-builder/_vue-open-api.scss +2 -2
  64. package/layouts/_code-preview.scss +11 -11
  65. package/package.json +1 -1
  66. package/vue-components/plugins/time-convert.js +49 -0
  67. package/vue-components/text.vue +1 -0
  68. package/vue-components/types/cluster.ts +6 -0
  69. package/vue-components/types/longRunningTasks.ts +20 -0
  70. package/vue-components/types/notification.ts +6 -0
  71. package/vue-components/types/previewYaml.ts +8 -0
  72. package/vue-components/types/table.ts +54 -0
  73. package/vue-components/types/theme.ts +10 -0
  74. package/vue-components/types/user.ts +22 -0
  75. package/vue-components/v2/card/OverviewCards.vue +17 -2
  76. package/vue-components/v2/editor/ResourceKeyValueEditor.vue +21 -21
  77. package/vue-components/v2/icons/Ellipsis.vue +2 -1
  78. package/vue-components/v2/modal/Modal.vue +0 -5
  79. package/vue-components/v2/navbar/Appdrawer.vue +37 -12
  80. package/vue-components/v2/navbar/Navbar.vue +3 -3
  81. package/vue-components/v2/navbar/NavbarItem.vue +3 -1
  82. package/vue-components/v2/navbar/NavbarItemContent.vue +1 -1
  83. package/vue-components/v2/navbar/User.vue +5 -22
  84. package/vue-components/v2/pagination/Pagination.vue +65 -0
  85. package/vue-components/v2/sidebar/SidebarItem.vue +10 -7
  86. package/vue-components/v3/accordion/Accordion.vue +151 -0
  87. package/vue-components/v3/alert/Alert.vue +238 -0
  88. package/vue-components/v3/alert/Toast.vue +79 -0
  89. package/vue-components/v3/banner/Banner.vue +10 -0
  90. package/vue-components/v3/breadcrumbs/Breadcrumb.vue +104 -0
  91. package/vue-components/v3/button/Button.vue +831 -58
  92. package/vue-components/v3/button/Buttons.vue +6 -0
  93. package/vue-components/v3/button/DownloadBtn.vue +31 -0
  94. package/vue-components/v3/cards/Card.vue +32 -0
  95. package/vue-components/v3/cards/CardContent.vue +7 -0
  96. package/vue-components/v3/cards/CardHeader.vue +14 -0
  97. package/vue-components/v3/cards/Cards.vue +7 -0
  98. package/vue-components/v3/cards/Cluster.vue +150 -0
  99. package/vue-components/v3/cards/Counter.vue +27 -0
  100. package/vue-components/v3/cards/FeatureCard.vue +40 -0
  101. package/vue-components/v3/cards/FeatureCards.vue +6 -0
  102. package/vue-components/v3/cards/InfoCard.vue +248 -0
  103. package/vue-components/v3/cards/Monitoring.vue +94 -0
  104. package/vue-components/v3/cards/OverviewCard.vue +24 -0
  105. package/vue-components/v3/cards/OverviewCards.vue +31 -0
  106. package/vue-components/v3/cards/Payment.vue +62 -0
  107. package/vue-components/v3/cards/Vendor.vue +23 -0
  108. package/vue-components/v3/content/ContentHeader.vue +39 -30
  109. package/vue-components/v3/content/ContentLayout.vue +20 -0
  110. package/vue-components/v3/content/ContentTable.vue +37 -61
  111. package/vue-components/v3/dropdown/DropdownDivider.vue +2 -0
  112. package/vue-components/v3/dropdown/DropdownItem.vue +2 -0
  113. package/vue-components/v3/dropdown/DropdownMenu.vue +85 -91
  114. package/vue-components/v3/editor/Editor.vue +100 -113
  115. package/vue-components/v3/editor/FilteredFileEditor.vue +124 -127
  116. package/vue-components/v3/editor/ResourceKeyValueEditor.vue +70 -94
  117. package/vue-components/v3/footer/FooterArea.vue +34 -0
  118. package/vue-components/v3/footer/FooterItem.vue +29 -0
  119. package/vue-components/v3/footer/FooterItems.vue +15 -0
  120. package/vue-components/v3/footer/Info.vue +23 -0
  121. package/vue-components/v3/footer/Status.vue +42 -0
  122. package/vue-components/v3/footer/Usage.vue +44 -0
  123. package/vue-components/v3/form/Form.vue +24 -33
  124. package/vue-components/v3/form/FormFooterControl.vue +7 -0
  125. package/vue-components/v3/form/FormFooterControls.vue +7 -0
  126. package/vue-components/v3/form-fields/AcSingleInput.vue +520 -0
  127. package/vue-components/v3/form-fields/Input.vue +19 -14
  128. package/vue-components/v3/header/Header.vue +117 -24
  129. package/vue-components/v3/header/HeaderItem.vue +18 -0
  130. package/vue-components/v3/header/HeaderItems.vue +4 -0
  131. package/vue-components/v3/icons/Ellipsis.vue +2 -0
  132. package/vue-components/v3/loaders/ResourceLoader.vue +4 -12
  133. package/vue-components/v3/loaders/SidebarLoader.vue +4 -12
  134. package/vue-components/v3/long-running-tasks/LongRunningTaskItem.vue +17 -15
  135. package/vue-components/v3/modal/Modal.vue +292 -96
  136. package/vue-components/v3/modals/DeleteConfirmationModal.vue +37 -50
  137. package/vue-components/v3/modals/JsonShowModal.vue +62 -68
  138. package/vue-components/v3/modals/LongRunningTasksModal.vue +145 -143
  139. package/vue-components/v3/navbar/Appdrawer.vue +196 -51
  140. package/vue-components/v3/navbar/Navbar.vue +296 -0
  141. package/vue-components/v3/navbar/NavbarItem.vue +81 -0
  142. package/vue-components/v3/navbar/NavbarItemContent.vue +284 -0
  143. package/vue-components/v3/navbar/Notification.vue +179 -0
  144. package/vue-components/v3/navbar/ThemeMode.vue +128 -112
  145. package/vue-components/v3/navbar/User.vue +383 -268
  146. package/vue-components/v3/notification/AlertBox.vue +39 -42
  147. package/vue-components/v3/notification/Notification.vue +49 -43
  148. package/vue-components/v3/notification/NotificationItem.vue +51 -19
  149. package/vue-components/v3/option-dots/Options.vue +188 -0
  150. package/vue-components/v3/pagination/Pagination.vue +203 -99
  151. package/vue-components/v3/preloader/Preloader.vue +23 -0
  152. package/vue-components/v3/searchbars/SearchBar.vue +51 -34
  153. package/vue-components/v3/sidebar/AccentColorPicker.vue +97 -0
  154. package/vue-components/v3/sidebar/ClusterSwitcher.vue +834 -81
  155. package/vue-components/v3/sidebar/Sidebar.vue +271 -0
  156. package/vue-components/v3/sidebar/SidebarBody.vue +7 -0
  157. package/vue-components/v3/sidebar/SidebarFooter.vue +80 -0
  158. package/vue-components/v3/sidebar/SidebarHeader.vue +124 -0
  159. package/vue-components/v3/sidebar/SidebarItem.vue +62 -0
  160. package/vue-components/v3/sidebar/SidebarItemWithDropDown.vue +101 -104
  161. package/vue-components/v3/sidebar/SidebarMenuList.vue +9 -0
  162. package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabs.vue +128 -0
  163. package/vue-components/v3/sidebar/sidebar-tabs/SidebarTabsLayout.vue +29 -0
  164. package/vue-components/v3/sidebar/sidebar-tabs/TabsContent.vue +99 -0
  165. package/vue-components/v3/tab/TabItem.vue +10 -12
  166. package/vue-components/v3/tab/Tabs.vue +9 -0
  167. package/vue-components/v3/tab/TabsBody.vue +7 -0
  168. package/vue-components/v3/table/EmptyTableInfo.vue +8 -0
  169. package/vue-components/v3/table/FakeTableCell.vue +22 -31
  170. package/vue-components/v3/table/InfoTable.vue +85 -59
  171. package/vue-components/v3/table/MultiInfoTable.vue +72 -95
  172. package/vue-components/v3/table/Table.vue +582 -151
  173. package/vue-components/v3/table/TableCell.vue +20 -23
  174. package/vue-components/v3/table/TableContainer.vue +50 -28
  175. package/vue-components/v3/table/TableRow.vue +63 -85
  176. package/vue-components/v3/table/table-cell/ArrayCell.vue +67 -79
  177. package/vue-components/v3/table/table-cell/CellValue.vue +97 -103
  178. package/vue-components/v3/table/table-cell/GenericCell.vue +43 -42
  179. package/vue-components/v3/table/table-cell/ObjectCell.vue +67 -79
  180. package/vue-components/v3/table/table-cell/ValueWithModal.vue +22 -31
  181. package/vue-components/v3/tabs/EditorTabs.vue +18 -24
  182. package/vue-components/v3/tag/Tag.vue +15 -12
  183. package/vue-components/v3/tag/Tags.vue +7 -0
  184. package/vue-components/v3/terminal/LongRunningTaskTerminal.vue +26 -23
  185. package/mixins/stickyContent.js +0 -141
  186. 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 "../../../typings/long-running-tasks.ts";
116
- import { Subscription, StringCodec } from "nats.ws";
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
- const props = withDefaults(
133
- defineProps<{
134
- open: boolean;
135
- theme: string;
136
- title: string;
137
- simple: boolean;
138
- natsSubject: string;
139
- isNatsConnectionLoading: boolean;
140
- errorCtx?: {
141
- connectionError: string;
142
- onError: (msg: string) => void;
143
- };
144
- successCtx?: {
145
- btnTitle?: string;
146
- isLoaderActive?: boolean;
147
- onSuccess: () => void;
148
- onSuccessBtnClick?: () => void;
149
- };
150
- }>(),
151
- {
152
- open: true,
153
- theme: "light",
154
- simple: true,
155
- title: "Sample title",
156
- natsSubject: "",
157
- isNatsConnectionLoading: false,
158
- errorCtx: undefined,
159
- successCtx: undefined,
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.error);
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.onSuccess();
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;