fluency-v8-components 1.3.5 → 1.3.7

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 (178) hide show
  1. package/dist/fluency-v8-components.es.js +1 -1
  2. package/dist/fluency-v8-components.umd.js +99 -99
  3. package/dist/{index-q2NbjdVo.mjs → index-ChEFiXF5.mjs} +12 -11
  4. package/dist/{index.es-PAPL4E6Y.mjs → index.es-CjjN70eV.mjs} +1 -1
  5. package/package.json +3 -2
  6. package/src/assets/images/ai.svg +1 -0
  7. package/src/assets/images/github-dark.svg +1 -0
  8. package/src/assets/images/github.svg +1 -0
  9. package/src/assets/images/high-priority.svg +1 -0
  10. package/src/assets/images/power-off.svg +1 -0
  11. package/src/assets/images/save.svg +1 -0
  12. package/src/assets/index.ts +15 -0
  13. package/src/assets/main.css +495 -0
  14. package/src/assets/prism-theme.css +290 -0
  15. package/src/components/buttons/ActionButtons.vue +374 -0
  16. package/src/components/buttons/DropdownButton.vue +104 -0
  17. package/src/components/buttons/IconButton.vue +63 -0
  18. package/src/components/buttons/ImageButton.vue +16 -0
  19. package/src/components/buttons/MenuButton.vue +138 -0
  20. package/src/components/buttons/SubmitButtons.vue +51 -0
  21. package/src/components/buttons/TextButton.vue +40 -0
  22. package/src/components/charts/AlertChart.vue +376 -0
  23. package/src/components/charts/BarChart.vue +212 -0
  24. package/src/components/charts/BarChartHorizontal.vue +243 -0
  25. package/src/components/charts/CronChart.vue +146 -0
  26. package/src/components/charts/EmptyChart.vue +76 -0
  27. package/src/components/charts/GradientChart.vue +310 -0
  28. package/src/components/charts/LineChart.test.js +59 -0
  29. package/src/components/charts/LineChart.vue +434 -0
  30. package/src/components/charts/PieChart.vue +293 -0
  31. package/src/components/charts/ProgressChart.vue +106 -0
  32. package/src/components/charts/StackedChart.vue +364 -0
  33. package/src/components/charts/StackedChartClustered.vue +395 -0
  34. package/src/components/charts/TimelineChart.vue +215 -0
  35. package/src/components/charts/WorkflowChart.vue +520 -0
  36. package/src/components/common/AutoCompleteSearchBar.vue +100 -0
  37. package/src/components/common/AutoRefreshButton.vue +53 -0
  38. package/src/components/common/Breadcrumb.vue +45 -0
  39. package/src/components/common/ButtonToggle.vue +24 -0
  40. package/src/components/common/Card.vue +116 -0
  41. package/src/components/common/Carousel.vue +66 -0
  42. package/src/components/common/CategoryCard.vue +28 -0
  43. package/src/components/common/CodeEditor.vue +59 -0
  44. package/src/components/common/DatePicker.vue +21 -0
  45. package/src/components/common/DatePickerInput.vue +109 -0
  46. package/src/components/common/Dialog.vue +103 -0
  47. package/src/components/common/EditorHeading.vue +10 -0
  48. package/src/components/common/EventList.vue +41 -0
  49. package/src/components/common/Facet.vue +206 -0
  50. package/src/components/common/Feed.vue +58 -0
  51. package/src/components/common/Flag.vue +27 -0
  52. package/src/components/common/HomeCard.vue +20 -0
  53. package/src/components/common/ItemBox.vue +49 -0
  54. package/src/components/common/Loading.vue +19 -0
  55. package/src/components/common/LoadingDots.vue +12 -0
  56. package/src/components/common/PageHeading.vue +30 -0
  57. package/src/components/common/Pagination.vue +105 -0
  58. package/src/components/common/Popover.vue +24 -0
  59. package/src/components/common/PowerToggle.vue +130 -0
  60. package/src/components/common/ProgressBar.vue +33 -0
  61. package/src/components/common/RadioButtons.vue +52 -0
  62. package/src/components/common/Schedule.vue +79 -0
  63. package/src/components/common/SearchBar.vue +30 -0
  64. package/src/components/common/Separator.vue +3 -0
  65. package/src/components/common/Slideout.vue +95 -0
  66. package/src/components/common/Sort.vue +83 -0
  67. package/src/components/common/Table.vue +48 -0
  68. package/src/components/common/Tabs.vue +129 -0
  69. package/src/components/common/Tag.vue +53 -0
  70. package/src/components/common/Tooltip.vue +49 -0
  71. package/src/components/common/VerticalTabs.vue +34 -0
  72. package/src/components/common/card/CardItem.vue +27 -0
  73. package/src/components/common/card/CardItemGroup.vue +45 -0
  74. package/src/components/common/facet/Leaf.vue +97 -0
  75. package/src/components/common/facet/TriState.vue +37 -0
  76. package/src/components/common/table/TableData.vue +48 -0
  77. package/src/components/common/table/TableHeader.vue +21 -0
  78. package/src/components/dialogs/ChooseValueDialog.vue +97 -0
  79. package/src/components/dialogs/ConfirmDialog.vue +73 -0
  80. package/src/components/dialogs/CopyDialog.vue +51 -0
  81. package/src/components/dialogs/DownloadDialog.vue +48 -0
  82. package/src/components/dialogs/NameDescDialog.vue +74 -0
  83. package/src/components/dialogs/NameDialog.vue +56 -0
  84. package/src/components/dialogs/PopupEditor.vue +113 -0
  85. package/src/components/dialogs/ProgressDialog.vue +58 -0
  86. package/src/components/dialogs/ResetPasswordDialog.vue +58 -0
  87. package/src/components/dialogs/Wizard.vue +99 -0
  88. package/src/components/dialogs/wizard/Stepper.vue +31 -0
  89. package/src/components/form/CheckBox.vue +26 -0
  90. package/src/components/form/Editor.vue +93 -0
  91. package/src/components/form/FormCol.vue +19 -0
  92. package/src/components/form/FormRow.vue +19 -0
  93. package/src/components/form/FormSection.vue +21 -0
  94. package/src/components/form/GreyForm.vue +7 -0
  95. package/src/components/form/GreyInput.vue +51 -0
  96. package/src/components/form/GreyInputAutocomplete.vue +100 -0
  97. package/src/components/form/GreyInputCopy.vue +66 -0
  98. package/src/components/form/GreyInputGrow.vue +42 -0
  99. package/src/components/form/GreyInputToken.vue +78 -0
  100. package/src/components/form/GreyPassword.vue +36 -0
  101. package/src/components/form/GreySelect.vue +154 -0
  102. package/src/components/form/GreySelectInput.vue +123 -0
  103. package/src/components/form/GreySelectInputMultiple.vue +218 -0
  104. package/src/components/form/GreyTel.vue +58 -0
  105. package/src/components/form/HamburgerItem.vue +95 -0
  106. package/src/components/form/KeyValueEntry.vue +74 -0
  107. package/src/components/form/RadioInput.vue +38 -0
  108. package/src/components/form/UploadFile.vue +99 -0
  109. package/src/components/icons/AiIcon.vue +6 -0
  110. package/src/components/icons/GithubIcon.vue +18 -0
  111. package/src/components/icons/HighPriorityIcon.vue +6 -0
  112. package/src/components/icons/PowerOffIcon.vue +6 -0
  113. package/src/components/icons/SaveIcon.vue +6 -0
  114. package/src/components/index.js +134 -0
  115. package/src/components/menu/DialogMenu.vue +142 -0
  116. package/src/components/menu/GrandChild.vue +39 -0
  117. package/src/components/menu/GridMenu.vue +88 -0
  118. package/src/components/menu/MenuAvatar.vue +66 -0
  119. package/src/components/menu/MenuDesktop.vue +90 -0
  120. package/src/components/notifications/Notify.vue +123 -0
  121. package/src/components/notifications/NotifyList.vue +130 -0
  122. package/src/components/page-structure/FacetPage.vue +77 -0
  123. package/src/components/query/Child.vue +63 -0
  124. package/src/components/query/LVDBQuery.vue +38 -0
  125. package/src/components/status/Active.vue +44 -0
  126. package/src/components/status/ScoreLevel.vue +43 -0
  127. package/src/components/status/Status.vue +51 -0
  128. package/src/components/status/TaskDot.vue +25 -0
  129. package/src/components/status/TaskStatus.vue +26 -0
  130. package/src/components/status/TicketStatus.vue +201 -0
  131. package/src/components/status/Trend.vue +20 -0
  132. package/src/components/tables/ArgumentRunTable.vue +96 -0
  133. package/src/components/tables/ArgumentTable.vue +67 -0
  134. package/src/components/tables/CloudFormationParameters.vue +25 -0
  135. package/src/constants/colors.js +248 -0
  136. package/src/constants/font-map.js +128 -0
  137. package/src/constants/fpl2.js +162 -0
  138. package/src/constants/icon-svg.js +405 -0
  139. package/src/constants/schedule.js +52 -0
  140. package/src/fpl/AddPanel.vue +237 -0
  141. package/src/fpl/Configs/Alert.vue +16 -0
  142. package/src/fpl/Configs/AlertSprite.vue +2 -0
  143. package/src/fpl/Configs/Chart.vue +63 -0
  144. package/src/fpl/Configs/Config.js +154 -0
  145. package/src/fpl/Configs/Counter.vue +35 -0
  146. package/src/fpl/Configs/Histogram.vue +70 -0
  147. package/src/fpl/Configs/IPMap.vue +37 -0
  148. package/src/fpl/Configs/Image.vue +163 -0
  149. package/src/fpl/Configs/MetricChart.vue +20 -0
  150. package/src/fpl/Configs/PieChart.vue +37 -0
  151. package/src/fpl/Configs/SparkChart.vue +41 -0
  152. package/src/fpl/Configs/StackedBarChart.vue +49 -0
  153. package/src/fpl/Configs/Table.vue +211 -0
  154. package/src/fpl/Configs/Text.vue +14 -0
  155. package/src/fpl/Configs/TopNChart.vue +37 -0
  156. package/src/fpl/Outputs/FPLAlert.vue +64 -0
  157. package/src/fpl/Outputs/FPLStream.vue +41 -0
  158. package/src/fpl/Outputs/FPLTable.vue +77 -0
  159. package/src/fpl/Panel.vue +202 -0
  160. package/src/fpl/Panels/Alert.vue +85 -0
  161. package/src/fpl/Panels/AlertSprite.vue +9 -0
  162. package/src/fpl/Panels/Chart.vue +98 -0
  163. package/src/fpl/Panels/Counter.vue +43 -0
  164. package/src/fpl/Panels/Histogram.vue +138 -0
  165. package/src/fpl/Panels/IPMap.vue +48 -0
  166. package/src/fpl/Panels/Image.vue +35 -0
  167. package/src/fpl/Panels/MetricChart.vue +97 -0
  168. package/src/fpl/Panels/PieChart.vue +54 -0
  169. package/src/fpl/Panels/SparkChart.vue +166 -0
  170. package/src/fpl/Panels/StackedBarChart.vue +74 -0
  171. package/src/fpl/Panels/Table.vue +103 -0
  172. package/src/fpl/Panels/Text.vue +24 -0
  173. package/src/fpl/Panels/TopNChart.vue +69 -0
  174. package/src/fpl/index.js +39 -0
  175. package/src/utils/download.js +220 -0
  176. package/src/utils/formatOutput.js +156 -0
  177. package/src/utils/random.js +32 -0
  178. package/src/utils/timeUtils.js +138 -0
@@ -0,0 +1,163 @@
1
+ <template>
2
+ <UploadFile
3
+ :formats="['.svg', '.png', '.jpg']"
4
+ reader-function="data"
5
+ @upload="onFileChange"
6
+ @notify="triggerNotify"
7
+ />
8
+ <FormRow fieldName="Positioning">
9
+ <div class="flex justify-center">
10
+ <div class="grid grid-rows-3 grid-cols-3 w-40 h-40">
11
+ <div class="image-position-box top-left flex">
12
+ <RadioInput
13
+ v-model="local.panelConfig.positioning"
14
+ radio-value="top-left"
15
+ />
16
+ </div>
17
+ <div class="image-position-box top-center flex">
18
+ <RadioInput
19
+ v-model="local.panelConfig.positioning"
20
+ radio-value="top-center"
21
+ />
22
+ </div>
23
+ <div class="image-position-box top-right flex">
24
+ <RadioInput
25
+ v-model="local.panelConfig.positioning"
26
+ radio-value="top-right"
27
+ />
28
+ </div>
29
+ <div class="image-position-box center-left flex">
30
+ <RadioInput
31
+ v-model="local.panelConfig.positioning"
32
+ radio-value="center-left"
33
+ />
34
+ </div>
35
+ <div class="image-position-box center-center flex">
36
+ <RadioInput
37
+ v-model="local.panelConfig.positioning"
38
+ radio-value="center-center"
39
+ />
40
+ </div>
41
+ <div class="image-position-box center-right flex">
42
+ <RadioInput
43
+ v-model="local.panelConfig.positioning"
44
+ radio-value="center-right"
45
+ />
46
+ </div>
47
+ <div class="image-position-box bottom-left flex">
48
+ <RadioInput
49
+ v-model="local.panelConfig.positioning"
50
+ radio-value="bottom-left"
51
+ />
52
+ </div>
53
+ <div class="image-position-box bottom-center flex">
54
+ <RadioInput
55
+ v-model="local.panelConfig.positioning"
56
+ radio-value="bottom-center"
57
+ />
58
+ </div>
59
+ <div class="image-position-box bottom-right flex">
60
+ <RadioInput
61
+ v-model="local.panelConfig.positioning"
62
+ radio-value="bottom-right"
63
+ />
64
+ </div>
65
+ </div>
66
+ </div>
67
+ </FormRow>
68
+ <FormRow fieldName="Background Color">
69
+ <div class="flex justify-center">
70
+ <CheckBox v-model="backgroundColor" @change.stop="updateBackground" />
71
+ <input
72
+ v-if="backgroundColor"
73
+ type="color"
74
+ class="mx-2 block w-20 bg-white border border-gray-200 cursor-pointer rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700"
75
+ id="hs-color-input"
76
+ v-model="local.panelConfig.backgroundColor"
77
+ />
78
+ </div>
79
+ </FormRow>
80
+ <FormRow fieldName="Size">
81
+ <div class="flex justify-center">
82
+ <div class="p-2">
83
+ <RadioInput
84
+ v-model="local.panelConfig.size"
85
+ radio-value="100%"
86
+ label="100% of card"
87
+ />
88
+ </div>
89
+ <div class="p-2">
90
+ <RadioInput
91
+ v-model="local.panelConfig.size"
92
+ radio-value="75%"
93
+ label="75% of card"
94
+ />
95
+ </div>
96
+ <div class="p-2">
97
+ <RadioInput
98
+ v-model="local.panelConfig.size"
99
+ radio-value="50%"
100
+ label="50% of card"
101
+ />
102
+ </div>
103
+ <div class="p-2">
104
+ <RadioInput
105
+ v-model="local.panelConfig.size"
106
+ radio-value="pixels"
107
+ label="Pixels"
108
+ />
109
+ </div>
110
+ <div v-if="local.panelConfig.size === 'pixels'" class="p-1 w-24">
111
+ <GreyInput v-model.number="local.panelConfig.pixels" type="number" />
112
+ </div>
113
+ </div>
114
+ </FormRow>
115
+ <FormSection class="pt-4" sectionName="Image Preview">
116
+ <div class="flex justify-center">
117
+ <img
118
+ v-if="local.panelConfig.image"
119
+ :src="local.panelConfig.image"
120
+ class="w-40 h-40"
121
+ :style="`background-color: ${local.panelConfig.backgroundColor};`"
122
+ />
123
+ <span v-else>No image provided</span>
124
+ </div>
125
+ </FormSection>
126
+ </template>
127
+ <script setup>
128
+ import { ref } from "vue";
129
+ import {
130
+ RadioInput,
131
+ UploadFile,
132
+ FormRow,
133
+ FormSection,
134
+ CheckBox,
135
+ GreyInput,
136
+ } from "@/components";
137
+
138
+ const props = defineProps({
139
+ object: Object,
140
+ entry: Object,
141
+ errors: Object,
142
+ });
143
+ const local = ref(props.entry);
144
+ const backgroundColor = ref(
145
+ local.value.panelConfig.backgroundColor !== "transparent"
146
+ );
147
+
148
+ function updateBackground() {
149
+ if (backgroundColor.value) {
150
+ local.value.panelConfig.backgroundColor = "transparent";
151
+ } else {
152
+ local.value.panelConfig.backgroundColor = "#FFFFFF";
153
+ }
154
+ }
155
+
156
+ function onFileChange(file) {
157
+ local.value.panelConfig.image = file;
158
+ }
159
+
160
+ function triggerNotify(title, message, success) {
161
+ console.log("invalid file format");
162
+ }
163
+ </script>
@@ -0,0 +1,20 @@
1
+ <template>
2
+ <FormRow fieldName="Chart Type">
3
+ <GreySelect v-model="local.panelConfig.chart" :options="chartOptions" />
4
+ </FormRow>
5
+ </template>
6
+ <script setup>
7
+ import { ref } from "vue";
8
+ import { FormRow, GreySelect } from "@/components";
9
+
10
+ const props = defineProps({
11
+ object: Object,
12
+ entry: Object,
13
+ errors: Object,
14
+ });
15
+ const local = ref(props.entry);
16
+ const chartOptions = [
17
+ { label: "Bar Chart", value: "bar" },
18
+ { label: "Line Chart", value: "line" },
19
+ ];
20
+ </script>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <FormRow fieldName="Pie Area Value">
3
+ <GreySelect
4
+ v-model="local.panelConfig.categories.focus.name"
5
+ :options="
6
+ object.table.columns.map((col) => ({
7
+ label: col.name,
8
+ value: col.name,
9
+ }))
10
+ "
11
+ :error="errors.categories"
12
+ />
13
+ </FormRow>
14
+ <FormRow fieldName="Pie Area Label">
15
+ <GreySelect
16
+ v-model="local.panelConfig.value.column.name"
17
+ :options="
18
+ object.table.columns.map((col) => ({
19
+ label: col.name,
20
+ value: col.name,
21
+ }))
22
+ "
23
+ :error="errors.value"
24
+ />
25
+ </FormRow>
26
+ </template>
27
+ <script setup>
28
+ import { ref } from "vue";
29
+ import { FormRow, GreySelect } from "@/components";
30
+
31
+ const props = defineProps({
32
+ object: Object,
33
+ entry: Object,
34
+ errors: Object,
35
+ });
36
+ const local = ref(props.entry);
37
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <FormRow v-if="object.table" fieldName="Table Column">
3
+ <GreySelect
4
+ v-model="local.panelConfig.field"
5
+ :options="
6
+ object.table.columns.map((col) => ({
7
+ label: col.name,
8
+ value: col.name,
9
+ }))
10
+ "
11
+ />
12
+ </FormRow>
13
+ <FormRow fieldName="Metric Type">
14
+ <GreySelect v-model="local.panelConfig.metrics" :options="metricOptions" />
15
+ </FormRow>
16
+ <FormRow fieldName="Unit">
17
+ <GreySelect v-model="local.panelConfig.unit" :options="unitOptions" />
18
+ </FormRow>
19
+ <FormRow fieldName="Show Sprite">
20
+ <CheckBox v-model="local.panelConfig.showline" />
21
+ </FormRow>
22
+ </template>
23
+ <script setup>
24
+ import { ref } from "vue";
25
+ import { FormRow, GreySelect, CheckBox } from "@/components";
26
+
27
+ const props = defineProps({
28
+ object: Object,
29
+ entry: Object,
30
+ errors: Object,
31
+ });
32
+ const local = ref(props.entry);
33
+ const metricOptions = [
34
+ { label: "Simple", value: "simple" },
35
+ { label: "Complex", value: "complex" },
36
+ ];
37
+ const unitOptions = [
38
+ { label: "Bytes (B)", value: "bytes" },
39
+ { label: "Number", value: "count" },
40
+ ];
41
+ </script>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <FormRow fieldName="Value Column (Y-Axis)">
3
+ <GreySelect
4
+ v-model="local.panelConfig.categories.focus.name"
5
+ :options="
6
+ object.table.columns.map((col) => ({
7
+ label: col.name,
8
+ value: col.name,
9
+ }))
10
+ "
11
+ :error="errors.categories"
12
+ />
13
+ </FormRow>
14
+ <FormRow fieldName="Timestamp (X-Axis)">
15
+ <GreySelect
16
+ v-model="local.panelConfig.value.column.name"
17
+ :options="
18
+ object.table.columns.map((col) => ({
19
+ label: col.name,
20
+ value: col.name,
21
+ }))
22
+ "
23
+ :error="errors.value"
24
+ />
25
+ </FormRow>
26
+ <FormRow fieldName="Label Column">
27
+ <GreySelect
28
+ v-model="local.panelConfig.categories.type.name"
29
+ :options="
30
+ object.table.columns.map((col) => ({
31
+ label: col.name,
32
+ value: col.name,
33
+ }))
34
+ "
35
+ :error="errors.categories"
36
+ />
37
+ </FormRow>
38
+ </template>
39
+ <script setup>
40
+ import { ref } from "vue";
41
+ import { FormRow, GreySelect } from "@/components";
42
+
43
+ const props = defineProps({
44
+ object: Object,
45
+ entry: Object,
46
+ errors: Object,
47
+ });
48
+ const local = ref(props.entry);
49
+ </script>
@@ -0,0 +1,211 @@
1
+ <template>
2
+ <table class="w-full select-none std-table">
3
+ <thead class="text-left bg-neutral-200 dark:dark-bg">
4
+ <tr>
5
+ <TableHeader title="" />
6
+ <TableHeader title="Selected" />
7
+ <TableHeader title="Column" />
8
+ <TableHeader title="Display Name" />
9
+ <TableHeader title="Format" />
10
+ <TableHeader title="Alignment" />
11
+ </tr>
12
+ </thead>
13
+ <tbody class="std-table-body">
14
+ <tr v-for="(col, i) in columns" :class="`cursor-grab draggable${i}`">
15
+ <TableData>
16
+ <Bars4Icon class="icon-xs" />
17
+ </TableData>
18
+ <TableData>
19
+ <CheckBox v-model="col.selected" @change.stop="toggleColumn(col)" />
20
+ </TableData>
21
+ <TableData :title="col.field" />
22
+ <TableData>
23
+ <GreyInput
24
+ v-model="col.header"
25
+ :readonly="!col.selected"
26
+ @change.stop="updateHeader(col)"
27
+ />
28
+ </TableData>
29
+ <TableData>
30
+ <GreySelect
31
+ v-model="col.dateTimeFormat"
32
+ :readonly="!col.selected"
33
+ :options="formatOption"
34
+ @update:modelValue="updateHeader(col)"
35
+ />
36
+ </TableData>
37
+ <TableData>
38
+ <RadioButtons
39
+ v-model="col.alignment"
40
+ :options="alignmentOption"
41
+ :useValue="false"
42
+ @update:modelValue="updateHeader(col)"
43
+ >
44
+ <template #option-0><Bars3BottomLeftIcon class="icon" /></template>
45
+ <template #option-1><Bars3Icon class="icon" /></template>
46
+ <template #option-2><Bars3BottomRightIcon class="icon" /></template>
47
+ </RadioButtons>
48
+ </TableData>
49
+ </tr>
50
+ </tbody>
51
+ </table>
52
+ </template>
53
+ <script setup>
54
+ import { ref } from "vue";
55
+ import {
56
+ TableData,
57
+ TableHeader,
58
+ CheckBox,
59
+ GreyInput,
60
+ GreySelect,
61
+ RadioButtons,
62
+ } from "@/components";
63
+ import { Bars3BottomLeftIcon, Bars3Icon, Bars3BottomRightIcon, Bars4Icon } from "@heroicons/vue/24/outline";
64
+ import interact from "interactjs";
65
+ // constants
66
+ const formatOption = [
67
+ { label: "Default", value: "default" },
68
+ { label: "Cost ($)", value: "cost" },
69
+ { label: "Data (B)", value: "data" },
70
+ { label: "Duration (seconds)", value: "duration" },
71
+ { label: "Compact", value: "readable" },
72
+ { label: "Thousands Seperated", value: "comma" },
73
+ { label: "Time (MMM DDD YYYY, HH:mm)", value: "MMM DDD YYYY, HH:mm" },
74
+ { label: "Time (MMM D, HH:mm)", value: "MMM D, HH:mm" },
75
+ { label: "Time (ddd HH:mm)", value: "ddd HH:mm" },
76
+ ];
77
+ const alignmentOption = [
78
+ { label: "Left", value: "left" },
79
+ { label: "Center", value: "center" },
80
+ { label: "Right", value: "right" },
81
+ ];
82
+ // props
83
+ const props = defineProps({
84
+ object: Object,
85
+ entry: Object,
86
+ errors: Object,
87
+ });
88
+ // states
89
+ const local = ref(props.entry);
90
+ const position = ref({ x: 0, y: 0 });
91
+ const columns = ref(
92
+ JSON.parse(JSON.stringify(local.value.panelConfig.columns))
93
+ );
94
+
95
+ // mounted
96
+ columns.value.forEach((col) => {
97
+ col.selected = true;
98
+ });
99
+ if (props.object.table.columns) {
100
+ props.object.table.columns.forEach((col) => {
101
+ if (!columns.value.some((c) => c.field === col.name)) {
102
+ columns.value.push({
103
+ field: col.name,
104
+ header: col.name,
105
+ dateTimeFormat: "default",
106
+ alignment: "",
107
+ selected: false,
108
+ });
109
+ }
110
+ });
111
+ // set all to true if none are selected
112
+ if (columns.value.every((col) => !col.selected)) {
113
+ columns.value.forEach((col) => {
114
+ col.selected = true;
115
+ });
116
+ local.value.panelConfig.columns = columns.value.map((col) => {
117
+ return {
118
+ field: col.field,
119
+ header: col.header,
120
+ dateTimeFormat: col.dateTimeFormat,
121
+ alignment: col.alignment,
122
+ };
123
+ });
124
+ }
125
+ }
126
+ setDraggable();
127
+
128
+ function toggleColumn(entry) {
129
+ if (!entry.selected) {
130
+ setTimeout(() => {
131
+ const getSelected = columns.value.filter((col) => col.selected);
132
+ const loc = getSelected.findIndex((col) => col.field === entry.field);
133
+ local.value.panelConfig.columns.splice(loc, 0, {
134
+ field: entry.field,
135
+ header: entry.field,
136
+ dateTimeFormat: "default",
137
+ alignment: "",
138
+ });
139
+ }, 100);
140
+ } else {
141
+ const loc = local.value.panelConfig.columns.findIndex(
142
+ (col) => col.field === entry.field
143
+ );
144
+ local.value.panelConfig.columns.splice(loc, 1);
145
+ }
146
+ }
147
+
148
+ function updateHeader(newCol) {
149
+ local.value.panelConfig.columns.forEach((col) => {
150
+ if (col.field === newCol.field) {
151
+ col.header = newCol.header;
152
+ col.dateTimeFormat = newCol.dateTimeFormat;
153
+ col.alignment = newCol.alignment;
154
+ }
155
+ });
156
+ }
157
+
158
+ function reorderColumns(newIndex, entry) {
159
+ columns.value[columns.value.indexOf(entry)] = columns.value[newIndex];
160
+ columns.value[newIndex] = entry;
161
+ }
162
+
163
+ function setDraggable() {
164
+ columns.value.forEach((col, i) => {
165
+ const relativePositions = columns.value.map((col, j) => {
166
+ const start = 0 - i * 53;
167
+ return start + j * 53;
168
+ });
169
+ interact(`.draggable${i}`).draggable({
170
+ listeners: {
171
+ start(event) {
172
+ position.value.x = 0;
173
+ position.value.y = 0;
174
+ },
175
+ move(event) {
176
+ position.value.x += event.dx;
177
+ position.value.y += event.dy;
178
+ // if touch something, change the order
179
+ const target = relativePositions.find(
180
+ (pos) => position.value.y > pos - 1 && position.value.y < pos + 1
181
+ );
182
+ if (target || target === 0) {
183
+ reorderColumns(relativePositions.indexOf(target), col);
184
+ } else {
185
+ event.target.style.transform = `translate(${position.value.x}px, ${position.value.y}px)`;
186
+ }
187
+ },
188
+ end(event) {
189
+ local.value.panelConfig.columns = columns.value
190
+ .filter((col) => col.selected)
191
+ .map((col) => {
192
+ return {
193
+ field: col.field,
194
+ header: col.header,
195
+ dateTimeFormat: col.dateTimeFormat,
196
+ alignment: col.alignment,
197
+ };
198
+ });
199
+ setDraggable();
200
+ },
201
+ },
202
+ modifiers: [
203
+ interact.modifiers.snap({
204
+ targets: relativePositions.map((pos) => ({ x: 0, y: pos })),
205
+ offset: "startCoords",
206
+ }),
207
+ ],
208
+ });
209
+ });
210
+ }
211
+ </script>
@@ -0,0 +1,14 @@
1
+ <template>
2
+ <Editor v-model="local.panelConfig.text" />
3
+ </template>
4
+ <script setup>
5
+ import { ref } from "vue";
6
+ import { Editor } from "@/components";
7
+
8
+ const props = defineProps({
9
+ object: Object,
10
+ entry: Object,
11
+ errors: Object,
12
+ });
13
+ const local = ref(props.entry);
14
+ </script>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <FormRow fieldName="Value (X-Axis)">
3
+ <GreySelect
4
+ v-model="local.panelConfig.categories.focus.name"
5
+ :options="
6
+ object.table.columns.map((col) => ({
7
+ label: col.name,
8
+ value: col.name,
9
+ }))
10
+ "
11
+ :error="errors.categories"
12
+ />
13
+ </FormRow>
14
+ <FormRow fieldName="Label (Y-Axis)">
15
+ <GreySelect
16
+ v-model="local.panelConfig.value.column.name"
17
+ :options="
18
+ object.table.columns.map((col) => ({
19
+ label: col.name,
20
+ value: col.name,
21
+ }))
22
+ "
23
+ :error="errors.value"
24
+ />
25
+ </FormRow>
26
+ </template>
27
+ <script setup>
28
+ import { ref } from "vue";
29
+ import { FormRow, GreySelect } from "@/components";
30
+
31
+ const props = defineProps({
32
+ object: Object,
33
+ entry: Object,
34
+ errors: Object,
35
+ });
36
+ const local = ref(props.entry);
37
+ </script>
@@ -0,0 +1,64 @@
1
+ <template>
2
+ <div v-for="(alert, i) in dat" class="py-2 overflow-x-auto">
3
+ <h3 class="text-lg font-semibold">{{ alert.action }}</h3>
4
+ <Tag
5
+ v-for="(tag, i) in alert.tags"
6
+ :key="i"
7
+ :text="tag.key + ': ' + tag.values.join(', ')"
8
+ color="blue"
9
+ />
10
+ <AlertChart
11
+ :data="alert"
12
+ :id="title + i"
13
+ unit="Value"
14
+ :height="300"
15
+ :width="800"
16
+ :theme="theme"
17
+ />
18
+ </div>
19
+ <EmptyChart v-if="dat.length === 0" :id="title" :height="300" :width="800" />
20
+ </template>
21
+ <script setup>
22
+ import { Tag, AlertChart, EmptyChart } from "@/components";
23
+ import { ref } from "vue";
24
+
25
+ // stores
26
+ // props and emits
27
+ const props = defineProps({
28
+ title: String,
29
+ data: Object,
30
+ theme: {
31
+ type: String,
32
+ default: "light",
33
+ },
34
+ });
35
+ // states
36
+ const dat = ref([]);
37
+ // mounted
38
+ if (props.data.alerts) parseData();
39
+
40
+ function parseData() {
41
+ const slots = props.data.slots.map((slot) => slot * 1000);
42
+ dat.value = props.data.alerts
43
+ ? props.data.alerts.map((alert) => {
44
+ return {
45
+ tags: alert.dimensionTags ? alert.dimensionTags[0].tags : [],
46
+ slots: slots,
47
+ action: alert.key,
48
+ metric: alert.alertMetric,
49
+ values: alert.values[0].metric.values,
50
+ series: alert.associates
51
+ ? alert.associates
52
+ .filter((associate) => associate.name)
53
+ .map((associate) => {
54
+ return {
55
+ action: associate.name,
56
+ values: associate.metric.values,
57
+ };
58
+ })
59
+ : [],
60
+ };
61
+ })
62
+ : [];
63
+ }
64
+ </script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div class="overflow-x-auto">
3
+ <LineChart
4
+ :data="dat"
5
+ :id="title"
6
+ :unit="data.unit ? data.unit : 'Value'"
7
+ :height="300"
8
+ :width="900"
9
+ :hideZeros="false"
10
+ :theme="theme"
11
+ />
12
+ </div>
13
+ </template>
14
+ <script setup>
15
+ import { ref } from "vue";
16
+ import { LineChart } from "@/components";
17
+
18
+ // stores
19
+ // props and emits
20
+ const props = defineProps({
21
+ title: String,
22
+ data: Object,
23
+ theme: {
24
+ type: String,
25
+ default: "light",
26
+ },
27
+ });
28
+ // states
29
+ const dat = ref([]);
30
+ const slots = props.data.slots.map((slot) => slot * 1000);
31
+ // mounted
32
+ dat.value = props.data.metrics
33
+ ? props.data.metrics.map((series) => {
34
+ return {
35
+ slots: slots,
36
+ action: series.key,
37
+ values: series.values,
38
+ };
39
+ })
40
+ : [];
41
+ </script>