@dative-gpi/foundation-shared-components 1.0.36 → 1.0.37-report-v1
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/components/FSBreadcrumbs.vue +21 -12
- package/components/FSButton.vue +10 -10
- package/components/FSCalendar.vue +52 -14
- package/components/FSCalendarTwin.vue +96 -40
- package/components/FSCard.vue +28 -7
- package/components/FSCardPlaceholder.vue +8 -5
- package/components/FSChip.vue +12 -2
- package/components/FSClickable.vue +12 -13
- package/components/FSClock.vue +16 -7
- package/components/FSColorIcon.vue +23 -5
- package/components/FSDialog.vue +2 -1
- package/components/FSDialogContent.vue +12 -11
- package/components/FSDialogForm.vue +22 -2
- package/components/FSDialogFormBody.vue +47 -28
- package/components/FSDialogMenu.vue +17 -8
- package/components/FSDialogMultiFormBody.vue +77 -54
- package/components/FSDialogRemove.vue +8 -8
- package/components/FSDialogSubmit.vue +17 -8
- package/components/FSEditImage.vue +1 -1
- package/components/FSEditImageUI.vue +20 -10
- package/components/FSFadeOut.vue +53 -21
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +1 -1
- package/components/FSIcon.vue +2 -1
- package/components/FSIconCard.vue +47 -7
- package/components/FSImage.vue +12 -4
- package/components/FSImageUI.vue +8 -15
- package/components/FSInstantPicker.vue +266 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -11
- package/components/FSOptionGroup.vue +51 -3
- package/components/FSPlayButtons.vue +72 -0
- package/components/FSProgressBar.vue +94 -0
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSpan.vue +17 -7
- package/components/FSSwitch.vue +57 -27
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +14 -3
- package/components/FSTagGroup.vue +1 -1
- package/components/FSText.vue +11 -7
- package/components/FSWindow.vue +128 -4
- package/components/FSWrapGroup.vue +13 -1
- package/components/agenda/FSAgenda.vue +223 -0
- package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
- package/components/agenda/FSAgendaHeader.vue +215 -0
- package/components/agenda/FSAgendaHorizontalEvent.vue +174 -0
- package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
- package/components/agenda/FSAgendaHoursCol.vue +103 -0
- package/components/agenda/FSAgendaHoursRow.vue +164 -0
- package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
- package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
- package/components/agenda/FSDayAgenda.vue +199 -0
- package/components/agenda/FSMonthAgenda.vue +252 -0
- package/components/agenda/FSSelectAgendaMode.vue +54 -0
- package/components/agenda/FSWeekAgenda.vue +323 -0
- package/components/autocompletes/FSAutoCompleteAddress.vue +22 -20
- package/components/autocompletes/FSAutocompleteLanguage.vue +7 -1
- package/components/autocompletes/FSAutocompleteTimeZone.vue +7 -1
- package/components/buttons/FSButtonAdd.vue +1 -1
- package/components/buttons/FSButtonAddLabel.vue +1 -1
- package/components/buttons/FSButtonCancel.vue +1 -1
- package/components/buttons/FSButtonCancelLabel.vue +1 -1
- package/components/buttons/FSButtonCopy.vue +1 -1
- package/components/buttons/FSButtonCopyLabel.vue +1 -1
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- package/components/buttons/FSButtonDuplicate.vue +1 -1
- package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
- package/components/buttons/FSButtonEdit.vue +1 -1
- package/components/buttons/FSButtonEditLabel.vue +1 -1
- package/components/buttons/FSButtonFile.vue +1 -1
- package/components/buttons/FSButtonFileLabel.vue +1 -1
- package/components/buttons/FSButtonNext.vue +1 -1
- package/components/buttons/FSButtonNextLabel.vue +1 -1
- package/components/buttons/FSButtonPrevious.vue +1 -1
- package/components/buttons/FSButtonPreviousLabel.vue +1 -1
- package/components/buttons/FSButtonRedo.vue +1 -1
- package/components/buttons/FSButtonRedoLabel.vue +1 -1
- package/components/buttons/FSButtonRemove.vue +1 -1
- package/components/buttons/FSButtonRemoveLabel.vue +1 -1
- package/components/buttons/FSButtonSave.vue +1 -1
- package/components/buttons/FSButtonSaveLabel.vue +1 -1
- package/components/buttons/FSButtonSearch.vue +1 -1
- package/components/buttons/FSButtonSearchLabel.vue +1 -1
- package/components/buttons/FSButtonUndo.vue +1 -1
- package/components/buttons/FSButtonUndoLabel.vue +1 -1
- package/components/buttons/FSButtonUpdate.vue +1 -1
- package/components/buttons/FSButtonUpdateLabel.vue +1 -1
- package/components/buttons/FSButtonValidate.vue +1 -1
- package/components/buttons/FSButtonValidateLabel.vue +1 -1
- package/components/calendar/FSSimpleCalendar.vue +145 -0
- package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
- package/components/calendar/FSSimpleMonthSelector.vue +138 -0
- package/components/deviceOrganisations/FSConnectivity.vue +11 -1
- package/components/deviceOrganisations/FSConnectivityCard.vue +19 -47
- package/components/deviceOrganisations/FSStatus.vue +11 -1
- package/components/deviceOrganisations/FSStatusCard.vue +35 -61
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +9 -3
- package/components/deviceOrganisations/FSWorstAlert.vue +30 -37
- package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -85
- package/components/fields/FSAutocompleteField.vue +445 -463
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +44 -27
- package/components/fields/FSColorField.vue +42 -39
- package/components/fields/FSCommentField.vue +105 -0
- package/components/fields/FSDateField.vue +3 -2
- package/components/fields/FSDateRangeField.vue +3 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +8 -6
- package/components/fields/FSEntityFieldUI.vue +271 -0
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSIconField.vue +0 -1
- package/components/fields/FSMagicConfigField.vue +10 -3
- package/components/fields/FSMagicField.vue +9 -4
- package/components/fields/FSNumberField.vue +6 -1
- package/components/fields/FSRichTextField.vue +102 -52
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +477 -252
- package/components/fields/FSTagField.vue +1 -1
- package/components/fields/FSTermField.vue +42 -17
- package/components/fields/FSTextArea.vue +26 -7
- package/components/fields/FSTextField.vue +8 -3
- package/components/fields/FSTimeRangeField.vue +304 -0
- package/components/fields/FSTimeStepField.vue +3 -3
- package/components/fields/FSTranslateField.vue +4 -3
- package/components/fields/FSTranslateRichTextField.vue +32 -12
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/periodicField/FSPeriodicDailyField.vue +2 -2
- package/components/fields/periodicField/FSPeriodicField.vue +8 -8
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +8 -8
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +23 -13
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +6 -6
- package/components/lists/FSDataTableUI.vue +173 -103
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +7 -11
- package/components/lists/FSHeaderButton.vue +4 -4
- package/components/lists/FSHiddenButton.vue +3 -5
- package/components/lists/FSLoadDataTable.vue +10 -7
- package/components/lists/FSSimpleList.vue +234 -0
- package/components/lists/FSSimpleListItem.vue +132 -0
- package/components/map/FSMap.vue +83 -33
- package/components/map/FSMapFeatureGroup.vue +2 -2
- package/components/map/FSMapLayerButton.vue +3 -3
- package/components/map/FSMapMarker.vue +11 -7
- package/components/map/FSMapMarkerClusterGroup.vue +8 -3
- package/components/map/FSMapOverlay.vue +37 -20
- package/components/map/FSMapPolygon.vue +5 -5
- package/components/map/FSMapTileLayer.vue +2 -2
- package/components/map/keys.ts +3 -3
- package/components/selects/FSSelectAutoRefresh.vue +9 -9
- package/components/selects/FSSelectDashboardVariableType.vue +5 -4
- package/components/selects/FSSelectDateSetting.vue +3 -2
- package/components/selects/FSSelectDays.vue +9 -9
- package/components/selects/FSSelectListMode.vue +51 -0
- package/components/selects/FSSelectMonths.vue +14 -14
- package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
- package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
- package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
- package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
- package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
- package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlotPerSelector.vue +52 -0
- package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
- package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
- package/components/tiles/FSAlertTileUI.vue +90 -0
- package/components/tiles/FSChartTileUI.vue +111 -0
- package/components/tiles/FSCommentTileUI.vue +174 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -0
- package/components/tiles/FSGroupTileUI.vue +2 -2
- package/components/tiles/FSLoadTile.vue +2 -0
- package/components/tiles/FSLocationTileUI.vue +192 -0
- package/components/tiles/FSModelTileUI.vue +18 -0
- package/components/tiles/FSSimpleTileUI.vue +9 -4
- package/components/tiles/FSTile.vue +93 -74
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -1
- package/components/toggleSets/FSToggleSetPosition.vue +2 -2
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -140
- package/components/views/FSSimpleView.vue +29 -0
- package/components/views/desktop/FSBaseDefaultDesktopView.vue +135 -0
- package/components/views/desktop/FSBaseDesktopView.vue +53 -0
- package/components/views/desktop/FSBaseEntityDesktopView.vue +209 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +199 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/useBreakpoints.ts +39 -3
- package/composables/useColors.ts +3 -2
- package/composables/useMagicFieldProvider.ts +1 -0
- package/composables/useSlots.ts +2 -1
- package/models/agenda.ts +9 -0
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/index.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +2 -2
- package/models/rules.ts +8 -5
- package/models/tables.ts +5 -2
- package/models/variableNode.ts +8 -5
- package/package.json +5 -5
- package/styles/components/fs_agenda.scss +36 -0
- package/styles/components/fs_agenda_event.scss +41 -0
- package/styles/components/fs_agenda_hours_col.scss +4 -0
- package/styles/components/fs_agenda_hours_row.scss +5 -0
- package/styles/components/fs_agenda_time_line_marker.scss +19 -0
- package/styles/components/fs_autocomplete_field.scss +0 -13
- package/styles/components/fs_breadcrumbs.scss +18 -36
- package/styles/components/fs_button.scss +7 -5
- package/styles/components/fs_chip.scss +8 -6
- package/styles/components/fs_clickable.scss +18 -23
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_color_field.scss +1 -4
- package/styles/components/fs_data_iterator_item.scss +12 -10
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +7 -17
- package/styles/components/fs_dialog_menu.scss +4 -2
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_gradient_field.scss +11 -11
- package/styles/components/fs_hidden_button.scss +2 -7
- package/styles/components/fs_image_card.scss +6 -4
- package/styles/components/fs_magic_config_field.scss +1 -2
- package/styles/components/fs_map.scss +11 -7
- package/styles/components/fs_meta_field.scss +3 -5
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_password_field.scss +4 -2
- package/styles/components/fs_progress_bar.scss +14 -0
- package/styles/components/fs_radio.scss +0 -11
- package/styles/components/fs_rich_text_field.scss +1 -9
- package/styles/components/fs_select_date_settings.scss +3 -0
- package/styles/components/fs_select_field.scss +4 -13
- package/styles/components/fs_slide_group.scss +7 -0
- package/styles/components/fs_span.scss +13 -4
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +19 -33
- package/styles/components/fs_tag.scss +8 -22
- package/styles/components/fs_text_area.scss +13 -17
- package/styles/components/fs_tile.scss +21 -15
- package/styles/components/fs_window.scss +7 -0
- package/styles/components/fs_wrap_group.scss +7 -0
- package/styles/components/index.scss +6 -4
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +28 -61
- package/styles/globals/scrollbars.scss +10 -0
- package/styles/globals/text_fonts.scss +18 -66
- package/tools/alertsTools.ts +69 -0
- package/tools/chartsTools.ts +427 -0
- package/tools/index.ts +4 -0
- package/tools/reportsTools.ts +38 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +69 -0
- package/utils/sort.ts +2 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +17 -17
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/views/FSEntityHeader.vue +0 -350
- package/components/views/FSListHeader.vue +0 -83
- package/components/views/FSListView.vue +0 -83
- package/components/views/FSSkeletonView.vue +0 -100
- package/styles/components/fs_icon_field.scss +0 -12
- package/styles/components/fs_tag_field.scss +0 -8
- package/styles/components/fs_time_field.scss +0 -12
- package/styles/components/fs_timeslot_field.scss +0 -12
- package/styles/globals/breakpoints.scss +0 -20
- package/styles/globals/fixes.scss +0 -5
|
@@ -1,68 +1,42 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSCard
|
|
3
|
-
padding="
|
|
3
|
+
padding="12px 24px"
|
|
4
4
|
:elevation="true"
|
|
5
|
-
:border="false"
|
|
6
5
|
>
|
|
7
6
|
<FSCol
|
|
8
7
|
align="center-center"
|
|
8
|
+
gap="12px"
|
|
9
9
|
>
|
|
10
|
+
<FSChip
|
|
11
|
+
:prependIcon="$props.statusGroup.icon"
|
|
12
|
+
:color="$props.statusGroup.color"
|
|
13
|
+
:label="$props.modelStatus.label"
|
|
14
|
+
/>
|
|
10
15
|
<FSCol
|
|
16
|
+
v-if="$props.statusGroup.value"
|
|
11
17
|
align="center-center"
|
|
12
18
|
gap="0px"
|
|
13
19
|
>
|
|
14
|
-
<
|
|
15
|
-
v-if="$props.
|
|
16
|
-
align="center-right"
|
|
20
|
+
<FSText
|
|
21
|
+
v-if="$props.statusGroup.value && $props.modelStatus.groupById && $props.statusGroup.groupByValue"
|
|
17
22
|
>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<FSCol
|
|
25
|
-
align="center-center"
|
|
26
|
-
padding="0px 24px"
|
|
27
|
-
gap="12px"
|
|
23
|
+
{{ $props.modelStatus.groupByLabel }} {{ $props.statusGroup.groupByValue }}
|
|
24
|
+
</FSText>
|
|
25
|
+
<FSText
|
|
26
|
+
v-if="$props.statusGroup.value"
|
|
27
|
+
font="text-button"
|
|
28
|
+
:color="$props.statusGroup.color"
|
|
28
29
|
>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
:color="$props.statusGroup.color"
|
|
32
|
-
:label="statusLabel"
|
|
33
|
-
/>
|
|
34
|
-
<FSRow
|
|
35
|
-
v-if="$props.statusGroup.value"
|
|
36
|
-
width="hug"
|
|
37
|
-
>
|
|
38
|
-
<FSText
|
|
39
|
-
font="text-button"
|
|
40
|
-
:color="$props.statusGroup.color"
|
|
41
|
-
>
|
|
42
|
-
{{ $props.statusGroup.value }} {{ $props.statusGroup.unit }}
|
|
43
|
-
</FSText>
|
|
44
|
-
</FSRow>
|
|
45
|
-
<FSRow
|
|
46
|
-
v-if="$props.statusGroup.value && $props.modelStatus.groupById && $props.statusGroup.groupByValue"
|
|
47
|
-
width="hug"
|
|
48
|
-
>
|
|
49
|
-
<FSSpan>
|
|
50
|
-
{{ $props.modelStatus.groupByLabel }} {{ $props.statusGroup.groupByValue }}
|
|
51
|
-
</FSSpan>
|
|
52
|
-
</FSRow>
|
|
53
|
-
</FSCol>
|
|
30
|
+
{{ statusValue }}
|
|
31
|
+
</FSText>
|
|
54
32
|
</FSCol>
|
|
55
|
-
<
|
|
33
|
+
<FSText
|
|
56
34
|
v-if="deviceTimestamp"
|
|
57
|
-
|
|
58
|
-
|
|
35
|
+
font="text-overline"
|
|
36
|
+
variant="soft"
|
|
59
37
|
>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
>
|
|
63
|
-
{{ deviceTimestamp }}
|
|
64
|
-
</FSSpan>
|
|
65
|
-
</FSRow>
|
|
38
|
+
{{ deviceTimestamp }}
|
|
39
|
+
</FSText>
|
|
66
40
|
</FSCol>
|
|
67
41
|
</FSCard>
|
|
68
42
|
</template>
|
|
@@ -71,26 +45,20 @@
|
|
|
71
45
|
import { computed, defineComponent, type PropType } from "vue";
|
|
72
46
|
|
|
73
47
|
import type { FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
|
|
74
|
-
import {
|
|
48
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
75
49
|
|
|
76
|
-
import FSButton from "../FSButton.vue";
|
|
77
50
|
import FSCard from "../FSCard.vue";
|
|
78
51
|
import FSChip from "../FSChip.vue";
|
|
79
52
|
import FSText from "../FSText.vue";
|
|
80
|
-
import FSSpan from "../FSSpan.vue";
|
|
81
53
|
import FSCol from "../FSCol.vue";
|
|
82
|
-
import FSRow from "../FSRow.vue";
|
|
83
54
|
|
|
84
55
|
export default defineComponent({
|
|
85
56
|
name: "FSStatusCard",
|
|
86
57
|
components: {
|
|
87
|
-
FSButton,
|
|
88
58
|
FSCard,
|
|
89
59
|
FSChip,
|
|
90
60
|
FSText,
|
|
91
|
-
|
|
92
|
-
FSCol,
|
|
93
|
-
FSRow
|
|
61
|
+
FSCol
|
|
94
62
|
},
|
|
95
63
|
props: {
|
|
96
64
|
closable: {
|
|
@@ -108,10 +76,16 @@ export default defineComponent({
|
|
|
108
76
|
},
|
|
109
77
|
emits: ["close"],
|
|
110
78
|
setup(props) {
|
|
111
|
-
const { epochToLongTimeFormat } =
|
|
79
|
+
const { epochToLongTimeFormat } = useDateFormat();
|
|
112
80
|
|
|
113
|
-
const
|
|
114
|
-
|
|
81
|
+
const statusValue = computed((): string => {
|
|
82
|
+
if (props.statusGroup.label) {
|
|
83
|
+
return props.statusGroup.label;
|
|
84
|
+
}
|
|
85
|
+
if (props.statusGroup.value && !isNaN(parseFloat(props.statusGroup.value))) {
|
|
86
|
+
return `${parseFloat(props.statusGroup.value).toLocaleString("fullwide", { maximumFractionDigits: 2 })} ${props.statusGroup.unit}`;
|
|
87
|
+
}
|
|
88
|
+
return `${props.statusGroup.value} ${props.statusGroup.unit}`;
|
|
115
89
|
});
|
|
116
90
|
|
|
117
91
|
const deviceTimestamp = computed((): string => {
|
|
@@ -123,7 +97,7 @@ export default defineComponent({
|
|
|
123
97
|
|
|
124
98
|
return {
|
|
125
99
|
deviceTimestamp,
|
|
126
|
-
|
|
100
|
+
statusValue
|
|
127
101
|
};
|
|
128
102
|
}
|
|
129
103
|
});
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
/>
|
|
11
11
|
<FSWorstAlert
|
|
12
12
|
v-if="$props.deviceWorstAlert"
|
|
13
|
-
:
|
|
14
|
-
:
|
|
13
|
+
:deviceWorstAlert="$props.deviceWorstAlert"
|
|
14
|
+
:deviceAlerts="$props.deviceAlerts"
|
|
15
|
+
:alertTo="$props.alertTo"
|
|
15
16
|
/>
|
|
16
17
|
<template
|
|
17
18
|
v-for="(modelStatus, index) in $props.modelStatuses"
|
|
@@ -30,7 +31,7 @@
|
|
|
30
31
|
import { defineComponent, type PropType } from "vue";
|
|
31
32
|
|
|
32
33
|
import type { FSDeviceAlert, FSDeviceConnectivity, FSDeviceStatus, FSDeviceStatusGroup, FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
|
|
33
|
-
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/
|
|
34
|
+
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/enums";
|
|
34
35
|
|
|
35
36
|
import FSConnectivity from "./FSConnectivity.vue";
|
|
36
37
|
import FSWorstAlert from "./FSWorstAlert.vue";
|
|
@@ -68,6 +69,11 @@ export default defineComponent({
|
|
|
68
69
|
deviceStatuses: {
|
|
69
70
|
type: Array as PropType<FSDeviceStatus[]>,
|
|
70
71
|
required: true
|
|
72
|
+
},
|
|
73
|
+
alertTo: {
|
|
74
|
+
type: Function,
|
|
75
|
+
required: false,
|
|
76
|
+
default: null
|
|
71
77
|
}
|
|
72
78
|
},
|
|
73
79
|
setup(props) {
|
|
@@ -2,27 +2,30 @@
|
|
|
2
2
|
<v-menu
|
|
3
3
|
:closeOnContentClick="false"
|
|
4
4
|
v-model="menu"
|
|
5
|
+
location="bottom center"
|
|
5
6
|
>
|
|
6
7
|
<template
|
|
7
8
|
#activator="{ props }"
|
|
8
9
|
>
|
|
9
10
|
<FSBadge
|
|
10
11
|
:content="badgeLabel"
|
|
11
|
-
:color="criticityColor"
|
|
12
|
+
:color="AlertTools.criticityColor($props.deviceWorstAlert?.criticity)"
|
|
12
13
|
>
|
|
13
14
|
<FSColorIcon
|
|
14
15
|
class="fs-stopclick"
|
|
15
|
-
|
|
16
|
-
:color="criticityColor"
|
|
16
|
+
:padding="$props.padding"
|
|
17
|
+
:color="AlertTools.criticityColor($props.deviceWorstAlert?.criticity)"
|
|
18
|
+
:size="$props.size"
|
|
17
19
|
@click.prevent.stop
|
|
18
20
|
v-bind="props"
|
|
19
21
|
>
|
|
20
|
-
{{ statusIcon }}
|
|
22
|
+
{{ AlertTools.statusIcon($props.deviceWorstAlert?.status) }}
|
|
21
23
|
</FSColorIcon>
|
|
22
24
|
</FSBadge>
|
|
23
25
|
</template>
|
|
24
26
|
<FSWorstAlertCard
|
|
25
|
-
:deviceAlert="
|
|
27
|
+
:deviceAlert="deviceWorstAlert"
|
|
28
|
+
:alertTo="$props.alertTo"
|
|
26
29
|
@close="menu = false"
|
|
27
30
|
/>
|
|
28
31
|
</v-menu>
|
|
@@ -31,9 +34,8 @@
|
|
|
31
34
|
<script lang="ts">
|
|
32
35
|
import { computed, defineComponent, type PropType, ref } from "vue";
|
|
33
36
|
|
|
34
|
-
import {
|
|
35
|
-
import
|
|
36
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
37
|
+
import { type FSDeviceAlert } from "@dative-gpi/foundation-shared-components/models";
|
|
38
|
+
import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
|
|
37
39
|
|
|
38
40
|
import FSWorstAlertCard from "./FSWorstAlertCard.vue";
|
|
39
41
|
import FSColorIcon from "../FSColorIcon.vue";
|
|
@@ -47,53 +49,44 @@ export default defineComponent({
|
|
|
47
49
|
FSBadge
|
|
48
50
|
},
|
|
49
51
|
props: {
|
|
50
|
-
|
|
52
|
+
deviceWorstAlert: {
|
|
51
53
|
type: Object as PropType<FSDeviceAlert>,
|
|
52
54
|
required: true
|
|
53
55
|
},
|
|
54
56
|
deviceAlerts: {
|
|
55
|
-
type:
|
|
57
|
+
type: Array as PropType<FSDeviceAlert[]>,
|
|
56
58
|
required: false,
|
|
57
|
-
default:
|
|
59
|
+
default: () => []
|
|
60
|
+
},
|
|
61
|
+
alertTo: {
|
|
62
|
+
type: Function,
|
|
63
|
+
required: false,
|
|
64
|
+
default: null
|
|
65
|
+
},
|
|
66
|
+
size: {
|
|
67
|
+
type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
|
|
68
|
+
default: "m"
|
|
69
|
+
},
|
|
70
|
+
padding: {
|
|
71
|
+
type: [String, Number] as PropType<string | number>,
|
|
72
|
+
default: "8px"
|
|
58
73
|
}
|
|
59
74
|
},
|
|
60
75
|
setup(props) {
|
|
61
76
|
const menu = ref(false);
|
|
62
77
|
|
|
63
|
-
const criticityColor = computed(() => {
|
|
64
|
-
switch (props.deviceAlert?.criticity) {
|
|
65
|
-
case Criticity.Error: return ColorEnum.Error;
|
|
66
|
-
case Criticity.Warning: return ColorEnum.Warning;
|
|
67
|
-
default: return ColorEnum.Primary;
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const statusIcon = computed(() => {
|
|
72
|
-
switch (props.deviceAlert?.status) {
|
|
73
|
-
case AlertStatus.Pending: return "mdi-timer-outline";
|
|
74
|
-
case AlertStatus.Untriggered: return "mdi-timer-off-outline";
|
|
75
|
-
case AlertStatus.Unresolved: return "mdi-alert-circle-outline";
|
|
76
|
-
case AlertStatus.Resolved: return "mdi-check-circle-outline";
|
|
77
|
-
case AlertStatus.Expired: return "mdi-clock-outline";
|
|
78
|
-
case AlertStatus.Triggered: return "mdi-alert-circle-outline";
|
|
79
|
-
case AlertStatus.Abandoned: return "mdi-cancel"
|
|
80
|
-
default: return "";
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
78
|
const badgeLabel = computed((): string | null => {
|
|
85
|
-
if (props.deviceAlerts < 1) {
|
|
79
|
+
if (!props.deviceAlerts || props.deviceAlerts.length < 1) {
|
|
86
80
|
return null;
|
|
87
81
|
}
|
|
88
|
-
if (props.deviceAlerts > 9) {
|
|
82
|
+
if (props.deviceAlerts.length > 9) {
|
|
89
83
|
return "9+";
|
|
90
84
|
}
|
|
91
|
-
return
|
|
85
|
+
return props.deviceAlerts.length.toString();
|
|
92
86
|
});
|
|
93
87
|
|
|
94
88
|
return {
|
|
95
|
-
|
|
96
|
-
statusIcon,
|
|
89
|
+
AlertTools,
|
|
97
90
|
badgeLabel,
|
|
98
91
|
menu
|
|
99
92
|
};
|
|
@@ -1,55 +1,44 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSCard
|
|
3
|
-
padding="
|
|
3
|
+
padding="12px 24px"
|
|
4
4
|
:elevation="true"
|
|
5
|
-
:border="false"
|
|
6
5
|
>
|
|
7
6
|
<FSCol
|
|
8
7
|
align="center-center"
|
|
8
|
+
gap="12px"
|
|
9
9
|
>
|
|
10
|
+
<FSChip
|
|
11
|
+
:label="$tr('ui.common.alert', 'Alert')"
|
|
12
|
+
:prependIcon="AlertTools.statusIcon($props.deviceAlert?.status)"
|
|
13
|
+
:color="AlertTools.criticityColor($props.deviceAlert?.criticity)"
|
|
14
|
+
/>
|
|
10
15
|
<FSCol
|
|
11
16
|
align="center-center"
|
|
12
17
|
gap="0px"
|
|
13
18
|
>
|
|
14
|
-
<
|
|
15
|
-
|
|
19
|
+
<FSText>
|
|
20
|
+
{{ $tr('ui.alert.status', 'Status') }} : {{ AlertTools.statusLabel($props.deviceAlert?.status) }}
|
|
21
|
+
</FSText>
|
|
22
|
+
<FSText
|
|
23
|
+
font="text-button"
|
|
24
|
+
:color="AlertTools.criticityColor($props.deviceAlert?.criticity)"
|
|
16
25
|
>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
variant="icon"
|
|
20
|
-
@click="$emit('close')"
|
|
21
|
-
/>
|
|
22
|
-
</FSRow>
|
|
23
|
-
<FSCol
|
|
24
|
-
align="center-center"
|
|
25
|
-
padding="0px 24px"
|
|
26
|
-
gap="12px"
|
|
27
|
-
>
|
|
28
|
-
<FSChip
|
|
29
|
-
:label="$props.deviceAlert.label"
|
|
30
|
-
:prependIcon="statusIcon"
|
|
31
|
-
:color="criticityColor"
|
|
32
|
-
/>
|
|
33
|
-
<FSRow
|
|
34
|
-
width="hug"
|
|
35
|
-
>
|
|
36
|
-
<FSText>
|
|
37
|
-
{{ statusLabel }}
|
|
38
|
-
</FSText>
|
|
39
|
-
</FSRow>
|
|
40
|
-
</FSCol>
|
|
26
|
+
{{ $props.deviceAlert.label }}
|
|
27
|
+
</FSText>
|
|
41
28
|
</FSCol>
|
|
42
|
-
<
|
|
29
|
+
<FSText
|
|
43
30
|
v-if="deviceTimestamp"
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
font="text-overline"
|
|
32
|
+
variant="dark"
|
|
46
33
|
>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
{{ deviceTimestamp }}
|
|
35
|
+
</FSText>
|
|
36
|
+
<FSButton
|
|
37
|
+
v-if="$props.alertTo"
|
|
38
|
+
icon="mdi-information-outline"
|
|
39
|
+
:label="$tr('ui.alert.details', 'Alert details')"
|
|
40
|
+
:to="$props.alertTo($props.deviceAlert.id)"
|
|
41
|
+
/>
|
|
53
42
|
</FSCol>
|
|
54
43
|
</FSCard>
|
|
55
44
|
</template>
|
|
@@ -57,19 +46,15 @@
|
|
|
57
46
|
<script lang="ts">
|
|
58
47
|
import { computed, defineComponent, type PropType } from "vue";
|
|
59
48
|
|
|
60
|
-
import {
|
|
61
|
-
import
|
|
62
|
-
import {
|
|
63
|
-
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/models";
|
|
64
|
-
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
49
|
+
import { type FSDeviceAlert } from "@dative-gpi/foundation-shared-components/models";
|
|
50
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
51
|
+
import { AlertTools } from "@dative-gpi/foundation-shared-components/tools";
|
|
65
52
|
|
|
66
53
|
import FSButton from "../FSButton.vue";
|
|
67
54
|
import FSCard from "../FSCard.vue";
|
|
68
55
|
import FSChip from "../FSChip.vue";
|
|
69
56
|
import FSText from "../FSText.vue";
|
|
70
|
-
import FSSpan from "../FSSpan.vue";
|
|
71
57
|
import FSCol from "../FSCol.vue";
|
|
72
|
-
import FSRow from "../FSRow.vue";
|
|
73
58
|
|
|
74
59
|
export default defineComponent({
|
|
75
60
|
name: "FSWorstAlertCard",
|
|
@@ -78,54 +63,22 @@ export default defineComponent({
|
|
|
78
63
|
FSCard,
|
|
79
64
|
FSChip,
|
|
80
65
|
FSText,
|
|
81
|
-
FSSpan,
|
|
82
66
|
FSCol,
|
|
83
|
-
FSRow
|
|
84
67
|
},
|
|
85
68
|
props: {
|
|
86
69
|
deviceAlert: {
|
|
87
70
|
type: Object as PropType<FSDeviceAlert>,
|
|
88
71
|
required: true
|
|
72
|
+
},
|
|
73
|
+
alertTo: {
|
|
74
|
+
type: Function,
|
|
75
|
+
required: false,
|
|
76
|
+
default: null
|
|
89
77
|
}
|
|
90
78
|
},
|
|
91
79
|
emits: ["close"],
|
|
92
80
|
setup(props) {
|
|
93
|
-
const { epochToLongTimeFormat } =
|
|
94
|
-
const { $tr } = useTranslationsProvider();
|
|
95
|
-
|
|
96
|
-
const criticityColor = computed(() => {
|
|
97
|
-
switch (props.deviceAlert?.criticity) {
|
|
98
|
-
case Criticity.Error: return ColorEnum.Error;
|
|
99
|
-
case Criticity.Warning: return ColorEnum.Warning;
|
|
100
|
-
default: return ColorEnum.Primary;
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
const statusIcon = computed(() => {
|
|
105
|
-
switch (props.deviceAlert?.status) {
|
|
106
|
-
case AlertStatus.Pending: return "mdi-timer-outline";
|
|
107
|
-
case AlertStatus.Untriggered: return "mdi-timer-off-outline";
|
|
108
|
-
case AlertStatus.Unresolved: return "mdi-alert-circle-outline";
|
|
109
|
-
case AlertStatus.Resolved: return "mdi-check-circle-outline";
|
|
110
|
-
case AlertStatus.Expired: return "mdi-clock-outline";
|
|
111
|
-
case AlertStatus.Triggered: return "mdi-alert-circle-outline";
|
|
112
|
-
case AlertStatus.Abandoned: return "mdi-cancel"
|
|
113
|
-
default: return "";
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
const statusLabel = computed(() => {
|
|
118
|
-
switch (props.deviceAlert?.status) {
|
|
119
|
-
case AlertStatus.Pending: return $tr("ui.alert-status.pending", "Pending");
|
|
120
|
-
case AlertStatus.Untriggered: return $tr("ui.alert-status.untriggered", "Untriggered");
|
|
121
|
-
case AlertStatus.Unresolved: return $tr("ui.alert-status.unresolved", "Unresolved");
|
|
122
|
-
case AlertStatus.Resolved: return $tr("ui.alert-status.resolved", "Resolved");
|
|
123
|
-
case AlertStatus.Expired: return $tr("ui.alert-status.expired", "Expired");
|
|
124
|
-
case AlertStatus.Triggered: return $tr("ui.alert-status.triggered", "Triggered");
|
|
125
|
-
case AlertStatus.Abandoned: return $tr("ui.alert-status.abandoned", "Abandoned");
|
|
126
|
-
default: return "";
|
|
127
|
-
}
|
|
128
|
-
});
|
|
81
|
+
const { epochToLongTimeFormat } = useDateFormat();
|
|
129
82
|
|
|
130
83
|
const deviceTimestamp = computed((): string => {
|
|
131
84
|
if (props.deviceAlert.sourceTimestamp) {
|
|
@@ -136,9 +89,7 @@ export default defineComponent({
|
|
|
136
89
|
|
|
137
90
|
return {
|
|
138
91
|
deviceTimestamp,
|
|
139
|
-
|
|
140
|
-
statusLabel,
|
|
141
|
-
statusIcon
|
|
92
|
+
AlertTools
|
|
142
93
|
};
|
|
143
94
|
}
|
|
144
95
|
});
|