mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-29 02:21:41 +00:00
Does the following: - Adjusts the shade of red buttons and banners to increase readability and reduce eye strain   - Cleans up factory reset and camera deletion modals   - Removes matchCamerasOnlyByPath as it is no longer used and throws errors in the console  - Limits the criteria to flag a camera mismatch in Camera Matching to only what is necessary based on camera type and highlights differences in table properties (testing on this is appreciated)  - Only displays both saved vs. current info in camera matching if there is a difference between the two  - Some general code cleanup (reduced unnecessary padding/margin/row-col statements, style="display:flex;" -> class="d-flex", etc. - Moves Compact Mode button to the bottom away from all the menu items (cleaner imo, open to thoughts) - Establishes a general spacing format for cards and pages and applies this to existing cards and pages to create a consistent look and feel to the UI (e.g. keeping things in line and less erratic spacing/placement of UI elements)     - Delete protection for camera matching modules - Anti-backend-spam for activate/deactivate/delete modules to hopefully prevent any odd behavior from button spamming - Enforces a common camera stream size on camera matching view (NEEDS MORE TESTING)  https://private-user-images.githubusercontent.com/29715865/400783758-dc99c151-b8a7-4367-a173-74c2fc5b2666.mp4?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzYyNTc3NzEsIm5iZiI6MTczNjI1NzQ3MSwicGF0aCI6Ii8yOTcxNTg2NS80MDA3ODM3NTgtZGM5OWMxNTEtYjhhNy00MzY3LWExNzMtNzRjMmZjNWIyNjY2Lm1wND9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAxMDclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMTA3VDEzNDQzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMwOWM1MDc2ZTVlOWZhM2MxYjAwZjAyZTc2MTYyZTk1ZTVmOGFhZmVkMzlmODRlZTk1ODVlOTk2ZGQzZmM0Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ovtRnObwbkEfljr9d5fqaory0nH91LWJSSkmrUUe_4Y
124 lines
4.6 KiB
Vue
124 lines
4.6 KiB
Vue
<script setup lang="ts">
|
|
import { PVCameraInfo } from "@/types/SettingTypes";
|
|
import _ from "lodash";
|
|
|
|
const { saved, current } = defineProps({
|
|
saved: {
|
|
type: PVCameraInfo,
|
|
required: true
|
|
},
|
|
current: {
|
|
type: PVCameraInfo,
|
|
required: true
|
|
}
|
|
});
|
|
|
|
const cameraInfoFor = (camera: PVCameraInfo): any => {
|
|
if (camera.PVUsbCameraInfo) {
|
|
return camera.PVUsbCameraInfo;
|
|
}
|
|
if (camera.PVCSICameraInfo) {
|
|
return camera.PVCSICameraInfo;
|
|
}
|
|
if (camera.PVFileCameraInfo) {
|
|
return camera.PVFileCameraInfo;
|
|
}
|
|
return {};
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<v-simple-table dense :style="{ backgroundColor: 'var(--v-primary-base)' }">
|
|
<tbody>
|
|
<tr>
|
|
<th></th>
|
|
<th>Saved</th>
|
|
<th>Current</th>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).dev !== undefined && cameraInfoFor(saved).dev !== null"
|
|
:class="cameraInfoFor(saved).dev !== cameraInfoFor(current).dev ? 'mismatch' : ''"
|
|
>
|
|
<td>Device Number:</td>
|
|
<td>{{ cameraInfoFor(saved).dev }}</td>
|
|
<td>{{ cameraInfoFor(current).dev }}</td>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).name !== undefined && cameraInfoFor(saved).name !== null"
|
|
:class="cameraInfoFor(saved).name !== cameraInfoFor(current).name ? 'mismatch' : ''"
|
|
>
|
|
<td>Name:</td>
|
|
<td>{{ cameraInfoFor(saved).name }}</td>
|
|
<td>{{ cameraInfoFor(current).name }}</td>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).baseName !== undefined && cameraInfoFor(saved).baseName !== null"
|
|
:class="cameraInfoFor(saved).baseName !== cameraInfoFor(current).baseName ? 'mismatch' : ''"
|
|
>
|
|
<td>Base Name:</td>
|
|
<td>{{ cameraInfoFor(saved).baseName }}</td>
|
|
<td>{{ cameraInfoFor(current).baseName }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Type:</td>
|
|
<td v-if="saved.PVUsbCameraInfo" class="mb-3">USB Camera</td>
|
|
<td v-else-if="saved.PVCSICameraInfo" class="mb-3">CSI Camera</td>
|
|
<td v-else-if="saved.PVFileCameraInfo" class="mb-3">File Camera</td>
|
|
<td v-else>Unidentified Camera Type</td>
|
|
<td v-if="current.PVUsbCameraInfo" class="mb-3">USB Camera</td>
|
|
<td v-else-if="current.PVCSICameraInfo" class="mb-3">CSI Camera</td>
|
|
<td v-else-if="current.PVFileCameraInfo" class="mb-3">File Camera</td>
|
|
<td v-else>Unidentified Camera Type</td>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).vendorId !== undefined && cameraInfoFor(saved).vendorId !== null"
|
|
:class="cameraInfoFor(saved).vendorId !== cameraInfoFor(current).vendorId ? 'mismatch' : ''"
|
|
>
|
|
<td>Vendor ID:</td>
|
|
<td>{{ cameraInfoFor(saved).vendorId }}</td>
|
|
<td>{{ cameraInfoFor(current).vendorId }}</td>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).productId !== undefined && cameraInfoFor(saved).productId !== null"
|
|
:class="cameraInfoFor(saved).productId !== cameraInfoFor(current).productId ? 'mismatch' : ''"
|
|
>
|
|
<td>Product ID:</td>
|
|
<td>{{ cameraInfoFor(saved).productId }}</td>
|
|
<td>{{ cameraInfoFor(current).productId }}</td>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).path !== undefined && cameraInfoFor(saved).path !== null"
|
|
:class="cameraInfoFor(saved).path !== cameraInfoFor(current).path ? 'mismatch' : ''"
|
|
>
|
|
<td>Path:</td>
|
|
<td style="word-break: break-all">{{ cameraInfoFor(saved).path }}</td>
|
|
<td style="word-break: break-all">{{ cameraInfoFor(current).path }}</td>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).otherPaths !== undefined && cameraInfoFor(saved).otherPaths !== null"
|
|
:class="!_.isEqual(cameraInfoFor(saved).otherPaths, cameraInfoFor(current).otherPaths) ? 'mismatch' : ''"
|
|
>
|
|
<td>Other Paths:</td>
|
|
<td>{{ cameraInfoFor(saved).otherPaths }}</td>
|
|
<td>{{ cameraInfoFor(current).otherPaths }}</td>
|
|
</tr>
|
|
<tr
|
|
v-if="cameraInfoFor(saved).uniquePath !== undefined && cameraInfoFor(saved).uniquePath !== null"
|
|
:class="cameraInfoFor(saved).uniquePath !== cameraInfoFor(current).uniquePath ? 'mismatch' : ''"
|
|
>
|
|
<td>Unique Path:</td>
|
|
<td style="word-break: break-all">{{ cameraInfoFor(saved).uniquePath }}</td>
|
|
<td style="word-break: break-all">{{ cameraInfoFor(current).uniquePath }}</td>
|
|
</tr>
|
|
</tbody>
|
|
</v-simple-table>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.mismatch {
|
|
background: #39a4d546 !important;
|
|
}
|
|
</style>
|