mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-26 07:24:10 +08:00
17 lines
11 KiB
JavaScript
17 lines
11 KiB
JavaScript
|
import{N as O,u as ie,d as n,O as Te,S as ze,i as s,P as ce,Q as Ge,t as g,b as Me,y as Ee,A as $,R as Ke,T as Y,U as i,B as x,V as J,I as W,W as ee,H as D,X as R,r as Re,w as Ne,D as b,g as y,Y as I,Z as w,_ as te,E as Oe,$ as Ae,a0 as He,F as T,a1 as N,a2 as ae,a3 as ne,a4 as je,a5 as Ve,a6 as Ue,a7 as Ze,a8 as Le,a9 as Qe,aa as qe,l as Be}from"./index-Csmv4Fkv.js";import{c as Xe,I as Ye,a as Je,f as z,b as We,d as et,g as tt,e as at,h as nt,i as lt,j as st,r as rt}from"./index-CBBLUqwt.js";import{D as ot}from"./DocumentTitle-DG90V81t.js";import{f as it}from"./time-CHbJgbks.js";/**
|
||
|
* @license @tabler/icons-solidjs v3.26.0 - MIT
|
||
|
*
|
||
|
* This source code is licensed under the MIT license.
|
||
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
*/var ct=O("outline","info-small","IconInfoSmall",[["path",{d:"M12 9h.01"}],["path",{d:"M11 12h1v4h1"}]]);/**
|
||
|
* @license @tabler/icons-solidjs v3.26.0 - MIT
|
||
|
*
|
||
|
* This source code is licensed under the MIT license.
|
||
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
*/var le=O("filled","zoom-in-filled","IconZoomInFilled",[["path",{d:"M14 3.072a8 8 0 0 1 2.617 11.424l4.944 4.943a1.5 1.5 0 0 1 -2.008 2.225l-.114 -.103l-4.943 -4.944a8 8 0 0 1 -12.49 -6.332l-.006 -.285l.005 -.285a8 8 0 0 1 11.995 -6.643zm-4 2.928a1 1 0 0 0 -.993 .883l-.007 .117v2h-2l-.117 .007a1 1 0 0 0 0 1.986l.117 .007h2v2l.007 .117a1 1 0 0 0 1.986 0l.007 -.117v-2h2l.117 -.007a1 1 0 0 0 0 -1.986l-.117 -.007h-2v-2l-.007 -.117a1 1 0 0 0 -.993 -.883z"}]]);/**
|
||
|
* @license @tabler/icons-solidjs v3.26.0 - MIT
|
||
|
*
|
||
|
* This source code is licensed under the MIT license.
|
||
|
* See the LICENSE file in the root directory of this source tree.
|
||
|
*/var se=O("filled","zoom-out-filled","IconZoomOutFilled",[["path",{d:"M14 3.072a8 8 0 0 1 2.617 11.424l4.944 4.943a1.5 1.5 0 0 1 -2.008 2.225l-.114 -.103l-4.943 -4.944a8 8 0 0 1 -12.49 -6.332l-.006 -.285l.005 -.285a8 8 0 0 1 11.995 -6.643zm-1 5.928h-6l-.117 .007a1 1 0 0 0 0 1.986l.117 .007h6l.117 -.007a1 1 0 0 0 0 -1.986l-.117 -.007z"}]]),dt=g("<pre><code>");const ut=d=>{const[f]=ie();return n(Ge,{ref:m=>{var a;return(a=d.ref)==null?void 0:a.call(d,m)},get icon(){return n(Te,{size:24})},get title(){return f("connectionsDetails")},get children(){return n(ze,{get when(){return d.selectedConnectionID},get children(){var m=dt(),a=m.firstChild;return s(a,()=>JSON.stringify(ce().find(({id:S})=>S===d.selectedConnectionID),null,2)),m}})}})};var gt=async d=>{typeof d=="string"?await navigator.clipboard.writeText(d):await navigator.clipboard.write(d)},re=g('<div class="flex h-4 items-center">'),mt=g('<div class="flex h-full flex-col gap-2"><div class="flex w-full flex-wrap items-center gap-2"><div class="flex items-center gap-2"><div class="tabs-boxed tabs gap-2"></div><div class="flex items-center"><span class="mr-2 hidden lg:inline-block">:</span><input type=checkbox class=toggle></div><select class="select select-bordered select-primary select-sm w-full max-w-full flex-1"><option value=""></option></select></div><div class="join flex flex-1 items-center"><input type=search class="input input-sm join-item input-primary min-w-0 flex-1"></div></div><div class="overflow-x-auto whitespace-nowrap rounded-md bg-base-300"><table><thead class="sticky top-0 z-10 h-8"></thead><tbody>'),pt=g('<button><span></span><div class="badge badge-sm">'),bt=g("<option>"),ft=g('<div class="loading loading-spinner">'),ht=g("<tr>"),vt=g("<th class=bg-base-200><div><div>"),Ct=g("<button class=cursor-pointer>"),$t=g('<tr class="hover:!bg-primary hover:text-primary-content">'),St=g("<td class=py-2>"),_t=g("<button><div></div><div></div><div>(<!>)");const oe=(d,f,m,a)=>{const S=rt(d.getValue(f),m);return a({itemRank:S}),S.passed},wt=()=>{const d=Me();if(!Ee())return d("/setup",{replace:!0}),null;let f,m;const[a]=ie(),[S,de]=$(0),{activeConnections:A,closedConnections:H,paused:ue,setPaused:ge}=Ke(),[me,j]=$(!1),[pe,V]=$(""),[U,be]=Y($(!1),{name:"enableQuickFilter",storage:localStorage}),[fe,he]=$(),ve=[{header:()=>a("details"),enableGrouping:!1,enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1,accessorKey:i.Details,cell:({row:e})=>(()=>{var r=re();return s(r,n(x,{class:"btn-circle btn-xs",onClick:()=>{he(e.original.id),m==null||m.showModal()},get icon(){return n(ct,{size:"16"})}})),r})()},{header:()=>a("close"),enableGrouping:!1,enableSorting:!1,enableColumnFilter:!1,enableGlobalFilter:!1,accessorKey:i.Close,cell:({row:e})=>(()=>{var r=re();return s(r,n(x,{class:"btn-circle btn-xs",onClick:()=>J(e.original.id),get icon(){return n(W,{size:"16"})}})),r})()},{header:()=>a("ID"),enableGrouping:!1,accessorKey:i.ID,accessorFn:e=>e.id},{header:()=>a("type"),accessorKey:i.Type,accessorFn:e=>`${e.metadata.type}(${e.metadata.network})`},{header:()=>a("process"),accessorKey:i.Process,accessorFn:e=>e.metadata.process||e.metadata.processPath.replace(/^.*[/\\](.*)$/,"$1")||"-"},{header:()=>a("host"),accessorKey:i.Host,accessorFn:e=>`${e.metadata.host?e.metadata.host:e.metadata.destinationIP}:${e.metadata.destinationPort}`},{header:()=>a("sniffHost"),accessorKey:i.SniffHost,accessorFn:e=>e.metadata.sniffHost||"-"},{header:()=>a("rule"),accessorKey:i.Rule,accessorFn:e=>e.rulePayload?`${e.rule} :: ${e.rulePayload}`:e.rule},{header:()=>a("chains"),accessorKey:i.Chains,accessorFn:e=>e.chains.slice().reverse().join(" :: ")},{header:()=>a("connectTime"),enableGrouping:!1,accessorKey:i.ConnectTime,accessorFn:e=>it(e.start),sortingFn:(e,r)=>ee(e.original.start).valueOf()-ee(r.original.start).valueOf()},{header:()=>a("dlSpeed"),enableGrouping:!1,accessorKey:i.DlSpeed,accessorFn:e=>`${D(e.downloadSpeed)}/s`,sortingFn:(e,r)=>e.original.downloadSpeed-r.original.downloadSpeed},{header:()=>a("ulSpeed"),enableGrouping:!1,accessorKey:i.UlSpeed,accessorFn:e=>`${D(e.uploadSpee
|