|
@@ -63,6 +63,7 @@ const editClient = ref<SyncClient>();
|
|
|
const editDeviceId = ref<number>();
|
|
const editDeviceId = ref<number>();
|
|
|
const editVisible = ref(false);
|
|
const editVisible = ref(false);
|
|
|
const refreshTimer = ref<ReturnType<typeof setTimeout>>();
|
|
const refreshTimer = ref<ReturnType<typeof setTimeout>>();
|
|
|
|
|
+const deviceWindows = new Map<number, Window>();
|
|
|
|
|
|
|
|
const columns = [
|
|
const columns = [
|
|
|
{
|
|
{
|
|
@@ -153,6 +154,22 @@ const getDeviceUrl = (deviceId?: number) => {
|
|
|
return `https://rdp.long.bid/#/client/${payload}`;
|
|
return `https://rdp.long.bid/#/client/${payload}`;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+const openDevice = (deviceId?: number) => {
|
|
|
|
|
+ if (!Number.isInteger(deviceId)) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const existingWindow = deviceWindows.get(deviceId);
|
|
|
|
|
+ if (existingWindow && !existingWindow.closed) {
|
|
|
|
|
+ existingWindow.focus();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ const deviceWindow = window.open(getDeviceUrl(deviceId), `rdp-device-${deviceId}`);
|
|
|
|
|
+ if (deviceWindow) {
|
|
|
|
|
+ deviceWindows.set(deviceId, deviceWindow);
|
|
|
|
|
+ deviceWindow.focus();
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const isOnline = (time?: number) => {
|
|
const isOnline = (time?: number) => {
|
|
|
return !!time && Date.now() - time <= onlineThreshold;
|
|
return !!time && Date.now() - time <= onlineThreshold;
|
|
|
};
|
|
};
|
|
@@ -480,14 +497,14 @@ onUnmounted(() => {
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="column.key === 'deviceId'">
|
|
<template v-else-if="column.key === 'deviceId'">
|
|
|
<Tooltip v-if="Number.isInteger(record.deviceId)" title="打开设备">
|
|
<Tooltip v-if="Number.isInteger(record.deviceId)" title="打开设备">
|
|
|
- <a
|
|
|
|
|
|
|
+ <Button
|
|
|
class="device-link"
|
|
class="device-link"
|
|
|
- :href="getDeviceUrl(record.deviceId)"
|
|
|
|
|
- rel="noopener noreferrer"
|
|
|
|
|
- target="_blank"
|
|
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ type="link"
|
|
|
|
|
+ @click="openDevice(record.deviceId)"
|
|
|
>
|
|
>
|
|
|
<DesktopOutlined />
|
|
<DesktopOutlined />
|
|
|
- </a>
|
|
|
|
|
|
|
+ </Button>
|
|
|
</Tooltip>
|
|
</Tooltip>
|
|
|
<span v-else>-</span>
|
|
<span v-else>-</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -549,6 +566,7 @@ onUnmounted(() => {
|
|
|
width: 24px;
|
|
width: 24px;
|
|
|
height: 24px;
|
|
height: 24px;
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
|
|
+ padding: 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
:deep(.hidden-expand-icon) {
|
|
:deep(.hidden-expand-icon) {
|