Added form defaults
This commit is contained in:
parent
58de012af6
commit
da6f1b8281
@ -9,6 +9,7 @@ import AccordionContent from 'primevue/accordioncontent';
|
|||||||
import Dialog from 'primevue/dialog'
|
import Dialog from 'primevue/dialog'
|
||||||
|
|
||||||
import { JsonForms } from "@jsonforms/vue";
|
import { JsonForms } from "@jsonforms/vue";
|
||||||
|
import { createAjv } from '@jsonforms/core'
|
||||||
import { primeVueRenderers } from 'jsonforms-primevue'
|
import { primeVueRenderers } from 'jsonforms-primevue'
|
||||||
|
|
||||||
import { useToast } from 'primevue/usetoast'
|
import { useToast } from 'primevue/usetoast'
|
||||||
@ -31,6 +32,10 @@ const commands = ref([])
|
|||||||
const commandMap = reactive({})
|
const commandMap = reactive({})
|
||||||
const commandByResponseId = reactive({})
|
const commandByResponseId = reactive({})
|
||||||
|
|
||||||
|
const defaultsAjv = createAjv({ useDefaults: true })
|
||||||
|
// Suppress Ajv unknown format warning by registering a no-op validator for "textarea"
|
||||||
|
defaultsAjv.addFormat('textarea', true)
|
||||||
|
|
||||||
function rebuildList() {
|
function rebuildList() {
|
||||||
commands.value = Object.values(commandMap)
|
commands.value = Object.values(commandMap)
|
||||||
}
|
}
|
||||||
@ -184,6 +189,7 @@ const jsonFormsConfig = {
|
|||||||
:renderers="renderers"
|
:renderers="renderers"
|
||||||
:config="jsonFormsConfig"
|
:config="jsonFormsConfig"
|
||||||
:onChange="({ data, errors }) => cmd.input = data"
|
:onChange="({ data, errors }) => cmd.input = data"
|
||||||
|
:ajv="defaultsAjv"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Right: Buttons -->
|
<!-- Right: Buttons -->
|
||||||
|
|||||||
@ -34,9 +34,9 @@ class MQTTHandler:
|
|||||||
self.mqtt_config = mqtt_config
|
self.mqtt_config = mqtt_config
|
||||||
|
|
||||||
self.topic_base = f"device/{handler_id}"
|
self.topic_base = f"device/{handler_id}"
|
||||||
self.status_topic = f"{self.topic_base}/status"
|
|
||||||
self.command_topic = f"{self.topic_base}/command"
|
self.command_topic = f"{self.topic_base}/command"
|
||||||
self.property_topic = f"{self.topic_base}/property"
|
self.property_topic = f"{self.topic_base}/property"
|
||||||
|
self.status_topic = f"{self.property_topic}/status"
|
||||||
|
|
||||||
self._shutdown_event = asyncio.Event()
|
self._shutdown_event = asyncio.Event()
|
||||||
will = aiomqtt.Will(
|
will = aiomqtt.Will(
|
||||||
|
|||||||
@ -106,6 +106,7 @@ class UBXHandler(MQTTHandler):
|
|||||||
460800,
|
460800,
|
||||||
921600,
|
921600,
|
||||||
],
|
],
|
||||||
|
"default": 9600
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"required": ["portID", "baudRate"],
|
"required": ["portID", "baudRate"],
|
||||||
@ -133,12 +134,14 @@ class UBXHandler(MQTTHandler):
|
|||||||
"minimum": 50,
|
"minimum": 50,
|
||||||
"maximum": 60000,
|
"maximum": 60000,
|
||||||
"description": "Measurement period in milliseconds",
|
"description": "Measurement period in milliseconds",
|
||||||
|
"default": 1000,
|
||||||
},
|
},
|
||||||
"navRate": {
|
"navRate": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 1,
|
"minimum": 1,
|
||||||
"maximum": 127,
|
"maximum": 127,
|
||||||
"description": "Number of measurement cycles per navigation solution",
|
"description": "Number of measurement cycles per navigation solution",
|
||||||
|
"default": 1
|
||||||
},
|
},
|
||||||
"timeRef": {
|
"timeRef": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user