mirror of
https://github.com/snltty/linker.git
synced 2025-10-26 10:30:24 +08:00
sync
This commit is contained in:
15
.github/workflows/dotnet.yml
vendored
15
.github/workflows/dotnet.yml
vendored
@@ -53,13 +53,14 @@ jobs:
|
||||
draft: false
|
||||
prerelease: false
|
||||
body: |
|
||||
1. 修复poershell卡死问题
|
||||
2. 新增排序
|
||||
3. 新增网卡IP自定义掩码
|
||||
4. 新增网卡端口转发
|
||||
5. 新增托盘置顶
|
||||
6. 移除linker.service,将windows service内置
|
||||
7. 还在测试,不要更新!不要更新!不要更新!
|
||||
1. 新增排序
|
||||
2. 新增网卡IP自定义掩码
|
||||
3. 新增网卡端口转发
|
||||
4. 新增托盘置顶
|
||||
5. 移除linker.service,将windows service内置
|
||||
6. 先更新所有客户端,再更新服务端
|
||||
7. windows下,需要重新卸载安装服务
|
||||
8. 还在测试,不要更新!不要更新!不要更新!
|
||||
|
||||
- name: upload win x64
|
||||
id: upload-win-x64
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<project ver="10" name="linker.tray.win" libEmbed="true" icon="..\linker\favicon.ico" ui="win" output="linker.tray.win.exe" CompanyName="snltty" FileDescription="linker.tray.win" LegalCopyright="Copyright (C) snltty 2024" ProductName="linker.tray.win" InternalName="linker.install.win" FileVersion="0.0.0.63" ProductVersion="0.0.0.63" publishDir="/dist/" dstrip="false" local="false" ignored="false">
|
||||
<project ver="10" name="linker.tray.win" libEmbed="true" icon="..\linker\favicon.ico" ui="win" output="linker.tray.win.exe" CompanyName="snltty" FileDescription="linker.tray.win" LegalCopyright="Copyright (C) snltty 2024" ProductName="linker.tray.win" InternalName="linker.install.win" FileVersion="0.0.0.66" ProductVersion="0.0.0.66" publishDir="/dist/" dstrip="false" local="false" ignored="false">
|
||||
<file name="main.aardio" path="main.aardio" comment="main.aardio"/>
|
||||
<folder name="资源文件" path="res" embed="true" local="false" ignored="false">
|
||||
<file name="favicon.ico" path="res\favicon.ico" comment="res\favicon.ico"/>
|
||||
|
||||
@@ -144,6 +144,7 @@ namespace linker.tun
|
||||
/// </summary>
|
||||
public void SetNat()
|
||||
{
|
||||
linkerTunDevice?.RemoveNat(out string error);
|
||||
linkerTunDevice?.SetNat(out error1);
|
||||
}
|
||||
/// <summary>
|
||||
|
||||
@@ -11,8 +11,8 @@ export const setSignInServers = (servers) => {
|
||||
export const getSignInfo = () => {
|
||||
return sendWebsocketMsg('signInclient/info');
|
||||
}
|
||||
export const setSignInIndex = (ids) => {
|
||||
return sendWebsocketMsg('signInclient/setindex', ids);
|
||||
export const setSignInOrder = (ids) => {
|
||||
return sendWebsocketMsg('signInclient/setorder', ids);
|
||||
}
|
||||
export const getSignInList = (data) => {
|
||||
return sendWebsocketMsg('signInclient/List', data);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<div class="home-list-wrap absolute" >
|
||||
<el-table border style="width: 100%" height="32px" size="small" @sort-change="handleSortChange" class="table-sort">
|
||||
<el-table-column prop="MachineId" label="设备名" width="120" sortable ></el-table-column>
|
||||
<el-table-column prop="Version" label="版本" width="120" sortable></el-table-column>
|
||||
<el-table-column prop="tunnel" label="网关" width="90" sortable></el-table-column>
|
||||
<el-table-column prop="tuntap" label="网卡IP" width="150" sortable></el-table-column>
|
||||
<el-table-column prop="MachineId" label="设备名" width="120" sortable="custom" ></el-table-column>
|
||||
<el-table-column prop="Version" label="版本" width="120" sortable="custom"></el-table-column>
|
||||
<el-table-column prop="tunnel" label="网关" width="90" sortable="custom"></el-table-column>
|
||||
<el-table-column prop="tuntap" label="网卡IP" width="150" sortable="custom"></el-table-column>
|
||||
<el-table-column prop="forward" label=""></el-table-column>
|
||||
<el-table-column label="" width="74" fixed="right"></el-table-column>
|
||||
</el-table>
|
||||
@@ -85,7 +85,7 @@ export default {
|
||||
|
||||
devices.page.Request.Prop = row.prop;
|
||||
devices.page.Request.Asc = row.order == 'ascending';
|
||||
|
||||
|
||||
let fn = new Promise((resolve,reject)=>{
|
||||
resolve();
|
||||
});
|
||||
@@ -103,6 +103,7 @@ export default {
|
||||
fn.then(()=>{
|
||||
handlePageChange();
|
||||
}).catch(()=>{});
|
||||
|
||||
}
|
||||
|
||||
const _handleForwardEdit = (machineId) => {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getSignInList, signInDel, setSignInIndex } from "@/apis/signin";
|
||||
import { getSignInList, signInDel, setSignInOrder } from "@/apis/signin";
|
||||
import { injectGlobalData } from "@/provide";
|
||||
import { computed, reactive } from "vue";
|
||||
|
||||
@@ -29,8 +29,6 @@ export const provideDevices = () => {
|
||||
res.List[j].showDel = machineId.value != res.List[j].MachineId && res.List[j].Connected == false;
|
||||
res.List[j].showReboot = res.List[j].Connected;
|
||||
res.List[j].isSelf = machineId.value == res.List[j].MachineId;
|
||||
|
||||
|
||||
}
|
||||
devices.page.List = res.List;
|
||||
for (let i = 0; i < devices.page.List.length; i++) {
|
||||
@@ -112,7 +110,7 @@ export const provideDevices = () => {
|
||||
}
|
||||
|
||||
const setSort = (ids) => {
|
||||
return setSignInIndex(ids);
|
||||
return setSignInOrder(ids);
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -42,7 +42,7 @@ export const provideTunnel = () => {
|
||||
}
|
||||
const sortTunnel = (asc) => {
|
||||
return Object.values(tunnel.value.list).sort((a, b) => {
|
||||
return asc ? a.RouteLevel - b.RouteLevel : b.RouteLevel - a.RouteLevel;
|
||||
return a.RouteLevel + a.RouteLevelPlus - b.RouteLevel + b.RouteLevelPlus;
|
||||
}).map(c => c.MachineId);
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -27,7 +27,6 @@ export const provideTuntap = () => {
|
||||
if (globalData.value.api.connected) {
|
||||
getTuntapInfo(tuntap.value.hashcode.toString()).then((res) => {
|
||||
tuntap.value.hashcode = res.HashCode;
|
||||
console.log(res);
|
||||
if (res.List) {
|
||||
for (let j in res.List) {
|
||||
res.List[j].running = res.List[j].Status == 2;
|
||||
@@ -83,16 +82,17 @@ export const provideTuntap = () => {
|
||||
.map(c => c.MachineId);
|
||||
}
|
||||
const sortTuntapIP = (asc) => {
|
||||
return Object.values(tuntap.value.list).sort((a, b) => {
|
||||
const sort = Object.values(tuntap.value.list).sort((a, b) => {
|
||||
const arrA = a.IP.split('.').map(c => Number(c));
|
||||
const arrB = b.IP.split('.').map(c => Number(c));
|
||||
for (let i = 0; i < arrA.length; i++) {
|
||||
if (arrA[i] != arrB[i]) {
|
||||
return asc ? arrA[i] - arrB[i] : arrB[i] - arrA[i];
|
||||
return arrA[i] - arrB[i];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}).map(c => c.MachineId);
|
||||
});
|
||||
return sort.map(c => c.MachineId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -70,12 +70,12 @@ namespace linker.plugins.signin
|
||||
Payload = MemoryPackSerializer.Serialize(param.Content)
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
public async Task SetIndex(ApiControllerParamsInfo param)
|
||||
public async Task SetOrder(ApiControllerParamsInfo param)
|
||||
{
|
||||
await messengerSender.SendOnly(new MessageRequestWrap
|
||||
{
|
||||
Connection = clientSignInState.Connection,
|
||||
MessengerId = (ushort)SignInMessengerIds.SetIndex,
|
||||
MessengerId = (ushort)SignInMessengerIds.SetOrder,
|
||||
Payload = MemoryPackSerializer.Serialize(param.Content.DeJson<string[]>())
|
||||
}).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
@@ -132,8 +132,8 @@ namespace linker.plugins.signin.messenger
|
||||
[MemoryPackIgnore, JsonIgnore, BsonIgnore]
|
||||
public IConnection Connection { get; set; }
|
||||
|
||||
[MemoryPackIgnore, JsonIgnore, BsonIgnore]
|
||||
public uint Index { get; set; } = 65535;
|
||||
[MemoryPackIgnore,JsonIgnore, BsonIgnore]
|
||||
public uint Order { get; set; } = int.MaxValue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ using MemoryPack;
|
||||
using linker.plugins.client;
|
||||
using linker.plugins.server;
|
||||
using linker.plugins.messenger;
|
||||
using linker.libs.extends;
|
||||
|
||||
namespace linker.plugins.signin.messenger
|
||||
{
|
||||
@@ -44,8 +45,8 @@ namespace linker.plugins.signin.messenger
|
||||
connection.Write(MemoryPackSerializer.Serialize(info.MachineId));
|
||||
}
|
||||
|
||||
[MessengerId((ushort)SignInMessengerIds.SetIndex)]
|
||||
public void SetIndex(IConnection connection)
|
||||
[MessengerId((ushort)SignInMessengerIds.SetOrder)]
|
||||
public void SetOrder(IConnection connection)
|
||||
{
|
||||
string[] ids = MemoryPackSerializer.Deserialize<string[]>(connection.ReceiveRequestWrap.Payload.Span);
|
||||
if (signCaching.TryGet(connection.Id, out SignCacheInfo cache))
|
||||
@@ -53,14 +54,16 @@ namespace linker.plugins.signin.messenger
|
||||
IEnumerable<SignCacheInfo> list = signCaching.Get(cache.GroupId);
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.Index = uint.MaxValue;
|
||||
item.Order = uint.MaxValue;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < ids.Length; i++)
|
||||
{
|
||||
SignCacheInfo item = list.FirstOrDefault(c => c.MachineId == ids[i]);
|
||||
if (item != null)
|
||||
item.Index = i;
|
||||
{
|
||||
item.Order = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -82,33 +85,21 @@ namespace linker.plugins.signin.messenger
|
||||
{
|
||||
if (request.Asc)
|
||||
{
|
||||
switch (request.Prop)
|
||||
list = request.Prop switch
|
||||
{
|
||||
case "MachineId":
|
||||
list = list.OrderBy(c => c.MachineName);
|
||||
break;
|
||||
case "Version":
|
||||
list = list.OrderBy(c => c.Version);
|
||||
break;
|
||||
default:
|
||||
list = list.OrderBy(c => c.Index);
|
||||
break;
|
||||
}
|
||||
"MachineId" => list.OrderBy(c => c.MachineName),
|
||||
"Version" => list.OrderBy(c => c.Version),
|
||||
_ => list.OrderBy(c => c.Order)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (request.Prop)
|
||||
list = request.Prop switch
|
||||
{
|
||||
case "MachineId":
|
||||
list = list.OrderByDescending(c => c.MachineName);
|
||||
break;
|
||||
case "Version":
|
||||
list = list.OrderByDescending(c => c.Version);
|
||||
break;
|
||||
default:
|
||||
list = list.OrderByDescending(c => c.Index);
|
||||
break;
|
||||
}
|
||||
"MachineId" => list.OrderByDescending(c => c.MachineName),
|
||||
"Version" => list.OrderByDescending(c => c.Version),
|
||||
_ => list.OrderByDescending(c => c.Order)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
Ids = 8,
|
||||
Exists = 9,
|
||||
|
||||
SetIndex = 10,
|
||||
SetOrder = 10,
|
||||
|
||||
None = 99
|
||||
}
|
||||
|
||||
@@ -215,6 +215,13 @@ namespace linker.plugins.updater
|
||||
{
|
||||
}
|
||||
}
|
||||
try
|
||||
{
|
||||
File.Delete("./linker.service.exe");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
Environment.Exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user