Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions photon-client/src/components/app/photon-error-snackbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,15 @@ import { useStateStore } from "@/stores/StateStore";
<p style="padding: 0; margin: 0; text-align: center">
{{ useStateStore().snackbarData.message }}
</p>
<v-progress-linear
v-if="useStateStore().snackbarData.progressBar != -1"
v-model="useStateStore().snackbarData.progressBar"
height="15"
:color="useStateStore().snackbarData.progressBarColor"
>
<template v-slot:default="{ value }">
<strong> {{ Math.ceil(value) }}% </strong>
</template>
</v-progress-linear>
</v-snackbar>
</template>
6 changes: 4 additions & 2 deletions photon-client/src/components/settings/DeviceControlCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ const handleOfflineUpdate = () => {
const uploadPercentage = (progress || 0) * 100.0;
if (uploadPercentage < 99.5) {
useStateStore().showSnackbarMessage({
message: "New Software Upload in Process, " + uploadPercentage.toFixed(2) + "% complete",
message: "New Software Upload in Progress",
color: "secondary",
timeout: -1
timeout: -1,
progressBar: uploadPercentage,
progressBarColor: "primary"
});
} else {
useStateStore().showSnackbarMessage({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ const handleBulkImport = () => {
const uploadPercentage = (progress || 0) * 100.0;
if (uploadPercentage < 99.5) {
useStateStore().showSnackbarMessage({
message: "Object Detection Models Upload in Process, " + uploadPercentage.toFixed(2) + "% complete",
message: "Object Detection Models Upload in Progress",
color: "secondary",
timeout: -1
timeout: -1,
progressBar: uploadPercentage,
progressBarColor: "primary"
});
} else {
useStateStore().showSnackbarMessage({
Expand Down
15 changes: 14 additions & 1 deletion photon-client/src/stores/StateStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ interface StateStore {

snackbarData: {
show: boolean;
progressBar: number;
progressBarColor: string;
message: string;
color: string;
timeout: number;
Expand Down Expand Up @@ -86,6 +88,8 @@ export const useStateStore = defineStore("state", {

snackbarData: {
show: false,
progressBar: -1,
progressBarColor: "info",
message: "No Message",
color: "info",
timeout: 2000
Expand Down Expand Up @@ -158,13 +162,22 @@ export const useStateStore = defineStore("state", {
updateDiscoveredCameras(data: VsmState) {
this.vsmState = data;
},
showSnackbarMessage(data: { message: string; color: string; timeout?: number }) {
showSnackbarMessage(data: {
message: string;
color: string;
timeout?: number;
progressBar?: number;
progressBarColor?: string;
}) {
this.snackbarData = {
show: true,
progressBar: data.progressBar || -1,
message: data.message,
color: data.color,
progressBarColor: data.progressBarColor || "",
timeout: data.timeout || 2000
};
console.log(this.snackbarData);
}
}
});
Loading