mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-07-15 08:17:20 +02:00
Allow Profile Imports to App, Map Sharing, iframe improvements (#102)
* update identiyf page * support non-ALPRs on Idenfity page * show pending devices, even w/o tags * update lprBaseTags * detect iframe instead of passing query string * implement share dialog * clean up identify * finishing touches for identify page
This commit is contained in:
@@ -1,20 +1,26 @@
|
||||
import { defineStore } from 'pinia';
|
||||
import { ref } from 'vue';
|
||||
import { cmsService } from '@/services/cmsService';
|
||||
import type { LprVendor } from '@/types';
|
||||
import type { LprVendor, OtherSurveillanceDevice } from '@/types';
|
||||
|
||||
export const useVendorStore = defineStore('vendorStore', () => {
|
||||
const lprVendors = ref<LprVendor[]>([]);
|
||||
const otherDevices = ref<OtherSurveillanceDevice[]>([]);
|
||||
|
||||
async function loadAllVendors(): Promise<void> {
|
||||
if (lprVendors.value.length > 0) return;
|
||||
lprVendors.value = await cmsService.getLprVendors();
|
||||
}
|
||||
|
||||
async function loadAllOtherDevices(): Promise<void> {
|
||||
if (otherDevices.value.length > 0) return;
|
||||
otherDevices.value = await cmsService.getOtherSurveillanceDevices();
|
||||
}
|
||||
|
||||
async function getFirstImageForManufacturer(fullName: string): Promise<string | null> {
|
||||
const vendor = lprVendors.value.find(v => v.fullName === fullName);
|
||||
return vendor?.urls?.[0]?.url ?? null;
|
||||
}
|
||||
|
||||
return { lprVendors, loadAllVendors, getFirstImageForManufacturer };
|
||||
return { lprVendors, otherDevices, loadAllVendors, loadAllOtherDevices, getFirstImageForManufacturer };
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user