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