mirror of
https://github.com/snltty/linker.git
synced 2025-12-18 01:16:46 +08:00
196
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"linker.Application": {
|
||||
"title": "Linker",
|
||||
"icon": "images/icon_{0}.png",
|
||||
"type": "iframe",
|
||||
"type": "url",
|
||||
"protocol": "http",
|
||||
"port": "1804",
|
||||
"url": "/",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
v1.9.6
|
||||
2025-11-21 11:45:52
|
||||
2025-11-21 16:14:25
|
||||
1. 一些累计更新,一些BUG修复
|
||||
2. 优化客户端数据同步,减少服务器流量
|
||||
3. 去除cdkey,改为发电解锁中继速度
|
||||
|
||||
1
src/linker.app/public/web/css/347.4f2d4b2b.css
Normal file
1
src/linker.app/public/web/css/347.4f2d4b2b.css
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/css/652.7f754031.css
Normal file
1
src/linker.app/public/web/css/652.7f754031.css
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/css/666.46e9a05f.css
Normal file
1
src/linker.app/public/web/css/666.46e9a05f.css
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/css/app.c8558a0b.css
Normal file
1
src/linker.app/public/web/css/app.c8558a0b.css
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>linker.web</title><link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/><script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script><script defer="defer" src="js/chunk-vendors.81dda515.js"></script><script defer="defer" src="js/app.260969ae.js"></script><link href="css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="css/app.eba1f9e0.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but linker.web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title>linker.web</title><link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/><script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script><script defer="defer" src="js/chunk-vendors.81dda515.js"></script><script defer="defer" src="js/app.32338bb2.js"></script><link href="css/chunk-vendors.d8267b33.css" rel="stylesheet"><link href="css/app.c8558a0b.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but linker.web doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
1
src/linker.app/public/web/js/120.4acbd9cf.js
Normal file
1
src/linker.app/public/web/js/120.4acbd9cf.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/347.924cd79b.js
Normal file
1
src/linker.app/public/web/js/347.924cd79b.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/522.5ac43407.js
Normal file
1
src/linker.app/public/web/js/522.5ac43407.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/607.17c02bc1.js
Normal file
1
src/linker.app/public/web/js/607.17c02bc1.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/652.f2ca6c94.js
Normal file
1
src/linker.app/public/web/js/652.f2ca6c94.js
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";(self["webpackChunklinker_web"]=self["webpackChunklinker_web"]||[]).push([[652],{2319:function(e,n,a){a.r(n),a.d(n,{default:function(){return V}});var t=a(6768);const s={class:"net-wrap app-wrap"},c={class:"inner absolute flex flex-column flex-nowrap"},l={class:"head"},r={class:"body flex-1 relative",id:"main-body"},o={class:"status"};function u(e,n,a,u,i,d){const p=(0,t.g2)("Head"),g=(0,t.g2)("List"),v=(0,t.g2)("Status");return(0,t.uX)(),(0,t.CE)("div",s,[(0,t.Lk)("div",c,[(0,t.Lk)("div",l,[(0,t.bF)(p)]),(0,t.Lk)("div",r,[(0,t.bF)(g)]),(0,t.Lk)("div",o,[(0,t.bF)(v,{config:!1})])])])}var i=a(4232);const d=e=>((0,t.Qi)("data-v-1cb47bd6"),e=e(),(0,t.jt)(),e),p={class:"head-wrap"},g={class:"tools flex"},v={class:"label"},f=d((()=>(0,t.Lk)("span",{class:"flex-1"},null,-1))),h={style:{"margin-left":"1rem"}};function k(e,n,a,s,c,l){const r=(0,t.g2)("Refresh"),o=(0,t.g2)("el-icon"),u=(0,t.g2)("el-button"),d=(0,t.g2)("Background");return(0,t.uX)(),(0,t.CE)("div",p,[(0,t.Lk)("div",g,[(0,t.Lk)("span",v,"分组 : "+(0,i.v_)(s.state.group),1),f,(0,t.bF)(u,{size:"small",onClick:s.handleRefresh},{default:(0,t.k6)((()=>[(0,t.eW)(" 刷新(F5)"),(0,t.bF)(o,null,{default:(0,t.k6)((()=>[(0,t.bF)(r)])),_:1})])),_:1},8,["onClick"]),(0,t.Lk)("div",h,[(0,t.bF)(d,{name:"net"})])])])}var b=a(3830),C=a(144),F=a(7477),m=a(8442),L={components:{Edit:F.ffu,Refresh:F.C42,Background:m.A},setup(){const e=(0,b.B)(),n=(0,C.Kh)({server:(0,t.EW)((()=>e.value.config.Client.Server.Host)),group:(0,t.EW)((()=>e.value.config.Client.Group.Name))}),a=()=>{window.location.reload()};return{state:n,handleRefresh:a}}},S=a(1241);const w=(0,S.A)(L,[["render",k],["__scopeId","data-v-1cb47bd6"]]);var x=w;const P=e=>((0,t.Qi)("data-v-891d79f4"),e=e(),(0,t.jt)(),e),_={class:"net-list-wrap flex flex-column absolute"},z={class:"flex-1 scrollbar"},R={class:"flex"},A=P((()=>(0,t.Lk)("div",{class:"flex-1"},null,-1))),E={class:"tuntap"},D={class:"page t-c"},y={class:"page-wrap t-c"};function B(e,n,a,s,c,l){const r=(0,t.g2)("DeviceName"),o=(0,t.g2)("UpdaterBtn"),u=(0,t.g2)("TuntapShow"),i=(0,t.g2)("el-pagination");return(0,t.uX)(),(0,t.CE)("div",_,[(0,t.Lk)("div",z,[(0,t.Lk)("ul",null,[((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(s.devices.page.List,((e,n)=>((0,t.uX)(),(0,t.CE)("li",{key:n},[(0,t.Lk)("dl",null,[(0,t.Lk)("dt",R,[(0,t.Lk)("div",null,[(0,t.bF)(r,{item:e},null,8,["item"])]),A,(0,t.Lk)("div",null,[(0,t.bF)(o,{config:!1,item:e},null,8,["item"])])]),(0,t.Lk)("dd",E,[e.hook_tuntap?((0,t.uX)(),(0,t.Wv)(u,{key:0,item:e},null,8,["item"])):(0,t.Q3)("",!0)])])])))),128))])]),(0,t.Lk)("div",D,[(0,t.Lk)("div",y,[(0,t.bF)(i,{size:"small",background:"",layout:"prev,pager, next","pager-count":5,total:s.devices.page.Count,"page-size":s.devices.page.Request.Size,"current-page":s.devices.page.Request.Page,onCurrentChange:s.handlePageChange,onSizeChange:s.handlePageSizeChange,"page-sizes":[10,20,50,100,255]},null,8,["total","page-size","current-page","onCurrentChange","onSizeChange"])])])])}var T=a(5234),X=a(4373),H=a(6777),I=a(7454),Q=a(6293),W=a(8651),K=a(6057),N=a(5304),j={components:{StarFilled:F.BQ2,UpdaterBtn:H.A,DeviceName:I.A,TuntapShow:Q.A},setup(e){const n=(0,C.Kh)({}),{devices:a,deviceAddHook:s,deviceRefreshHook:c,deviceStartProcess:l,handlePageChange:r,handlePageSizeChange:o,deviceClearTimeout:u,setSort:i}=(0,X.r)(),{accessDataFn:d,accessProcessFn:p,accessRefreshFn:g}=(0,K.Y)();s("access",d,p,g);const{updater:v,updaterDataFn:f,updaterProcessFn:h,updaterRefreshFn:k,updaterSubscribe:b,updaterClearTimeout:F}=(0,N.d)();s("updater",f,h,k);const{tuntap:m,tuntapDataFn:L,tuntapProcessFn:S,tuntapRefreshFn:w,getTuntapMachines:x,sortTuntapIP:P}=(0,T.O)();s("tuntap",L,S,w);const{connections:_,connectionDataFn:z,connectionProcessFn:R,connectionRefreshFn:A}=(0,W.L)();return s("connection",z,R,A),(0,t.sV)((()=>{r(),l()})),(0,t.hi)((()=>{u(),F()})),{state:n,devices:a,handlePageChange:r,handlePageSizeChange:o,tuntap:m}}};const q=(0,S.A)(j,[["render",B],["__scopeId","data-v-891d79f4"]]);var U=q,G=a(3342),M={components:{Head:x,List:U,Status:G.A},setup(){return document.addEventListener("contextmenu",(function(e){e.preventDefault()})),{}}};const O=(0,S.A)(M,[["render",u],["__scopeId","data-v-7c182892"]]);var V=O}}]);
|
||||
1
src/linker.app/public/web/js/666.4bd5cb71.js
Normal file
1
src/linker.app/public/web/js/666.4bd5cb71.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/745.044e18ff.js
Normal file
1
src/linker.app/public/web/js/745.044e18ff.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/904.e10fb999.js
Normal file
1
src/linker.app/public/web/js/904.e10fb999.js
Normal file
File diff suppressed because one or more lines are too long
1
src/linker.app/public/web/js/app.32338bb2.js
Normal file
1
src/linker.app/public/web/js/app.32338bb2.js
Normal file
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763364230445" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12699" xmlns:xlink="http://www.w3.org/1999/xlink" width="1000" height="1000"><path d="M0 512c0 282.4 229.6 512 512 512s512-229.6 512-512S794.4 0 512 0 0 229.6 0 512z" fill="#515151" p-id="12700" data-spm-anchor-id="a313x.search_index.0.i2.53a83a81qrVrBK" class="selected"></path><path d="M85.6 512c0 236 191.2 426.4 426.4 426.4 236 0 426.4-191.2 426.4-426.4 0-236-191.2-426.4-426.4-426.4S85.6 276 85.6 512z" fill="#FFFFFF" p-id="12701"></path><path d="M624.8 469.6v104L720 793.6s28.8 46.4-16.8 60c0 0-30.4 4.8-46.4-24L572 668.8s-18.4-48-34.4-30.4l-60 64.8s-16.8 34.4-16.8 128c0 0 7.2 22.4-37.6 22.4 0 0-30.4 1.6-30.4-20.8V745.6s4.8-99.2 92-197.6v-28.8l-15.2-81.6s-16.8-20.8-28.8-3.2c0 0 3.2 24-48 51.2l-58.4 20.8s-32.8 12-37.6-7.2c0 0-12-25.6 7.2-32.8l52.8-28.8s61.6-40.8 58.4-92c0 0 10.4-58.4 63.2-75.2 0 0 25.6-20.8 58.4-8.8l138.4 63.2s18.4 12 18.4 25.6v136.8s3.2 25.6-15.2 25.6c0 0-30.4-10.4-30.4-18.4l1.6-102.4s-3.2-8.8-25.6-22.4l-22.4-16.8S576 336 580.8 360c-2.4-1.6 44 66.4 44 109.6zM445.6 256c-32.8 0-60-25.6-60-60 0-32.8 25.6-60 60-60s60 25.6 60 60-26.4 60-60 60z" fill="#515151" p-id="12702" data-spm-anchor-id="a313x.search_index.0.i3.53a83a81qrVrBK" class="selected"></path></svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1763625401599" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5643" xmlns:xlink="http://www.w3.org/1999/xlink" width="1000" height="1000"><path d="M0 512c0 282.4 229.6 512 512 512s512-229.6 512-512S794.4 0 512 0 0 229.6 0 512z" fill="#cdcdcd" p-id="5644" data-spm-anchor-id="a313x.search_index.0.i2.74063a81vN1pno" class="selected"></path><path d="M85.6 512c0 236 191.2 426.4 426.4 426.4 236 0 426.4-191.2 426.4-426.4 0-236-191.2-426.4-426.4-426.4S85.6 276 85.6 512z" fill="#FFFFFF" p-id="5645"></path><path d="M624.8 469.6v104L720 793.6s28.8 46.4-16.8 60c0 0-30.4 4.8-46.4-24L572 668.8s-18.4-48-34.4-30.4l-60 64.8s-16.8 34.4-16.8 128c0 0 7.2 22.4-37.6 22.4 0 0-30.4 1.6-30.4-20.8V745.6s4.8-99.2 92-197.6v-28.8l-15.2-81.6s-16.8-20.8-28.8-3.2c0 0 3.2 24-48 51.2l-58.4 20.8s-32.8 12-37.6-7.2c0 0-12-25.6 7.2-32.8l52.8-28.8s61.6-40.8 58.4-92c0 0 10.4-58.4 63.2-75.2 0 0 25.6-20.8 58.4-8.8l138.4 63.2s18.4 12 18.4 25.6v136.8s3.2 25.6-15.2 25.6c0 0-30.4-10.4-30.4-18.4l1.6-102.4s-3.2-8.8-25.6-22.4l-22.4-16.8S576 336 580.8 360c-2.4-1.6 44 66.4 44 109.6zM445.6 256c-32.8 0-60-25.6-60-60 0-32.8 25.6-60 60-60s60 25.6 60 60-26.4 60-60 60z" fill="#cdcdcd" p-id="5646" data-spm-anchor-id="a313x.search_index.0.i3.74063a81vN1pno" class="selected"></path></svg>
|
||||
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -31,6 +31,9 @@ namespace linker.libs.web
|
||||
/// 数据
|
||||
/// </summary>
|
||||
public object Content { get; set; } = string.Empty;
|
||||
|
||||
[JsonIgnore]
|
||||
public WebSocket Connection { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -158,16 +158,16 @@ namespace linker.libs.web
|
||||
using IMemoryOwner<byte> buffer = MemoryPool<byte>.Shared.Rent(8 * 1024);
|
||||
try
|
||||
{
|
||||
ValueWebSocketReceiveResult result = await websocket.ReceiveAsync(buffer.Memory, CancellationToken.None);
|
||||
ValueWebSocketReceiveResult result = await websocket.ReceiveAsync(buffer.Memory, CancellationToken.None).ConfigureAwait(false);
|
||||
if (result.MessageType != WebSocketMessageType.Text)
|
||||
{
|
||||
await websocket.CloseAsync(WebSocketCloseStatus.ProtocolError, "password fail", CancellationToken.None);
|
||||
await websocket.CloseAsync(WebSocketCloseStatus.ProtocolError, "only text frame", CancellationToken.None).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
ApiControllerRequestInfo req = Encoding.UTF8.GetString(buffer.Memory.Slice(0, result.Count).Span).DeJson<ApiControllerRequestInfo>();
|
||||
if (req.Path != "password" || req.Content != this.password)
|
||||
{
|
||||
await websocket.CloseAsync(WebSocketCloseStatus.ProtocolError, "password fail", CancellationToken.None);
|
||||
await websocket.CloseAsync(WebSocketCloseStatus.ProtocolError, "password fail", CancellationToken.None).ConfigureAwait(false);
|
||||
return;
|
||||
}
|
||||
await websocket.SendAsync(new ApiControllerResponseInfo
|
||||
@@ -176,27 +176,28 @@ namespace linker.libs.web
|
||||
Path = req.Path,
|
||||
RequestId = req.RequestId,
|
||||
Content = "password ok",
|
||||
}.ToJson().ToBytes(), WebSocketMessageType.Text, true, CancellationToken.None);
|
||||
}.ToJson().ToBytes(), WebSocketMessageType.Text, true, CancellationToken.None).ConfigureAwait(false);
|
||||
|
||||
while (websocket.State == WebSocketState.Open)
|
||||
{
|
||||
try
|
||||
{
|
||||
result = await websocket.ReceiveAsync(buffer.Memory, CancellationToken.None);
|
||||
switch (result.MessageType)
|
||||
ValueWebSocketReceiveResult _result = await websocket.ReceiveAsync(buffer.Memory, CancellationToken.None);
|
||||
switch (_result.MessageType)
|
||||
{
|
||||
case WebSocketMessageType.Text:
|
||||
{
|
||||
req = Encoding.UTF8.GetString(buffer.Memory.Slice(0, result.Count).Span).DeJson<ApiControllerRequestInfo>();
|
||||
req.Connection = websocket;
|
||||
ApiControllerResponseInfo resp = await OnMessage(req);
|
||||
await websocket.SendAsync(resp.ToJson().ToBytes(), WebSocketMessageType.Text, true, CancellationToken.None);
|
||||
req = Encoding.UTF8.GetString(buffer.Memory.Slice(0, _result.Count).Span).DeJson<ApiControllerRequestInfo>();
|
||||
ApiControllerRequestInfo _req = req;
|
||||
_req.Connection = websocket;
|
||||
var resp = await OnMessage(_req).ConfigureAwait(false);
|
||||
await resp.Connection.SendAsync(resp.ToJson().ToBytes(), WebSocketMessageType.Text, true, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
break;
|
||||
case WebSocketMessageType.Binary:
|
||||
break;
|
||||
case WebSocketMessageType.Close:
|
||||
await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closed by client", CancellationToken.None);
|
||||
await websocket.CloseAsync(WebSocketCloseStatus.NormalClosure, "Closed by client", CancellationToken.None).ConfigureAwait(false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -223,7 +224,8 @@ namespace linker.libs.web
|
||||
Content = $"{model.Path} not exists",
|
||||
RequestId = model.RequestId,
|
||||
Path = model.Path,
|
||||
Code = ApiControllerResponseCodes.NotFound
|
||||
Code = ApiControllerResponseCodes.NotFound,
|
||||
Connection = model.Connection
|
||||
};
|
||||
}
|
||||
if (plugin.HasAccess(plugin.Access) == false)
|
||||
@@ -233,7 +235,8 @@ namespace linker.libs.web
|
||||
Content = "no permission",
|
||||
RequestId = model.RequestId,
|
||||
Path = model.Path,
|
||||
Code = ApiControllerResponseCodes.Error
|
||||
Code = ApiControllerResponseCodes.Error,
|
||||
Connection = model.Connection
|
||||
};
|
||||
}
|
||||
|
||||
@@ -268,6 +271,7 @@ namespace linker.libs.web
|
||||
Content = param.Code != ApiControllerResponseCodes.Error ? resultObject : param.ErrorMessage,
|
||||
RequestId = model.RequestId,
|
||||
Path = model.Path,
|
||||
Connection = model.Connection
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -278,7 +282,8 @@ namespace linker.libs.web
|
||||
Content = ex.Message,
|
||||
RequestId = model.RequestId,
|
||||
Path = model.Path,
|
||||
Code = ApiControllerResponseCodes.Error
|
||||
Code = ApiControllerResponseCodes.Error,
|
||||
Connection = model.Connection
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace linker.messenger
|
||||
return;
|
||||
}
|
||||
|
||||
int length = await socket.ReceiveAsync(buffer.AsMemory(0, 1), SocketFlags.None).AsTask().WaitAsync(TimeSpan.FromMilliseconds(1000)).ConfigureAwait(false);
|
||||
int length = await socket.ReceiveAsync(buffer.AsMemory(0, 1), SocketFlags.None).AsTask().WaitAsync(TimeSpan.FromMilliseconds(5000)).ConfigureAwait(false);
|
||||
byte type = buffer[0];
|
||||
|
||||
if (resolvers.TryGetValue(type, out IResolver resolver))
|
||||
|
||||
Reference in New Issue
Block a user