feat: add chipDetected emit, hide single-option firmware selector, remove alerts

This commit is contained in:
kerms 2026-03-07 20:29:05 +01:00
parent c8b560387b
commit 92dd27ed9b
Signed by: kerms
GPG Key ID: 5432C10DDCF8DAD5
1 changed files with 4 additions and 7 deletions

View File

@ -31,6 +31,8 @@ type ImageOption = {
target: string; target: string;
}; };
const emit = defineEmits(['chipDetected'])
const props = defineProps({ const props = defineProps({
imageOptions: { imageOptions: {
type: Array as PropType<ImageOption[]>, type: Array as PropType<ImageOption[]>,
@ -168,6 +170,7 @@ async function programConnect() {
programConnected.value = true; programConnected.value = true;
chip_type.value = esploader.chip.CHIP_NAME; chip_type.value = esploader.chip.CHIP_NAME;
emit('chipDetected', chip_type.value);
// Temporarily broken // Temporarily broken
// await esploader.flashId(); // await esploader.flashId();
@ -480,19 +483,13 @@ async function reset() {
<template> <template>
<div> <div>
<div v-show="serialSupported"> <div v-show="serialSupported">
<el-alert type="info" class="mb-4" show-icon>
烧录 日志 是独立的功能连接中无法切换功能
</el-alert>
<el-tabs> <el-tabs>
<el-tab-pane label="烧录" :disabled="consoleStarted"> <el-tab-pane label="烧录" :disabled="consoleStarted">
<el-alert v-if="imageOptions.length === 0" type="warning" class="mb-4" show-icon :closable="false"> <el-alert v-if="imageOptions.length === 0" type="warning" class="mb-4" show-icon :closable="false">
未配置固件选项无法烧录 未配置固件选项无法烧录
</el-alert> </el-alert>
<el-alert type="info" class="mb-4" show-icon>
若无法连接请先让ESP32进入下载模式再尝试连接按住BOOT按一下RESET松开BOOT
</el-alert>
<el-form label-width="auto"> <el-form label-width="auto">
<el-form-item label="固件"> <el-form-item v-if="imageOptions.length > 1" label="固件">
<client-only> <client-only>
<el-select <el-select
v-model="imageSelect" v-model="imageSelect"