From a009c35b5298a3ed42a9ef1a217fbeafe0bec734 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 10 Nov 2025 20:19:49 +0100 Subject: [PATCH] copy to clipboard functionality for system log. Report view sharpening --- .../layout/error/ErrorModalOverview.vue | 37 +++++++++-- .../src/components/layout/report/Report.vue | 63 ++++++++++++++----- src/frontend/src/main.js | 3 +- 3 files changed, 84 insertions(+), 19 deletions(-) diff --git a/src/frontend/src/components/layout/error/ErrorModalOverview.vue b/src/frontend/src/components/layout/error/ErrorModalOverview.vue index 1be2c2a..a296852 100644 --- a/src/frontend/src/components/layout/error/ErrorModalOverview.vue +++ b/src/frontend/src/components/layout/error/ErrorModalOverview.vue @@ -1,6 +1,12 @@ @@ -78,10 +86,13 @@ import BasicBadge from "@/components/UI/BasicBadge.vue"; import {buildDate} from "@/common.js"; +import BasicButton from "@/components/UI/BasicButton.vue"; +import Toast from "@/components/UI/Toast.vue"; +import {error} from "loglevel"; export default { name: "ErrorModalOverview", - components: {BasicBadge}, + components: {Toast, BasicButton, BasicBadge}, props: { isSelected: { type: Boolean, @@ -92,6 +103,24 @@ export default { required: true, } }, + methods: { + async copyToClipboard() { + try { + await navigator.clipboard.writeText(JSON.stringify(this.error)); + + this.$refs.toast.addToast({ + icon: 'Bug', + message: "The error has been copied to clipboard", + title: "Copied to clipboard", + variant: 'success', + duration: 4000 + }) + + } catch (err) { + console.error('Fehler beim Kopieren:', err); + } + } + }, computed: { badgeVariant() { switch (this.error.type) { @@ -164,11 +193,11 @@ code { .error-section { display: grid; - grid-template-columns: 20rem 1fr; + grid-template-columns: 10rem 1fr; align-items: center; - padding: 1.6rem; + padding: 0.8rem; gap: 0.6rem; - border-bottom: 0.16rem solid #f3f4f6; + border-bottom: .1rem solid #E3EDFF } .error-label { diff --git a/src/frontend/src/components/layout/report/Report.vue b/src/frontend/src/components/layout/report/Report.vue index be41be6..6527379 100644 --- a/src/frontend/src/components/layout/report/Report.vue +++ b/src/frontend/src/components/layout/report/Report.vue @@ -16,21 +16,27 @@
-
+
-
MEK B
-
{{ report.risk.mek_b.total.toFixed(2) }}
+
MEK B
+
{{ report.risk.mek_b.total.toFixed(2) }} €
+
Opportunity scenario
-
{{ report.risk.opportunity_scenario.total.toFixed(2) }}
+
{{ report.risk.opportunity_scenario.total.toFixed(2) }} €
+
{{ + `${(report.risk.opportunity_scenario.percentage * 100).toFixed(2)} %` + }} +
Risk scenario
-
{{ report.risk.risk_scenario.total.toFixed(2) }}
+
{{ report.risk.risk_scenario.total.toFixed(2) }} €
+
{{ `${(report.risk.risk_scenario.percentage * 100).toFixed(2)} %`}}
@@ -150,7 +156,7 @@ -
Premisses
+
Premises
@@ -191,12 +197,12 @@
-
Packaging
+
Handling unit
-
HU dimensions [{{ premise.dimension_unit }}]
+
Dimensions [{{ premise.dimension_unit }}]
{{ toFixedDimension(premise.length, premise.dimension_unit) }} x {{ toFixedDimension(premise.width, premise.dimension_unit) }} x {{ toFixedDimension(premise.height, premise.dimension_unit) }} @@ -204,20 +210,26 @@
-
HU weight [{{ premise.weight_unit }}]
+
Weight [{{ premise.weight_unit }}]
{{ toFixedWeight(premise.weight, premise.weight_unit) }}
-
HU unit count
+
Unit count
{{ premise.hu_unit_count }}
-
Mixed container
+
Mixed transport
{{ premise.mixed ? 'Yes' : 'No' }}
+
+ +
Container
+ +
+
Stacked layers
{{ hasMainRun(premise.sections) ? premise.layer : '-' }}
@@ -225,17 +237,25 @@
Container unit count
-
{{hasMainRun(premise.sections) ? (premise.unit_count * premise.hu_unit_count) : '-' }}
+
+ {{ hasMainRun(premise.sections) ? (premise.unit_count * premise.hu_unit_count) : '-' }} +
+ +
Container type
-
{{hasMainRun(premise.sections) ? getContainerTypeName(premise.container_type) : '-' }}
+
+ {{ hasMainRun(premise.sections) ? getContainerTypeName(premise.container_type) : '-' }} +
Limiting factor
-
{{hasMainRun(premise.sections) ? premise.weight_exceeded ? 'Weight' : 'Volume' : '-'}}
+
+ {{ hasMainRun(premise.sections) ? premise.weight_exceeded ? 'Weight' : 'Volume' : '-' }} +
@@ -333,6 +353,21 @@ export default { text-align: right; } + +.report-content-data-cell-highlight { + background-color: #5AF0B4; + color: #002F54; + border-radius: 0.4rem; + padding: 0.2rem 0.4rem; + font-weight: 600; + +} + +.report-content-row-highlight { + font-weight: 500; + color: #001D33; +} + .report-content-data-header-cell { text-align: right; color: #001D33; diff --git a/src/frontend/src/main.js b/src/frontend/src/main.js index dfa3f04..fb15c60 100644 --- a/src/frontend/src/main.js +++ b/src/frontend/src/main.js @@ -29,7 +29,7 @@ import { PhFloppyDisk, PhArrowCounterClockwise, PhCheck, PhBug, PhShuffle, PhStack, PhFile, PhFilePlus, PhDownloadSimple, PhMonitor, PhCpu, PhFileJs, PhFileCloud, - PhCloudX, PhDesktop, PhHardDrives + PhCloudX, PhDesktop, PhHardDrives, PhClipboard } from "@phosphor-icons/vue"; @@ -69,6 +69,7 @@ app.component('PhStack', PhStack ); app.component('PhFile', PhFile); app.component("PhDesktop", PhDesktop ); app.component("PhHardDrives", PhHardDrives ); +app.component("PhClipboard", PhClipboard ); app.use(router);