Skip to content

Commit

Permalink
[*] 获取隧道配置文件节点排序
Browse files Browse the repository at this point in the history
  • Loading branch information
Muska-Ami committed Oct 11, 2024
1 parent 3f442aa commit 8e9f2e0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/views/proxies/ConfigView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,18 @@ onMounted(async () => {
sendErrorMessage('请求节点列表失败: ' + e)
}
if (!rs) return
var i = 0
rs.data.list.forEach((s) => {
let i = 0
const list = rs.data.list
list.sort((a, b) => {
if (a.name < b.name) {
return -1
}
if (a.name > b.name) {
return 1
}
return 0
})
list.forEach((s) => {
if (i === 0) {
node.value = s.id
updateValue(s.id)
Expand Down

0 comments on commit 8e9f2e0

Please sign in to comment.