Skip to content

Commit

Permalink
feat: Change “Wallet Addr” to “ETH Wallet Addr”, and disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Wvirgil123 committed Oct 25, 2023
1 parent accf3e9 commit a59aa52
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sensecap_indicator_iotex_cfg_tool_ng",
"description": "Indicator IoTeX Configuration Tool",
"version": "1.0.0",
"version": "1.0.1",
"homepage": "https://github.com/Seeed-Solution/ConfigTool_for_IoTex_DePIN",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ ipcMain.on('dev-info-req', async (event) => {
logger.info('dev-info-req ...')
try {
let mac
let wallet
let ETH
let sn
let msg
try {
Expand All @@ -412,7 +412,7 @@ ipcMain.on('dev-info-req', async (event) => {
if( found ) {
mac = found[1]
sn = found[2]
wallet=found[3]
ETH=found[3]
}
} else {
event.reply('dev-info-resp-error', msg.data)
Expand All @@ -421,7 +421,7 @@ ipcMain.on('dev-info-req', async (event) => {
event.reply(`dev-info-resp-error:`, error)
}

let deviceInfoObj = {'MAC': mac, 'SN':sn, 'Wallet':wallet}
let deviceInfoObj = {'MAC': mac, 'SN':sn, 'ETH':ETH}
logger.debug('deviceInfoObj:', deviceInfoObj)
event.reply('dev-info-resp', deviceInfoObj)

Expand All @@ -437,7 +437,7 @@ ipcMain.on('dev-info-write', async (event, msg) => {

//write
logger.debug('device info:',msg)
let cmd = "Device_PIN" + ' -s '+msg.SN + ' -w ' + msg.Wallet +'\r\n'
let cmd = "Device_PIN" + ' -s '+msg.SN +'\r\n'
logger.debug('send cmd:', cmd)
try {
let resp = await CmdAsync(cmd, 3000)
Expand Down
28 changes: 14 additions & 14 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"Serial Port": "串口",
"WiFi MAC": "WiFi MAC",
"Device SN": "SN",
"Wallet Addr": "钱包地址",
"ETH Wallet Addr": "ETH 钱包地址",
"Read": "读取",
"Write": "写入",
"text: dev-info-error": "获取设备信息失败,请再次连接串口。",
Expand Down Expand Up @@ -46,15 +46,15 @@
</v-text-field>
</v-col>

<!-- sn -->
<v-col cols="12" class="py-0">
<v-text-field v-model="deviceSN" :label="$t('Device SN')" :rules="deviceSNRules" outlined dense>
<!-- ETH Addr -->
<v-col cols="12" class="py-0">
<v-text-field v-model="ETHAddr" :label="$t('ETH Wallet Addr')" disabled outlined dense>
</v-text-field>
</v-col>

<!-- wallet addr -->
<!-- sn -->
<v-col cols="12" class="py-0">
<v-text-field v-model="WalletAddr" :label="$t('Wallet Addr')" :rules="WalletAddrRules" outlined dense>
<v-text-field v-model="deviceSN" :label="$t('Device SN')" :rules="deviceSNRules" outlined dense>
</v-text-field>
</v-col>

Expand Down Expand Up @@ -136,7 +136,7 @@ export default {
//rules
rules: rules,
deviceSNRules: [rules.required, rules.num18],
WalletAddrRules: [rules.required, rules.charAndNum],
//ETHAddrRules: [rules.required, rules.charAndNum],
//serial
selectedSerialPort: null,
Expand All @@ -157,7 +157,7 @@ export default {
//config fields
wifiMAC: '',
deviceSN: '',
WalletAddr: '',
ETHAddr: '',
//stream parse
stream: null,
Expand Down Expand Up @@ -212,7 +212,7 @@ export default {
this.$message.error(this.$t('xxx'));
},
readFn() {
this.wifiMAC = this.deviceSN = this.WalletAddr = ''
this.wifiMAC = this.deviceSN = this.ETHAddr = ''
ipcRenderer.send('dev-info-req')
Expand All @@ -221,17 +221,17 @@ export default {
writeFn() {
this.deviceSN = this.deviceSN.trim()
this.WalletAddr = this.WalletAddr.trim()
this.ETHAddr = this.ETHAddr.trim()
if (!this.$refs.form1.validate()) return false
this.writeLoading = true
console.log({
deviceSN: this.deviceSN,
WalletAddr: this.WalletAddr,
ETHAddr: this.ETHAddr,
})
let deviceInfo = {'SN':this.deviceSN, 'Wallet':this.WalletAddr}
let deviceInfo = {'SN':this.deviceSN}
ipcRenderer.send('dev-info-write', deviceInfo)
}
Expand Down Expand Up @@ -304,10 +304,10 @@ export default {
Message.error(arg)
})
ipcRenderer.on('dev-info-resp', (event, arg) => {
let {'MAC':MAC, 'SN':SN, 'Wallet':Wallet} = arg
let {'MAC':MAC, 'SN':SN, 'ETH':ETH} = arg
this.wifiMAC = MAC
this.deviceSN = SN
this.WalletAddr = Wallet
this.ETHAddr = ETH
})
ipcRenderer.on('dev-info-write-ack-error', (event, arg) => {
Expand Down

0 comments on commit a59aa52

Please sign in to comment.