diff --git a/README.md b/README.md
index b560d44..cd1a279 100644
--- a/README.md
+++ b/README.md
@@ -91,8 +91,6 @@ We will transition from version 0 to version 1 at the appropriate time and will
### About V2
-The overall situation is currently unfavorable, and there is significant pressure in both personal and professional aspects.
-
The complexity and difficulty of the v2 version are much higher than anticipated. I can only work on its development during fragmented time periods, and the constant interruptions disrupt productivity significantly. Given this situation, we will continue to optimize and iterate on the current version until we have more free time to proceed with the major version overhaul.
The concept behind v2 is based on my years of experience and reflection in the cloud-native domain, particularly in K8s and ServiceMesh. Its core is a modernized four-layer and seven-layer proxy, similar to envoy. This proxy itself is highly scalable, not only capable of implementing the functionality of intranet penetration but also applicable to various other domains. Building upon this highly scalable core, we aim to implement all the capabilities of frp v1 while also addressing the functionalities that were previously unachievable or difficult to implement in an elegant manner. Furthermore, we will maintain efficient development and iteration capabilities.
@@ -218,7 +216,7 @@ Unfortunately, we cannot resolve a domain name to a local IP. However, we can us
vhostHTTPPort = 8080
```
- If you want to configure an https proxy, you need to set up the `vhost_https_port`.
+ If you want to configure an https proxy, you need to set up the `vhostHTTPSPort`.
2. Start `frps`:
@@ -337,7 +335,7 @@ Configure `frps` as described above, then:
### Enable HTTPS for a local HTTP(S) service
-You may substitute `https2https` for the plugin, and point the `plugin_local_addr` to a HTTPS endpoint.
+You may substitute `https2https` for the plugin, and point the `localAddr` to a HTTPS endpoint.
1. Start `frpc` with the following configuration:
@@ -369,7 +367,7 @@ To mitigate risks associated with exposing certain services directly to the publ
Configure `frps` same as above.
-1. Start `frpc` on machine B with the following config. This example is for exposing the SSH service (port 22), and note the `sk` field for the preshared key, and that the `remote_port` field is removed here:
+1. Start `frpc` on machine B with the following config. This example is for exposing the SSH service (port 22), and note the `secretKey` field for the preshared key, and that the `remotePort` field is removed here:
```toml
# frpc.toml
@@ -384,7 +382,7 @@ Configure `frps` same as above.
localPort = 22
```
-2. Start another `frpc` (typically on another machine C) with the following config to access the SSH service with a security key (`sk` field):
+2. Start another `frpc` (typically on another machine C) with the following config to access the SSH service with a security key (`secretKey` field):
```toml
# frpc.toml
@@ -526,7 +524,7 @@ webServer.user = "admin"
webServer.password = "admin"
```
-Then visit `http://[server_addr]:7500` to see the dashboard, with username and password both being `admin`.
+Then visit `http://[serverAddr]:7500` to see the dashboard, with username and password both being `admin`.
Additionally, you can use HTTPS port by using your domains wildcard or normal SSL certificate:
@@ -539,7 +537,7 @@ webServer.tls.certFile = "server.crt"
webServer.tls.keyFile = "server.key"
```
-Then visit `https://[server_addr]:7500` to see the dashboard in secure HTTPS connection, with username and password both being `admin`.
+Then visit `https://[serverAddr]:7500` to see the dashboard in secure HTTPS connection, with username and password both being `admin`.
![dashboard](/doc/pic/dashboard.png)
@@ -836,7 +834,7 @@ Using QUIC in frp:
quicBindPort = 7000
```
- The `quicBindPort` number can be the same number as `bind_port`, since `bind_port` field specifies a TCP port.
+ The `quicBindPort` number can be the same number as `bindPort`, since `bindPort` field specifies a TCP port.
2. Configure `frpc.toml` to use QUIC to connect to frps:
diff --git a/README_zh.md b/README_zh.md
index d6256a1..77cf797 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -41,9 +41,7 @@ master 分支用于发布稳定版本,dev 分支用于开发,您可以尝试
### 关于 v2 的一些说明
-当前整体形势不佳,面临的生活工作压力很大。
-
-v2 版本的复杂度和难度比我们预期的要高得多。我只能利用零散的时间进行开发,而且由于上下文经常被打断,效率极低。由于这种情况可能会持续一段时间,我们仍然会在当前版本上进行一些优化和迭代,直到我们有更多空闲时间来推进大版本的重构。
+v2 版本的复杂度和难度比我们预期的要高得多。我只能利用零散的时间进行开发,而且由于上下文经常被打断,效率极低。由于这种情况可能会持续一段时间,我们仍然会在当前版本上进行一些优化和迭代,直到我们有更多空闲时间来推进大版本的重构,或者也有可能放弃一次性的重构,而是采用渐进的方式在当前版本上逐步做一些可能会导致不兼容的修改。
v2 的构想是基于我多年在云原生领域,特别是在 K8s 和 ServiceMesh 方面的工作经验和思考。它的核心是一个现代化的四层和七层代理,类似于 envoy。这个代理本身高度可扩展,不仅可以用于实现内网穿透的功能,还可以应用于更多领域。在这个高度可扩展的内核基础上,我们将实现 frp v1 中的所有功能,并且能够以一种更加优雅的方式实现原先架构中无法实现或不易实现的功能。同时,我们将保持高效的开发和迭代能力。
@@ -55,7 +53,7 @@ v2 的构想是基于我多年在云原生领域,特别是在 K8s 和 ServiceM
## 文档
-完整文档已经迁移至 [https://gofrp.org](https://gofrp.org/docs)。
+完整文档已经迁移至 [https://gofrp.org](https://gofrp.org)。
## 为 frp 做贡献
diff --git a/Release.md b/Release.md
index 2d7cf01..61ea1f4 100644
--- a/Release.md
+++ b/Release.md
@@ -1,6 +1,3 @@
### Fixes
-* `transport.tls.disableCustomTLSFirstByte` doesn't have any effect.
-* The Server API did not return the data correctly.
-* The Dashboard is unable to display data.
-* `natHoleStunServer` is missing a default value.
+* Encryption and compression are not displayed correctly in the dashboard.
diff --git a/assets/frps/static/index-9465253b.js b/assets/frps/static/index-c322b7dd.js
similarity index 99%
rename from assets/frps/static/index-9465253b.js
rename to assets/frps/static/index-c322b7dd.js
index c2f4e63..466c8b2 100644
--- a/assets/frps/static/index-9465253b.js
+++ b/assets/frps/static/index-c322b7dd.js
@@ -71,4 +71,4 @@ PERFORMANCE OF THIS SOFTWARE.
`:" ",m=f.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,u)?this._updatePosition(s,h,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,m,u,Math.random()+"",o[0],o[1],h,null,d)})},t.prototype._showSeriesItemTooltip=function(r,n,i){var a=this._ecModel,o=ft(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,c=o.dataIndex,f=o.dataType,d=u.getData(f),h=this._renderMode,v=r.positionDefault,p=ml([d.getItemModel(c),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),g=p.get("trigger");if(!(g!=null&&g!=="item")){var m=u.getDataParams(c,f),y=new Xv;m.marker=y.makeTooltipMarker("item",Lu(m.color),h);var _=SS(u.formatTooltip(c,!1,f)),b=p.get("order"),S=p.get("valueFormatter"),w=_.frag,x=w?AS(S?se({valueFormatter:S},w):w,y,h,b,a.get("useUTC"),p.get("textStyle")):_.text,C="item_"+u.name+"_"+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,m,C,r.offsetX,r.offsetY,r.position,r.target,y)}),i({type:"showTip",dataIndexInside:c,dataIndex:d.getRawIndex(c),seriesIndex:s,from:this.uid})}},t.prototype._showComponentItemTooltip=function(r,n,i){var a=ft(n),o=a.tooltipConfig,s=o.option||{};if(Te(s)){var l=s;s={content:l,formatter:l}}var u=[s],c=this._ecModel.getComponent(a.componentMainType,a.componentIndex);c&&u.push(c),u.push({formatter:s.content});var f=r.positionDefault,d=ml(u,this._tooltipModel,f?{position:f}:null),h=d.get("content"),v=Math.random()+"",p=new Xv;this._showOrMove(d,function(){var g=Qe(d.get("formatterParams")||{});this._showTooltipContent(d,h,g,v,r.offsetX,r.offsetY,r.position,n,p)}),i({type:"showTip",from:this.uid})},t.prototype._showTooltipContent=function(r,n,i,a,o,s,l,u,c){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent;f.setEnterable(r.get("enterable"));var d=r.get("formatter");l=l||r.get("position");var h=n,v=this._getNearestPoint([o,s],i,r.get("trigger"),r.get("borderColor")),p=v.color;if(d)if(Te(d)){var g=r.ecModel.get("useUTC"),m=ge(i)?i[0]:i,y=m&&m.axisType&&m.axisType.indexOf("time")>=0;h=d,y&&(h=mh(m.axisValue,h,g)),h=U2(h,i,!0)}else if(Ve(d)){var _=_t(function(b,S){b===this._ticket&&(f.setContent(S,c,r,p,l),this._updatePosition(r,l,o,s,f,i,u))},this);this._ticket=a,h=d(i,a,_)}else h=d;f.setContent(h,c,r,p,l),f.show(r,p),this._updatePosition(r,l,o,s,f,i,u)}},t.prototype._getNearestPoint=function(r,n,i,a){if(i==="axis"||ge(n))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!ge(n))return{color:a||n.color||n.borderColor}},t.prototype._updatePosition=function(r,n,i,a,o,s,l){var u=this._api.getWidth(),c=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),d=r.get("align"),h=r.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),Ve(n)&&(n=n([i,a],s,o.el,v,{viewSize:[u,c],contentSize:f.slice()})),ge(n))i=gt(n[0],u),a=gt(n[1],c);else if(Ie(n)){var p=n;p.width=f[0],p.height=f[1];var g=Ls(p,{width:u,height:c});i=g.x,a=g.y,d=null,h=null}else if(Te(n)&&l){var m=kte(n,v,f,r.get("borderWidth"));i=m[0],a=m[1]}else{var m=Ote(i,a,o,u,c,d?null:20,h?null:20);i=m[0],a=m[1]}if(d&&(i-=uC(d)?f[0]/2:d==="right"?f[0]:0),h&&(a-=uC(h)?f[1]/2:h==="bottom"?f[1]:0),JL(r)){var m=Rte(i,a,o,u,c);i=m[0],a=m[1]}o.moveTo(i,a)},t.prototype._updateContentNotChangedOnAxis=function(r,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===r.length;return o&&O(i,function(s,l){var u=s.dataByAxis||[],c=r[l]||{},f=c.dataByAxis||[];o=o&&u.length===f.length,o&&O(u,function(d,h){var v=f[h]||{},p=d.seriesDataIndices||[],g=v.seriesDataIndices||[];o=o&&d.value===v.value&&d.axisType===v.axisType&&d.axisId===v.axisId&&p.length===g.length,o&&O(p,function(m,y){var _=g[y];o=o&&m.seriesIndex===_.seriesIndex&&m.dataIndex===_.dataIndex}),a&&O(d.seriesDataIndices,function(m){var y=m.seriesIndex,_=n[y],b=a[y];_&&b&&b.data!==_.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},t.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},t.prototype.dispose=function(r,n){Ge.node||!n.getDom()||(sm(this,"_updatePosition"),this._tooltipContent.dispose(),xm("itemTooltip",n))},t.type="tooltip",t}(Si);function ml(e,t,r){var n=t.ecModel,i;r?(i=new rr(r,n,n),i=new rr(t.option,i,n)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof rr&&(o=o.get("tooltip",!0)),Te(o)&&(o={formatter:o}),o&&(i=new rr(o,i,n)))}return i}function lC(e,t){return e.dispatchAction||_t(t.dispatchAction,t)}function Ote(e,t,r,n,i,a,o){var s=r.getSize(),l=s[0],u=s[1];return a!=null&&(e+l+a+2>n?e-=l+a:e+=a),o!=null&&(t+u+o>i?t-=u+o:t+=o),[e,t]}function Rte(e,t,r,n,i){var a=r.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,n)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function kte(e,t,r,n){var i=r[0],a=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=t.width,c=t.height;switch(e){case"inside":s=t.x+u/2-i/2,l=t.y+c/2-a/2;break;case"top":s=t.x+u/2-i/2,l=t.y-a-o;break;case"bottom":s=t.x+u/2-i/2,l=t.y+c+o;break;case"left":s=t.x-i-o,l=t.y+c/2-a/2;break;case"right":s=t.x+u+o,l=t.y+c/2-a/2}return[s,l]}function uC(e){return e==="center"||e==="middle"}function Nte(e,t,r){var n=r0(e).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=ic(t,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var c=ft(u).tooltipConfig;if(c&&c.name===e.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}const Fte=Ite;function Bte(e){ua(QL),e.registerComponentModel(mte),e.registerComponentView(Fte),e.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Tr),e.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Tr)}var $te=function(e){pe(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.type="title",t.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},t}(St),Hte=function(e){pe(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.render=function(r,n,i){if(this.group.removeAll(),!!r.get("show")){var a=this.group,o=r.getModel("textStyle"),s=r.getModel("subtextStyle"),l=r.get("textAlign"),u=qe(r.get("textBaseline"),r.get("textVerticalAlign")),c=new dr({style:la(o,{text:r.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=c.getBoundingRect(),d=r.get("subtext"),h=new dr({style:la(s,{text:d,fill:s.getTextColor(),y:f.height+r.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),v=r.get("link"),p=r.get("sublink"),g=r.get("triggerEvent",!0);c.silent=!v&&!g,h.silent=!p&&!g,v&&c.on("click",function(){iS(v,"_"+r.get("target"))}),p&&h.on("click",function(){iS(p,"_"+r.get("subtarget"))}),ft(c).eventData=ft(h).eventData=g?{componentType:"title",componentIndex:r.componentIndex}:null,a.add(c),d&&a.add(h);var m=a.getBoundingRect(),y=r.getBoxLayoutParams();y.width=m.width,y.height=m.height;var _=Ls(y,{width:i.getWidth(),height:i.getHeight()},r.get("padding"));l||(l=r.get("left")||r.get("right"),l==="middle"&&(l="center"),l==="right"?_.x+=_.width:l==="center"&&(_.x+=_.width/2)),u||(u=r.get("top")||r.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?_.y+=_.height:u==="middle"&&(_.y+=_.height/2),u=u||"top"),a.x=_.x,a.y=_.y,a.markRedraw();var b={align:l,verticalAlign:u};c.setStyle(b),h.setStyle(b),m=a.getBoundingRect();var S=_.margin,w=r.getItemStyle(["color","opacity"]);w.fill=r.get("backgroundColor");var x=new Ht({shape:{x:m.x-S[3],y:m.y-S[0],width:m.width+S[1]+S[3],height:m.height+S[0]+S[2],r:r.get("borderRadius")},style:w,subPixelOptimize:!0,silent:!0});a.add(x)}},t.type="title",t}(Si);function zte(e){e.registerComponentModel($te),e.registerComponentView(Hte)}var Wte=function(e,t){if(t==="all")return{type:"all",title:e.getLocaleModel().get(["legend","selector","all"])};if(t==="inverse")return{type:"inverse",title:e.getLocaleModel().get(["legend","selector","inverse"])}},Vte=function(e){pe(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.layoutMode={type:"box",ignoreSize:!0},r}return t.prototype.init=function(r,n,i){this.mergeDefaultAndTheme(r,i),r.selected=r.selected||{},this._updateSelector(r)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.call(this,r,n),this._updateSelector(r)},t.prototype._updateSelector=function(r){var n=r.selector,i=this.ecModel;n===!0&&(n=r.selector=["all","inverse"]),ge(n)&&O(n,function(a,o){Te(a)&&(a={type:a}),n[o]=st(a,Wte(i,a.type))})},t.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var n=!1,i=0;i=0},t.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},t.type="legend.plain",t.dependencies=["series"],t.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(St);const Cm=Vte;var jo=Rt,Tm=O,gf=cn,Gte=function(e){pe(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!1,r}return t.prototype.init=function(){this.group.add(this._contentGroup=new gf),this.group.add(this._selectorGroup=new gf),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(r,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),u=r.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,i,l,s,u);var c=r.getBoxLayoutParams(),f={width:i.getWidth(),height:i.getHeight()},d=r.get("padding"),h=Ls(c,f,d),v=this.layoutInner(r,o,h,a,l,u),p=Ls(dt({width:v.width,height:v.height},c),f,d);this.group.x=p.x-v.x,this.group.y=p.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=pte(v,r))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this.getContentGroup(),c=Ue(),f=n.get("selectedMode"),d=[];i.eachRawSeries(function(h){!h.get("legendHoverLink")&&d.push(h.id)}),Tm(n.getData(),function(h,v){var p=h.get("name");if(!this.newlineDisabled&&(p===""||p===`
`)){var g=new gf;g.newline=!0,u.add(g);return}var m=i.getSeriesByName(p)[0];if(!c.get(p))if(m){var y=m.getData(),_=y.getVisual("legendLineStyle")||{},b=y.getVisual("legendIcon"),S=y.getVisual("style"),w=this._createItem(m,p,v,h,n,r,_,S,b,f,a);w.on("click",jo(cC,p,null,a,d)).on("mouseover",jo(Mm,m.name,null,a,d)).on("mouseout",jo(Am,m.name,null,a,d)),c.set(p,!0)}else i.eachRawSeries(function(x){if(!c.get(p)&&x.legendVisualProvider){var C=x.legendVisualProvider;if(!C.containName(p))return;var M=C.indexOfName(p),E=C.getItemVisual(M,"style"),A=C.getItemVisual(M,"legendIcon"),T=so(E.fill);T&&T[3]===0&&(T[3]=.2,E=se(se({},E),{fill:Ky(T,"rgba")}));var D=this._createItem(x,p,v,h,n,r,{},E,A,f,a);D.on("click",jo(cC,null,p,a,d)).on("mouseover",jo(Mm,null,p,a,d)).on("mouseout",jo(Am,null,p,a,d)),c.set(p,!0)}},this)},this),o&&this._createSelector(o,n,a,s,l)},t.prototype._createSelector=function(r,n,i,a,o){var s=this.getSelectorGroup();Tm(r,function(u){var c=u.type,f=new dr({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:c==="all"?"legendAllSelect":"legendInverseSelect"})}});s.add(f);var d=n.getModel("selectorLabel"),h=n.getModel(["emphasis","selectorLabel"]);m0(f,{normal:d,emphasis:h},{defaultText:u.title}),Kg(f)})},t.prototype._createItem=function(r,n,i,a,o,s,l,u,c,f,d){var h=r.visualDrawType,v=o.get("itemWidth"),p=o.get("itemHeight"),g=o.isSelected(n),m=a.get("symbolRotate"),y=a.get("symbolKeepAspect"),_=a.get("icon");c=_||c||"roundRect";var b=Ute(c,a,l,u,h,g,d),S=new gf,w=a.getModel("textStyle");if(Ve(r.getLegendIcon)&&(!_||_==="inherit"))S.add(r.getLegendIcon({itemWidth:v,itemHeight:p,icon:c,iconRotate:m,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:y}));else{var x=_==="inherit"&&r.getData().getVisual("symbol")?m==="inherit"?r.getData().getVisual("symbolRotate"):m:0;S.add(jte({itemWidth:v,itemHeight:p,icon:c,iconRotate:x,itemStyle:b.itemStyle,lineStyle:b.lineStyle,symbolKeepAspect:y}))}var C=s==="left"?v+5:-5,M=s,E=o.get("formatter"),A=n;Te(E)&&E?A=E.replace("{name}",n??""):Ve(E)&&(A=E(n));var T=a.get("inactiveColor");S.add(new dr({style:la(w,{text:A,x:C,y:p/2,fill:g?w.getTextColor():T,align:M,verticalAlign:"middle"})}));var D=new Ht({shape:S.getBoundingRect(),invisible:!0}),N=a.getModel("tooltip");return N.get("show")&&p0({el:D,componentModel:o,itemName:n,itemTooltipOption:N.option}),S.add(D),S.eachChild(function(H){H.silent=!0}),D.silent=!f,this.getContentGroup().add(S),Kg(S),S.__legendDataIndex=i,S},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Xl(r.get("orient"),l,r.get("itemGap"),i.width,i.height);var c=l.getBoundingRect(),f=[-c.x,-c.y];if(u.markRedraw(),l.markRedraw(),o){Xl("horizontal",u,r.get("selectorItemGap",!0));var d=u.getBoundingRect(),h=[-d.x,-d.y],v=r.get("selectorButtonGap",!0),p=r.getOrient().index,g=p===0?"width":"height",m=p===0?"height":"width",y=p===0?"y":"x";s==="end"?h[p]+=c[g]+v:f[p]+=d[g]+v,h[1-p]+=c[m]/2-d[m]/2,u.x=h[0],u.y=h[1],l.x=f[0],l.y=f[1];var _={x:0,y:0};return _[g]=c[g]+v+d[g],_[m]=Math.max(c[m],d[m]),_[y]=Math.min(0,d[y]+h[1-p]),_}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type="legend.plain",t}(Si);function Ute(e,t,r,n,i,a,o){function s(g,m){g.lineWidth==="auto"&&(g.lineWidth=m.lineWidth>0?2:0),Tm(g,function(y,_){g[_]==="inherit"&&(g[_]=m[_])})}var l=t.getModel("itemStyle"),u=l.getItemStyle(),c=e.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?n.decal:dm(f,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[c]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:r).opacity),s(u,n);var d=t.getModel("lineStyle"),h=d.getLineStyle();if(s(h,r),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),h.stroke==="auto"&&(h.stroke=n.fill),!a){var v=t.get("inactiveBorderWidth"),p=u[c];u.lineWidth=v==="auto"?n.lineWidth>0&&p?2:0:u.lineWidth,u.fill=t.get("inactiveColor"),u.stroke=t.get("inactiveBorderColor"),h.stroke=d.get("inactiveColor"),h.lineWidth=d.get("inactiveWidth")}return{itemStyle:u,lineStyle:h}}function jte(e){var t=e.icon||"roundRect",r=R0(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return r.setStyle(e.itemStyle),r.rotation=(e.iconRotate||0)*Math.PI/180,r.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill="#fff",r.style.lineWidth=2),r}function cC(e,t,r,n){Am(e,t,r,n),r.dispatchAction({type:"legendToggleSelect",name:e??t}),Mm(e,t,r,n)}function nD(e){for(var t=e.getZr().storage.getDisplayList(),r,n=0,i=t.length;ni[o],g=[-h.x,-h.y];n||(g[a]=c[u]);var m=[0,0],y=[-v.x,-v.y],_=qe(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(p){var b=r.get("pageButtonPosition",!0);b==="end"?y[a]+=i[o]-v[o]:m[a]+=v[o]+_}y[1-a]+=h[s]/2-v[s]/2,c.setPosition(g),f.setPosition(m),d.setPosition(y);var S={x:0,y:0};if(S[o]=p?i[o]:h[o],S[s]=Math.max(h[s],v[s]),S[l]=Math.min(0,v[l]+y[1-a]),f.__rectSize=i[o],p){var w={x:0,y:0};w[o]=Math.max(i[o]-v[o]-_,0),w[s]=S[s],f.setClipPath(new Ht({shape:w})),f.__rectSize=w[o]}else d.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(r);return x.pageIndex!=null&&Er(c,{x:x.contentPosition[0],y:x.contentPosition[1]},p?r:null),this._updatePageInfoView(r,x),S},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;O(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",d=n[f]!=null,h=i.childOfName(c);h&&(h.setStyle("fill",d?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),h.cursor=d?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",Te(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=wp[o],l=Sp[o],u=this._findTargetItemIndex(n),c=i.children(),f=c[u],d=c.length,h=d?1:0,v={contentPosition:[i.x,i.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return v;var p=b(f);v.contentPosition[o]=-p.s;for(var g=u+1,m=p,y=p,_=null;g<=d;++g)_=b(c[g]),(!_&&y.e>m.s+a||_&&!S(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=m.i),++v.pageCount)),y=_;for(var g=u-1,m=p,y=p,_=null;g>=-1;--g)_=b(c[g]),(!_||!S(y,_.s))&&m.i=x&&w.s<=x+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(iD);const Qte=Zte;function Jte(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function ere(e){ua(aD),e.registerComponentModel(Xte),e.registerComponentView(Qte),Jte(e)}function tre(e){ua(aD),ua(ere)}ua([KJ,OJ,$ee,sJ,zte,Bte,tre,vte]);function rre(e,t,r){const n=B0(document.getElementById(e),"macarons");n.showLoading();const i={title:{text:"Network Traffic",subtext:"today",left:"center"},tooltip:{trigger:"item",formatter:function(a){return aa.fileSize(a.data.value)+" ("+a.percent+"%)"}},legend:{orient:"vertical",left:"left",data:["Traffic In","Traffic Out"]},series:[{type:"pie",radius:"55%",center:["50%","60%"],data:[{value:t,name:"Traffic In"},{value:r,name:"Traffic Out"}],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};n.setOption(i),n.hideLoading()}function nre(e,t){const r=B0(document.getElementById(e),"macarons");r.showLoading();const n={title:{text:"Proxies",subtext:"now",left:"center"},tooltip:{trigger:"item",formatter:function(i){return String(i.data.value)}},legend:{orient:"vertical",left:"left",data:[]},series:[{type:"pie",radius:"55%",center:["50%","60%"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};t.proxyTypeCount.tcp!=null&&t.proxyTypeCount.tcp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.tcp,name:"TCP"}),n.legend.data.push("TCP")),t.proxyTypeCount.udp!=null&&t.proxyTypeCount.udp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.udp,name:"UDP"}),n.legend.data.push("UDP")),t.proxyTypeCount.http!=null&&t.proxyTypeCount.http!=0&&(n.series[0].data.push({value:t.proxyTypeCount.http,name:"HTTP"}),n.legend.data.push("HTTP")),t.proxyTypeCount.https!=null&&t.proxyTypeCount.https!=0&&(n.series[0].data.push({value:t.proxyTypeCount.https,name:"HTTPS"}),n.legend.data.push("HTTPS")),t.proxyTypeCount.stcp!=null&&t.proxyTypeCount.stcp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.stcp,name:"STCP"}),n.legend.data.push("STCP")),t.proxyTypeCount.sudp!=null&&t.proxyTypeCount.sudp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.sudp,name:"SUDP"}),n.legend.data.push("SUDP")),t.proxyTypeCount.xtcp!=null&&t.proxyTypeCount.xtcp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.xtcp,name:"XTCP"}),n.legend.data.push("XTCP")),r.setOption(n),r.hideLoading()}function ire(e,t,r){const n={width:"600px",height:"400px"},i=B0(document.getElementById(e),"macarons",n);i.showLoading(),t=t.reverse(),r=r.reverse();let a=new Date;a=new Date(a.getFullYear(),a.getMonth(),a.getDate()-6);const o=[];for(let l=0;l<7;l++)o.push(a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()),a=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1);const s={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(l){let u="";l.length>0&&(u+=l[0].name+" ");for(const c of l){const f='';u+=f+c.seriesName+": "+aa.fileSize(c.value)+" "}return u}},legend:{data:["Traffic In","Traffic Out"]},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",data:o}],yAxis:[{type:"value",axisLabel:{formatter:function(l){return aa.fileSize(l)}}}],series:[{name:"Traffic In",type:"bar",data:t},{name:"Traffic Out",type:"bar",data:r}]};i.setOption(s),i.hideLoading()}const hC=ce({__name:"LongSpan",props:{content:null,length:null},setup(e){return(t,r)=>{const n=Ju;return Y(),me(pt,null,[ee(n,{content:e.content,placement:"top"},{default:Z(()=>[nr(ae("span",null,Me(e.content.slice(0,e.length))+"...",513),[[yi,e.content.length>e.length]])]),_:1},8,["content"]),nr(ae("span",null,Me(e.content),513),[[yi,e.content.length<30]])],64)}}}),are={class:"source"},ore=ae("div",{id:"traffic",style:{width:"400px",height:"250px","margin-bottom":"30px"}},null,-1),sre=ae("div",{id:"proxies",style:{width:"400px",height:"250px"}},null,-1),lre=ce({__name:"ServerOverview",setup(e){let t=B({version:"",bindPort:0,kcpBindPort:0,quicBindPort:0,vhostHTTPPort:0,vhostHTTPSPort:0,tcpmuxHTTPConnectPort:0,subdomainHost:"",maxPoolCount:0,maxPortsPerClient:"",allowPortsStr:"",tlsForce:!1,heartbeatTimeout:0,clientCounts:0,curConns:0,proxyCounts:0});return(()=>{fetch("../api/serverinfo",{credentials:"include"}).then(n=>n.json()).then(n=>{t.value.version=n.version,t.value.bindPort=n.bindPort,t.value.kcpBindPort=n.kcpBindPort,t.value.quicBindPort=n.quicBindPort,t.value.vhostHTTPPort=n.vhostHTTPPort,t.value.vhostHTTPSPort=n.vhostHTTPSPort,t.value.tcpmuxHTTPConnectPort=n.tcpmuxHTTPConnectPort,t.value.subdomainHost=n.subdomainHost,t.value.maxPoolCount=n.maxPoolCount,t.value.maxPortsPerClient=n.maxPortsPerClient,t.value.maxPortsPerClient=="0"&&(t.value.maxPortsPerClient="no limit"),t.value.allowPortsStr=n.allowPortsStr,t.value.tlsForce=n.tlsForce,t.value.heartbeatTimeout=n.heartbeatTimeout,t.value.clientCounts=n.clientCounts,t.value.curConns=n.curConns,t.value.proxyCounts=0,n.proxyTypeCount!=null&&(n.proxyTypeCount.tcp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.tcp),n.proxyTypeCount.udp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.udp),n.proxyTypeCount.http!=null&&(t.value.proxyCounts+=n.proxyTypeCount.http),n.proxyTypeCount.https!=null&&(t.value.proxyCounts+=n.proxyTypeCount.https),n.proxyTypeCount.stcp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.stcp),n.proxyTypeCount.sudp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.sudp),n.proxyTypeCount.xtcp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.xtcp)),rre("traffic",n.totalTrafficIn,n.totalTrafficOut),nre("proxies",n)}).catch(()=>{DA({showClose:!0,message:"Get server info from frps failed!",type:"warning"})})})(),(n,i)=>{const a=zM,o=HM,s=pA,l=vA;return Y(),me("div",null,[ee(l,null,{default:Z(()=>[ee(s,{md:12},{default:Z(()=>[ae("div",are,[ee(o,{"label-position":"left","label-width":"220px",class:"server_info"},{default:Z(()=>[ee(a,{label:"Version"},{default:Z(()=>[ae("span",null,Me(P(t).version),1)]),_:1}),ee(a,{label:"BindPort"},{default:Z(()=>[ae("span",null,Me(P(t).bindPort),1)]),_:1}),P(t).kcpBindPort!=0?(Y(),_e(a,{key:0,label:"KCP Bind Port"},{default:Z(()=>[ae("span",null,Me(P(t).kcpBindPort),1)]),_:1})):Fe("",!0),P(t).quicBindPort!=0?(Y(),_e(a,{key:1,label:"QUIC Bind Port"},{default:Z(()=>[ae("span",null,Me(P(t).quicBindPort),1)]),_:1})):Fe("",!0),P(t).vhostHTTPPort!=0?(Y(),_e(a,{key:2,label:"Http Port"},{default:Z(()=>[ae("span",null,Me(P(t).vhostHTTPPort),1)]),_:1})):Fe("",!0),P(t).vhostHTTPSPort!=0?(Y(),_e(a,{key:3,label:"Https Port"},{default:Z(()=>[ae("span",null,Me(P(t).vhostHTTPSPort),1)]),_:1})):Fe("",!0),P(t).tcpmuxHTTPConnectPort!=0?(Y(),_e(a,{key:4,label:"TCPMux HTTPConnect Port"},{default:Z(()=>[ae("span",null,Me(P(t).tcpmuxHTTPConnectPort),1)]),_:1})):Fe("",!0),P(t).subdomainHost!=""?(Y(),_e(a,{key:5,label:"Subdomain Host"},{default:Z(()=>[ee(hC,{content:P(t).subdomainHost,length:30},null,8,["content"])]),_:1})):Fe("",!0),ee(a,{label:"Max PoolCount"},{default:Z(()=>[ae("span",null,Me(P(t).maxPoolCount),1)]),_:1}),ee(a,{label:"Max Ports Per Client"},{default:Z(()=>[ae("span",null,Me(P(t).maxPortsPerClient),1)]),_:1}),P(t).allowPortsStr!=""?(Y(),_e(a,{key:6,label:"Allow Ports"},{default:Z(()=>[ee(hC,{content:P(t).allowPortsStr,length:30},null,8,["content"])]),_:1})):Fe("",!0),P(t).tlsForce===!0?(Y(),_e(a,{key:7,label:"TLS Force"},{default:Z(()=>[ae("span",null,Me(P(t).tlsForce),1)]),_:1})):Fe("",!0),ee(a,{label:"HeartBeat Timeout"},{default:Z(()=>[ae("span",null,Me(P(t).heartbeatTimeout),1)]),_:1}),ee(a,{label:"Client Counts"},{default:Z(()=>[ae("span",null,Me(P(t).clientCounts),1)]),_:1}),ee(a,{label:"Current Connections"},{default:Z(()=>[ae("span",null,Me(P(t).curConns),1)]),_:1}),ee(a,{label:"Proxy Counts"},{default:Z(()=>[ae("span",null,Me(P(t).proxyCounts),1)]),_:1})]),_:1})])]),_:1}),ee(s,{md:12},{default:Z(()=>[ore,sre]),_:1})]),_:1})])}}});class Us{constructor(t){Wt(this,"name");Wt(this,"type");Wt(this,"encryption");Wt(this,"compression");Wt(this,"conns");Wt(this,"trafficIn");Wt(this,"trafficOut");Wt(this,"lastStartTime");Wt(this,"lastCloseTime");Wt(this,"status");Wt(this,"clientVersion");Wt(this,"addr");Wt(this,"port");Wt(this,"customDomains");Wt(this,"hostHeaderRewrite");Wt(this,"locations");Wt(this,"subdomain");this.name=t.name,this.type="",this.encryption=!1,this.compression=!1,t.conf!=null&&t.conf.useEncryption!=null&&(this.encryption=t.conf.useEncryption),t.conf!=null&&t.conf.useCompression!=null&&(this.compression=t.conf.useCompression),this.conns=t.curConns,this.trafficIn=t.todayTrafficIn,this.trafficOut=t.todayTrafficOut,this.lastStartTime=t.lastStartTime,this.lastCloseTime=t.lastCloseTime,this.status=t.status,this.clientVersion=t.clientVersion,this.addr="",this.port=0,this.customDomains="",this.hostHeaderRewrite="",this.locations="",this.subdomain=""}}class ure extends Us{constructor(t){super(t),this.type="tcp",t.conf!=null?(this.addr=":"+t.conf.remotePort,this.port=t.conf.remotePort):(this.addr="",this.port=0)}}class cre extends Us{constructor(t){super(t),this.type="udp",t.conf!=null?(this.addr=":"+t.conf.remotePort,this.port=t.conf.remotePort):(this.addr="",this.port=0)}}class fre extends Us{constructor(t,r,n){super(t),this.type="http",this.port=r,t.conf!=null&&(t.conf.customDomains!=null&&(this.customDomains=t.conf.customDomains),this.hostHeaderRewrite=t.conf.hostHeaderRewrite,this.locations=t.conf.locations,t.conf.subdomain!=null&&t.conf.subdomain!=""&&(this.subdomain=t.conf.subdomain+"."+n))}}class dre extends Us{constructor(t,r,n){super(t),this.type="https",this.port=r,t.conf!=null&&(t.conf.customDomains!=null&&(this.customDomains=t.conf.customDomains),t.conf.subdomain!=null&&t.conf.subdomain!=""&&(this.subdomain=t.conf.subdomain+"."+n))}}class hre extends Us{constructor(t){super(t),this.type="stcp"}}class vre extends Us{constructor(t){super(t),this.type="sudp"}}const pre=["id"],gre=ce({__name:"Traffic",props:{proxyName:null},setup(e){const t=e;return(()=>{let n="../api/traffic/"+t.proxyName;fetch(n,{credentials:"include"}).then(i=>i.json()).then(i=>{ire(t.proxyName,i.trafficIn,i.trafficOut)}).catch(i=>{DA({showClose:!0,message:"Get traffic info failed!"+i,type:"warning"})})})(),(n,i)=>(Y(),me("div",{id:e.proxyName,style:{width:"600px",height:"400px"}},null,8,pre))}}),mre=ce({__name:"ProxyViewExpand",props:{row:null,proxyType:null},setup(e){return(t,r)=>{const n=zM,i=HM;return e.proxyType==="http"||e.proxyType==="https"?(Y(),_e(i,{key:0,"label-position":"left",inline:"",class:"proxy-table-expand"},{default:Z(()=>[ee(n,{label:"Name"},{default:Z(()=>[ae("span",null,Me(e.row.name),1)]),_:1}),ee(n,{label:"Type"},{default:Z(()=>[ae("span",null,Me(e.row.type),1)]),_:1}),ee(n,{label:"Domains"},{default:Z(()=>[ae("span",null,Me(e.row.customDomains),1)]),_:1}),ee(n,{label:"SubDomain"},{default:Z(()=>[ae("span",null,Me(e.row.subdomain),1)]),_:1}),ee(n,{label:"locations"},{default:Z(()=>[ae("span",null,Me(e.row.locations),1)]),_:1}),ee(n,{label:"HostRewrite"},{default:Z(()=>[ae("span",null,Me(e.row.hostHeaderRewrite),1)]),_:1}),ee(n,{label:"Encryption"},{default:Z(()=>[ae("span",null,Me(e.row.encryption),1)]),_:1}),ee(n,{label:"Compression"},{default:Z(()=>[ae("span",null,Me(e.row.compression),1)]),_:1}),ee(n,{label:"Last Start"},{default:Z(()=>[ae("span",null,Me(e.row.lastStartTime),1)]),_:1}),ee(n,{label:"Last Close"},{default:Z(()=>[ae("span",null,Me(e.row.lastCloseTime),1)]),_:1})]),_:1})):(Y(),_e(i,{key:1,"label-position":"left",inline:"",class:"proxy-table-expand"},{default:Z(()=>[ee(n,{label:"Name"},{default:Z(()=>[ae("span",null,Me(e.row.name),1)]),_:1}),ee(n,{label:"Type"},{default:Z(()=>[ae("span",null,Me(e.row.type),1)]),_:1}),ee(n,{label:"Addr"},{default:Z(()=>[ae("span",null,Me(e.row.addr),1)]),_:1}),ee(n,{label:"Encryption"},{default:Z(()=>[ae("span",null,Me(e.row.encryption),1)]),_:1}),ee(n,{label:"Compression"},{default:Z(()=>[ae("span",null,Me(e.row.compression),1)]),_:1}),ee(n,{label:"Last Start"},{default:Z(()=>[ae("span",null,Me(e.row.lastStartTime),1)]),_:1}),ee(n,{label:"Last Close"},{default:Z(()=>[ae("span",null,Me(e.row.lastCloseTime),1)]),_:1})]),_:1}))}}}),js=ce({__name:"ProxyView",props:{proxies:null,proxyType:null},setup(e){const t=(n,i)=>aa.fileSize(n.trafficIn),r=(n,i)=>aa.fileSize(n.trafficOut);return(n,i)=>{const a=gre,o=J6,s=IW,l=ZV,u=O8,c=XV;return Y(),me("div",null,[ee(c,{data:e.proxies,"default-sort":{prop:"name",order:"ascending"},style:{width:"100%"}},{default:Z(()=>[ee(l,{type:"expand"},{default:Z(f=>[ee(s,{placement:"right",width:"600",style:{"margin-left":"0px"},trigger:"click"},{default:Z(()=>[ee(a,{proxyName:f.row.name},null,8,["proxyName"])]),reference:Z(()=>[ee(o,{type:"primary",size:"large",name:f.row.name,style:{"margin-bottom":"10px"}},{default:Z(()=>[Bt("Traffic Statistics ")]),_:2},1032,["name"])]),_:2},1024),ee(mre,{row:f.row,proxyType:e.proxyType},null,8,["row","proxyType"])]),_:1}),ee(l,{label:"Name",prop:"name",sortable:""}),ee(l,{label:"Port",prop:"port",sortable:""}),ee(l,{label:"Connections",prop:"conns",sortable:""}),ee(l,{label:"Traffic In",prop:"trafficIn",formatter:t,sortable:""}),ee(l,{label:"Traffic Out",prop:"trafficOut",formatter:r,sortable:""}),ee(l,{label:"ClientVersion",prop:"clientVersion",sortable:""}),ee(l,{label:"Status",prop:"status",sortable:""},{default:Z(f=>[f.row.status==="online"?(Y(),_e(u,{key:0,type:"success"},{default:Z(()=>[Bt(Me(f.row.status),1)]),_:2},1024)):(Y(),_e(u,{key:1,type:"danger"},{default:Z(()=>[Bt(Me(f.row.status),1)]),_:2},1024))]),_:1})]),_:1},8,["data"])])}}}),yre=ce({__name:"ProxiesTCP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/tcp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new ure(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"tcp"},null,8,["proxies"]))}}),_re=ce({__name:"ProxiesUDP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/udp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new cre(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"udp"},null,8,["proxies"]))}}),bre=ce({__name:"ProxiesHTTP",setup(e){let t=B([]);return(()=>{let n,i;fetch("../api/serverinfo",{credentials:"include"}).then(a=>a.json()).then(a=>{n=a.vhostHTTPPort,i=a.subdomainHost,!(n==null||n==0)&&fetch("../api/proxy/http",{credentials:"include"}).then(o=>o.json()).then(o=>{for(let s of o.proxies)t.value.push(new fre(s,n,i))})})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"http"},null,8,["proxies"]))}}),wre=ce({__name:"ProxiesHTTPS",setup(e){let t=B([]);return(()=>{let n,i;fetch("../api/serverinfo",{credentials:"include"}).then(a=>a.json()).then(a=>{n=a.vhostHTTPSPort,i=a.subdomainHost,!(n==null||n==0)&&fetch("../api/proxy/https",{credentials:"include"}).then(o=>o.json()).then(o=>{for(let s of o.proxies)t.value.push(new dre(s,n,i))})})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"https"},null,8,["proxies"]))}}),Sre=ce({__name:"ProxiesSTCP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/stcp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new hre(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"stcp"},null,8,["proxies"]))}}),xre=ce({__name:"ProxiesSUDP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/sudp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new vre(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"sudp"},null,8,["proxies"]))}}),Cre=xU({history:$G(),routes:[{path:"/",name:"ServerOverview",component:lre},{path:"/proxies/tcp",name:"ProxiesTCP",component:yre},{path:"/proxies/udp",name:"ProxiesUDP",component:_re},{path:"/proxies/http",name:"ProxiesHTTP",component:bre},{path:"/proxies/https",name:"ProxiesHTTPS",component:wre},{path:"/proxies/stcp",name:"ProxiesSTCP",component:Sre},{path:"/proxies/sudp",name:"ProxiesSUDP",component:xre}]}),oD=YO(bG);oD.use(Cre);oD.mount("#app")});export default Tre();
+`||u==="")){var c=o.isSelected(u);n.hasOwnProperty(u)?n[u]=n[u]&&c:n[u]=c}})}),e==="allSelect"||e==="inverseSelect"?{selected:n}:{name:t.name,selected:n}}function qte(e){e.registerAction("legendToggleSelect","legendselectchanged",Rt(yl,"toggleSelected")),e.registerAction("legendAllSelect","legendselectall",Rt(yl,"allSelect")),e.registerAction("legendInverseSelect","legendinverseselect",Rt(yl,"inverseSelect")),e.registerAction("legendSelect","legendselected",Rt(yl,"select")),e.registerAction("legendUnSelect","legendunselected",Rt(yl,"unSelect"))}function aD(e){e.registerComponentModel(Cm),e.registerComponentView(iD),e.registerProcessor(e.PRIORITY.PROCESSOR.SERIES_FILTER,Yte),e.registerSubTypeDefaulter("legend",function(){return"plain"}),qte(e)}var Kte=function(e){pe(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r}return t.prototype.setScrollDataIndex=function(r){this.option.scrollDataIndex=r},t.prototype.init=function(r,n,i){var a=xh(r);e.prototype.init.call(this,r,n,i),fC(this,r,a)},t.prototype.mergeOption=function(r,n){e.prototype.mergeOption.call(this,r,n),fC(this,this.option,r)},t.type="legend.scroll",t.defaultOption=I2(Cm.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),t}(Cm);function fC(e,t,r){var n=e.getOrient(),i=[1,1];i[n.index]=0,Ds(t,r,{type:"box",ignoreSize:!!i})}const Xte=Kte;var dC=cn,wp=["width","height"],Sp=["x","y"],Zte=function(e){pe(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.type=t.type,r.newlineDisabled=!0,r._currentIndex=0,r}return t.prototype.init=function(){e.prototype.init.call(this),this.group.add(this._containerGroup=new dC),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new dC)},t.prototype.resetInner=function(){e.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},t.prototype.renderInner=function(r,n,i,a,o,s,l){var u=this;e.prototype.renderInner.call(this,r,n,i,a,o,s,l);var c=this._controllerGroup,f=n.get("pageIconSize",!0),d=ge(f)?f:[f,f];v("pagePrev",0);var h=n.getModel("pageTextStyle");c.add(new dr({name:"pageText",style:{text:"xx/xx",fill:h.getTextColor(),font:h.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),v("pageNext",1);function v(p,g){var m=p+"DataIndex",y=v0(n.get("pageIcons",!0)[n.getOrient().name][g],{onclick:_t(u._pageGo,u,m,n,a)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[1]});y.name=p,c.add(y)}},t.prototype.layoutInner=function(r,n,i,a,o,s){var l=this.getSelectorGroup(),u=r.getOrient().index,c=wp[u],f=Sp[u],d=wp[1-u],h=Sp[1-u];o&&Xl("horizontal",l,r.get("selectorItemGap",!0));var v=r.get("selectorButtonGap",!0),p=l.getBoundingRect(),g=[-p.x,-p.y],m=Qe(i);o&&(m[c]=i[c]-p[c]-v);var y=this._layoutContentAndController(r,a,m,u,c,d,h,f);if(o){if(s==="end")g[u]+=y[c]+v;else{var _=p[c]+v;g[u]-=_,y[f]-=_}y[c]+=p[c]+v,g[1-u]+=y[h]+y[d]/2-p[d]/2,y[d]=Math.max(y[d],p[d]),y[h]=Math.min(y[h],p[h]+g[1-u]),l.x=g[0],l.y=g[1],l.markRedraw()}return y},t.prototype._layoutContentAndController=function(r,n,i,a,o,s,l,u){var c=this.getContentGroup(),f=this._containerGroup,d=this._controllerGroup;Xl(r.get("orient"),c,r.get("itemGap"),a?i.width:null,a?null:i.height),Xl("horizontal",d,r.get("pageButtonItemGap",!0));var h=c.getBoundingRect(),v=d.getBoundingRect(),p=this._showController=h[o]>i[o],g=[-h.x,-h.y];n||(g[a]=c[u]);var m=[0,0],y=[-v.x,-v.y],_=qe(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(p){var b=r.get("pageButtonPosition",!0);b==="end"?y[a]+=i[o]-v[o]:m[a]+=v[o]+_}y[1-a]+=h[s]/2-v[s]/2,c.setPosition(g),f.setPosition(m),d.setPosition(y);var S={x:0,y:0};if(S[o]=p?i[o]:h[o],S[s]=Math.max(h[s],v[s]),S[l]=Math.min(0,v[l]+y[1-a]),f.__rectSize=i[o],p){var w={x:0,y:0};w[o]=Math.max(i[o]-v[o]-_,0),w[s]=S[s],f.setClipPath(new Ht({shape:w})),f.__rectSize=w[o]}else d.eachChild(function(C){C.attr({invisible:!0,silent:!0})});var x=this._getPageInfo(r);return x.pageIndex!=null&&Er(c,{x:x.contentPosition[0],y:x.contentPosition[1]},p?r:null),this._updatePageInfoView(r,x),S},t.prototype._pageGo=function(r,n,i){var a=this._getPageInfo(n)[r];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},t.prototype._updatePageInfoView=function(r,n){var i=this._controllerGroup;O(["pagePrev","pageNext"],function(c){var f=c+"DataIndex",d=n[f]!=null,h=i.childOfName(c);h&&(h.setStyle("fill",d?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),h.cursor=d?"pointer":"default")});var a=i.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",Te(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},t.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=r.getOrient().index,s=wp[o],l=Sp[o],u=this._findTargetItemIndex(n),c=i.children(),f=c[u],d=c.length,h=d?1:0,v={contentPosition:[i.x,i.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return v;var p=b(f);v.contentPosition[o]=-p.s;for(var g=u+1,m=p,y=p,_=null;g<=d;++g)_=b(c[g]),(!_&&y.e>m.s+a||_&&!S(_,m.s))&&(y.i>m.i?m=y:m=_,m&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=m.i),++v.pageCount)),y=_;for(var g=u-1,m=p,y=p,_=null;g>=-1;--g)_=b(c[g]),(!_||!S(y,_.s))&&m.i=x&&w.s<=x+a}},t.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===r&&(n=s)}),n??a},t.type="legend.scroll",t}(iD);const Qte=Zte;function Jte(e){e.registerAction("legendScroll","legendscroll",function(t,r){var n=t.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:t},function(i){i.setScrollDataIndex(n)})})}function ere(e){ua(aD),e.registerComponentModel(Xte),e.registerComponentView(Qte),Jte(e)}function tre(e){ua(aD),ua(ere)}ua([KJ,OJ,$ee,sJ,zte,Bte,tre,vte]);function rre(e,t,r){const n=B0(document.getElementById(e),"macarons");n.showLoading();const i={title:{text:"Network Traffic",subtext:"today",left:"center"},tooltip:{trigger:"item",formatter:function(a){return aa.fileSize(a.data.value)+" ("+a.percent+"%)"}},legend:{orient:"vertical",left:"left",data:["Traffic In","Traffic Out"]},series:[{type:"pie",radius:"55%",center:["50%","60%"],data:[{value:t,name:"Traffic In"},{value:r,name:"Traffic Out"}],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};n.setOption(i),n.hideLoading()}function nre(e,t){const r=B0(document.getElementById(e),"macarons");r.showLoading();const n={title:{text:"Proxies",subtext:"now",left:"center"},tooltip:{trigger:"item",formatter:function(i){return String(i.data.value)}},legend:{orient:"vertical",left:"left",data:[]},series:[{type:"pie",radius:"55%",center:["50%","60%"],data:[],emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};t.proxyTypeCount.tcp!=null&&t.proxyTypeCount.tcp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.tcp,name:"TCP"}),n.legend.data.push("TCP")),t.proxyTypeCount.udp!=null&&t.proxyTypeCount.udp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.udp,name:"UDP"}),n.legend.data.push("UDP")),t.proxyTypeCount.http!=null&&t.proxyTypeCount.http!=0&&(n.series[0].data.push({value:t.proxyTypeCount.http,name:"HTTP"}),n.legend.data.push("HTTP")),t.proxyTypeCount.https!=null&&t.proxyTypeCount.https!=0&&(n.series[0].data.push({value:t.proxyTypeCount.https,name:"HTTPS"}),n.legend.data.push("HTTPS")),t.proxyTypeCount.stcp!=null&&t.proxyTypeCount.stcp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.stcp,name:"STCP"}),n.legend.data.push("STCP")),t.proxyTypeCount.sudp!=null&&t.proxyTypeCount.sudp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.sudp,name:"SUDP"}),n.legend.data.push("SUDP")),t.proxyTypeCount.xtcp!=null&&t.proxyTypeCount.xtcp!=0&&(n.series[0].data.push({value:t.proxyTypeCount.xtcp,name:"XTCP"}),n.legend.data.push("XTCP")),r.setOption(n),r.hideLoading()}function ire(e,t,r){const n={width:"600px",height:"400px"},i=B0(document.getElementById(e),"macarons",n);i.showLoading(),t=t.reverse(),r=r.reverse();let a=new Date;a=new Date(a.getFullYear(),a.getMonth(),a.getDate()-6);const o=[];for(let l=0;l<7;l++)o.push(a.getFullYear()+"-"+(a.getMonth()+1)+"-"+a.getDate()),a=new Date(a.getFullYear(),a.getMonth(),a.getDate()+1);const s={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(l){let u="";l.length>0&&(u+=l[0].name+" ");for(const c of l){const f='';u+=f+c.seriesName+": "+aa.fileSize(c.value)+" "}return u}},legend:{data:["Traffic In","Traffic Out"]},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:[{type:"category",data:o}],yAxis:[{type:"value",axisLabel:{formatter:function(l){return aa.fileSize(l)}}}],series:[{name:"Traffic In",type:"bar",data:t},{name:"Traffic Out",type:"bar",data:r}]};i.setOption(s),i.hideLoading()}const hC=ce({__name:"LongSpan",props:{content:null,length:null},setup(e){return(t,r)=>{const n=Ju;return Y(),me(pt,null,[ee(n,{content:e.content,placement:"top"},{default:Z(()=>[nr(ae("span",null,Me(e.content.slice(0,e.length))+"...",513),[[yi,e.content.length>e.length]])]),_:1},8,["content"]),nr(ae("span",null,Me(e.content),513),[[yi,e.content.length<30]])],64)}}}),are={class:"source"},ore=ae("div",{id:"traffic",style:{width:"400px",height:"250px","margin-bottom":"30px"}},null,-1),sre=ae("div",{id:"proxies",style:{width:"400px",height:"250px"}},null,-1),lre=ce({__name:"ServerOverview",setup(e){let t=B({version:"",bindPort:0,kcpBindPort:0,quicBindPort:0,vhostHTTPPort:0,vhostHTTPSPort:0,tcpmuxHTTPConnectPort:0,subdomainHost:"",maxPoolCount:0,maxPortsPerClient:"",allowPortsStr:"",tlsForce:!1,heartbeatTimeout:0,clientCounts:0,curConns:0,proxyCounts:0});return(()=>{fetch("../api/serverinfo",{credentials:"include"}).then(n=>n.json()).then(n=>{t.value.version=n.version,t.value.bindPort=n.bindPort,t.value.kcpBindPort=n.kcpBindPort,t.value.quicBindPort=n.quicBindPort,t.value.vhostHTTPPort=n.vhostHTTPPort,t.value.vhostHTTPSPort=n.vhostHTTPSPort,t.value.tcpmuxHTTPConnectPort=n.tcpmuxHTTPConnectPort,t.value.subdomainHost=n.subdomainHost,t.value.maxPoolCount=n.maxPoolCount,t.value.maxPortsPerClient=n.maxPortsPerClient,t.value.maxPortsPerClient=="0"&&(t.value.maxPortsPerClient="no limit"),t.value.allowPortsStr=n.allowPortsStr,t.value.tlsForce=n.tlsForce,t.value.heartbeatTimeout=n.heartbeatTimeout,t.value.clientCounts=n.clientCounts,t.value.curConns=n.curConns,t.value.proxyCounts=0,n.proxyTypeCount!=null&&(n.proxyTypeCount.tcp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.tcp),n.proxyTypeCount.udp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.udp),n.proxyTypeCount.http!=null&&(t.value.proxyCounts+=n.proxyTypeCount.http),n.proxyTypeCount.https!=null&&(t.value.proxyCounts+=n.proxyTypeCount.https),n.proxyTypeCount.stcp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.stcp),n.proxyTypeCount.sudp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.sudp),n.proxyTypeCount.xtcp!=null&&(t.value.proxyCounts+=n.proxyTypeCount.xtcp)),rre("traffic",n.totalTrafficIn,n.totalTrafficOut),nre("proxies",n)}).catch(()=>{DA({showClose:!0,message:"Get server info from frps failed!",type:"warning"})})})(),(n,i)=>{const a=zM,o=HM,s=pA,l=vA;return Y(),me("div",null,[ee(l,null,{default:Z(()=>[ee(s,{md:12},{default:Z(()=>[ae("div",are,[ee(o,{"label-position":"left","label-width":"220px",class:"server_info"},{default:Z(()=>[ee(a,{label:"Version"},{default:Z(()=>[ae("span",null,Me(P(t).version),1)]),_:1}),ee(a,{label:"BindPort"},{default:Z(()=>[ae("span",null,Me(P(t).bindPort),1)]),_:1}),P(t).kcpBindPort!=0?(Y(),_e(a,{key:0,label:"KCP Bind Port"},{default:Z(()=>[ae("span",null,Me(P(t).kcpBindPort),1)]),_:1})):Fe("",!0),P(t).quicBindPort!=0?(Y(),_e(a,{key:1,label:"QUIC Bind Port"},{default:Z(()=>[ae("span",null,Me(P(t).quicBindPort),1)]),_:1})):Fe("",!0),P(t).vhostHTTPPort!=0?(Y(),_e(a,{key:2,label:"Http Port"},{default:Z(()=>[ae("span",null,Me(P(t).vhostHTTPPort),1)]),_:1})):Fe("",!0),P(t).vhostHTTPSPort!=0?(Y(),_e(a,{key:3,label:"Https Port"},{default:Z(()=>[ae("span",null,Me(P(t).vhostHTTPSPort),1)]),_:1})):Fe("",!0),P(t).tcpmuxHTTPConnectPort!=0?(Y(),_e(a,{key:4,label:"TCPMux HTTPConnect Port"},{default:Z(()=>[ae("span",null,Me(P(t).tcpmuxHTTPConnectPort),1)]),_:1})):Fe("",!0),P(t).subdomainHost!=""?(Y(),_e(a,{key:5,label:"Subdomain Host"},{default:Z(()=>[ee(hC,{content:P(t).subdomainHost,length:30},null,8,["content"])]),_:1})):Fe("",!0),ee(a,{label:"Max PoolCount"},{default:Z(()=>[ae("span",null,Me(P(t).maxPoolCount),1)]),_:1}),ee(a,{label:"Max Ports Per Client"},{default:Z(()=>[ae("span",null,Me(P(t).maxPortsPerClient),1)]),_:1}),P(t).allowPortsStr!=""?(Y(),_e(a,{key:6,label:"Allow Ports"},{default:Z(()=>[ee(hC,{content:P(t).allowPortsStr,length:30},null,8,["content"])]),_:1})):Fe("",!0),P(t).tlsForce===!0?(Y(),_e(a,{key:7,label:"TLS Force"},{default:Z(()=>[ae("span",null,Me(P(t).tlsForce),1)]),_:1})):Fe("",!0),ee(a,{label:"HeartBeat Timeout"},{default:Z(()=>[ae("span",null,Me(P(t).heartbeatTimeout),1)]),_:1}),ee(a,{label:"Client Counts"},{default:Z(()=>[ae("span",null,Me(P(t).clientCounts),1)]),_:1}),ee(a,{label:"Current Connections"},{default:Z(()=>[ae("span",null,Me(P(t).curConns),1)]),_:1}),ee(a,{label:"Proxy Counts"},{default:Z(()=>[ae("span",null,Me(P(t).proxyCounts),1)]),_:1})]),_:1})])]),_:1}),ee(s,{md:12},{default:Z(()=>[ore,sre]),_:1})]),_:1})])}}});class Us{constructor(t){Wt(this,"name");Wt(this,"type");Wt(this,"encryption");Wt(this,"compression");Wt(this,"conns");Wt(this,"trafficIn");Wt(this,"trafficOut");Wt(this,"lastStartTime");Wt(this,"lastCloseTime");Wt(this,"status");Wt(this,"clientVersion");Wt(this,"addr");Wt(this,"port");Wt(this,"customDomains");Wt(this,"hostHeaderRewrite");Wt(this,"locations");Wt(this,"subdomain");var r,n,i,a;this.name=t.name,this.type="",this.encryption=!1,this.compression=!1,this.encryption=((n=(r=t.conf)==null?void 0:r.transport)==null?void 0:n.useEncryption)||this.encryption,this.compression=((a=(i=t.conf)==null?void 0:i.transport)==null?void 0:a.useCompression)||this.compression,this.conns=t.curConns,this.trafficIn=t.todayTrafficIn,this.trafficOut=t.todayTrafficOut,this.lastStartTime=t.lastStartTime,this.lastCloseTime=t.lastCloseTime,this.status=t.status,this.clientVersion=t.clientVersion,this.addr="",this.port=0,this.customDomains="",this.hostHeaderRewrite="",this.locations="",this.subdomain=""}}class ure extends Us{constructor(t){super(t),this.type="tcp",t.conf!=null?(this.addr=":"+t.conf.remotePort,this.port=t.conf.remotePort):(this.addr="",this.port=0)}}class cre extends Us{constructor(t){super(t),this.type="udp",t.conf!=null?(this.addr=":"+t.conf.remotePort,this.port=t.conf.remotePort):(this.addr="",this.port=0)}}class fre extends Us{constructor(t,r,n){super(t),this.type="http",this.port=r,t.conf&&(this.customDomains=t.conf.customDomains||this.customDomains,this.hostHeaderRewrite=t.conf.hostHeaderRewrite,this.locations=t.conf.locations,t.conf.subdomain&&(this.subdomain=`${t.conf.subdomain}.${n}`))}}class dre extends Us{constructor(t,r,n){super(t),this.type="https",this.port=r,t.conf!=null&&(this.customDomains=t.conf.customDomains||this.customDomains,t.conf.subdomain&&(this.subdomain=`${t.conf.subdomain}.${n}`))}}class hre extends Us{constructor(t){super(t),this.type="stcp"}}class vre extends Us{constructor(t){super(t),this.type="sudp"}}const pre=["id"],gre=ce({__name:"Traffic",props:{proxyName:null},setup(e){const t=e;return(()=>{let n="../api/traffic/"+t.proxyName;fetch(n,{credentials:"include"}).then(i=>i.json()).then(i=>{ire(t.proxyName,i.trafficIn,i.trafficOut)}).catch(i=>{DA({showClose:!0,message:"Get traffic info failed!"+i,type:"warning"})})})(),(n,i)=>(Y(),me("div",{id:e.proxyName,style:{width:"600px",height:"400px"}},null,8,pre))}}),mre=ce({__name:"ProxyViewExpand",props:{row:null,proxyType:null},setup(e){return(t,r)=>{const n=zM,i=HM;return e.proxyType==="http"||e.proxyType==="https"?(Y(),_e(i,{key:0,"label-position":"left",inline:"",class:"proxy-table-expand"},{default:Z(()=>[ee(n,{label:"Name"},{default:Z(()=>[ae("span",null,Me(e.row.name),1)]),_:1}),ee(n,{label:"Type"},{default:Z(()=>[ae("span",null,Me(e.row.type),1)]),_:1}),ee(n,{label:"Domains"},{default:Z(()=>[ae("span",null,Me(e.row.customDomains),1)]),_:1}),ee(n,{label:"SubDomain"},{default:Z(()=>[ae("span",null,Me(e.row.subdomain),1)]),_:1}),ee(n,{label:"locations"},{default:Z(()=>[ae("span",null,Me(e.row.locations),1)]),_:1}),ee(n,{label:"HostRewrite"},{default:Z(()=>[ae("span",null,Me(e.row.hostHeaderRewrite),1)]),_:1}),ee(n,{label:"Encryption"},{default:Z(()=>[ae("span",null,Me(e.row.encryption),1)]),_:1}),ee(n,{label:"Compression"},{default:Z(()=>[ae("span",null,Me(e.row.compression),1)]),_:1}),ee(n,{label:"Last Start"},{default:Z(()=>[ae("span",null,Me(e.row.lastStartTime),1)]),_:1}),ee(n,{label:"Last Close"},{default:Z(()=>[ae("span",null,Me(e.row.lastCloseTime),1)]),_:1})]),_:1})):(Y(),_e(i,{key:1,"label-position":"left",inline:"",class:"proxy-table-expand"},{default:Z(()=>[ee(n,{label:"Name"},{default:Z(()=>[ae("span",null,Me(e.row.name),1)]),_:1}),ee(n,{label:"Type"},{default:Z(()=>[ae("span",null,Me(e.row.type),1)]),_:1}),ee(n,{label:"Addr"},{default:Z(()=>[ae("span",null,Me(e.row.addr),1)]),_:1}),ee(n,{label:"Encryption"},{default:Z(()=>[ae("span",null,Me(e.row.encryption),1)]),_:1}),ee(n,{label:"Compression"},{default:Z(()=>[ae("span",null,Me(e.row.compression),1)]),_:1}),ee(n,{label:"Last Start"},{default:Z(()=>[ae("span",null,Me(e.row.lastStartTime),1)]),_:1}),ee(n,{label:"Last Close"},{default:Z(()=>[ae("span",null,Me(e.row.lastCloseTime),1)]),_:1})]),_:1}))}}}),js=ce({__name:"ProxyView",props:{proxies:null,proxyType:null},setup(e){const t=(n,i)=>aa.fileSize(n.trafficIn),r=(n,i)=>aa.fileSize(n.trafficOut);return(n,i)=>{const a=gre,o=J6,s=IW,l=ZV,u=O8,c=XV;return Y(),me("div",null,[ee(c,{data:e.proxies,"default-sort":{prop:"name",order:"ascending"},style:{width:"100%"}},{default:Z(()=>[ee(l,{type:"expand"},{default:Z(f=>[ee(s,{placement:"right",width:"600",style:{"margin-left":"0px"},trigger:"click"},{default:Z(()=>[ee(a,{proxyName:f.row.name},null,8,["proxyName"])]),reference:Z(()=>[ee(o,{type:"primary",size:"large",name:f.row.name,style:{"margin-bottom":"10px"}},{default:Z(()=>[Bt("Traffic Statistics ")]),_:2},1032,["name"])]),_:2},1024),ee(mre,{row:f.row,proxyType:e.proxyType},null,8,["row","proxyType"])]),_:1}),ee(l,{label:"Name",prop:"name",sortable:""}),ee(l,{label:"Port",prop:"port",sortable:""}),ee(l,{label:"Connections",prop:"conns",sortable:""}),ee(l,{label:"Traffic In",prop:"trafficIn",formatter:t,sortable:""}),ee(l,{label:"Traffic Out",prop:"trafficOut",formatter:r,sortable:""}),ee(l,{label:"ClientVersion",prop:"clientVersion",sortable:""}),ee(l,{label:"Status",prop:"status",sortable:""},{default:Z(f=>[f.row.status==="online"?(Y(),_e(u,{key:0,type:"success"},{default:Z(()=>[Bt(Me(f.row.status),1)]),_:2},1024)):(Y(),_e(u,{key:1,type:"danger"},{default:Z(()=>[Bt(Me(f.row.status),1)]),_:2},1024))]),_:1})]),_:1},8,["data"])])}}}),yre=ce({__name:"ProxiesTCP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/tcp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new ure(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"tcp"},null,8,["proxies"]))}}),_re=ce({__name:"ProxiesUDP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/udp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new cre(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"udp"},null,8,["proxies"]))}}),bre=ce({__name:"ProxiesHTTP",setup(e){let t=B([]);return(()=>{let n,i;fetch("../api/serverinfo",{credentials:"include"}).then(a=>a.json()).then(a=>{n=a.vhostHTTPPort,i=a.subdomainHost,!(n==null||n==0)&&fetch("../api/proxy/http",{credentials:"include"}).then(o=>o.json()).then(o=>{for(let s of o.proxies)t.value.push(new fre(s,n,i))})})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"http"},null,8,["proxies"]))}}),wre=ce({__name:"ProxiesHTTPS",setup(e){let t=B([]);return(()=>{let n,i;fetch("../api/serverinfo",{credentials:"include"}).then(a=>a.json()).then(a=>{n=a.vhostHTTPSPort,i=a.subdomainHost,!(n==null||n==0)&&fetch("../api/proxy/https",{credentials:"include"}).then(o=>o.json()).then(o=>{for(let s of o.proxies)t.value.push(new dre(s,n,i))})})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"https"},null,8,["proxies"]))}}),Sre=ce({__name:"ProxiesSTCP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/stcp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new hre(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"stcp"},null,8,["proxies"]))}}),xre=ce({__name:"ProxiesSUDP",setup(e){let t=B([]);return(()=>{fetch("../api/proxy/sudp",{credentials:"include"}).then(n=>n.json()).then(n=>{for(let i of n.proxies)t.value.push(new vre(i))})})(),(n,i)=>(Y(),_e(js,{proxies:P(t),proxyType:"sudp"},null,8,["proxies"]))}}),Cre=xU({history:$G(),routes:[{path:"/",name:"ServerOverview",component:lre},{path:"/proxies/tcp",name:"ProxiesTCP",component:yre},{path:"/proxies/udp",name:"ProxiesUDP",component:_re},{path:"/proxies/http",name:"ProxiesHTTP",component:bre},{path:"/proxies/https",name:"ProxiesHTTPS",component:wre},{path:"/proxies/stcp",name:"ProxiesSTCP",component:Sre},{path:"/proxies/sudp",name:"ProxiesSUDP",component:xre}]}),oD=YO(bG);oD.use(Cre);oD.mount("#app")});export default Tre();
diff --git a/assets/frps/static/index.html b/assets/frps/static/index.html
index 4f2e0ca..5c295d7 100644
--- a/assets/frps/static/index.html
+++ b/assets/frps/static/index.html
@@ -4,7 +4,7 @@
frps dashboard
-
+
diff --git a/conf/frpc.toml b/conf/frpc.toml
index 05d6cbe..bdfc564 100644
--- a/conf/frpc.toml
+++ b/conf/frpc.toml
@@ -1,3 +1,5 @@
+# This configuration file is for reference only. Please do not use this configuration directly to run the program as it may have various issues.
+
# your proxy name will be changed to {user}.{proxy}
user = "your_name"
@@ -36,7 +38,7 @@ auth.token = "12345678"
# auth.oidc.clientSecret = ""
# oidc.audience specifies the audience of the token in OIDC authentication.
# auth.oidc.audience = ""
-# oidc_scope specifies the permisssions of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "".
+# oidc.scope specifies the permisssions of the token in OIDC authentication if AuthenticationMethod == "oidc". By default, this value is "".
# auth.oidc.scope = ""
# oidc.tokenEndpointURL specifies the URL which implements OIDC Token Endpoint.
# It will be used to get an OIDC token.
@@ -110,7 +112,7 @@ transport.tls.enable = true
# transport.tls.disableCustomTLSFirstByte = true
# Heartbeat configure, it's not recommended to modify the default value.
-# The default value of heartbeat_interval is 10 and heartbeat_timeout is 90. Set negative value
+# The default value of heartbeatInterval is 10 and heartbeatTimeout is 90. Set negative value
# to disable it.
# transport.heartbeatInterval = 30
# transport.heartbeatTimeout = 90
@@ -173,7 +175,7 @@ name = "ssh_random"
type = "tcp"
localIP = "192.168.31.100"
localPort = 22
-# If remote_port is 0, frps will assign a random port for you
+# If remotePort is 0, frps will assign a random port for you
remotePort = 0
[[proxies]]
@@ -183,14 +185,14 @@ localIP = "114.114.114.114"
localPort = 53
remotePort = 6002
-# Resolve your domain names to [server_addr] so you can use http://web01.yourdomain.com to browse web01 and http://web02.yourdomain.com to browse web02
+# Resolve your domain names to [serverAddr] so you can use http://web01.yourdomain.com to browse web01 and http://web02.yourdomain.com to browse web02
[[proxies]]
name = "web01"
type = "http"
localIP = "127.0.0.1"
localPort = 80
# http username and password are safety certification for http protocol
-# if not set, you can access this custom_domains without certification
+# if not set, you can access this customDomains without certification
httpUser = "admin"
httpPassword = "admin"
# if domain for frps is frps.com, then you can access [web01] proxy by URL http://web01.frps.com
@@ -199,9 +201,8 @@ customDomains = ["web01.yourdomain.com"]
# locations is only available for http type
locations = ["/", "/pic"]
# route requests to this service if http basic auto user is abc
-# route_by_http_user = abc
+# routeByHTTPUser = abc
hostHeaderRewrite = "example.com"
-# params with prefix "header_" will be used to update http request headers
requestHeaders.set.x-from-where = "frp"
healthCheck.type = "http"
# frpc will send a GET http request '/status' to local http service
@@ -235,7 +236,7 @@ customDomains = ["tunnel1"]
name = "plugin_unix_domain_socket"
type = "tcp"
remotePort = 6003
-# if plugin is defined, local_ip and local_port is useless
+# if plugin is defined, localIP and localPort is useless
# plugin will handle connections got from frps
[proxies.plugin]
type = "unix_domain_socket"
@@ -306,7 +307,7 @@ requestHeaders.set.x-from-where = "frp"
[[proxies]]
name = "secret_tcp"
-# If the type is secret tcp, remote_port is useless
+# If the type is secret tcp, remotePort is useless
# Who want to connect local port should deploy another frpc with stcp proxy and role is visitor
type = "stcp"
# secretKey is used for authentication for visitors
@@ -353,7 +354,7 @@ bindAddr = "127.0.0.1"
bindPort = 9001
# when automatic tunnel persistence is required, set it to true
keepTunnelOpen = false
-# effective when keep_tunnel_open is set to true, the number of attempts to punch through per hour
+# effective when keepTunnelOpen is set to true, the number of attempts to punch through per hour
maxRetriesAnHour = 8
minRetryInterval = 90
# fallbackTo = "stcp_visitor"
diff --git a/conf/frps.toml b/conf/frps.toml
index 180a3b2..d25f647 100644
--- a/conf/frps.toml
+++ b/conf/frps.toml
@@ -1,10 +1,12 @@
+# This configuration file is for reference only. Please do not use this configuration directly to run the program as it may have various issues.
+
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
-# For single "bind_addr" field, no need square brackets, like "bind_addr = ::".
+# For single "bindAddr" field, no need square brackets, like `bindAddr = "::"`.
bindAddr = "0.0.0.0"
bindPort = 7000
-# udp port used for kcp protocol, it can be same with 'bind_port'.
+# udp port used for kcp protocol, it can be same with 'bindPort'.
# if not set, kcp is disabled in frps.
kcpBindPort = 7000
@@ -12,8 +14,8 @@ kcpBindPort = 7000
# if not set, quic is disabled in frps.
# quicBindPort = 7002
-# Specify which address proxy will listen for, default value is same with bind_addr
-# proxy_bind_addr = "127.0.0.1"
+# Specify which address proxy will listen for, default value is same with bindAddr
+# proxyBindAddr = "127.0.0.1"
# quic protocol options
# transport.quic.keepalivePeriod = 10
@@ -21,7 +23,7 @@ kcpBindPort = 7000
# transport.quic.maxIncomingStreams = 100000
# Heartbeat configure, it's not recommended to modify the default value
-# The default value of heartbeat_timeout is 90. Set negative value to disable it.
+# The default value of heartbeatTimeout is 90. Set negative value to disable it.
# transport.heartbeatTimeout = 90
# Pool count in each proxy will keep no more than maxPoolCount.
@@ -46,7 +48,7 @@ tls.force = false
# transport.tls.trustedCaFile = "ca.crt"
# If you want to support virtual host, you must set the http port for listening (optional)
-# Note: http port and https port can be same with bind_port
+# Note: http port and https port can be same with bindPort
vhostHTTPPort = 80
vhostHTTPSPort = 443
@@ -59,7 +61,7 @@ vhostHTTPSPort = 443
# HTTP CONNECT requests. By default, this value is 0.
# tcpmuxHTTPConnectPort = 1337
-# If tcpmux_passthrough is true, frps won't do any update on traffic.
+# If tcpmuxPassthrough is true, frps won't do any update on traffic.
# tcpmuxPassthrough = false
# Configure the web server to enable the dashboard for frps.
diff --git a/package.sh b/package.sh
index f3b220b..5d51434 100755
--- a/package.sh
+++ b/package.sh
@@ -46,8 +46,6 @@ for os in $os_all; do
mv ./frps_${os}_${arch} ${frp_path}/frps
fi
cp ../LICENSE ${frp_path}
- cp -rf ../conf/* ${frp_path}
- rm -rf ${frp_path}/legacy
# packages
cd ./packages
diff --git a/pkg/config/v1/server.go b/pkg/config/v1/server.go
index 5648d24..c42c3ec 100644
--- a/pkg/config/v1/server.go
+++ b/pkg/config/v1/server.go
@@ -150,6 +150,7 @@ type ServerTransportConfig struct {
// TCPMux toggles TCP stream multiplexing. This allows multiple requests
// from a client to share a single TCP connection. By default, this value
// is true.
+ // $HideFromDoc
TCPMux *bool `json:"tcpMux,omitempty"`
// TCPMuxKeepaliveInterval specifies the keep alive interval for TCP stream multipler.
// If TCPMux is true, heartbeat of application layer is unnecessary because it can only rely on heartbeat in TCPMux.
diff --git a/pkg/util/version/version.go b/pkg/util/version/version.go
index 5f6f370..0f58a3b 100644
--- a/pkg/util/version/version.go
+++ b/pkg/util/version/version.go
@@ -19,7 +19,7 @@ import (
"strings"
)
-var version = "0.52.1"
+var version = "0.52.2"
func Full() string {
return version
diff --git a/web/frps/src/utils/proxy.ts b/web/frps/src/utils/proxy.ts
index 384680d..08d4017 100644
--- a/web/frps/src/utils/proxy.ts
+++ b/web/frps/src/utils/proxy.ts
@@ -23,12 +23,8 @@ class BaseProxy {
this.type = ''
this.encryption = false
this.compression = false
- if (proxyStats.conf != null && proxyStats.conf.useEncryption != null) {
- this.encryption = proxyStats.conf.useEncryption
- }
- if (proxyStats.conf != null && proxyStats.conf.useCompression != null) {
- this.compression = proxyStats.conf.useCompression
- }
+ this.encryption = (proxyStats.conf?.transport?.useEncryption) || this.encryption;
+ this.compression = (proxyStats.conf?.transport?.useCompression) || this.compression;
this.conns = proxyStats.curConns
this.trafficIn = proxyStats.todayTrafficIn
this.trafficOut = proxyStats.todayTrafficOut
@@ -79,14 +75,12 @@ class HTTPProxy extends BaseProxy {
super(proxyStats)
this.type = 'http'
this.port = port
- if (proxyStats.conf != null) {
- if (proxyStats.conf.customDomains != null) {
- this.customDomains = proxyStats.conf.customDomains
- }
+ if (proxyStats.conf) {
+ this.customDomains = proxyStats.conf.customDomains || this.customDomains;
this.hostHeaderRewrite = proxyStats.conf.hostHeaderRewrite
this.locations = proxyStats.conf.locations
- if (proxyStats.conf.subdomain != null && proxyStats.conf.subdomain != '') {
- this.subdomain = proxyStats.conf.subdomain + '.' + subdomainHost
+ if (proxyStats.conf.subdomain) {
+ this.subdomain = `${proxyStats.conf.subdomain}.${subdomainHost}`
}
}
}
@@ -98,11 +92,9 @@ class HTTPSProxy extends BaseProxy {
this.type = 'https'
this.port = port
if (proxyStats.conf != null) {
- if (proxyStats.conf.customDomains != null) {
- this.customDomains = proxyStats.conf.customDomains
- }
- if (proxyStats.conf.subdomain != null && proxyStats.conf.subdomain != '') {
- this.subdomain = proxyStats.conf.subdomain + '.' + subdomainHost
+ this.customDomains = proxyStats.conf.customDomains || this.customDomains;
+ if (proxyStats.conf.subdomain) {
+ this.subdomain = `${proxyStats.conf.subdomain}.${subdomainHost}`
}
}
}