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.
- package/dist/fluency-v8-components.es.js +1 -1
- package/dist/fluency-v8-components.umd.js +99 -99
- package/dist/{index-q2NbjdVo.mjs → index-ChEFiXF5.mjs} +12 -11
- package/dist/{index.es-PAPL4E6Y.mjs → index.es-CjjN70eV.mjs} +1 -1
- package/package.json +3 -2
- package/src/assets/images/ai.svg +1 -0
- package/src/assets/images/github-dark.svg +1 -0
- package/src/assets/images/github.svg +1 -0
- package/src/assets/images/high-priority.svg +1 -0
- package/src/assets/images/power-off.svg +1 -0
- package/src/assets/images/save.svg +1 -0
- package/src/assets/index.ts +15 -0
- package/src/assets/main.css +495 -0
- package/src/assets/prism-theme.css +290 -0
- package/src/components/buttons/ActionButtons.vue +374 -0
- package/src/components/buttons/DropdownButton.vue +104 -0
- package/src/components/buttons/IconButton.vue +63 -0
- package/src/components/buttons/ImageButton.vue +16 -0
- package/src/components/buttons/MenuButton.vue +138 -0
- package/src/components/buttons/SubmitButtons.vue +51 -0
- package/src/components/buttons/TextButton.vue +40 -0
- package/src/components/charts/AlertChart.vue +376 -0
- package/src/components/charts/BarChart.vue +212 -0
- package/src/components/charts/BarChartHorizontal.vue +243 -0
- package/src/components/charts/CronChart.vue +146 -0
- package/src/components/charts/EmptyChart.vue +76 -0
- package/src/components/charts/GradientChart.vue +310 -0
- package/src/components/charts/LineChart.test.js +59 -0
- package/src/components/charts/LineChart.vue +434 -0
- package/src/components/charts/PieChart.vue +293 -0
- package/src/components/charts/ProgressChart.vue +106 -0
- package/src/components/charts/StackedChart.vue +364 -0
- package/src/components/charts/StackedChartClustered.vue +395 -0
- package/src/components/charts/TimelineChart.vue +215 -0
- package/src/components/charts/WorkflowChart.vue +520 -0
- package/src/components/common/AutoCompleteSearchBar.vue +100 -0
- package/src/components/common/AutoRefreshButton.vue +53 -0
- package/src/components/common/Breadcrumb.vue +45 -0
- package/src/components/common/ButtonToggle.vue +24 -0
- package/src/components/common/Card.vue +116 -0
- package/src/components/common/Carousel.vue +66 -0
- package/src/components/common/CategoryCard.vue +28 -0
- package/src/components/common/CodeEditor.vue +59 -0
- package/src/components/common/DatePicker.vue +21 -0
- package/src/components/common/DatePickerInput.vue +109 -0
- package/src/components/common/Dialog.vue +103 -0
- package/src/components/common/EditorHeading.vue +10 -0
- package/src/components/common/EventList.vue +41 -0
- package/src/components/common/Facet.vue +206 -0
- package/src/components/common/Feed.vue +58 -0
- package/src/components/common/Flag.vue +27 -0
- package/src/components/common/HomeCard.vue +20 -0
- package/src/components/common/ItemBox.vue +49 -0
- package/src/components/common/Loading.vue +19 -0
- package/src/components/common/LoadingDots.vue +12 -0
- package/src/components/common/PageHeading.vue +30 -0
- package/src/components/common/Pagination.vue +105 -0
- package/src/components/common/Popover.vue +24 -0
- package/src/components/common/PowerToggle.vue +130 -0
- package/src/components/common/ProgressBar.vue +33 -0
- package/src/components/common/RadioButtons.vue +52 -0
- package/src/components/common/Schedule.vue +79 -0
- package/src/components/common/SearchBar.vue +30 -0
- package/src/components/common/Separator.vue +3 -0
- package/src/components/common/Slideout.vue +95 -0
- package/src/components/common/Sort.vue +83 -0
- package/src/components/common/Table.vue +48 -0
- package/src/components/common/Tabs.vue +129 -0
- package/src/components/common/Tag.vue +53 -0
- package/src/components/common/Tooltip.vue +49 -0
- package/src/components/common/VerticalTabs.vue +34 -0
- package/src/components/common/card/CardItem.vue +27 -0
- package/src/components/common/card/CardItemGroup.vue +45 -0
- package/src/components/common/facet/Leaf.vue +97 -0
- package/src/components/common/facet/TriState.vue +37 -0
- package/src/components/common/table/TableData.vue +48 -0
- package/src/components/common/table/TableHeader.vue +21 -0
- package/src/components/dialogs/ChooseValueDialog.vue +97 -0
- package/src/components/dialogs/ConfirmDialog.vue +73 -0
- package/src/components/dialogs/CopyDialog.vue +51 -0
- package/src/components/dialogs/DownloadDialog.vue +48 -0
- package/src/components/dialogs/NameDescDialog.vue +74 -0
- package/src/components/dialogs/NameDialog.vue +56 -0
- package/src/components/dialogs/PopupEditor.vue +113 -0
- package/src/components/dialogs/ProgressDialog.vue +58 -0
- package/src/components/dialogs/ResetPasswordDialog.vue +58 -0
- package/src/components/dialogs/Wizard.vue +99 -0
- package/src/components/dialogs/wizard/Stepper.vue +31 -0
- package/src/components/form/CheckBox.vue +26 -0
- package/src/components/form/Editor.vue +93 -0
- package/src/components/form/FormCol.vue +19 -0
- package/src/components/form/FormRow.vue +19 -0
- package/src/components/form/FormSection.vue +21 -0
- package/src/components/form/GreyForm.vue +7 -0
- package/src/components/form/GreyInput.vue +51 -0
- package/src/components/form/GreyInputAutocomplete.vue +100 -0
- package/src/components/form/GreyInputCopy.vue +66 -0
- package/src/components/form/GreyInputGrow.vue +42 -0
- package/src/components/form/GreyInputToken.vue +78 -0
- package/src/components/form/GreyPassword.vue +36 -0
- package/src/components/form/GreySelect.vue +154 -0
- package/src/components/form/GreySelectInput.vue +123 -0
- package/src/components/form/GreySelectInputMultiple.vue +218 -0
- package/src/components/form/GreyTel.vue +58 -0
- package/src/components/form/HamburgerItem.vue +95 -0
- package/src/components/form/KeyValueEntry.vue +74 -0
- package/src/components/form/RadioInput.vue +38 -0
- package/src/components/form/UploadFile.vue +99 -0
- package/src/components/icons/AiIcon.vue +6 -0
- package/src/components/icons/GithubIcon.vue +18 -0
- package/src/components/icons/HighPriorityIcon.vue +6 -0
- package/src/components/icons/PowerOffIcon.vue +6 -0
- package/src/components/icons/SaveIcon.vue +6 -0
- package/src/components/index.js +134 -0
- package/src/components/menu/DialogMenu.vue +142 -0
- package/src/components/menu/GrandChild.vue +39 -0
- package/src/components/menu/GridMenu.vue +88 -0
- package/src/components/menu/MenuAvatar.vue +66 -0
- package/src/components/menu/MenuDesktop.vue +90 -0
- package/src/components/notifications/Notify.vue +123 -0
- package/src/components/notifications/NotifyList.vue +130 -0
- package/src/components/page-structure/FacetPage.vue +77 -0
- package/src/components/query/Child.vue +63 -0
- package/src/components/query/LVDBQuery.vue +38 -0
- package/src/components/status/Active.vue +44 -0
- package/src/components/status/ScoreLevel.vue +43 -0
- package/src/components/status/Status.vue +51 -0
- package/src/components/status/TaskDot.vue +25 -0
- package/src/components/status/TaskStatus.vue +26 -0
- package/src/components/status/TicketStatus.vue +201 -0
- package/src/components/status/Trend.vue +20 -0
- package/src/components/tables/ArgumentRunTable.vue +96 -0
- package/src/components/tables/ArgumentTable.vue +67 -0
- package/src/components/tables/CloudFormationParameters.vue +25 -0
- package/src/constants/colors.js +248 -0
- package/src/constants/font-map.js +128 -0
- package/src/constants/fpl2.js +162 -0
- package/src/constants/icon-svg.js +405 -0
- package/src/constants/schedule.js +52 -0
- package/src/fpl/AddPanel.vue +237 -0
- package/src/fpl/Configs/Alert.vue +16 -0
- package/src/fpl/Configs/AlertSprite.vue +2 -0
- package/src/fpl/Configs/Chart.vue +63 -0
- package/src/fpl/Configs/Config.js +154 -0
- package/src/fpl/Configs/Counter.vue +35 -0
- package/src/fpl/Configs/Histogram.vue +70 -0
- package/src/fpl/Configs/IPMap.vue +37 -0
- package/src/fpl/Configs/Image.vue +163 -0
- package/src/fpl/Configs/MetricChart.vue +20 -0
- package/src/fpl/Configs/PieChart.vue +37 -0
- package/src/fpl/Configs/SparkChart.vue +41 -0
- package/src/fpl/Configs/StackedBarChart.vue +49 -0
- package/src/fpl/Configs/Table.vue +211 -0
- package/src/fpl/Configs/Text.vue +14 -0
- package/src/fpl/Configs/TopNChart.vue +37 -0
- package/src/fpl/Outputs/FPLAlert.vue +64 -0
- package/src/fpl/Outputs/FPLStream.vue +41 -0
- package/src/fpl/Outputs/FPLTable.vue +77 -0
- package/src/fpl/Panel.vue +202 -0
- package/src/fpl/Panels/Alert.vue +85 -0
- package/src/fpl/Panels/AlertSprite.vue +9 -0
- package/src/fpl/Panels/Chart.vue +98 -0
- package/src/fpl/Panels/Counter.vue +43 -0
- package/src/fpl/Panels/Histogram.vue +138 -0
- package/src/fpl/Panels/IPMap.vue +48 -0
- package/src/fpl/Panels/Image.vue +35 -0
- package/src/fpl/Panels/MetricChart.vue +97 -0
- package/src/fpl/Panels/PieChart.vue +54 -0
- package/src/fpl/Panels/SparkChart.vue +166 -0
- package/src/fpl/Panels/StackedBarChart.vue +74 -0
- package/src/fpl/Panels/Table.vue +103 -0
- package/src/fpl/Panels/Text.vue +24 -0
- package/src/fpl/Panels/TopNChart.vue +69 -0
- package/src/fpl/index.js +39 -0
- package/src/utils/download.js +220 -0
- package/src/utils/formatOutput.js +156 -0
- package/src/utils/random.js +32 -0
- package/src/utils/timeUtils.js +138 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="['flex h-full w-full p-0', props.config.positioning]"
|
|
4
|
+
:style="`backgroundColor: ${config.backgroundColor}`"
|
|
5
|
+
>
|
|
6
|
+
<img :src="config.image" :style="getStyle()" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<script setup>
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
config: Object,
|
|
12
|
+
obj: Object,
|
|
13
|
+
layout: Object,
|
|
14
|
+
id: String,
|
|
15
|
+
theme: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: "light",
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
function getStyle() {
|
|
22
|
+
if (props.config.size === "pixels") {
|
|
23
|
+
return {
|
|
24
|
+
backgroundColor: props.config.backgroundColor,
|
|
25
|
+
width: props.config.pixels + "px",
|
|
26
|
+
height: props.config.pixels + "px",
|
|
27
|
+
};
|
|
28
|
+
} else {
|
|
29
|
+
return {
|
|
30
|
+
backgroundColor: props.config.backgroundColor,
|
|
31
|
+
width: props.config.size,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<LineChart
|
|
4
|
+
v-if="config.chart === 'line' && !redraw"
|
|
5
|
+
:data="data"
|
|
6
|
+
:id="id"
|
|
7
|
+
:unit="unit"
|
|
8
|
+
:height="props.layout.h * 60 - 40"
|
|
9
|
+
:width="props.layout.w * 69 - 155"
|
|
10
|
+
:hideZeros="false"
|
|
11
|
+
tooltipOffset="offset"
|
|
12
|
+
:theme="theme"
|
|
13
|
+
/>
|
|
14
|
+
<StackedChart
|
|
15
|
+
v-if="config.chart === 'bar' && !redraw"
|
|
16
|
+
:data="data"
|
|
17
|
+
:names="data.names"
|
|
18
|
+
:id="id"
|
|
19
|
+
:unit="unit"
|
|
20
|
+
:height="props.layout.h * 60 - 50"
|
|
21
|
+
:width="props.layout.w * 69 - 20"
|
|
22
|
+
tooltipOffset="offset"
|
|
23
|
+
:theme="theme"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script setup>
|
|
28
|
+
import { ref, watch } from "vue";
|
|
29
|
+
import { LineChart, StackedChart } from "@/components";
|
|
30
|
+
|
|
31
|
+
// stores
|
|
32
|
+
// props and emits
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
config: Object,
|
|
35
|
+
obj: Object,
|
|
36
|
+
layout: Object,
|
|
37
|
+
id: String,
|
|
38
|
+
theme: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "light",
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
// states
|
|
44
|
+
const redraw = ref(false);
|
|
45
|
+
const unit = ref("Value");
|
|
46
|
+
const data = ref([]);
|
|
47
|
+
// watcher
|
|
48
|
+
watch(
|
|
49
|
+
() => [props.layout.w, props.layout.h],
|
|
50
|
+
() => {
|
|
51
|
+
redraw.value = true;
|
|
52
|
+
setInterval(() => {
|
|
53
|
+
redraw.value = false;
|
|
54
|
+
}, 1);
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
// mounted
|
|
59
|
+
getData();
|
|
60
|
+
|
|
61
|
+
// function defs
|
|
62
|
+
function getData() {
|
|
63
|
+
const slots = props.obj.stream.slots.map((slot) => slot * 1000);
|
|
64
|
+
unit.value = props.obj.stream.unit || "Value";
|
|
65
|
+
if (props.config.chart === "line") {
|
|
66
|
+
data.value = props.obj.stream.metrics
|
|
67
|
+
? props.obj.stream.metrics.map((series) => {
|
|
68
|
+
return {
|
|
69
|
+
slots: slots,
|
|
70
|
+
action: series.key,
|
|
71
|
+
values: series.values,
|
|
72
|
+
};
|
|
73
|
+
})
|
|
74
|
+
: [];
|
|
75
|
+
} else if (props.config.chart === "bar") {
|
|
76
|
+
const nameMap = {};
|
|
77
|
+
const values = [];
|
|
78
|
+
props.obj.stream.metrics.forEach((series) => {
|
|
79
|
+
nameMap[series.key] = series.key;
|
|
80
|
+
series.values.forEach((value, i) => {
|
|
81
|
+
values.push({
|
|
82
|
+
slot: slots[i],
|
|
83
|
+
name: series.key,
|
|
84
|
+
value: value,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
data.value = {
|
|
89
|
+
slots: slots,
|
|
90
|
+
names: nameMap,
|
|
91
|
+
series: values,
|
|
92
|
+
};
|
|
93
|
+
} else {
|
|
94
|
+
data.value = [];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<PieChart
|
|
4
|
+
v-if="!redraw"
|
|
5
|
+
:data="data"
|
|
6
|
+
:id="id"
|
|
7
|
+
unit="Value"
|
|
8
|
+
:height="props.layout.h * 60 - 40"
|
|
9
|
+
:width="props.layout.w * 69 - 10"
|
|
10
|
+
tooltipOffset="offset"
|
|
11
|
+
:value-name="props.config.categories.focus.name"
|
|
12
|
+
:theme="theme"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script setup lang="ts">
|
|
17
|
+
import { ref, watch } from "vue";
|
|
18
|
+
import { PieChart } from "@/components";
|
|
19
|
+
|
|
20
|
+
// stores
|
|
21
|
+
// props and emits
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
config: Object,
|
|
24
|
+
obj: Object,
|
|
25
|
+
id: String,
|
|
26
|
+
layout: Object,
|
|
27
|
+
theme: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "light",
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
// states
|
|
33
|
+
const redraw = ref(false);
|
|
34
|
+
const data = ref([]);
|
|
35
|
+
// watcher
|
|
36
|
+
watch(
|
|
37
|
+
() => [props.layout.w, props.layout.h],
|
|
38
|
+
() => {
|
|
39
|
+
redraw.value = true;
|
|
40
|
+
setInterval(() => {
|
|
41
|
+
redraw.value = false;
|
|
42
|
+
}, 1);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
// mounted
|
|
46
|
+
if (props.obj.table.rows) {
|
|
47
|
+
data.value = props.obj.table.rows.map((row) => {
|
|
48
|
+
return {
|
|
49
|
+
values: row[props.config.categories.focus.name],
|
|
50
|
+
field: row[props.config.value.column.name],
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div :class="config.showline ? 'grid grid-cols-2' : 'text-right'">
|
|
4
|
+
<GradientChart
|
|
5
|
+
v-if="config.showline"
|
|
6
|
+
:id="id"
|
|
7
|
+
:data="data.chart"
|
|
8
|
+
unit="Value"
|
|
9
|
+
:change="data.first <= data.last ? 'positive' : 'negative'"
|
|
10
|
+
:hideAxis="true"
|
|
11
|
+
:height="50"
|
|
12
|
+
:width="175"
|
|
13
|
+
:resizable="true"
|
|
14
|
+
:hideTooltip="true"
|
|
15
|
+
tooltipOffset="offset"
|
|
16
|
+
:theme="theme"
|
|
17
|
+
/>
|
|
18
|
+
<div class="text-right content-center">
|
|
19
|
+
<Trend
|
|
20
|
+
:trend="data.first <= data.last ? 'positive' : 'negative'"
|
|
21
|
+
:value="
|
|
22
|
+
config.unit === 'bytes'
|
|
23
|
+
? dataCount(Math.abs(data.first - data.last)) + 'B'
|
|
24
|
+
: humanCount(Math.abs(data.first - data.last)).toString()
|
|
25
|
+
"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
<span
|
|
30
|
+
:class="[
|
|
31
|
+
'flex justify-center p-4 overflow-auto',
|
|
32
|
+
layout.w > 4 ? 'text-7xl' : 'text-4xl',
|
|
33
|
+
]"
|
|
34
|
+
>
|
|
35
|
+
{{
|
|
36
|
+
config.unit === "bytes" || config.isData
|
|
37
|
+
? dataCount(data.total) + "B"
|
|
38
|
+
: humanCount(data.total)
|
|
39
|
+
}}
|
|
40
|
+
</span>
|
|
41
|
+
<div
|
|
42
|
+
v-if="config.metrics === 'complex'"
|
|
43
|
+
class="grid grid-cols-2 grid-rows-2"
|
|
44
|
+
>
|
|
45
|
+
<span>
|
|
46
|
+
Min:
|
|
47
|
+
{{
|
|
48
|
+
config.unit === "bytes" || config.isData
|
|
49
|
+
? dataCount(data.min) + "B"
|
|
50
|
+
: humanCount(data.min)
|
|
51
|
+
}}
|
|
52
|
+
</span>
|
|
53
|
+
<span class="text-right">
|
|
54
|
+
Max:
|
|
55
|
+
{{
|
|
56
|
+
config.unit === "bytes" || config.isData
|
|
57
|
+
? dataCount(data.max) + "B"
|
|
58
|
+
: humanCount(data.max)
|
|
59
|
+
}}
|
|
60
|
+
</span>
|
|
61
|
+
<span>
|
|
62
|
+
First:
|
|
63
|
+
{{
|
|
64
|
+
config.unit === "bytes" || config.isData
|
|
65
|
+
? dataCount(data.first) + "B"
|
|
66
|
+
: humanCount(data.first)
|
|
67
|
+
}}
|
|
68
|
+
</span>
|
|
69
|
+
<span class="text-right">
|
|
70
|
+
Last:
|
|
71
|
+
{{
|
|
72
|
+
config.unit === "bytes" || config.isData
|
|
73
|
+
? dataCount(data.last) + "B"
|
|
74
|
+
: humanCount(data.last)
|
|
75
|
+
}}
|
|
76
|
+
</span>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</template>
|
|
80
|
+
<script setup>
|
|
81
|
+
import { ref } from "vue";
|
|
82
|
+
import { humanCount, dataCount } from "@/utils/formatOutput";
|
|
83
|
+
import { Trend, GradientChart } from "@/components";
|
|
84
|
+
|
|
85
|
+
// stores
|
|
86
|
+
// props and emits
|
|
87
|
+
const props = defineProps({
|
|
88
|
+
config: Object,
|
|
89
|
+
obj: Object,
|
|
90
|
+
layout: Object,
|
|
91
|
+
id: String,
|
|
92
|
+
theme: {
|
|
93
|
+
type: String,
|
|
94
|
+
default: "light",
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
// states
|
|
98
|
+
const data = ref({
|
|
99
|
+
total: 0,
|
|
100
|
+
first: 0,
|
|
101
|
+
last: 0,
|
|
102
|
+
min: 0,
|
|
103
|
+
max: 0,
|
|
104
|
+
chart: {},
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
// watch(() => props.obj, processObject, { immediate: true, deep: true });
|
|
108
|
+
// mounted
|
|
109
|
+
processObject();
|
|
110
|
+
// function defs
|
|
111
|
+
function processObject() {
|
|
112
|
+
// check if obj is a stream or table
|
|
113
|
+
if (props.obj.table) {
|
|
114
|
+
if (props.obj.table.rows.length > 0) {
|
|
115
|
+
const values = props.obj.table.rows.map(
|
|
116
|
+
(row) => row[props.config.field] || 0
|
|
117
|
+
);
|
|
118
|
+
data.value.total = values.reduce((acc, val) => {
|
|
119
|
+
return acc + val;
|
|
120
|
+
}, 0);
|
|
121
|
+
data.value.first = values[0];
|
|
122
|
+
data.value.last = values.slice(-1);
|
|
123
|
+
data.value.min = Math.min(...values);
|
|
124
|
+
data.value.max = Math.max(...values);
|
|
125
|
+
if (props.config.showline) {
|
|
126
|
+
data.value.chart = {
|
|
127
|
+
slots: props.obj.table.rows.map((row, i) => 1000000000 + i * 1000),
|
|
128
|
+
values: values,
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
} else if (props.obj.stream) {
|
|
134
|
+
if (props.obj.stream.metrics && props.obj.stream.metrics.length > 0) {
|
|
135
|
+
data.value.total = props.obj.stream.metrics[0].values.reduce(
|
|
136
|
+
(acc, val) => {
|
|
137
|
+
return acc + val;
|
|
138
|
+
},
|
|
139
|
+
0
|
|
140
|
+
);
|
|
141
|
+
data.value.first = props.obj.stream.metrics[0].values[0];
|
|
142
|
+
data.value.last = props.obj.stream.metrics[0].values.slice(-1)[0];
|
|
143
|
+
data.value.min = Math.min(...props.obj.stream.metrics[0].values);
|
|
144
|
+
data.value.max = Math.max(...props.obj.stream.metrics[0].values);
|
|
145
|
+
if (props.config.showline) {
|
|
146
|
+
data.value.chart = {
|
|
147
|
+
slots: props.obj.stream.slots.map((slot) => slot * 1000),
|
|
148
|
+
values: props.obj.stream.metrics[0].values,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
data.value = {
|
|
155
|
+
total: 0,
|
|
156
|
+
first: 0,
|
|
157
|
+
last: 0,
|
|
158
|
+
min: 0,
|
|
159
|
+
max: 0,
|
|
160
|
+
chart: {
|
|
161
|
+
slots: [],
|
|
162
|
+
values: [],
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
</script>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<StackedChart
|
|
4
|
+
v-if="!redraw"
|
|
5
|
+
:data="data"
|
|
6
|
+
:names="data.names || {}"
|
|
7
|
+
:id="id"
|
|
8
|
+
unit="Value"
|
|
9
|
+
:height="props.layout.h * 60 - 50"
|
|
10
|
+
:width="props.layout.w * 69 - 20"
|
|
11
|
+
:is-time="true"
|
|
12
|
+
tooltipOffset="offset"
|
|
13
|
+
:theme="theme"
|
|
14
|
+
/>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
<script setup>
|
|
18
|
+
import { ref, watch } from "vue";
|
|
19
|
+
import { parseTime } from "@/utils/timeUtils";
|
|
20
|
+
import { StackedChart } from "@/components";
|
|
21
|
+
|
|
22
|
+
// stores
|
|
23
|
+
// props and emits
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
config: Object,
|
|
26
|
+
obj: Object,
|
|
27
|
+
layout: Object,
|
|
28
|
+
id: String,
|
|
29
|
+
theme: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "light",
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
// states
|
|
35
|
+
const redraw = ref(false);
|
|
36
|
+
const data = ref([]);
|
|
37
|
+
// watcher
|
|
38
|
+
watch(
|
|
39
|
+
() => [props.layout.w, props.layout.h],
|
|
40
|
+
() => {
|
|
41
|
+
redraw.value = true;
|
|
42
|
+
setInterval(() => {
|
|
43
|
+
redraw.value = false;
|
|
44
|
+
}, 1);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
// mounted
|
|
48
|
+
getData();
|
|
49
|
+
// function defs
|
|
50
|
+
function getData() {
|
|
51
|
+
const slots = props.obj.table.rows.map((row) =>
|
|
52
|
+
parseTime(row[props.config.value.column.name])
|
|
53
|
+
);
|
|
54
|
+
const colName = props.config.categories.focus.name;
|
|
55
|
+
const label = props.config.categories.type.name;
|
|
56
|
+
const labelMap = {};
|
|
57
|
+
const values = [];
|
|
58
|
+
props.obj.table.rows.forEach((row, i) => {
|
|
59
|
+
if (!labelMap[row[label]]) {
|
|
60
|
+
labelMap[row[label]] = row[label];
|
|
61
|
+
}
|
|
62
|
+
values.push({
|
|
63
|
+
slot: parseTime(row[props.config.value.column.name]),
|
|
64
|
+
name: row[label],
|
|
65
|
+
value: row[colName],
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
data.value = {
|
|
69
|
+
slots: slots,
|
|
70
|
+
series: values,
|
|
71
|
+
names: labelMap,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div
|
|
4
|
+
class="overflow-auto"
|
|
5
|
+
:style="`max-height: ${
|
|
6
|
+
hasPagination ? layout.h * 70 - 120 : layout.h * 67 - 45
|
|
7
|
+
}px; width: ${layout.w * 68}px;`"
|
|
8
|
+
>
|
|
9
|
+
<table class="std-table whitespace-nowrap">
|
|
10
|
+
<thead>
|
|
11
|
+
<tr>
|
|
12
|
+
<TableHeader
|
|
13
|
+
v-for="cols in config.columns"
|
|
14
|
+
:key="cols.field"
|
|
15
|
+
:title="cols.header"
|
|
16
|
+
class="text-xs"
|
|
17
|
+
/>
|
|
18
|
+
</tr>
|
|
19
|
+
</thead>
|
|
20
|
+
<tbody v-if="!obj.table.rows || obj.table.rows.length === 0">
|
|
21
|
+
<tr>
|
|
22
|
+
<td colspan="100%" class="h-24 text-center">No data available</td>
|
|
23
|
+
</tr>
|
|
24
|
+
</tbody>
|
|
25
|
+
<tbody class="std-table-body">
|
|
26
|
+
<tr v-for="row in dataTable">
|
|
27
|
+
<TableData
|
|
28
|
+
v-for="cols in config.columns"
|
|
29
|
+
:title="formatCol(row[cols.field], cols.dateTimeFormat)"
|
|
30
|
+
:center="cols.alignment === 'center' || !cols.alignment"
|
|
31
|
+
:right="cols.alignment === 'right'"
|
|
32
|
+
class="text-xs"
|
|
33
|
+
/>
|
|
34
|
+
</tr>
|
|
35
|
+
</tbody>
|
|
36
|
+
</table>
|
|
37
|
+
</div>
|
|
38
|
+
<Pagination
|
|
39
|
+
v-if="hasPagination"
|
|
40
|
+
:startPos="props.paginationStore.startPos"
|
|
41
|
+
:pageSize="props.paginationStore.pageSize"
|
|
42
|
+
:total="obj.table.rows.length"
|
|
43
|
+
:style="`width: ${layout.w * 68}px;`"
|
|
44
|
+
@previous="previousPage()"
|
|
45
|
+
@next="nextPage()"
|
|
46
|
+
@navtopage="skipToPage"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script setup>
|
|
52
|
+
import { ref, computed } from "vue";
|
|
53
|
+
import { Pagination, TableHeader, TableData } from "@/components";
|
|
54
|
+
import {
|
|
55
|
+
costCount,
|
|
56
|
+
dataCount,
|
|
57
|
+
durationCount,
|
|
58
|
+
humanCount,
|
|
59
|
+
} from "@/utils/formatOutput";
|
|
60
|
+
import moment from "moment";
|
|
61
|
+
|
|
62
|
+
const props = defineProps({
|
|
63
|
+
config: Object,
|
|
64
|
+
obj: Object,
|
|
65
|
+
layout: Object,
|
|
66
|
+
id: String,
|
|
67
|
+
theme: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: "light",
|
|
70
|
+
},
|
|
71
|
+
paginationStore: Object,
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
const hasPagination = computed(() => {
|
|
75
|
+
return (
|
|
76
|
+
props.obj.table.rows &&
|
|
77
|
+
props.obj.table.rows.length > 0 &&
|
|
78
|
+
props.obj.table.rows.length > props.paginationStore.pageSize
|
|
79
|
+
);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
props.paginationStore.$reset;
|
|
83
|
+
const dataTable = ref(props.paginationStore.paginate(props.obj.table.rows));
|
|
84
|
+
function previousPage() {
|
|
85
|
+
dataTable.value = props.paginationStore.previousPage(props.obj.table.rows);
|
|
86
|
+
}
|
|
87
|
+
function nextPage() {
|
|
88
|
+
dataTable.value = props.paginationStore.nextPage(props.obj.table.rows);
|
|
89
|
+
}
|
|
90
|
+
function skipToPage(page) {
|
|
91
|
+
dataTable.value = props.paginationStore.skipToPage(props.obj.table.rows, page);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function formatCol(value, format) {
|
|
95
|
+
if (format === "default") return value;
|
|
96
|
+
if (format === "data") return dataCount(value) + "B";
|
|
97
|
+
if (format === "readable") return humanCount(value);
|
|
98
|
+
if (format === "cost") return costCount(value);
|
|
99
|
+
if (format === "duration") return durationCount(value);
|
|
100
|
+
if (format === "comma") return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
101
|
+
return moment(value).format(format);
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-html="config.text" class="ql-editor text-panel" />
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
|
+
import { onMounted } from "vue";
|
|
6
|
+
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
config: Object,
|
|
9
|
+
obj: Object,
|
|
10
|
+
id: String,
|
|
11
|
+
layout: Object,
|
|
12
|
+
theme: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "light",
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
onMounted(() => {
|
|
19
|
+
const textPanels = document.querySelectorAll(".text-panel");
|
|
20
|
+
Array.prototype.forEach.call(textPanels, (el) => {
|
|
21
|
+
el.style.padding = "0";
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<BarChartHorizontal
|
|
4
|
+
v-if="!redraw"
|
|
5
|
+
:id="id"
|
|
6
|
+
:data="data"
|
|
7
|
+
:unit="unit"
|
|
8
|
+
tooltipOffset="offset"
|
|
9
|
+
:height="props.layout.h * 65 - 40"
|
|
10
|
+
:width="props.layout.w * 65"
|
|
11
|
+
:value-name="props.config.categories.focus.name"
|
|
12
|
+
:theme="theme"
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref, watch } from "vue";
|
|
18
|
+
import { BarChartHorizontal } from "@/components";
|
|
19
|
+
|
|
20
|
+
// stores
|
|
21
|
+
// props and emits
|
|
22
|
+
const props = defineProps({
|
|
23
|
+
config: Object,
|
|
24
|
+
obj: Object,
|
|
25
|
+
id: String,
|
|
26
|
+
layout: Object,
|
|
27
|
+
theme: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "light",
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
// states
|
|
33
|
+
const data = ref({});
|
|
34
|
+
const redraw = ref(false);
|
|
35
|
+
const unit = ref("Value");
|
|
36
|
+
// watcher
|
|
37
|
+
watch(
|
|
38
|
+
() => [props.layout.w, props.layout.h],
|
|
39
|
+
() => {
|
|
40
|
+
redraw.value = true;
|
|
41
|
+
setInterval(() => {
|
|
42
|
+
redraw.value = false;
|
|
43
|
+
}, 1);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
// mounted
|
|
47
|
+
if (props.obj.table.columns) {
|
|
48
|
+
const col = props.obj.table.columns.find(
|
|
49
|
+
(col) => col.name === props.config.categories.focus.name
|
|
50
|
+
);
|
|
51
|
+
unit.value = col?.unit || "Value";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (props.obj.table.rows) {
|
|
55
|
+
const rows = JSON.parse(
|
|
56
|
+
JSON.stringify(
|
|
57
|
+
props.obj.table.rows.sort(
|
|
58
|
+
(a, b) =>
|
|
59
|
+
a[props.config.categories.focus.name] -
|
|
60
|
+
b[props.config.categories.focus.name]
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
);
|
|
64
|
+
data.value.fields = rows.map((row) => row[props.config.value.column.name]);
|
|
65
|
+
data.value.values = rows.map(
|
|
66
|
+
(row) => row[props.config.categories.focus.name]
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
</script>
|
package/src/fpl/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Outputs
|
|
2
|
+
export { default as FPLAlert } from "./Outputs/FPLAlert.vue";
|
|
3
|
+
export { default as FPLStream } from "./Outputs/FPLStream.vue";
|
|
4
|
+
export { default as FPLTable } from "./Outputs/FPLTable.vue";
|
|
5
|
+
|
|
6
|
+
// Panels
|
|
7
|
+
export { default as AlertPanel } from "./Panels/Alert.vue";
|
|
8
|
+
export { default as AlertSpritePanel } from "./Panels/AlertSprite.vue";
|
|
9
|
+
export { default as ChartPanel } from "./Panels/Chart.vue";
|
|
10
|
+
export { default as CounterPanel } from "./Panels/Counter.vue";
|
|
11
|
+
export { default as IPMapPanel } from "./Panels/IPMap.vue";
|
|
12
|
+
export { default as HistogramPanel } from "./Panels/Histogram.vue";
|
|
13
|
+
export { default as ImagePanel } from "./Panels/Image.vue";
|
|
14
|
+
export { default as MetricChartPanel } from "./Panels/MetricChart.vue";
|
|
15
|
+
export { default as PieChartPanel } from "./Panels/PieChart.vue";
|
|
16
|
+
export { default as SparkChartPanel } from "./Panels/SparkChart.vue";
|
|
17
|
+
export { default as StackedBarChartPanel } from "./Panels/StackedBarChart.vue";
|
|
18
|
+
export { default as TablePanel } from "./Panels/Table.vue";
|
|
19
|
+
export { default as TextPanel } from "./Panels/Text.vue";
|
|
20
|
+
export { default as TopNChartPanel } from "./Panels/TopNChart.vue";
|
|
21
|
+
|
|
22
|
+
// Configs
|
|
23
|
+
export { default as AlertConfig } from "./Configs/Alert.vue";
|
|
24
|
+
export { default as AlertSpriteConfig } from "./Configs/AlertSprite.vue";
|
|
25
|
+
export { default as ChartConfig } from "./Configs/Chart.vue";
|
|
26
|
+
export { default as CounterConfig } from "./Configs/Counter.vue";
|
|
27
|
+
export { default as IPMapConfig } from "./Configs/IPMap.vue";
|
|
28
|
+
export { default as HistogramConfig } from "./Configs/Histogram.vue";
|
|
29
|
+
export { default as ImageConfig } from "./Configs/Image.vue";
|
|
30
|
+
export { default as MetricChartConfig } from "./Configs/MetricChart.vue";
|
|
31
|
+
export { default as PieChartConfig } from "./Configs/PieChart.vue";
|
|
32
|
+
export { default as SparkChartConfig } from "./Configs/SparkChart.vue";
|
|
33
|
+
export { default as StackedBarChartConfig } from "./Configs/StackedBarChart.vue";
|
|
34
|
+
export { default as TableConfig } from "./Configs/Table.vue";
|
|
35
|
+
export { default as TextConfig } from "./Configs/Text.vue";
|
|
36
|
+
export { default as TopNChartConfig } from "./Configs/TopNChart.vue";
|
|
37
|
+
|
|
38
|
+
export { default as AddPanel } from "./AddPanel.vue";
|
|
39
|
+
export { default as Panel } from "./Panel.vue";
|