Skip to content

Commit

Permalink
refactor: rename Flash Firmware to Tools
Browse files Browse the repository at this point in the history
  • Loading branch information
LynnL4 committed Sep 15, 2023
1 parent f08432f commit d9f8530
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 51 deletions.
3 changes: 1 addition & 2 deletions src/locale/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
'menu.setup': 'Setup',
'menu.setup.process': 'Process',
'menu.setup.output': 'Output',
'menu.firmware': 'Flash Firmware',
'menu.tool': 'Tool',
'menu.data': 'Data Acquisition',
'menu.data.vision': 'Vision',
'menu.data.sensor': 'Sensor',
Expand All @@ -20,4 +20,3 @@ export default {
...localeSettings,
...localeWorkplace,
};

2 changes: 1 addition & 1 deletion src/locale/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
'menu.setup': '设置',
'menu.setup.process': '工作台',
'menu.setup.output': '输出',
'menu.firmware': '烧录固件',
'menu.tool': '工具',
'menu.data': '数据采集',
'menu.data.vision': '视觉',
'menu.data.sensor': '传感器',
Expand Down
31 changes: 31 additions & 0 deletions src/router/routes/modules/esptool.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { DEFAULT_LAYOUT } from '../base';
import { AppRouteRecordRaw } from '../types';

const ESPTOOL: AppRouteRecordRaw = {
path: '/esptool',
name: 'esptool',
component: DEFAULT_LAYOUT,
redirect: '/esptool/esptool',
meta: {
locale: 'menu.tool',
requiresAuth: true,
icon: 'icon-tool',
order: 1,
hideChildrenInMenu: true,
},
children: [
{
path: 'esptool',
name: 'esptool',
component: () => import('@/views/esptool/index.vue'),
meta: {
locale: 'menu.tool',
requiresAuth: true,
roles: ['*'],
activeMenu: 'esptool',
},
},
],
};

export default ESPTOOL;
31 changes: 0 additions & 31 deletions src/router/routes/modules/firmware.ts

This file was deleted.

16 changes: 8 additions & 8 deletions src/views/firmware/index.vue → src/views/esptool/index.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<a-spin :loading="loading" :tip="loadingTip" class="item-card">
<a-card class="general-card" :title="$t('workplace.device.card.firmware')">
<a-card class="general-card" :title="$t('workplace.device.card.esptool')">
<template #extra>
<a-button type="primary" status="danger" @click="handleEraseflash">
{{ $t('workplace.firmware.eraseflash') }}
Expand Down Expand Up @@ -62,8 +62,8 @@
<a-button type="primary" @click="addFile">{{
$t('workplace.firmware.addfile')
}}</a-button>
<a-button class="burn-btn" type="primary" @click="burnFirmware">
{{ $t('workplace.device.btn.burn') }}
<a-button class="flash-btn" type="primary" @click="flashFirmware">
{{ $t('workplace.device.btn.flash') }}
</a-button>
</div>
</a-card>
Expand Down Expand Up @@ -126,7 +126,7 @@
device.deleteInfo();
device.deleteAction();
deviceStore.setCurrentModel(undefined);
Message.success('Erase Flash successful');
Message.success('Erase Device successful');
} else {
Message.error('Erase failed, please check device connection');
}
Expand All @@ -145,7 +145,7 @@
});
};
const burnFirmware = async () => {
const flashFirmware = async () => {
loading.value = true;
const fileArray = [] as {
data: string;
Expand Down Expand Up @@ -219,9 +219,9 @@
setTimeout(resolve, 100);
});
await transport?.setDTR(true);
Message.success('Burn successful');
Message.success('Flash successful');
} else {
Message.error('Burn failed');
Message.error('Flash failed');
}
// 连接设备
if (deviceStore.deviceStatus !== DeviceStatus.SerialConnected) {
Expand Down Expand Up @@ -333,7 +333,7 @@
height: 60px;
margin-top: 30px;
.burn-btn {
.flash-btn {
margin-left: 80px;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/setup/process/components/device.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
};
};
const burnFirmware = async (isCustom = false) => {
const flashFirmware = async (isCustom = false) => {
loading.value = true;
loadingTip.value = 'Connecting';
if (deviceStore.deviceStatus !== DeviceStatus.EspConnected) {
Expand Down Expand Up @@ -433,7 +433,7 @@
}
}
try {
burnFirmware();
flashFirmware();
} catch (error) {
console.log(error);
loadingTip.value = '';
Expand Down Expand Up @@ -479,7 +479,7 @@
Message.error('Please enter at least one object');
return false;
}
burnFirmware(true);
flashFirmware(true);
return true;
};
Expand Down
6 changes: 3 additions & 3 deletions src/views/setup/process/locale/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ export default {
'workplace.device.card.aimodel': 'Upload AI model',
'workplace.device.card.binFile': 'Upload Bin files',
'workplace.device.btn.upload': 'Upload',
'workplace.device.card.firmware': 'Burn firmware',
'workplace.firmware.eraseflash': 'Erase Flash',
'workplace.device.card.esptool': 'ESP Tool',
'workplace.firmware.eraseflash': 'Erase Device',
'workplace.firmware.address': 'Address',
'workplace.firmware.file': 'File',
'workplace.firmware.choosefile': 'Choose File',
'workplace.firmware.addfile': 'Add File',
'workplace.firmware.remove': 'Remove',
'workplace.device.btn.burn': 'Burn',
'workplace.device.btn.flash': 'Flash',
'workplace.config.title': 'Preview Settings',
'workplace.config.btn.save': 'Save',
'workplace.config.btn.reset': 'Reset',
Expand Down
6 changes: 3 additions & 3 deletions src/views/setup/process/locale/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export default {
'workplace.device.card.aimodel': '上传AI模型',
'workplace.device.card.binFile': '上传Bin文件',
'workplace.device.btn.upload': '上传',
'workplace.device.card.firmware': '烧录固件',
'workplace.firmware.eraseflash': '擦除闪存',
'workplace.device.card.esptool': 'ESP Tool',
'workplace.firmware.eraseflash': '擦除设备',
'workplace.firmware.address': '地址',
'workplace.firmware.file': '文件',
'workplace.firmware.choosefile': '选择文件',
'workplace.firmware.addfile': '新增文件',
'workplace.firmware.remove': '删除',
'workplace.device.btn.burn': '烧录',
'workplace.device.btn.flash': '烧录',
'workplace.config.title': '预览配置',
'workplace.config.btn.save': '保存',
'workplace.config.btn.reset': '重置',
Expand Down

0 comments on commit d9f8530

Please sign in to comment.