界面显示时增加默认线路值

This commit is contained in:
GoEdgeLab
2021-01-31 16:09:55 +08:00
parent 74f2e86f51
commit 69a060e276
2 changed files with 11 additions and 2 deletions

View File

@@ -89,6 +89,12 @@ func (this *NodeAction) RunGet(params struct {
})
}
}
if len(dnsRouteMaps) == 0 {
dnsRouteMaps = append(dnsRouteMaps, maps.Map{
"name": "",
"code": "",
})
}
this.Data["dnsRoutes"] = dnsRouteMaps
this.Data["dnsRecordName"] = recordName
this.Data["dnsRecordValue"] = recordValue

View File

@@ -29,7 +29,7 @@
</div>
</td>
</tr>
<tr v-if="dnsRoutes.length > 0">
<tr v-if="dnsRoutes.length > 0 && dnsRoutes[0].name.length > 0">
<td>DNS线路</td>
<td>
<span class="ui label tiny basic" v-for="route in dnsRoutes">{{route.name}}</span>
@@ -51,7 +51,10 @@
<tr v-for="route in dnsRoutes">
<td>{{dnsRecordName}}</td>
<td>A</td>
<td>{{route.name}}</td>
<td>
<span v-if="route.name.length > 0">{{route.name}}</span>
<span v-else class="disabled">默认</span>
</td>
<td>{{address.ip}}</td>
</tr>
</tbody>