fix: frontend upload bitstream failed
This commit is contained in:
@@ -7,11 +7,16 @@ import { isNumber } from 'mathjs';
|
||||
export const useEquipments = defineStore('equipments', () => {
|
||||
const boardAddr = ref("127.0.0.1")
|
||||
const boardPort = ref(1234)
|
||||
function setAddr(address: string) {
|
||||
const jtagBitstream = ref<File>()
|
||||
|
||||
function setAddr(address: string | undefined) {
|
||||
if (isUndefined(address)) return;
|
||||
if (z.string().ip("4").safeParse(address).success)
|
||||
boardAddr.value = address;
|
||||
}
|
||||
function setPort(port: string | number) {
|
||||
|
||||
function setPort(port: string | number | undefined) {
|
||||
if (isUndefined(port)) return;
|
||||
|
||||
if (isString(port) && port.length != 0) {
|
||||
const portNumber = toNumber(port);
|
||||
@@ -23,8 +28,6 @@ export const useEquipments = defineStore('equipments', () => {
|
||||
boardPort.value = port;
|
||||
}
|
||||
}
|
||||
const jtagBitstream = ref<File | undefined>()
|
||||
const remoteUpdateBitstream = ref<File | undefined>()
|
||||
|
||||
return {
|
||||
boardAddr,
|
||||
@@ -32,7 +35,6 @@ export const useEquipments = defineStore('equipments', () => {
|
||||
setAddr,
|
||||
setPort,
|
||||
jtagBitstream,
|
||||
remoteUpdateBitstream,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user