Fix Lint and Check errors

This commit is contained in:
ingalls
2025-12-12 10:13:47 -07:00
parent 3a36561ee2
commit 6330d1c528
5 changed files with 234 additions and 227 deletions

View File

@@ -39,87 +39,87 @@
<div class='col-12'>
<div class='mx-2 py-2'>
<div class='rounded bg-accent px-2 py-2'>
<TablerLoading
v-if='loading'
:inline='true'
class='my-2'
/>
<div
v-else-if='upload'
class='py-2 px-4'
>
<Upload
:url='uploadURL()'
:headers='uploadHeaders()'
method='PUT'
@cancel='upload = false'
@done='uploadComplete($event)'
<TablerLoading
v-if='loading'
:inline='true'
class='my-2'
/>
</div>
<div
v-else-if='upload'
class='py-2 px-4'
>
<Upload
:url='uploadURL()'
:headers='uploadHeaders()'
method='PUT'
@cancel='upload = false'
@done='uploadComplete($event)'
/>
</div>
<TablerNone
v-else-if='!files.length'
:compact='true'
:create='false'
/>
<template v-else>
<div class='w-100 d-flex flex-wrap align-items-center justify-content-center'>
<template v-for='file of files'>
<div
class='px-2 py-2 hover rounded'
>
<TablerNone
v-else-if='!files.length'
:compact='true'
:create='false'
/>
<template v-else>
<div class='w-100 d-flex flex-wrap align-items-center justify-content-center'>
<template v-for='file of files'>
<div
class='d-flex align-items-center justify-content-center'
style='
class='px-2 py-2 hover rounded'
>
<div
class='d-flex align-items-center justify-content-center'
style='
height: 200px;
width: 200px;
'
>
<img
v-if='[".png", ".jpg", ".jpeg", ".webp"].includes(file.ext.toLowerCase())'
class='cursor-pointer'
:style='{
"max-height": "180px",
"object-fit": "contain"
}'
:src='downloadAssetUrl(file)'
@click='attachmentPane(file)'
>
<IconFile
v-else
:size='60'
stroke='1'
/>
</div>
<img
v-if='[".png", ".jpg", ".jpeg", ".webp"].includes(file.ext.toLowerCase())'
class='cursor-pointer'
:style='{
"max-height": "180px",
"object-fit": "contain"
}'
:src='downloadAssetUrl(file)'
@click='attachmentPane(file)'
>
<IconFile
v-else
:size='60'
stroke='1'
/>
</div>
<div
class='d-flex align-items-center pt-2'
style='
<div
class='d-flex align-items-center pt-2'
style='
height: 30px;
'
>
<span
class='mx-2 text-truncate'
style='max-width: 160px;'
v-text='file.name'
/>
>
<span
class='mx-2 text-truncate'
style='max-width: 160px;'
v-text='file.name'
/>
<div class='ms-auto'>
<TablerIconButton
title='Download Asset'
@click='downloadAsset(file)'
>
<IconDownload
:size='24'
stroke='1'
/>
</TablerIconButton>
<div class='ms-auto'>
<TablerIconButton
title='Download Asset'
@click='downloadAsset(file)'
>
<IconDownload
:size='24'
stroke='1'
/>
</TablerIconButton>
</div>
</div>
</div>
</div>
</template>
</div>
</template>
</template>
</div>
</template>
</div>
</div>
</div>

View File

@@ -39,59 +39,59 @@
<div v-text='sensor.model || "Unknown"' />
</div>
<TablerRange
v-if='sensor.range !== undefined'
v-model='sensor.range'
label='Sensor Range Length'
:min='0'
:max='60000'
>
<div class='d-flex align-items-center'>
<TablerInput
v-model='sensor.range'
style='width: 82px'
/>
<div class='ms-1'>
m
<TablerRange
v-if='sensor.range !== undefined'
v-model='sensor.range'
label='Sensor Range Length'
:min='0'
:max='60000'
>
<div class='d-flex align-items-center'>
<TablerInput
v-model='sensor.range'
style='width: 82px'
/>
<div class='ms-1'>
m
</div>
</div>
</div>
</TablerRange>
</TablerRange>
<TablerRange
v-if='sensor.azimuth !== undefined'
v-model='sensor.azimuth'
label='Sensor Direction'
:min='0'
:max='360'
>
<div class='d-flex align-items-center'>
<TablerInput
v-model='sensor.azimuth'
style='width: 82px'
/>
<div class='ms-1'>
deg
<TablerRange
v-if='sensor.azimuth !== undefined'
v-model='sensor.azimuth'
label='Sensor Direction'
:min='0'
:max='360'
>
<div class='d-flex align-items-center'>
<TablerInput
v-model='sensor.azimuth'
style='width: 82px'
/>
<div class='ms-1'>
deg
</div>
</div>
</div>
</TablerRange>
</TablerRange>
<TablerRange
v-if='sensor.fov !== undefined'
v-model='sensor.fov'
label='Sensor FOV'
:min='0'
:max='360'
>
<div class='d-flex align-items-center'>
<TablerInput
v-model='sensor.fov'
style='width: 82px'
/>
<div class='ms-1'>
deg
<TablerRange
v-if='sensor.fov !== undefined'
v-model='sensor.fov'
label='Sensor FOV'
:min='0'
:max='360'
>
<div class='d-flex align-items-center'>
<TablerInput
v-model='sensor.fov'
style='width: 82px'
/>
<div class='ms-1'>
deg
</div>
</div>
</div>
</TablerRange>
</TablerRange>
</div>
</div>
</div>

View File

@@ -45,99 +45,99 @@
@update:model-value='updatePropertyIcon($event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Point Color</label>
<TablerInput
:model-value='cot.properties["marker-color"]'
label=''
default='#FFFFFF'
type='color'
class='pb-2'
@update:model-value='updateProperty("marker-color", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Point Opacity</label>
<TablerRange
:model-value='cot.properties["marker-opacity"]'
label=''
:default='1'
:min='0'
:max='1'
:step='0.01'
@update:model-value='updateProperty("marker-opacity", $event)'
/>
</div>
</template>
<template v-else>
<div class='col-12'>
<label class='subheader user-select-none'>Line Colour</label>
<TablerInput
:model-value='cot.properties["stroke"]'
label=''
type='color'
@update:model-value='updateProperty("stroke", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Point Color</label>
<TablerInput
:model-value='cot.properties["marker-color"]'
label=''
default='#FFFFFF'
type='color'
class='pb-2'
@update:model-value='updateProperty("marker-color", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Point Opacity</label>
<TablerRange
:model-value='cot.properties["marker-opacity"]'
label=''
:default='1'
:min='0'
:max='1'
:step='0.01'
@update:model-value='updateProperty("marker-opacity", $event)'
/>
</div>
</template>
<template v-else>
<div class='col-12'>
<label class='subheader user-select-none'>Line Colour</label>
<TablerInput
:model-value='cot.properties["stroke"]'
label=''
type='color'
@update:model-value='updateProperty("stroke", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Line Style</label>
<TablerEnum
:model-value='cot.properties["stroke-style"]'
label=''
:options='["solid", "dashed", "dotted", "outlined"]'
default='solid'
@update:model-value='updateProperty("stroke-style", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Line Thickness</label>
<TablerRange
:model-value='cot.properties["stroke-width"]'
label=''
:default='1'
:min='1'
:max='6'
:step='1'
@update:model-value='updateProperty("stroke-width", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Line Opacity</label>
<TablerRange
:model-value='cot.properties["stroke-opacity"]'
label=''
:default='1'
:min='0'
:max='1'
:step='0.01'
@update:model-value='updateProperty("stroke-opacity", $event)'
/>
</div>
</template>
<template v-if='cot.geometry.type === "Polygon" || cot.geometry.type === "MultiPolygon"'>
<div class='col-12'>
<label class='subheader user-select-none'>Fill Colour</label>
<TablerInput
:model-value='cot.properties["fill"]'
label=''
type='color'
@update:model-value='updateProperty("fill", $event)'
/>
</div>
<div class='col-12 round'>
<label class='subheader user-select-none'>Fill Opacity</label>
<TablerRange
:model-value='cot.properties["fill-opacity"]'
label=''
:default='1'
:min='0'
:max='1'
:step='0.01'
@update:model-value='updateProperty("fill-opacity", $event)'
/>
</div>
</template>
<div class='col-12'>
<label class='subheader user-select-none'>Line Style</label>
<TablerEnum
:model-value='cot.properties["stroke-style"]'
label=''
:options='["solid", "dashed", "dotted", "outlined"]'
default='solid'
@update:model-value='updateProperty("stroke-style", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Line Thickness</label>
<TablerRange
:model-value='cot.properties["stroke-width"]'
label=''
:default='1'
:min='1'
:max='6'
:step='1'
@update:model-value='updateProperty("stroke-width", $event)'
/>
</div>
<div class='col-12'>
<label class='subheader user-select-none'>Line Opacity</label>
<TablerRange
:model-value='cot.properties["stroke-opacity"]'
label=''
:default='1'
:min='0'
:max='1'
:step='0.01'
@update:model-value='updateProperty("stroke-opacity", $event)'
/>
</div>
</template>
<template v-if='cot.geometry.type === "Polygon" || cot.geometry.type === "MultiPolygon"'>
<div class='col-12'>
<label class='subheader user-select-none'>Fill Colour</label>
<TablerInput
:model-value='cot.properties["fill"]'
label=''
type='color'
@update:model-value='updateProperty("fill", $event)'
/>
</div>
<div class='col-12 round'>
<label class='subheader user-select-none'>Fill Opacity</label>
<TablerRange
:model-value='cot.properties["fill-opacity"]'
label=''
:default='1'
:min='0'
:max='1'
:step='0.01'
@update:model-value='updateProperty("fill-opacity", $event)'
/>
</div>
</template>
</div>
</div>
</div>
@@ -181,14 +181,16 @@ watch(expanded, (val) => {
function updateProperty(key: string, event: any) {
if (!props.cot) return;
const properties = { ...props.cot.properties };
if (typeof event === 'string' || typeof event === 'number') {
if (props.cot.properties[key] !== event) {
props.cot.properties[key] = event;
props.cot.update({})
if (properties[key] !== event) {
properties[key] = event;
props.cot.update({ properties });
}
} else {
props.cot.properties[key] = event;
props.cot.update({})
properties[key] = event;
props.cot.update({ properties });
}
}
@@ -199,27 +201,29 @@ function updatePropertyIcon(event: string | null) {
event = event.replace(/\.png$/g, '').replace(':', '/');
}
const properties = { ...props.cot.properties };
if (
event
&& (
!props.cot.properties.icon
!properties.icon
|| (
props.cot.properties.icon
&& event !== props.cot.properties.icon
properties.icon
&& event !== properties.icon
)
)
) {
props.cot.properties.icon = event;
props.cot.properties["marker-color"] = '#FFFFFF';
props.cot.update({});
} else if (props.cot.properties.icon && !event) {
if (props.cot.properties.type !== 'u-d-p') {
props.cot.properties.icon = props.cot.properties.type;
properties.icon = event;
properties["marker-color"] = '#FFFFFF';
props.cot.update({ properties });
} else if (properties.icon && !event) {
if (properties.type !== 'u-d-p') {
properties.icon = properties.type;
} else {
props.cot.properties.icon = undefined;
properties.icon = undefined;
}
props.cot.update({});
props.cot.update({ properties });
}
}
</script>

View File

@@ -35,7 +35,7 @@ globalThis.process = {
env: {
API_URL: 'http://localhost:5001',
},
}
} as any
// Mock self for workers
if (typeof self === 'undefined') {

View File

@@ -1,5 +1,6 @@
import type { paths } from './derived-types.js';
import type { Origin } from './base/cot.ts'
import type { Geometry } from 'geojson';
/*
* This file exports more human managable types from the
@@ -115,7 +116,7 @@ export type ProfileVideo = paths["/api/profile/video/{:id}"]["get"]["responses"]
export type ProfileFileList = paths["/api/profile/asset"]["get"]["responses"]["200"]["content"]["application/json"]
export type ProfileFile = ProfileFileList["items"][0];
export type Feature = paths["/api/profile/feature/{:id}"]["get"]["responses"]["200"]["content"]["application/json"] & {
export type Feature = Omit<paths["/api/profile/feature/{:id}"]["get"]["responses"]["200"]["content"]["application/json"], "geometry"> & {
origin?: Origin
properties: {
'id': string;
@@ -124,9 +125,10 @@ export type Feature = paths["/api/profile/feature/{:id}"]["get"]["responses"]["2
[index: string]: unknown
}
geometry: Geometry
}
export type InputFeature = paths["/api/profile/feature/{:id}"]["get"]["responses"]["200"]["content"]["application/json"] & {
export type InputFeature = Omit<paths["/api/profile/feature/{:id}"]["get"]["responses"]["200"]["content"]["application/json"], "geometry"> & {
origin?: Origin
properties: {
'id'?: string;
@@ -135,6 +137,7 @@ export type InputFeature = paths["/api/profile/feature/{:id}"]["get"]["responses
[index: string]: unknown
}
geometry: Geometry
}
export type FeaturePropertyCreator = Exclude<Feature["properties"]["creator"], undefined>