修复局域网连接返回为null问题
This commit is contained in:
@@ -111,7 +111,7 @@ func (s *DeviceService) ListCandidates(currentDeviceID string) []model.Device {
|
|||||||
current, _ := s.store.GetDevice(currentDeviceID)
|
current, _ := s.store.GetDevice(currentDeviceID)
|
||||||
currentNetworkGroupKey := strings.TrimSpace(current.NetworkGroupKey)
|
currentNetworkGroupKey := strings.TrimSpace(current.NetworkGroupKey)
|
||||||
if currentNetworkGroupKey == "" {
|
if currentNetworkGroupKey == "" {
|
||||||
return nil
|
return []model.Device{}
|
||||||
}
|
}
|
||||||
|
|
||||||
devices := s.store.ListDevices()
|
devices := s.store.ListDevices()
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
25
frontend/dist/favicon.svg
vendored
Normal file
25
frontend/dist/favicon.svg
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="bg" x1="0%" x2="100%" y1="0%" y2="100%">
|
||||||
|
<stop offset="0%" stop-color="#1f7ae0" />
|
||||||
|
<stop offset="100%" stop-color="#5db1ff" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect width="64" height="64" rx="16" fill="url(#bg)" />
|
||||||
|
<path
|
||||||
|
d="M20 39.5a10 10 0 0 1 1.6-19.87A13.5 13.5 0 0 1 47 24.5a8.5 8.5 0 1 1-1.2 16.9H36"
|
||||||
|
fill="none"
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="4"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M32 46V28m0 0-7 7m7-7 7 7"
|
||||||
|
fill="none"
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="4"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 699 B |
3
frontend/dist/index.html
vendored
3
frontend/dist/index.html
vendored
@@ -3,8 +3,9 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<title>AirShare Pro</title>
|
<title>AirShare Pro</title>
|
||||||
<script type="module" crossorigin src="/assets/index-DoCMU-eK.js"></script>
|
<script type="module" crossorigin src="/assets/index-BjlDNx75.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-qzWUgf-t.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-qzWUgf-t.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<title>AirShare Pro</title>
|
<title>AirShare Pro</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
25
frontend/public/favicon.svg
Normal file
25
frontend/public/favicon.svg
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="bg" x1="0%" x2="100%" y1="0%" y2="100%">
|
||||||
|
<stop offset="0%" stop-color="#1f7ae0" />
|
||||||
|
<stop offset="100%" stop-color="#5db1ff" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<rect width="64" height="64" rx="16" fill="url(#bg)" />
|
||||||
|
<path
|
||||||
|
d="M20 39.5a10 10 0 0 1 1.6-19.87A13.5 13.5 0 0 1 47 24.5a8.5 8.5 0 1 1-1.2 16.9H36"
|
||||||
|
fill="none"
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="4"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M32 46V28m0 0-7 7m7-7 7 7"
|
||||||
|
fill="none"
|
||||||
|
stroke="#fff"
|
||||||
|
stroke-linecap="round"
|
||||||
|
stroke-linejoin="round"
|
||||||
|
stroke-width="4"
|
||||||
|
/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 699 B |
@@ -276,7 +276,8 @@ async function refreshCandidates() {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const candidates = await devicesApi.listCandidates(localDevice.value.id)
|
const candidates = await devicesApi.listCandidates(localDevice.value.id)
|
||||||
devices.value = candidates.map((device) => ({
|
const safeCandidates = Array.isArray(candidates) ? candidates : []
|
||||||
|
devices.value = safeCandidates.map((device) => ({
|
||||||
...device,
|
...device,
|
||||||
description: `${formatDeviceType(device.type)} · 最近活跃 ${formatRelativeTime(device.last_seen_at)}`,
|
description: `${formatDeviceType(device.type)} · 最近活跃 ${formatRelativeTime(device.last_seen_at)}`,
|
||||||
icon: mapDeviceIcon(device.type),
|
icon: mapDeviceIcon(device.type),
|
||||||
@@ -2351,7 +2352,8 @@ refreshCandidates = async function refreshCandidatesOverride() {
|
|||||||
return devicesApi
|
return devicesApi
|
||||||
.listCandidates(localDevice.value.id)
|
.listCandidates(localDevice.value.id)
|
||||||
.then((candidates) => {
|
.then((candidates) => {
|
||||||
devices.value = candidates.map((device) => ({
|
const safeCandidates = Array.isArray(candidates) ? candidates : []
|
||||||
|
devices.value = safeCandidates.map((device) => ({
|
||||||
...device,
|
...device,
|
||||||
description: `${formatDeviceType(device.type)} · 最近活跃 ${formatRelativeTime(device.last_seen_at)}`,
|
description: `${formatDeviceType(device.type)} · 最近活跃 ${formatRelativeTime(device.last_seen_at)}`,
|
||||||
icon: mapDeviceIcon(device.type),
|
icon: mapDeviceIcon(device.type),
|
||||||
|
|||||||
Reference in New Issue
Block a user