From 79b7a411eaf120e33d0fc1357718e49d98911120 Mon Sep 17 00:00:00 2001 From: bakacai Date: Mon, 26 Jan 2026 16:47:44 +0800 Subject: [PATCH] feat(ui): improve user interaction experience --- src/i18n/locales/en.json | 8 +- src/i18n/locales/zh.json | 10 +- src/stores/stubConfigStore.ts | 2 + src/views/StubConfigView.vue | 570 ++++++++++++++++++++++------------ 4 files changed, 388 insertions(+), 202 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index f11e3b9..618fd58 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -241,13 +241,15 @@ "addDevice": "Add Device", "device": "Device", "media": "Media Type", - "driverIndex": "Driver Index", + "driverIndex": "Type", "capacity": "Capacity", "capacityHint": "Supports numbers, hexadecimal (0x...) or with units (16M)", "manufacturerId": "Manufacturer ID", "deviceType": "Device Type", "densityId": "Density ID", "flags": "Flags", + "deviceInvalid": "Invalid", + "sectionInvalid": "Invalid", "noDevices": "No FLASH devices added", "invalidCapacity": "Invalid capacity format", "invalidHexValue": "Invalid hexadecimal value (0x00-0xFF)", @@ -269,7 +271,9 @@ "conflictDetected": "Configuration conflict detected", "disabled": "Please enable SDIO configuration to start setting", "invalidAddress": "Invalid address format", - "addressTooLarge": "Address value too large" + "addressTooLarge": "Address value too large", + "addressRequired": "Please enter base address", + "sectionInvalid": "Invalid" }, "pin": { "title": "GPIO Pin Configuration", diff --git a/src/i18n/locales/zh.json b/src/i18n/locales/zh.json index e91decc..a088698 100644 --- a/src/i18n/locales/zh.json +++ b/src/i18n/locales/zh.json @@ -241,13 +241,15 @@ "addDevice": "添加设备", "device": "设备", "media": "介质类型", - "driverIndex": "驱动索引", + "driverIndex": "Type", "capacity": "容量", "capacityHint": "支持数字、十六进制 (0x...) 或带单位 (16M)", "manufacturerId": "制造商 ID", "deviceType": "设备类型", - "densityId": "容量 ID", + "densityId": "颗粒 ID", "flags": "标志", + "deviceInvalid": "配置有误", + "sectionInvalid": "配置有误", "noDevices": "尚未添加 FLASH 设备", "invalidCapacity": "无效的容量格式", "invalidHexValue": "无效的十六进制值 (0x00-0xFF)", @@ -269,7 +271,9 @@ "conflictDetected": "检测到配置冲突", "disabled": "请启用 SDIO 配置以开始设置", "invalidAddress": "无效的地址格式", - "addressTooLarge": "地址值过大" + "addressTooLarge": "地址值过大", + "addressRequired": "请输入基地址", + "sectionInvalid": "配置有误" }, "pin": { "title": "GPIO 默认状态", diff --git a/src/stores/stubConfigStore.ts b/src/stores/stubConfigStore.ts index 92ee60b..377b07e 100644 --- a/src/stores/stubConfigStore.ts +++ b/src/stores/stubConfigStore.ts @@ -2,6 +2,7 @@ import { defineStore } from 'pinia'; import { ref, computed } from 'vue'; export interface FlashDevice { + id: string; media: 'nor' | 'nand'; driver_index: number; manufacturer_id: string; @@ -18,6 +19,7 @@ export interface FlashDevice { } export interface PinItem { + id: string; port: 'PA' | 'PB' | 'PBR'; number: number; level: 'low' | 'high'; diff --git a/src/views/StubConfigView.vue b/src/views/StubConfigView.vue index 309aaa9..fdc0b49 100644 --- a/src/views/StubConfigView.vue +++ b/src/views/StubConfigView.vue @@ -30,6 +30,9 @@ memory

{{ $t('stubConfig.flash.title') }}

{{ flashConfig.devices.length }} + + {{ $t('stubConfig.flash.sectionInvalid') }} + - - -
-
-
- - -
- -
- - -
- -
- - -