IP测速:测速IP后面直接显示DNS名称;测速未通过的IP却排在前面的问题修复。
parent
aef75c8c2a
commit
827feac5e4
|
@ -200,8 +200,8 @@
|
||||||
<a-icon v-else type="info-circle"/>
|
<a-icon v-else type="info-circle"/>
|
||||||
</a>
|
</a>
|
||||||
<a-tag style="margin:2px;" v-for="(element,index) of item.backupList" :title="element.dns"
|
<a-tag style="margin:2px;" v-for="(element,index) of item.backupList" :title="element.dns"
|
||||||
:color="element.time?'green':'red'" :key='index'>{{ element.host }}
|
:color="element.time?'green':'red'" :key='index'>
|
||||||
{{ element.time }}{{ element.time ? 'ms' : '' }}
|
{{ element.host }} {{ element.time }}{{ element.time ? 'ms' : '' }} {{ element.dns }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
</a-card>
|
</a-card>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
|
@ -111,7 +111,18 @@ class SpeedTester {
|
||||||
_.merge(item, ret)
|
_.merge(item, ret)
|
||||||
aliveList.push({ ...ret, ...item })
|
aliveList.push({ ...ret, ...item })
|
||||||
aliveList.sort((a, b) => a.time - b.time)
|
aliveList.sort((a, b) => a.time - b.time)
|
||||||
this.backupList.sort((a, b) => a.time - b.time)
|
this.backupList.sort((a, b) => {
|
||||||
|
if (a.time === b.time) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if (a.time == null) {
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
if (b.time == null) {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
return a.time - b.time
|
||||||
|
})
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.message !== 'timeout') {
|
if (e.message !== 'timeout') {
|
||||||
log.warn('[speed] test error: ', this.hostname, `➜ ${item.host}:${item.port} from DNS '${item.dns}'`, ', errorMsg:', e.message)
|
log.warn('[speed] test error: ', this.hostname, `➜ ${item.host}:${item.port} from DNS '${item.dns}'`, ', errorMsg:', e.message)
|
||||||
|
|
Loading…
Reference in New Issue