mirror of
https://github.com/FoggedLens/deflock.git
synced 2026-07-06 04:18:00 +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,4 +1,4 @@
|
||||
import type { LprVendor } from "@/types";
|
||||
import type { LprVendor, OtherSurveillanceDevice } from "@/types";
|
||||
import axios from "axios";
|
||||
|
||||
export interface Chapter {
|
||||
@@ -42,5 +42,14 @@ export const cmsService = {
|
||||
console.error("Error fetching LPR vendors:", error);
|
||||
throw new Error("Failed to fetch LPR vendors");
|
||||
}
|
||||
},
|
||||
async getOtherSurveillanceDevices(): Promise<OtherSurveillanceDevice[]> {
|
||||
try {
|
||||
const response = await cmsApiService.get("/items/nonLprVendors");
|
||||
return response.data.data as OtherSurveillanceDevice[];
|
||||
} catch (error) {
|
||||
console.error("Error fetching other surveillance devices:", error);
|
||||
throw new Error("Failed to fetch other surveillance devices");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,21 +1,25 @@
|
||||
import { lprBaseTags } from "@/constants";
|
||||
|
||||
interface DeflockProfileTags {
|
||||
interface DeflockProfile {
|
||||
name: string;
|
||||
tags: Record<string, string>;
|
||||
requiresDirection: boolean;
|
||||
submittable: boolean;
|
||||
fov: number;
|
||||
fov: number | null;
|
||||
}
|
||||
|
||||
export function createDeflockProfileUrl(name: string, obj: Record<string, string>): string {
|
||||
const tags = { ...lprBaseTags, ...obj };
|
||||
const profile: DeflockProfileTags = {
|
||||
interface DeflockProfileOptions {
|
||||
requiresDirection?: boolean;
|
||||
fov?: number | null;
|
||||
}
|
||||
|
||||
export function createDeflockProfileUrl(name: string, osmTags: Record<string, string>, options?: DeflockProfileOptions): string {
|
||||
const { requiresDirection = true, fov = null } = options || {};
|
||||
|
||||
const profile: DeflockProfile = {
|
||||
name,
|
||||
tags,
|
||||
requiresDirection: true,
|
||||
tags: osmTags,
|
||||
submittable: true,
|
||||
fov: 90.0,
|
||||
requiresDirection,
|
||||
fov
|
||||
};
|
||||
const payload = btoa(JSON.stringify(profile));
|
||||
return `deflockapp://profiles/add?p=${payload}`;
|
||||
|
||||
Reference in New Issue
Block a user