feat: 可视化面板支持日志显示

chore: 减少了一些日志输出
This commit is contained in:
Soulter committed 2024-02-04 21:28:03 +08:00
1 parent 3519e38211
commit 7079ce096f
34 files changed
+286 -191

No files matched your search

+1
View File
@@ -6,3 +6,4 @@ configs/session
configs/config.yaml
**/.DS_Store
temp
cmd_config.json
@@ -1 +1 @@
import{x as i,o as l,c as _,w as s,a as e,f as a,J as m,V as r,b as t,t as u,ab as p,B as n,ac as o,j as f}from"./index-7c8bc001.js";const b={class:"text-h3"},h={class:"d-flex align-center"},g={class:"d-flex align-center"},V=i({__name:"BaseBreadcrumb",props:{title:String,breadcrumbs:Array,icon:String},setup(d){const c=d;return(x,B)=>(l(),_(r,{class:"page-breadcrumb mb-1 mt-1"},{default:s(()=>[e(a,{cols:"12",md:"12"},{default:s(()=>[e(m,{variant:"outlined",elevation:"0",class:"px-4 py-3 withbg"},{default:s(()=>[e(r,{"no-gutters":"",class:"align-center"},{default:s(()=>[e(a,{md:"5"},{default:s(()=>[t("h3",b,u(c.title),1)]),_:1}),e(a,{md:"7",sm:"12",cols:"12"},{default:s(()=>[e(p,{items:c.breadcrumbs,class:"text-h5 justify-md-end pa-1"},{divider:s(()=>[t("div",h,[e(n(o),{size:"17"})])]),prepend:s(()=>[e(f,{size:"small",icon:"mdi-home",class:"text-secondary mr-2"}),t("div",g,[e(n(o),{size:"17"})])]),_:1},8,["items"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}});export{V as _};
import{x as i,o as l,c as _,w as s,a as e,f as a,J as m,V as r,b as t,t as u,ab as p,B as n,ac as o,j as f}from"./index-f71951bf.js";const b={class:"text-h3"},h={class:"d-flex align-center"},g={class:"d-flex align-center"},V=i({__name:"BaseBreadcrumb",props:{title:String,breadcrumbs:Array,icon:String},setup(d){const c=d;return(x,B)=>(l(),_(r,{class:"page-breadcrumb mb-1 mt-1"},{default:s(()=>[e(a,{cols:"12",md:"12"},{default:s(()=>[e(m,{variant:"outlined",elevation:"0",class:"px-4 py-3 withbg"},{default:s(()=>[e(r,{"no-gutters":"",class:"align-center"},{default:s(()=>[e(a,{md:"5"},{default:s(()=>[t("h3",b,u(c.title),1)]),_:1}),e(a,{md:"7",sm:"12",cols:"12"},{default:s(()=>[e(p,{items:c.breadcrumbs,class:"text-h5 justify-md-end pa-1"},{divider:s(()=>[t("div",h,[e(n(o),{size:"17"})])]),prepend:s(()=>[e(f,{size:"small",icon:"mdi-home",class:"text-secondary mr-2"}),t("div",g,[e(n(o),{size:"17"})])]),_:1},8,["items"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1}))}});export{V as _};
@@ -1 +1 @@
import{x as e,o as a,c as t,w as o,a as s,B as n,X as r,T as c}from"./index-7c8bc001.js";const f=e({__name:"BlankLayout",setup(p){return(u,_)=>(a(),t(c,null,{default:o(()=>[s(n(r))]),_:1}))}});export{f as default};
import{x as e,o as a,c as t,w as o,a as s,B as n,X as r,T as c}from"./index-f71951bf.js";const f=e({__name:"BlankLayout",setup(p){return(u,_)=>(a(),t(c,null,{default:o(()=>[s(n(r))]),_:1}))}});export{f as default};
@@ -1 +1 @@
import{_ as m}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-89ca5198.js";import{_}from"./UiParentCard.vue_vue_type_script_setup_true_lang-03a5c441.js";import{x as p,D as a,o as r,s,a as e,w as t,f as o,V as i,F as n,u as g,c as h,_ as b,e as x,t as y}from"./index-7c8bc001.js";const P=p({__name:"ColorPage",setup(C){const c=a({title:"Colors Page"}),d=a([{title:"Utilities",disabled:!1,href:"#"},{title:"Colors",disabled:!0,href:"#"}]),u=a(["primary","lightprimary","secondary","lightsecondary","info","success","accent","warning","error","darkText","lightText","borderLight","inputBorder","containerBg"]);return(V,k)=>(r(),s(n,null,[e(m,{title:c.value.title,breadcrumbs:d.value},null,8,["title","breadcrumbs"]),e(i,null,{default:t(()=>[e(o,{cols:"12",md:"12"},{default:t(()=>[e(_,{title:"Color Palette"},{default:t(()=>[e(i,null,{default:t(()=>[(r(!0),s(n,null,g(u.value,(l,f)=>(r(),h(o,{md:"3",cols:"12",key:f},{default:t(()=>[e(b,{rounded:"md",class:"align-center justify-center d-flex",height:"100",width:"100%",color:l},{default:t(()=>[x("class: "+y(l),1)]),_:2},1032,["color"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1})],64))}});export{P as default};
import{_ as m}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-2b6e2e87.js";import{_}from"./UiParentCard.vue_vue_type_script_setup_true_lang-820f34f1.js";import{x as p,D as a,o as r,s,a as e,w as t,f as o,V as i,F as n,u as g,c as h,_ as b,e as x,t as y}from"./index-f71951bf.js";const P=p({__name:"ColorPage",setup(C){const c=a({title:"Colors Page"}),d=a([{title:"Utilities",disabled:!1,href:"#"},{title:"Colors",disabled:!0,href:"#"}]),u=a(["primary","lightprimary","secondary","lightsecondary","info","success","accent","warning","error","darkText","lightText","borderLight","inputBorder","containerBg"]);return(V,k)=>(r(),s(n,null,[e(m,{title:c.value.title,breadcrumbs:d.value},null,8,["title","breadcrumbs"]),e(i,null,{default:t(()=>[e(o,{cols:"12",md:"12"},{default:t(()=>[e(_,{title:"Color Palette"},{default:t(()=>[e(i,null,{default:t(()=>[(r(!0),s(n,null,g(u.value,(l,f)=>(r(),h(o,{md:"3",cols:"12",key:f},{default:t(()=>[e(b,{rounded:"md",class:"align-center justify-center d-flex",height:"100",width:"100%",color:l},{default:t(()=>[x("class: "+y(l),1)]),_:2},1032,["color"])]),_:2},1024))),128))]),_:1})]),_:1})]),_:1})]),_:1})],64))}});export{P as default};
@@ -1 +1 @@
import{_ as h}from"./UiParentCard.vue_vue_type_script_setup_true_lang-03a5c441.js";import{o as a,s as t,a as n,w as i,f as b,F as d,u as g,V as C,d as U,e as x,t as c,a8 as B,R as _,c as r,a9 as w,O as v,b as V,aa as N,i as F,q as P,k as f,A as S}from"./index-7c8bc001.js";const D={name:"ConfigPage",components:{UiParentCard:h},data(){return{config_data:{data:[]},save_message_snack:!1,save_message:"",save_message_success:""}},mounted(){this.getConfig()},methods:{getConfig(){_.get("/api/configs").then(o=>{this.config_data=o.data.data,console.log(this.config_data)})},updateConfig(){_.post("/api/configs",this.config_data).then(o=>{console.log(this.config_data),o.data.status==="success"?(this.save_message=o.data.message,this.save_message_snack=!0,this.save_message_success="success"):(this.save_message=o.data.message,this.save_message_snack=!0,this.save_message_success="error")})}}},$=Object.assign(D,{setup(o){return(s,m)=>(a(),t(d,null,[n(C,null,{default:i(()=>[n(b,{cols:"12",md:"12"},{default:i(()=>[(a(!0),t(d,null,g(s.config_data.data,u=>(a(),r(h,{key:u.name,title:u.name,style:{"margin-bottom":"16px"}},{default:i(()=>[(a(!0),t(d,null,g(u.body,e=>(a(),t(d,null,[e.config_type==="item"?(a(),t(d,{key:0},[e.val_type==="bool"?(a(),r(w,{key:0,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,label:e.name,hint:e.description,color:"primary",inset:""},null,8,["modelValue","onUpdate:modelValue","label","hint"])):e.val_type==="string"?(a(),r(v,{key:1,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,label:e.name,hint:e.description,style:{"margin-bottom":"8px"},variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","label","hint"])):e.val_type==="int"?(a(),r(v,{key:2,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,label:e.name,hint:e.description,style:{"margin-bottom":"8px"},variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","label","hint"])):e.val_type==="list"?(a(),t(d,{key:3},[V("span",null,c(e.name),1),n(N,{modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,chips:"",clearable:"",label:"请添加",multiple:"","prepend-icon":"mdi-tag-multiple-outline"},{selection:i(({attrs:l,item:p,select:k,selected:y})=>[n(F,P(l,{"model-value":y,closable:"",onClick:k,"onClick:close":O=>s.remove(p)}),{default:i(()=>[V("strong",null,c(p),1)]),_:2},1040,["model-value","onClick","onClick:close"])]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):f("",!0)],64)):e.config_type==="divider"?(a(),r(S,{key:1,style:{"margin-top":"8px","margin-bottom":"8px"}})):f("",!0)],64))),256))]),_:2},1032,["title"]))),128))]),_:1})]),_:1}),n(U,{icon:"mdi-content-save",size:"x-large",style:{position:"fixed",right:"52px",bottom:"52px"},color:"darkprimary",onClick:s.updateConfig},null,8,["onClick"]),n(B,{timeout:2e3,elevation:"24",color:s.save_message_success,modelValue:s.save_message_snack,"onUpdate:modelValue":m[0]||(m[0]=u=>s.save_message_snack=u)},{default:i(()=>[x(c(s.save_message),1)]),_:1},8,["color","modelValue"])],64))}});export{$ as default};
import{_ as h}from"./UiParentCard.vue_vue_type_script_setup_true_lang-820f34f1.js";import{o as a,s as t,a as n,w as i,f as b,F as d,u as g,V as C,d as U,e as x,t as c,a8 as B,R as _,c as r,a9 as w,O as v,b as V,aa as N,i as F,q as P,k as f,A as S}from"./index-f71951bf.js";const D={name:"ConfigPage",components:{UiParentCard:h},data(){return{config_data:{data:[]},save_message_snack:!1,save_message:"",save_message_success:""}},mounted(){this.getConfig()},methods:{getConfig(){_.get("/api/configs").then(o=>{this.config_data=o.data.data,console.log(this.config_data)})},updateConfig(){_.post("/api/configs",this.config_data).then(o=>{console.log(this.config_data),o.data.status==="success"?(this.save_message=o.data.message,this.save_message_snack=!0,this.save_message_success="success"):(this.save_message=o.data.message,this.save_message_snack=!0,this.save_message_success="error")})}}},$=Object.assign(D,{setup(o){return(s,m)=>(a(),t(d,null,[n(C,null,{default:i(()=>[n(b,{cols:"12",md:"12"},{default:i(()=>[(a(!0),t(d,null,g(s.config_data.data,u=>(a(),r(h,{key:u.name,title:u.name,style:{"margin-bottom":"16px"}},{default:i(()=>[(a(!0),t(d,null,g(u.body,e=>(a(),t(d,null,[e.config_type==="item"?(a(),t(d,{key:0},[e.val_type==="bool"?(a(),r(w,{key:0,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,label:e.name,hint:e.description,color:"primary",inset:""},null,8,["modelValue","onUpdate:modelValue","label","hint"])):e.val_type==="string"?(a(),r(v,{key:1,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,label:e.name,hint:e.description,style:{"margin-bottom":"8px"},variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","label","hint"])):e.val_type==="int"?(a(),r(v,{key:2,modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,label:e.name,hint:e.description,style:{"margin-bottom":"8px"},variant:"outlined"},null,8,["modelValue","onUpdate:modelValue","label","hint"])):e.val_type==="list"?(a(),t(d,{key:3},[V("span",null,c(e.name),1),n(N,{modelValue:e.value,"onUpdate:modelValue":l=>e.value=l,chips:"",clearable:"",label:"请添加",multiple:"","prepend-icon":"mdi-tag-multiple-outline"},{selection:i(({attrs:l,item:p,select:k,selected:y})=>[n(F,P(l,{"model-value":y,closable:"",onClick:k,"onClick:close":O=>s.remove(p)}),{default:i(()=>[V("strong",null,c(p),1)]),_:2},1040,["model-value","onClick","onClick:close"])]),_:2},1032,["modelValue","onUpdate:modelValue"])],64)):f("",!0)],64)):e.config_type==="divider"?(a(),r(S,{key:1,style:{"margin-top":"8px","margin-bottom":"8px"}})):f("",!0)],64))),256))]),_:2},1032,["title"]))),128))]),_:1})]),_:1}),n(U,{icon:"mdi-content-save",size:"x-large",style:{position:"fixed",right:"52px",bottom:"52px"},color:"darkprimary",onClick:s.updateConfig},null,8,["onClick"]),n(B,{timeout:2e3,elevation:"24",color:s.save_message_success,modelValue:s.save_message_snack,"onUpdate:modelValue":m[0]||(m[0]=u=>s.save_message_snack=u)},{default:i(()=>[x(c(s.save_message),1)]),_:1},8,["color","modelValue"])],64))}});export{$ as default};
@@ -1,12 +1,11 @@
import{o as me,s as Se,b as Ce}from"./index-7c8bc001.js";var fe={exports:{}};(function(_e,ge){(function(oe,re){_e.exports=re()})(self,()=>(()=>{var oe={4567:function(I,r,a){var l=this&&this.__decorate||function(i,o,c,v){var m,h=arguments.length,g=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,o,c,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(g=(h<3?m(g):h>3?m(o,c,g):m(o,c))||g);return h>3&&g&&Object.defineProperty(o,c,g),g},u=this&&this.__param||function(i,o){return function(c,v){o(c,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),p=a(844),_=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends p.Disposable{constructor(i,o){super(),this._terminal=i,this._renderService=o,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(c=>this._handleResize(c.rows))),this.register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(c=>this._handleChar(c))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
import{o as Ce,s as be,b as he,t as ge,a as ye,w as we,e as Ee,d as ke,F as Le}from"./index-f71951bf.js";var pe={exports:{}};(function(Q,ne){(function(ce,oe){Q.exports=oe()})(self,()=>(()=>{var ce={4567:function(I,r,a){var l=this&&this.__decorate||function(i,o,c,v){var m,h=arguments.length,g=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,c):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(i,o,c,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(g=(h<3?m(g):h>3?m(o,c,g):m(o,c))||g);return h>3&&g&&Object.defineProperty(o,c,g),g},u=this&&this.__param||function(i,o){return function(c,v){o(c,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),p=a(844),_=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends p.Disposable{constructor(i,o){super(),this._terminal=i,this._renderService=o,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new f.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(c=>this._handleResize(c.rows))),this.register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(c=>this._handleChar(c))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
`))),this.register(this._terminal.onA11yTab(c=>this._handleTab(c))),this.register(this._terminal.onKey(c=>this._handleKey(c.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new _.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,s.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,p.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(i){for(let o=0;o<i;o++)this._handleChar(" ")}_handleChar(i){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==i&&(this._charsToAnnounce+=i):this._charsToAnnounce+=i,i===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),d.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,d.isMac&&this._liveRegion.remove()}_handleKey(i){this._clearLiveRegion(),/\p{Control}/u.test(i)||this._charsToConsume.push(i)}_refreshRows(i,o){this._liveRegionDebouncer.refresh(i,o,this._terminal.rows)}_renderRows(i,o){const c=this._terminal.buffer,v=c.lines.length.toString();for(let m=i;m<=o;m++){const h=c.translateBufferLineToString(c.ydisp+m,!0),g=(c.ydisp+m+1).toString(),b=this._rowElements[m];b&&(h.length===0?b.innerText=" ":b.textContent=h,b.setAttribute("aria-posinset",g),b.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,o){const c=i.target,v=this._rowElements[o===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==v)return;let m,h;if(o===0?(m=c,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=c,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),i.preventDefault(),i.stopImmediatePropagation()}_handleResize(i){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const i=document.createElement("div");return i.setAttribute("role","listitem"),i.tabIndex=-1,this._refreshRowDimensions(i),i}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let i=0;i<this._terminal.rows;i++)this._refreshRowDimensions(this._rowElements[i])}}_refreshRowDimensions(i){i.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=t=l([u(1,e.IRenderService)],t)},3614:(I,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function l(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function u(d,f,p,_){d=l(d=a(d),p.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),p.triggerDataEvent(d,!0),f.value=""}function n(d,f,p){const _=p.getBoundingClientRect(),e=d.clientX-_.left-10,s=d.clientY-_.top-10;f.style.width="20px",f.style.height="20px",f.style.left=`${e}px`,f.style.top=`${s}px`,f.style.zIndex="1000",f.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=l,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,p,_){d.stopPropagation(),d.clipboardData&&u(d.clipboardData.getData("text/plain"),f,p,_)},r.paste=u,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,p,_,e){n(d,f,p),e&&_.rightClickSelect(d),f.value=_.selectionText,f.select()}},7239:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const l=a(1505);r.ColorContrastCache=class{constructor(){this._color=new l.TwoKeyMap,this._css=new l.TwoKeyMap}setCss(u,n,d){this._css.set(u,n,d)}getCss(u,n){return this._css.get(u,n)}setColor(u,n,d){this._color.set(u,n,d)}getColor(u,n){return this._color.get(u,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,l,u,n){a.addEventListe Line truncated
WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=f=l([u(0,d.IBufferService),u(1,d.IOptionsService),u(2,d.IOscLinkService)],f)},6193:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(a,l){this._parentWindow=a,this._renderCallback=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,l,u){this._rowCount=u,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const l=a(844);class u extends l.Disposable{constructor(d){super(),this._parentWindow=d,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,l.toDisposable)(()=>{this.clearListener()}))}setListener(d){this._listener&&this.clearListener(),this._listener=d,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var d;this._outerListener&&((d=this._resolutionMediaMatchList)===null||d===void 0||d.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=u},3236:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=a(3614),u=a(3656),n=a(6465),d=a(9042),f=a(3730),p=a(1680),_=a(3107),e=a(5744),s=a(2950),t=a(1296),i=a(428),o=a(4269),c=a(5114),v=a(8934),m=a(3230),h=a(9312),g=a(4725),b=a(6731),L=a(8055),y=a(8969),k=a(8460),x=a(844),T=a(6114),O=a(8437),M=a(2584),C=a(7399),w=a(5941),E=a(9074),D=a(2585),P=a(5435),H=a(4567),U=typeof window<"u"?window.document:null;class W extends y.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(S={}){super(S),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new x.MutableDisposable),this._onCursorMove=this.register(new k.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new k.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new k.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new k.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new k.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new k.EventEmitter),this._onBlur=this.register(new k.EventEmitter),this._onA11yCharEmitter=this.register(new k.EventEmitter),this._onA11yTabEmitter=this.register(new k.EventEmitter),this._onWillOpen=this.register(new k.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(n.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,B)=>this.refresh(R,B))),this.r Line truncated
WARNING: This link could potentially be dangerous`)){const s=window.open();if(s){try{s.opener=null}catch{}s.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=f=l([u(0,d.IBufferService),u(1,d.IOptionsService),u(2,d.IOscLinkService)],f)},6193:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(a,l){this._parentWindow=a,this._renderCallback=l,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,l,u){this._rowCount=u,a=a!==void 0?a:0,l=l!==void 0?l:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,l):l,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const a=Math.max(this._rowStart,0),l=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,l),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const l=a(844);class u extends l.Disposable{constructor(d){super(),this._parentWindow=d,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,l.toDisposable)(()=>{this.clearListener()}))}setListener(d){this._listener&&this.clearListener(),this._listener=d,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var d;this._outerListener&&((d=this._resolutionMediaMatchList)===null||d===void 0||d.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=u},3236:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const l=a(3614),u=a(3656),n=a(6465),d=a(9042),f=a(3730),p=a(1680),_=a(3107),e=a(5744),s=a(2950),t=a(1296),i=a(428),o=a(4269),c=a(5114),v=a(8934),m=a(3230),h=a(9312),g=a(4725),b=a(6731),L=a(8055),y=a(8969),k=a(8460),x=a(844),T=a(6114),O=a(8437),M=a(2584),C=a(7399),w=a(5941),E=a(9074),D=a(2585),P=a(5435),H=a(4567),U=typeof window<"u"?window.document:null;class W extends y.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(S={}){super(S),this.browser=T,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new x.MutableDisposable),this._onCursorMove=this.register(new k.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new k.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new k.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new k.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new k.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new k.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new k.EventEmitter),this._onBlur=this.register(new k.EventEmitter),this._onA11yCharEmitter=this.register(new k.EventEmitter),this._onA11yTabEmitter=this.register(new k.EventEmitter),this._onWillOpen=this.register(new k.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(n.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(f.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(E.DecorationService),this._instantiationService.setService(D.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((R,B)=>this.refresh(R,B))),this.r Line truncated
`:`
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(h){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),s.isLinux&&h&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(h){const g=this._getMouseBufferCoords(h),b=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(b&&L&&g)&&this._areCoordsInSelection(g,b,L)}isCellInSelection(h,g){const b=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!(!b||!L)&&this._areCoordsInSelection([h,g],b,L)}_areCoordsInSelection(h,g,b){return h[1]>g[1]&&h[1]<b[1]||g[1]===b[1]&&h[1]===g[1]&&h[0]>=g[0]&&h[0]<b[0]||g[1]<b[1]&&h[1]===b[1]&&h[0]<b[0]||g[1]<b[1]&&h[1]===g[1]&&h[0]>=g[0]}_selectWordAtCursor(h,g){var b,L;const y=(L=(b=this._linkifier.currentLink)===null||b===void 0?void 0:b.link)===null||L===void 0?void 0:L.range;if(y)return this._model.selectionStart=[y.start.x-1,y.start.y-1],this._model.selectionStartLength=(0,t.getRangeLength)(y,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const k=this._getMouseBufferCoords(h);return!!k&&(this._selectWordAt(k,g),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(h,g){this._model.clearSelection(),h=Math.max(h,0),g=Math.min(g,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,h],this._model.selectionEnd=[this._bufferService.cols,g],this.refresh(),this._onSelectionChange.fire()}_handleTrim(h){this._model.handleTrim(h)&&this.refresh()}_getMouseBufferCoords(h){const g=this._mouseService.getCoords(h,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(g)return g[0]--,g[1]--,g[1]+=this._bufferService.buffer.ydisp,g}_getMouseEventScrollAmount(h){let g=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,h,this._screenElement)[1];const b=this._renderService.dimensions.css.canvas.height;return g>=0&&g<=b?0:(g>b&&(g-=b),g=Math.min(Math.max(g,-50),50),g/=50,g/Math.abs(g)+Math.round(14*g))}shouldForceSelection(h){return s.isMac?h.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:h.shiftKey}handleMouseDown(h){if(this._mouseDownTimeStamp=h.timeStamp,(h.button!==2||!this.hasSelection)&&h.button===0){if(!this._enabled){if(!this.shouldForceSelection(h))return;h.stopPropagation()}h.preventDefault(),this._dragScrollAmount=0,this._enabled&&h.shiftKey?this._handleIncrementalClick(h):h.detail===1?this._handleSingleClick(h):h.detail===2?this._handleDoubleClick(h):h.detail===3&&this._handleTripleClick(h),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(h){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(h))}_handleSingleClick(h){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(h)?3:0,this._model.selectionStart=this._getMouseBufferCoords(h),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const g=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);g&&g.length!==this._model.selectionStart[0]&&g.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(h){this._selectWordAtCursor(h,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(h){const g=this._getMouseBufferCoords(h);g&&(this._activeSelectionMode=2,this._selectLineAt(g[1]))}shouldColumnSelect(h){return h.altKey&&!(s.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(h){if(h.stopImmediatePropagation(),!this._model.selectionStart)return;const g=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(h),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.sele Line truncated
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""}(a||(r.C0=a={})),function(n){n.PAD="€",n.HOP="",n.BPH="‚",n.NBH="ƒ",n.IND="„",n.NEL="…",n.SSA="†",n.ESA="‡",n.HTS="ˆ",n.HTJ="‰",n.VTS="Š",n.PLD="‹",n.PLU="Œ",n.RI="",n.SS2="Ž",n.SS3="",n.DCS="",n.PU1="‘",n.PU2="’",n.STS="“",n.CCH="”",n.MW="•",n.SPA="–",n.EPA="—",n.SOS="˜",n.SGCI="™",n.SCI="š",n.CSI="›",n.ST="œ",n.OSC="",n.PM="ž",n.APC="Ÿ"}(l||(r.C1=l={})),function(n){n.ST=`${a.ESC}\\`}(u||(r.C1_ESCAPED=u={}))},7399:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=a(2584),u={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(n,d,f,p){const _={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?_.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?_.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?_.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(_.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:if(n.altKey){_.key=l.C0.ESC+l.C0.DEL;break}_.key=l.C0.DEL;break;case 9:if(n.shiftKey){_.key=l.C0.ESC+"[Z";break}_.key=l.C0.HT,_.cancel=!0;break;case 13:_.key=n.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,_.cancel=!0;break;case 27:_.key=l.C0.ESC,n.altKey&&(_.key=l.C0.ESC+l.C0.ESC),_.cancel=!0;break;case 37:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"D",_.key===l.C0.ESC+"[1;3D"&&(_.key=l.C0.ESC+(f?"b":"[1;5D"))):_.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"C",_.key===l.C0.ESC+"[1;3C"&&(_.key=l.C0.ESC+(f?"f":"[1;5C"))):_.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"A",f||_.key!==l.C0.ESC+"[1;3A"||(_.key=l.C0.ESC+"[1;5A")):_.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"B",f||_.key!==l.C0.ESC+"[1;3B"||(_.key=l.C0.ESC+"[1;5B")):_.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(_.key=l.C0.ESC+"[2~");break;case 46:_.key=e?l.C0.ESC+"[3;"+(e+1)+"~":l.C0.ESC+"[3~";break;case 36:_.key=e?l.C0.ESC+"[1;"+(e+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:_.key=e?l.C0.ESC+"[1;"+(e+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:n.shiftKey?_.type=2:n.ctrlKey?_.key=l.C0.ESC+"[5;"+(e+1)+"~":_.key=l.C0.ESC+"[5~";break;case 34:n.shiftKey?_.type=3:n.ctrlKey?_.key=l.C0.ESC+"[6;"+(e+1)+"~":_.key=l.C0.ESC+"[6~";break;case 112:_.key=e?l.C0.ESC+"[1;"+(e+1)+"P":l.C0.ESC+"OP";break;case 113:_.key=e?l.C0.ESC+"[1;"+(e+1)+"Q":l.C0.ESC+"OQ";break;case 114:_.key=e?l.C0.ESC+"[1;"+(e+1)+"R":l.C0.ESC+"OR";break;case 115:_.key=e?l.C0.ESC+"[1;"+(e+1)+"S":l.C0.ESC+"OS";break;case 116:_.key=e?l.C0.ESC+"[15;"+(e+1)+"~":l.C0.ESC+"[15~";break;case 117:_.key=e?l.C0.ESC+"[17;"+(e+1)+"~":l.C0.ESC+"[17~";break;case 118:_.key=e?l.C0.ESC+"[18;"+(e+1)+"~":l.C0.ESC+"[18~";break;case 119:_.key=e?l.C0.ESC+"[19;"+(e+1)+"~":l.C0.ESC+"[19~";break;case 120:_.key=e?l.C0.ESC+"[20;"+(e+1)+"~":l.C0.ESC+"[20~";break;case 121:_.key=e?l.C0.ESC+"[21;"+(e+1)+"~":l.C0.ESC+"[21~";break;case 122:_.key=e?l.C0.ESC+"[23;"+(e+1)+"~":l.C0.ESC+"[23~";break;case 123:_.key=e?l.C0.ESC+"[24;"+(e+1)+"~":l.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!p||!n.altKey||n.metaKey)!f||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?_.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(_.key=l.C0.US),n.key==="@"&&(_.key=l.C0.NUL)):n.keyCode===65&&(_.type=1);else{const s=u[n.keyCode],t=s==null?void 0:s[n.shiftKey?1:0];if(t)_.key=l.C0.ESC+t;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let o=String.fromCharCode(i);n.shiftKey&&(o=o.toUpperCase()),_.key=l.C0.ESC+o}else if(n.keyCode===32)_.key=l.C0.ESC+(n.ctrlKey?l.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),_.key=l.C0.ESC+i,_.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?_.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?_.key=l.C0.NUL:n.keyCode>=51&&n.keyCode<=55?_.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?_.key=l.C0.DEL:n.keyCode===219?_.key=l.C0.ESC:n.keyCode===220?_.key=l.C0.FS:n.keyCode===221&&(_.key=l.C0.GS)}return _}},482:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10Line truncated
`,t)}paste(s){this._core.paste(s)}refresh(s,t){this._verifyIntegers(s,t),this._core.refresh(s,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const t of s)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const t of s)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}I.Terminal=_})(),ue})())})(fe);var be=fe.exports;const ye={style:{width:"100%",height:"100%","background-color":"#fff",padding:"16px","border-radius":"10px"}},we=Ce("div",{id:"terminal",style:{}},null,-1),Ee=[we],ke={name:"ConsolePage",components:{},data(){return{term:null}},mounted(){this.term=new be.Terminal({rows:35,cols:100,theme:{foreground:"#000",background:"#ffffff"}}),this.term.open(document.getElementById("terminal")),this.term.write(`AstrBot Console By xterm && Soulter
`),this.term.write(`🚧 施工中 🚧
`),this.term.write(`此 Console 暂时不可用。
`)},methods:{}},De=Object.assign(ke,{setup(_e){return(ge,oe)=>(me(),Se("div",ye,Ee))}});export{De as default};
`,n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="\x1B",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL=""}(a||(r.C0=a={})),function(n){n.PAD="€",n.HOP="",n.BPH="‚",n.NBH="ƒ",n.IND="„",n.NEL="…",n.SSA="†",n.ESA="‡",n.HTS="ˆ",n.HTJ="‰",n.VTS="Š",n.PLD="‹",n.PLU="Œ",n.RI="",n.SS2="Ž",n.SS3="",n.DCS="",n.PU1="‘",n.PU2="’",n.STS="“",n.CCH="”",n.MW="•",n.SPA="–",n.EPA="—",n.SOS="˜",n.SGCI="™",n.SCI="š",n.CSI="›",n.ST="œ",n.OSC="",n.PM="ž",n.APC="Ÿ"}(l||(r.C1=l={})),function(n){n.ST=`${a.ESC}\\`}(u||(r.C1_ESCAPED=u={}))},7399:(I,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const l=a(2584),u={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(n,d,f,p){const _={type:0,cancel:!1,key:void 0},e=(n.shiftKey?1:0)|(n.altKey?2:0)|(n.ctrlKey?4:0)|(n.metaKey?8:0);switch(n.keyCode){case 0:n.key==="UIKeyInputUpArrow"?_.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A":n.key==="UIKeyInputLeftArrow"?_.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D":n.key==="UIKeyInputRightArrow"?_.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C":n.key==="UIKeyInputDownArrow"&&(_.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:if(n.altKey){_.key=l.C0.ESC+l.C0.DEL;break}_.key=l.C0.DEL;break;case 9:if(n.shiftKey){_.key=l.C0.ESC+"[Z";break}_.key=l.C0.HT,_.cancel=!0;break;case 13:_.key=n.altKey?l.C0.ESC+l.C0.CR:l.C0.CR,_.cancel=!0;break;case 27:_.key=l.C0.ESC,n.altKey&&(_.key=l.C0.ESC+l.C0.ESC),_.cancel=!0;break;case 37:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"D",_.key===l.C0.ESC+"[1;3D"&&(_.key=l.C0.ESC+(f?"b":"[1;5D"))):_.key=d?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"C",_.key===l.C0.ESC+"[1;3C"&&(_.key=l.C0.ESC+(f?"f":"[1;5C"))):_.key=d?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"A",f||_.key!==l.C0.ESC+"[1;3A"||(_.key=l.C0.ESC+"[1;5A")):_.key=d?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(n.metaKey)break;e?(_.key=l.C0.ESC+"[1;"+(e+1)+"B",f||_.key!==l.C0.ESC+"[1;3B"||(_.key=l.C0.ESC+"[1;5B")):_.key=d?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:n.shiftKey||n.ctrlKey||(_.key=l.C0.ESC+"[2~");break;case 46:_.key=e?l.C0.ESC+"[3;"+(e+1)+"~":l.C0.ESC+"[3~";break;case 36:_.key=e?l.C0.ESC+"[1;"+(e+1)+"H":d?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:_.key=e?l.C0.ESC+"[1;"+(e+1)+"F":d?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:n.shiftKey?_.type=2:n.ctrlKey?_.key=l.C0.ESC+"[5;"+(e+1)+"~":_.key=l.C0.ESC+"[5~";break;case 34:n.shiftKey?_.type=3:n.ctrlKey?_.key=l.C0.ESC+"[6;"+(e+1)+"~":_.key=l.C0.ESC+"[6~";break;case 112:_.key=e?l.C0.ESC+"[1;"+(e+1)+"P":l.C0.ESC+"OP";break;case 113:_.key=e?l.C0.ESC+"[1;"+(e+1)+"Q":l.C0.ESC+"OQ";break;case 114:_.key=e?l.C0.ESC+"[1;"+(e+1)+"R":l.C0.ESC+"OR";break;case 115:_.key=e?l.C0.ESC+"[1;"+(e+1)+"S":l.C0.ESC+"OS";break;case 116:_.key=e?l.C0.ESC+"[15;"+(e+1)+"~":l.C0.ESC+"[15~";break;case 117:_.key=e?l.C0.ESC+"[17;"+(e+1)+"~":l.C0.ESC+"[17~";break;case 118:_.key=e?l.C0.ESC+"[18;"+(e+1)+"~":l.C0.ESC+"[18~";break;case 119:_.key=e?l.C0.ESC+"[19;"+(e+1)+"~":l.C0.ESC+"[19~";break;case 120:_.key=e?l.C0.ESC+"[20;"+(e+1)+"~":l.C0.ESC+"[20~";break;case 121:_.key=e?l.C0.ESC+"[21;"+(e+1)+"~":l.C0.ESC+"[21~";break;case 122:_.key=e?l.C0.ESC+"[23;"+(e+1)+"~":l.C0.ESC+"[23~";break;case 123:_.key=e?l.C0.ESC+"[24;"+(e+1)+"~":l.C0.ESC+"[24~";break;default:if(!n.ctrlKey||n.shiftKey||n.altKey||n.metaKey)if(f&&!p||!n.altKey||n.metaKey)!f||n.altKey||n.ctrlKey||n.shiftKey||!n.metaKey?n.key&&!n.ctrlKey&&!n.altKey&&!n.metaKey&&n.keyCode>=48&&n.key.length===1?_.key=n.key:n.key&&n.ctrlKey&&(n.key==="_"&&(_.key=l.C0.US),n.key==="@"&&(_.key=l.C0.NUL)):n.keyCode===65&&(_.type=1);else{const s=u[n.keyCode],t=s==null?void 0:s[n.shiftKey?1:0];if(t)_.key=l.C0.ESC+t;else if(n.keyCode>=65&&n.keyCode<=90){const i=n.ctrlKey?n.keyCode-64:n.keyCode+32;let o=String.fromCharCode(i);n.shiftKey&&(o=o.toUpperCase()),_.key=l.C0.ESC+o}else if(n.keyCode===32)_.key=l.C0.ESC+(n.ctrlKey?l.C0.NUL:" ");else if(n.key==="Dead"&&n.code.startsWith("Key")){let i=n.code.slice(3,4);n.shiftKey||(i=i.toLowerCase()),_.key=l.C0.ESC+i,_.cancel=!0}}else n.keyCode>=65&&n.keyCode<=90?_.key=String.fromCharCode(n.keyCode-64):n.keyCode===32?_.key=l.C0.NUL:n.keyCode>=51&&n.keyCode<=55?_.key=String.fromCharCode(n.keyCode-51+27):n.keyCode===56?_.key=l.C0.DEL:n.keyCode===219?_.key=l.C0.ESC:n.keyCode===220?_.key=l.C0.FS:n.keyCode===221&&(_.key=l.C0.GS)}return _}},482:(I,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10Line truncated
`,t)}paste(s){this._core.paste(s)}refresh(s,t){this._verifyIntegers(s,t),this._core.refresh(s,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(s){this._addonManager.loadAddon(this,s)}static get strings(){return r}_verifyIntegers(...s){for(const t of s)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...s){for(const t of s)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}I.Terminal=_})(),ve})())})(pe);var De=pe.exports;const Re={style:{"background-color":"white",width:"100%",padding:"8px","padding-left":"16px","border-radius":"10px","margin-bottom":"16px",display:"flex","flex-direction":"row","align-items":"center","justify-content":"space-between"}},xe=he("div",{style:{width:"100%",height:"100%","background-color":"#fff",padding:"16px","border-radius":"10px"}},[he("div",{id:"terminal",style:{}})],-1),Ae={name:"ConsolePage",components:{},data(){return{term:null,websocket:null,status:"",connection_status:"连接"}},mounted(){this.term=new De.Terminal({rendererType:"canvas",rows:28,cols:100,theme:{foreground:"#000",background:"#ffffff",cursor:"#000",convertEol:!0}}),this.term.open(document.getElementById("terminal")),this.createWebSocket()},methods:{createWebSocket(){this.status="正在连接",this.websocket=new WebSocket("ws://localhost:6186"),this.status="已连接",this.connection_status="断开",this.websocket.onopen=()=>{console.log("WebSocket连接已打开")},this.websocket.onerror=Q=>{console.error("WebSocket发生错误:",Q)},this.websocket.onclose=()=>{console.log("WebSocket连接已关闭")},this.websocket.onmessage=Q=>{this.term.write(Q.data+`\r
`)}},handleConnection(){this.connection_status==="连接"?this.createWebSocket():(this.websocket.close(),this.term.write(`已手动断开连接。\r
`),this.status="未连接",this.connection_status="连接")}},beforeUnmount(){this.websocket.close()}},Te=Object.assign(Ae,{setup(Q){return(ne,ce)=>(Ce(),be(Le,null,[he("div",Re,[he("h3",null,ge(ne.status),1),ye(ke,{color:"primary",variant:"text",onClick:ne.handleConnection},{default:we(()=>[Ee(ge(ne.connection_status),1)]),_:1},8,["onClick"])]),xe],64))}});export{Te as default};
Whitespace-only changes.
+32
View File
@@ -0,0 +1,32 @@
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/term.js
* @license MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Originally forked from (with the author's permission):
* Fabrice Bellard's javascript vt100 for jslinux:
* http://bellard.org/jslinux/
* Copyright (c) 2011 Fabrice Bellard
* The original design remains. The terminal itself
* has been extended to include xterm CSI codes, among
* other features.
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}
@@ -1 +1 @@
import{y as P,p as u,o as _,c as f,w as e,a as t,L as w,b as a,d as p,j as $,Z as I,q as z,_ as F,z as S,s as M,F as D,u as j,n as x,r as N,l as V,e as y,t as h,J as b,$ as U,D as W,a0 as C,a1 as G,a2 as O,a3 as H,a4 as L,V as k,f as m,G as X,a5 as q,R as A}from"./index-7c8bc001.js";import{_ as B}from"./_plugin-vue_export-helper-c27b6911.js";const E={class:"d-flex align-start mb-6"},J={class:"ml-auto z-1"},Y={class:"text-h1 font-weight-medium"},Z=a("span",{class:"text-subtitle-1 text-medium-emphasis text-white"},"消息总数",-1),K={name:"TotalMessage",components:{},props:["stat"],watch:{stat:{handler:function(s,o){this.message_total=s.message_total},deep:!0}},data:()=>({message_total:0}),mounted(){}},Q=Object.assign(K,{setup(s){const o=P([{title:"移除",icon:U}]);return(d,c)=>{const l=u("DotsIcon");return _(),f(b,{elevation:"0",class:"bg-secondary overflow-hidden bubble-shape bubble-secondary-shape"},{default:e(()=>[t(w,null,{default:e(()=>[a("div",E,[t(p,{icon:"",rounded:"sm",color:"darksecondary",variant:"flat"},{default:e(()=>[t($,{icon:"mdi-message"})]),_:1}),a("div",J,[t(I,{"close-on-content-click":!1},{activator:e(({props:r})=>[t(p,z({icon:"",rounded:"sm",color:"secondary",variant:"flat",size:"small"},r),{default:e(()=>[t(l,{"stroke-width":"1.5",width:"20"})]),_:2},1040)]),default:e(()=>[t(F,{rounded:"md",width:"150",class:"elevation-10"},{default:e(()=>[t(S,{density:"compact"},{default:e(()=>[(_(!0),M(D,null,j(o.value,(r,n)=>(_(),f(x,{key:n,value:n},{prepend:e(()=>[(_(),f(N(r.icon),{"stroke-width":"1.5",size:"20"}))]),default:e(()=>[t(V,{class:"ml-2"},{default:e(()=>[y(h(r.title),1)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1})])]),a("h2",Y,h(d.message_total),1),Z]),_:1})]),_:1})}}}),tt={class:"d-flex align-start mb-3"},et={class:"ml-auto z-1"},at={class:"text-h1 font-weight-medium"},st=a("span",{class:"text-subtitle-1 text-medium-emphasis text-white"},"会话总数",-1),ot={class:"text-h1 font-weight-medium"},lt=a("span",{class:"text-subtitle-1 text-medium-emphasis text-white"},"会话总数",-1),nt={name:"TotalSession",components:{},props:["stat"],watch:{stat:{handler:function(s,o){this.session_total=s.session_total},deep:!0}},data:()=>({session_total:0}),mounted(){}},it=Object.assign(nt,{setup(s){const o=W("1"),d=C(()=>({chart:{type:"bar",height:90,fontFamily:"inherit",foreColor:"#a1aab2",sparkline:{enabled:!0}},dataLabels:{enabled:!1},colors:["#fff"],fill:{type:"solid",opacity:1},stroke:{curve:"smooth",width:3},yaxis:{min:0,max:100},tooltip:{theme:"dark",fixed:{enabled:!1},x:{show:!1},y:{title:{formatter:()=>"会话总数"}},marker:{show:!1}}})),c={series:[{name:"series1",data:[45,66,41,89,25,44,9,54]}]},l=C(()=>({chart:{type:"bar",height:90,fontFamily:"inherit",foreColor:"#a1aab2",sparkline:{enabled:!0}},dataLabels:{enabled:!1},colors:["#fff"],fill:{type:"solid",opacity:1},stroke:{curve:"smooth",width:3},yaxis:{min:0,max:100},tooltip:{theme:"dark",fixed:{enabled:!1},x:{show:!1},y:{title:{formatter:()=>"会话总数"}},marker:{show:!1}}})),r={series:[{name:"series1",data:[35,44,9,54,45,66,41,69]}]};return(n,i)=>{const g=u("apexchart");return _(),f(b,{elevation:"0",class:"bg-primary overflow-hidden bubble-shape bubble-primary-shape"},{default:e(()=>[t(w,null,{default:e(()=>[a("div",tt,[t(p,{icon:"",rounded:"sm",color:"darkprimary",variant:"flat"},{default:e(()=>[t($,{icon:"mdi-account-multiple-outline"})]),_:1}),a("div",et,[t(G,{modelValue:o.value,"onUpdate:modelValue":i[0]||(i[0]=v=>o.value=v),class:"theme-tab",density:"compact",end:""},{default:e(()=>[t(O,{value:"1","hide-slider":"",color:"transparent"},{default:e(()=>[y("按日")]),_:1}),t(O,{value:"2","hide-slider":"",color:"transparent"},{default:e(()=>[y("按月")]),_:1})]),_:1},8,["modelValue"])])]),t(H,{modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=v=>o.value=v),class:"z-1"},{default:e(()=>[t(L,{value:"1"},{default:e(()=>[t(k,null,{default:e(()=>[t(m,{cols:"6"},{default:e(()=>[a("h2",at,h(n.session_total),1),st]),_:1}),t(m,{cols:"6"},{default:e(()=>[t(g,{type:"line",height:"90",options:d.value,series:c.series},null,8,["options","series"])]),_:1})]),_:1})]),_:1}),t(L,{value:"2"},{default:e(()=>[t(k,null,{default:e(()=>[t(m,{cols:"6"},{default:e(()=>[a("h2",ot,h(n.session_total),1),lt]),_:1}),t(m,{cols:"6"},{default:e(()=>[t(g,{type:"line",height:"90",options:l.value,series:r.series},null,8,["options","series"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})}}}),rt={name:"OnlineTime",components:{},props:["stat"],watch:{stat:{handler:function(s,o){this.memory=s.sys_perf.memory,this.runtime_str=s.sys_start_time;let d=new Date().getTime(),c=new Date(s.sys_start_time*1e3).getTime(),l=d-c,r=Math.floor(l/(24*3600*1e3)),n=l%(24*3600*1e3),i=Math.floor(n/(3600*1e3)),g=n%(3600*1e3),v=Math.floor(g/(60*1e3)),T=g%(60*1e3),R=Math.round(T/1e3);this.runtime_str=r+"天"+i+"小时"+v+"分"+R+"秒"},deep:!0}},data:()=>({_stat:{},memory:"Loading",runtime_str:"Loading"}),mounted(){}},dt={class:"d-flex align-centLine truncated
import{y as P,p as u,o as _,c as f,w as e,a as t,L as w,b as a,d as p,j as $,Z as I,q as z,_ as F,z as S,s as M,F as D,u as j,n as x,r as N,l as V,e as y,t as h,J as b,$ as U,D as W,a0 as C,a1 as G,a2 as O,a3 as H,a4 as L,V as k,f as m,G as X,a5 as q,R as A}from"./index-f71951bf.js";import{_ as B}from"./_plugin-vue_export-helper-c27b6911.js";const E={class:"d-flex align-start mb-6"},J={class:"ml-auto z-1"},Y={class:"text-h1 font-weight-medium"},Z=a("span",{class:"text-subtitle-1 text-medium-emphasis text-white"},"消息总数",-1),K={name:"TotalMessage",components:{},props:["stat"],watch:{stat:{handler:function(s,o){this.message_total=s.message_total},deep:!0}},data:()=>({message_total:0}),mounted(){}},Q=Object.assign(K,{setup(s){const o=P([{title:"移除",icon:U}]);return(d,c)=>{const l=u("DotsIcon");return _(),f(b,{elevation:"0",class:"bg-secondary overflow-hidden bubble-shape bubble-secondary-shape"},{default:e(()=>[t(w,null,{default:e(()=>[a("div",E,[t(p,{icon:"",rounded:"sm",color:"darksecondary",variant:"flat"},{default:e(()=>[t($,{icon:"mdi-message"})]),_:1}),a("div",J,[t(I,{"close-on-content-click":!1},{activator:e(({props:r})=>[t(p,z({icon:"",rounded:"sm",color:"secondary",variant:"flat",size:"small"},r),{default:e(()=>[t(l,{"stroke-width":"1.5",width:"20"})]),_:2},1040)]),default:e(()=>[t(F,{rounded:"md",width:"150",class:"elevation-10"},{default:e(()=>[t(S,{density:"compact"},{default:e(()=>[(_(!0),M(D,null,j(o.value,(r,n)=>(_(),f(x,{key:n,value:n},{prepend:e(()=>[(_(),f(N(r.icon),{"stroke-width":"1.5",size:"20"}))]),default:e(()=>[t(V,{class:"ml-2"},{default:e(()=>[y(h(r.title),1)]),_:2},1024)]),_:2},1032,["value"]))),128))]),_:1})]),_:1})]),_:1})])]),a("h2",Y,h(d.message_total),1),Z]),_:1})]),_:1})}}}),tt={class:"d-flex align-start mb-3"},et={class:"ml-auto z-1"},at={class:"text-h1 font-weight-medium"},st=a("span",{class:"text-subtitle-1 text-medium-emphasis text-white"},"会话总数",-1),ot={class:"text-h1 font-weight-medium"},lt=a("span",{class:"text-subtitle-1 text-medium-emphasis text-white"},"会话总数",-1),nt={name:"TotalSession",components:{},props:["stat"],watch:{stat:{handler:function(s,o){this.session_total=s.session_total},deep:!0}},data:()=>({session_total:0}),mounted(){}},it=Object.assign(nt,{setup(s){const o=W("1"),d=C(()=>({chart:{type:"bar",height:90,fontFamily:"inherit",foreColor:"#a1aab2",sparkline:{enabled:!0}},dataLabels:{enabled:!1},colors:["#fff"],fill:{type:"solid",opacity:1},stroke:{curve:"smooth",width:3},yaxis:{min:0,max:100},tooltip:{theme:"dark",fixed:{enabled:!1},x:{show:!1},y:{title:{formatter:()=>"会话总数"}},marker:{show:!1}}})),c={series:[{name:"series1",data:[45,66,41,89,25,44,9,54]}]},l=C(()=>({chart:{type:"bar",height:90,fontFamily:"inherit",foreColor:"#a1aab2",sparkline:{enabled:!0}},dataLabels:{enabled:!1},colors:["#fff"],fill:{type:"solid",opacity:1},stroke:{curve:"smooth",width:3},yaxis:{min:0,max:100},tooltip:{theme:"dark",fixed:{enabled:!1},x:{show:!1},y:{title:{formatter:()=>"会话总数"}},marker:{show:!1}}})),r={series:[{name:"series1",data:[35,44,9,54,45,66,41,69]}]};return(n,i)=>{const g=u("apexchart");return _(),f(b,{elevation:"0",class:"bg-primary overflow-hidden bubble-shape bubble-primary-shape"},{default:e(()=>[t(w,null,{default:e(()=>[a("div",tt,[t(p,{icon:"",rounded:"sm",color:"darkprimary",variant:"flat"},{default:e(()=>[t($,{icon:"mdi-account-multiple-outline"})]),_:1}),a("div",et,[t(G,{modelValue:o.value,"onUpdate:modelValue":i[0]||(i[0]=v=>o.value=v),class:"theme-tab",density:"compact",end:""},{default:e(()=>[t(O,{value:"1","hide-slider":"",color:"transparent"},{default:e(()=>[y("按日")]),_:1}),t(O,{value:"2","hide-slider":"",color:"transparent"},{default:e(()=>[y("按月")]),_:1})]),_:1},8,["modelValue"])])]),t(H,{modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=v=>o.value=v),class:"z-1"},{default:e(()=>[t(L,{value:"1"},{default:e(()=>[t(k,null,{default:e(()=>[t(m,{cols:"6"},{default:e(()=>[a("h2",at,h(n.session_total),1),st]),_:1}),t(m,{cols:"6"},{default:e(()=>[t(g,{type:"line",height:"90",options:d.value,series:c.series},null,8,["options","series"])]),_:1})]),_:1})]),_:1}),t(L,{value:"2"},{default:e(()=>[t(k,null,{default:e(()=>[t(m,{cols:"6"},{default:e(()=>[a("h2",ot,h(n.session_total),1),lt]),_:1}),t(m,{cols:"6"},{default:e(()=>[t(g,{type:"line",height:"90",options:l.value,series:r.series},null,8,["options","series"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})}}}),rt={name:"OnlineTime",components:{},props:["stat"],watch:{stat:{handler:function(s,o){this.memory=s.sys_perf.memory,this.runtime_str=s.sys_start_time;let d=new Date().getTime(),c=new Date(s.sys_start_time*1e3).getTime(),l=d-c,r=Math.floor(l/(24*3600*1e3)),n=l%(24*3600*1e3),i=Math.floor(n/(3600*1e3)),g=n%(3600*1e3),v=Math.floor(g/(60*1e3)),T=g%(60*1e3),R=Math.round(T/1e3);this.runtime_str=r+"天"+i+"小时"+v+"分"+R+"秒"},deep:!0}},data:()=>({_stat:{},memory:"Loading",runtime_str:"Loading"}),mounted(){}},dt={class:"d-flex align-centLine truncated
@@ -1 +1 @@
import{_ as t}from"./_plugin-vue_export-helper-c27b6911.js";import{o,c,w as s,V as i,a as r,b as e,d as l,e as a,f as d}from"./index-7c8bc001.js";const n="/assets/img-error-bg-ab6474a0.svg",_="/assets/img-error-blue-2675a7a9.svg",m="/assets/img-error-text-a6aebfa0.svg",g="/assets/img-error-purple-edee3fbc.svg";const p={},u={class:"text-center"},f=e("div",{class:"CardMediaWrapper"},[e("img",{src:n,alt:"grid",class:"w-100"}),e("img",{src:_,alt:"grid",class:"CardMediaParts"}),e("img",{src:m,alt:"build",class:"CardMediaBuild"}),e("img",{src:g,alt:"build",class:"CardMediaBuild"})],-1),h=e("h1",{class:"text-h1"},"Something is wrong",-1),v=e("p",null,[e("small",null,[a("The page you are looking was moved, removed, "),e("br"),a("renamed, or might never exist! ")])],-1);function x(b,V){return o(),c(i,{"no-gutters":"",class:"h-100vh"},{default:s(()=>[r(d,{class:"d-flex align-center justify-center"},{default:s(()=>[e("div",u,[f,h,v,r(l,{variant:"flat",color:"primary",class:"mt-4",to:"/","prepend-icon":"mdi-home"},{default:s(()=>[a(" Home")]),_:1})])]),_:1})]),_:1})}const C=t(p,[["render",x]]);export{C as default};
import{_ as t}from"./_plugin-vue_export-helper-c27b6911.js";import{o,c,w as s,V as i,a as r,b as e,d as l,e as a,f as d}from"./index-f71951bf.js";const n="/assets/img-error-bg-ab6474a0.svg",_="/assets/img-error-blue-2675a7a9.svg",m="/assets/img-error-text-a6aebfa0.svg",g="/assets/img-error-purple-edee3fbc.svg";const p={},u={class:"text-center"},f=e("div",{class:"CardMediaWrapper"},[e("img",{src:n,alt:"grid",class:"w-100"}),e("img",{src:_,alt:"grid",class:"CardMediaParts"}),e("img",{src:m,alt:"build",class:"CardMediaBuild"}),e("img",{src:g,alt:"build",class:"CardMediaBuild"})],-1),h=e("h1",{class:"text-h1"},"Something is wrong",-1),v=e("p",null,[e("small",null,[a("The page you are looking was moved, removed, "),e("br"),a("renamed, or might never exist! ")])],-1);function x(b,V){return o(),c(i,{"no-gutters":"",class:"h-100vh"},{default:s(()=>[r(d,{class:"d-flex align-center justify-center"},{default:s(()=>[e("div",u,[f,h,v,r(l,{variant:"flat",color:"primary",class:"mt-4",to:"/","prepend-icon":"mdi-home"},{default:s(()=>[a(" Home")]),_:1})])]),_:1})]),_:1})}const C=t(p,[["render",x]]);export{C as default};
@@ -1 +1 @@
import{x as b,o as d,c as h,w as e,a,a6 as C,b as i,K as x,e as o,t as u,G as m,d as r,A as E,L as V,a7 as y,J as w,s as p,f as c,F as f,u as $,V as k,q as S,N as B,O as N,P as T,H as j,a8 as D,R as g,j as F}from"./index-7c8bc001.js";const G={class:"d-sm-flex align-center justify-space-between"},v=b({__name:"ExtensionCard",props:{title:String,link:String},setup(n){const s=n,l=t=>{window.open(t,"_blank")};return(t,_)=>(d(),h(w,{variant:"outlined",elevation:"0",class:"withbg"},{default:e(()=>[a(C,{style:{padding:"10px 20px"}},{default:e(()=>[i("div",G,[a(x,null,{default:e(()=>[o(u(s.title),1)]),_:1}),a(m),a(r,{icon:"mdi-link",variant:"plain",onClick:_[0]||(_[0]=z=>l(s.link))})])]),_:1}),a(E),a(V,null,{default:e(()=>[y(t.$slots,"default")]),_:3})]),_:3}))}}),P=i("div",{style:{"background-color":"white",width:"100%",padding:"16px","border-radius":"10px"}},[i("h3",null,"🧩 已安装的插件")],-1),U={style:{"min-height":"180px","max-height":"180px",overflow:"hidden"}},q={class:"d-flex align-center gap-3"},A=i("div",{style:{"background-color":"white",width:"100%",padding:"16px","border-radius":"10px"}},[i("h3",null,"🧩 插件市场 [待开发]")],-1),I=i("span",{class:"text-h5"},"从 Git 仓库链接安装插件",-1),L=i("small",null,"github, gitee, gitlab 等公开的仓库都行。",-1),O=i("br",null,null,-1),R={name:"ExtensionPage",components:{ExtensionCard:v},data(){return{extension_data:{data:[]},save_message_snack:!1,save_message:"",save_message_success:"",extension_url:"",status:"",dialog:!1,snack_message:"",snack_show:!1,snack_success:"success",install_loading:!1,uninstall_loading:!1}},mounted(){this.getExtensions()},methods:{getExtensions(){g.get("/api/extensions").then(n=>{this.extension_data.data=n.data.data,console.log(this.extension_data)})},newExtension(){this.install_loading=!0,console.log(this.install_loading),g.post("/api/extensions/install",{url:this.extension_url}).then(n=>{if(this.install_loading=!1,n.data.status==="error"){this.snack_message=n.data.message,this.snack_show=!0,this.snack_success="error";return}this.extension_data.data=n.data.data,console.log(this.extension_data),this.extension_url="",this.snack_message=n.data.message,this.snack_show=!0,this.snack_success="success",this.dialog=!1,this.getExtensions()}).catch(n=>{this.install_loading=!1,this.snack_message=n,this.snack_show=!0,this.snack_success="error"})},uninstallExtension(n){this.uninstall_loading=!0,g.post("/api/extensions/uninstall",{name:n}).then(s=>{if(this.uninstall_loading=!1,s.data.status==="error"){this.snack_message=s.data.message,this.snack_show=!0,this.snack_success="error";return}this.extension_data.data=s.data.data,console.log(this.extension_data),this.snack_message=s.data.message,this.snack_show=!0,this.snack_success="success",this.dialog=!1,this.getExtensions()}).catch(s=>{this.uninstall_loading=!1,this.snack_message=s,this.snack_show=!0,this.snack_success="error"})}}},J=Object.assign(R,{setup(n){return(s,l)=>(d(),p(f,null,[a(k,null,{default:e(()=>[a(c,{cols:"12",md:"12"},{default:e(()=>[P]),_:1}),(d(!0),p(f,null,$(s.extension_data.data,t=>(d(),h(c,{cols:"12",md:"6",lg:"4"},{default:e(()=>[(d(),h(v,{key:t.name,title:t.name,link:t.repo,style:{"margin-bottom":"16px"}},{default:e(()=>[i("p",U,u(t.desc),1),i("div",q,[a(F,null,{default:e(()=>[o("mdi-account")]),_:1}),i("span",null,u(t.author),1),a(m),a(r,{variant:"plain",onClick:_=>s.uninstallExtension(t.name),loading:s.uninstall_loading},{default:e(()=>[o("卸 载")]),_:2},1032,["onClick","loading"])])]),_:2},1032,["title","link"]))]),_:2},1024))),256)),a(c,{cols:"12",md:"12"},{default:e(()=>[A]),_:1})]),_:1}),a(j,{modelValue:s.dialog,"onUpdate:modelValue":l[3]||(l[3]=t=>s.dialog=t),persistent:"",width:"700"},{activator:e(({props:t})=>[a(r,S(t,{icon:"mdi-plus",size:"x-large",style:{position:"fixed",right:"52px",bottom:"52px"},color:"darkprimary"}),null,16)]),default:e(()=>[a(w,null,{default:e(()=>[a(x,null,{default:e(()=>[I]),_:1}),a(V,null,{default:e(()=>[a(B,null,{default:e(()=>[a(k,null,{default:e(()=>[a(c,{cols:"12"},{default:e(()=>[a(N,{label:"Git 库链接",modelValue:s.extension_url,"onUpdate:modelValue":l[0]||(l[0]=t=>s.extension_url=t),required:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),L,O,i("small",null,u(s.status),1)]),_:1}),a(T,null,{default:e(()=>[a(m),a(r,{color:"blue-darken-1",variant:"text",onClick:l[1]||(l[1]=t=>s.dialog=!1)},{default:e(()=>[o(" 关闭 ")]),_:1}),a(r,{color:"blue-darken-1",variant:"text",loading:s.install_loading,onClick:l[2]||(l[2]=t=>s.newExtension(s.extension_url))},{default:e(()=>[o(" 安装 ")]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a(D,{timeout:2e3,elevation:"24",color:s.snack_success,modelValue:s.snack_show,"onUpdate:modelValue":l[4]||(l[4]=t=>s.snack_show=t)},{default:e(()=>[o(u(s.snack_message),1)]),_:1},8,["color","modelValue"])],64))}});export{J as default};
import{x as b,o as d,c as h,w as e,a,a6 as C,b as i,K as x,e as o,t as u,G as m,d as r,A as E,L as V,a7 as y,J as w,s as p,f as c,F as f,u as $,V as k,q as S,N as B,O as N,P as T,H as j,a8 as D,R as g,j as F}from"./index-f71951bf.js";const G={class:"d-sm-flex align-center justify-space-between"},v=b({__name:"ExtensionCard",props:{title:String,link:String},setup(n){const s=n,l=t=>{window.open(t,"_blank")};return(t,_)=>(d(),h(w,{variant:"outlined",elevation:"0",class:"withbg"},{default:e(()=>[a(C,{style:{padding:"10px 20px"}},{default:e(()=>[i("div",G,[a(x,null,{default:e(()=>[o(u(s.title),1)]),_:1}),a(m),a(r,{icon:"mdi-link",variant:"plain",onClick:_[0]||(_[0]=z=>l(s.link))})])]),_:1}),a(E),a(V,null,{default:e(()=>[y(t.$slots,"default")]),_:3})]),_:3}))}}),P=i("div",{style:{"background-color":"white",width:"100%",padding:"16px","border-radius":"10px"}},[i("h3",null,"🧩 已安装的插件")],-1),U={style:{"min-height":"180px","max-height":"180px",overflow:"hidden"}},q={class:"d-flex align-center gap-3"},A=i("div",{style:{"background-color":"white",width:"100%",padding:"16px","border-radius":"10px"}},[i("h3",null,"🧩 插件市场 [待开发]")],-1),I=i("span",{class:"text-h5"},"从 Git 仓库链接安装插件",-1),L=i("small",null,"github, gitee, gitlab 等公开的仓库都行。",-1),O=i("br",null,null,-1),R={name:"ExtensionPage",components:{ExtensionCard:v},data(){return{extension_data:{data:[]},save_message_snack:!1,save_message:"",save_message_success:"",extension_url:"",status:"",dialog:!1,snack_message:"",snack_show:!1,snack_success:"success",install_loading:!1,uninstall_loading:!1}},mounted(){this.getExtensions()},methods:{getExtensions(){g.get("/api/extensions").then(n=>{this.extension_data.data=n.data.data,console.log(this.extension_data)})},newExtension(){this.install_loading=!0,console.log(this.install_loading),g.post("/api/extensions/install",{url:this.extension_url}).then(n=>{if(this.install_loading=!1,n.data.status==="error"){this.snack_message=n.data.message,this.snack_show=!0,this.snack_success="error";return}this.extension_data.data=n.data.data,console.log(this.extension_data),this.extension_url="",this.snack_message=n.data.message,this.snack_show=!0,this.snack_success="success",this.dialog=!1,this.getExtensions()}).catch(n=>{this.install_loading=!1,this.snack_message=n,this.snack_show=!0,this.snack_success="error"})},uninstallExtension(n){this.uninstall_loading=!0,g.post("/api/extensions/uninstall",{name:n}).then(s=>{if(this.uninstall_loading=!1,s.data.status==="error"){this.snack_message=s.data.message,this.snack_show=!0,this.snack_success="error";return}this.extension_data.data=s.data.data,console.log(this.extension_data),this.snack_message=s.data.message,this.snack_show=!0,this.snack_success="success",this.dialog=!1,this.getExtensions()}).catch(s=>{this.uninstall_loading=!1,this.snack_message=s,this.snack_show=!0,this.snack_success="error"})}}},J=Object.assign(R,{setup(n){return(s,l)=>(d(),p(f,null,[a(k,null,{default:e(()=>[a(c,{cols:"12",md:"12"},{default:e(()=>[P]),_:1}),(d(!0),p(f,null,$(s.extension_data.data,t=>(d(),h(c,{cols:"12",md:"6",lg:"4"},{default:e(()=>[(d(),h(v,{key:t.name,title:t.name,link:t.repo,style:{"margin-bottom":"16px"}},{default:e(()=>[i("p",U,u(t.desc),1),i("div",q,[a(F,null,{default:e(()=>[o("mdi-account")]),_:1}),i("span",null,u(t.author),1),a(m),a(r,{variant:"plain",onClick:_=>s.uninstallExtension(t.name),loading:s.uninstall_loading},{default:e(()=>[o("卸 载")]),_:2},1032,["onClick","loading"])])]),_:2},1032,["title","link"]))]),_:2},1024))),256)),a(c,{cols:"12",md:"12"},{default:e(()=>[A]),_:1})]),_:1}),a(j,{modelValue:s.dialog,"onUpdate:modelValue":l[3]||(l[3]=t=>s.dialog=t),persistent:"",width:"700"},{activator:e(({props:t})=>[a(r,S(t,{icon:"mdi-plus",size:"x-large",style:{position:"fixed",right:"52px",bottom:"52px"},color:"darkprimary"}),null,16)]),default:e(()=>[a(w,null,{default:e(()=>[a(x,null,{default:e(()=>[I]),_:1}),a(V,null,{default:e(()=>[a(B,null,{default:e(()=>[a(k,null,{default:e(()=>[a(c,{cols:"12"},{default:e(()=>[a(N,{label:"Git 库链接",modelValue:s.extension_url,"onUpdate:modelValue":l[0]||(l[0]=t=>s.extension_url=t),required:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),L,O,i("small",null,u(s.status),1)]),_:1}),a(T,null,{default:e(()=>[a(m),a(r,{color:"blue-darken-1",variant:"text",onClick:l[1]||(l[1]=t=>s.dialog=!1)},{default:e(()=>[o(" 关闭 ")]),_:1}),a(r,{color:"blue-darken-1",variant:"text",loading:s.install_loading,onClick:l[2]||(l[2]=t=>s.newExtension(s.extension_url))},{default:e(()=>[o(" 安装 ")]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a(D,{timeout:2e3,elevation:"24",color:s.snack_success,modelValue:s.snack_show,"onUpdate:modelValue":l[4]||(l[4]=t=>s.snack_show=t)},{default:e(()=>[o(u(s.snack_message),1)]),_:1},8,["color","modelValue"])],64))}});export{J as default};
@@ -1 +1 @@
import{o as s,c as i,w as t,e as v,t as h,g as F,h as q,a as e,i as A,j as g,k as w,l as D,m as R,n as E,r as I,p as M,q as P,s as k,F as y,u as j,v as G,x as z,y as W,b as _,z as H,A as J,B as o,C as K,D as b,d as V,E as N,M as B,G as T,H as Q,I as C,J as X,K as Y,L as Z,N as O,V as ee,f as te,O as L,P as ae,Q as le,R as se,S as ie,T as ne,U as oe,W as re,X as ue,Y as de}from"./index-7c8bc001.js";import{_ as ce,u as S}from"./LogoDark.vue_vue_type_script_setup_true_lang-4faa128a.js";import{m as $}from"./md5-c4ed0ff4.js";const me=[{title:"面板",icon:"mdi-view-dashboard",to:"/dashboard/default"},{title:"配置",icon:"mdi-cog",to:"/config"},{title:"插件",icon:"mdi-puzzle",to:"/extension"},{title:"控制台",icon:"mdi-console",to:"/console"}],fe={__name:"NavGroup",props:{item:Object},setup(a){const l=a;return(n,r)=>(s(),i(F,{color:"darkText",class:"smallCap"},{default:t(()=>[v(h(l.item.header),1)]),_:1}))}},U={__name:"NavItem",props:{item:Object,level:Number},setup(a){return(l,n)=>(s(),i(E,{to:a.item.type==="external"?"":a.item.to,href:a.item.type==="external"?a.item.to:"",rounded:"",class:"mb-1",color:"secondary",disabled:a.item.disabled,target:a.item.type==="external"?"_blank":""},q({prepend:t(()=>[a.item.icon?(s(),i(g,{key:0,color:a.item.iconColor,size:a.item.iconSize,class:"hide-menu",icon:a.item.icon},null,8,["color","size","icon"])):w("",!0)]),default:t(()=>[e(D,null,{default:t(()=>[v(h(a.item.title),1)]),_:1}),a.item.subCaption?(s(),i(R,{key:0,class:"text-caption mt-n1 hide-menu"},{default:t(()=>[v(h(a.item.subCaption),1)]),_:1})):w("",!0)]),_:2},[a.item.chip?{name:"append",fn:t(()=>[e(A,{color:a.item.chipColor,class:"sidebarchip hide-menu",size:a.item.chipIcon?"small":"default",variant:a.item.chipVariant,"prepend-icon":a.item.chipIcon},{default:t(()=>[v(h(a.item.chip),1)]),_:1},8,["color","size","variant","prepend-icon"])]),key:"0"}:void 0]),1032,["to","href","disabled","target"]))}},pe={__name:"IconSet",props:{item:Object,level:Number},setup(a){const l=a;return(n,r)=>l.level>0?(s(),i(I(l.item),{key:0,size:"5",fill:"currentColor","stroke-width":"1.5",class:"iconClass"})):(s(),i(I(l.item),{key:1,size:"20","stroke-width":"1.5",class:"iconClass"}))}},ve={__name:"NavCollapse",props:{item:Object,level:Number},setup(a){const l=a;return(n,r)=>{const u=M("NavCollapse",!0);return s(),i(G,{"no-action":""},{activator:t(({props:f})=>[e(E,P(f,{value:a.item.title,rounded:"",class:"mb-1",color:"secondary"}),{prepend:t(()=>[e(pe,{item:a.item.icon,level:a.level},null,8,["item","level"])]),default:t(()=>[e(D,{class:"mr-auto"},{default:t(()=>[v(h(a.item.title),1)]),_:1}),a.item.subCaption?(s(),i(R,{key:0,class:"text-caption mt-n1 hide-menu"},{default:t(()=>[v(h(a.item.subCaption),1)]),_:1})):w("",!0)]),_:2},1040,["value"])]),default:t(()=>[(s(!0),k(y,null,j(a.item.children,(f,d)=>(s(),k(y,{key:d},[f.children?(s(),i(u,{key:0,item:f,level:l.level+1},null,8,["item","level"])):(s(),i(U,{key:1,item:f,level:l.level+1},null,8,["item","level"]))],64))),128))]),_:1})}}},he={__name:"LogoMain",setup(a){return(l,n)=>(s(),i(ce))}},_e={class:"pa-5"},Ve={class:"pa-4 text-center"},be=z({__name:"VerticalSidebar",setup(a){const l=S(),n=W(me);return(r,u)=>{const f=M("perfect-scrollbar");return s(),i(K,{left:"",modelValue:o(l).Sidebar_drawer,"onUpdate:modelValue":u[0]||(u[0]=d=>o(l).Sidebar_drawer=d),elevation:"0","rail-width":"105","mobile-breakpoint":"960",app:"",class:"leftSidebar",rail:o(l).mini_sidebar,"expand-on-hover":""},{default:t(()=>[_("div",_e,[e(he)]),e(f,{class:"scrollnavbar"},{default:t(()=>[e(H,{class:"pa-4"},{default:t(()=>[(s(!0),k(y,null,j(n.value,(d,x)=>(s(),k(y,{key:x},[d.header?(s(),i(fe,{item:d,key:d.title},null,8,["item"])):d.divider?(s(),i(J,{key:1,class:"my-3"})):d.children?(s(),i(ve,{key:2,class:"leftPadding",item:d,level:0},null,8,["item"])):(s(),i(U,{key:3,item:d,class:"leftPadding"},null,8,["item"]))],64))),128))]),_:1}),_("div",Ve,[e(A,{color:"inputBorder",size:"small"},{default:t(()=>[v(" v1.0.0 ")]),_:1})])]),_:1})]),_:1},8,["modelValue","rail"])}}}),Ce=_("span",{class:"text-h5"},"密码修改",-1),ke=_("small",null,"如果是第一次修改密码,原密码请留空。",-1),ye=_("br",null,null,-1),xe=z({__name:"VerticalHeader",setup(a){const l=S();b(!1);let n=b(!1),r=b(""),u=b(""),f=b("");const d=p=>{window.open(p,"_blank")};function x(){r.value!=""&&(r.value=$.md5(r.value)),u.value=$.md5(u.value),se.post("/api/change_password",{password:r.value,new_password:u.value}).then(p=>{if(p.data.status=="error"){f.value=p.data.message,r.value="",u.value="";return}n.value=!n.value,f.value=p.data.message,setTimeout(()=>{ie().logout()},1e3)}).catch(p=>{console.log(p),f.value=p,r.value="",u.value=""})}return(p,c)=>(s(),i(le,{elevation:"0",height:"80"},{default:t(()=>[e(V,{class:"hidden-md-and-down text-secondary",color:"lightsecondary",icon:"",rounded:"sm",variant:"flat",onClick:c[0]||(c[0]=N(m=>o(l).SET_MINI_SIDEBAR(!o(l).mini_sidebar),["stop"])),size:"small"},{default:t(()=>[e(o(B),{size:"20","stroke-width":"1.5"Line truncated
import{o as s,c as i,w as t,e as v,t as h,g as F,h as q,a as e,i as A,j as g,k as w,l as D,m as R,n as E,r as I,p as M,q as P,s as k,F as y,u as j,v as G,x as z,y as W,b as _,z as H,A as J,B as o,C as K,D as b,d as V,E as N,M as B,G as T,H as Q,I as C,J as X,K as Y,L as Z,N as O,V as ee,f as te,O as L,P as ae,Q as le,R as se,S as ie,T as ne,U as oe,W as re,X as ue,Y as de}from"./index-f71951bf.js";import{_ as ce,u as S}from"./LogoDark.vue_vue_type_script_setup_true_lang-fb0b037c.js";import{m as $}from"./md5-0015f538.js";const me=[{title:"面板",icon:"mdi-view-dashboard",to:"/dashboard/default"},{title:"配置",icon:"mdi-cog",to:"/config"},{title:"插件",icon:"mdi-puzzle",to:"/extension"},{title:"控制台",icon:"mdi-console",to:"/console"}],fe={__name:"NavGroup",props:{item:Object},setup(a){const l=a;return(n,r)=>(s(),i(F,{color:"darkText",class:"smallCap"},{default:t(()=>[v(h(l.item.header),1)]),_:1}))}},U={__name:"NavItem",props:{item:Object,level:Number},setup(a){return(l,n)=>(s(),i(E,{to:a.item.type==="external"?"":a.item.to,href:a.item.type==="external"?a.item.to:"",rounded:"",class:"mb-1",color:"secondary",disabled:a.item.disabled,target:a.item.type==="external"?"_blank":""},q({prepend:t(()=>[a.item.icon?(s(),i(g,{key:0,color:a.item.iconColor,size:a.item.iconSize,class:"hide-menu",icon:a.item.icon},null,8,["color","size","icon"])):w("",!0)]),default:t(()=>[e(D,null,{default:t(()=>[v(h(a.item.title),1)]),_:1}),a.item.subCaption?(s(),i(R,{key:0,class:"text-caption mt-n1 hide-menu"},{default:t(()=>[v(h(a.item.subCaption),1)]),_:1})):w("",!0)]),_:2},[a.item.chip?{name:"append",fn:t(()=>[e(A,{color:a.item.chipColor,class:"sidebarchip hide-menu",size:a.item.chipIcon?"small":"default",variant:a.item.chipVariant,"prepend-icon":a.item.chipIcon},{default:t(()=>[v(h(a.item.chip),1)]),_:1},8,["color","size","variant","prepend-icon"])]),key:"0"}:void 0]),1032,["to","href","disabled","target"]))}},pe={__name:"IconSet",props:{item:Object,level:Number},setup(a){const l=a;return(n,r)=>l.level>0?(s(),i(I(l.item),{key:0,size:"5",fill:"currentColor","stroke-width":"1.5",class:"iconClass"})):(s(),i(I(l.item),{key:1,size:"20","stroke-width":"1.5",class:"iconClass"}))}},ve={__name:"NavCollapse",props:{item:Object,level:Number},setup(a){const l=a;return(n,r)=>{const u=M("NavCollapse",!0);return s(),i(G,{"no-action":""},{activator:t(({props:f})=>[e(E,P(f,{value:a.item.title,rounded:"",class:"mb-1",color:"secondary"}),{prepend:t(()=>[e(pe,{item:a.item.icon,level:a.level},null,8,["item","level"])]),default:t(()=>[e(D,{class:"mr-auto"},{default:t(()=>[v(h(a.item.title),1)]),_:1}),a.item.subCaption?(s(),i(R,{key:0,class:"text-caption mt-n1 hide-menu"},{default:t(()=>[v(h(a.item.subCaption),1)]),_:1})):w("",!0)]),_:2},1040,["value"])]),default:t(()=>[(s(!0),k(y,null,j(a.item.children,(f,d)=>(s(),k(y,{key:d},[f.children?(s(),i(u,{key:0,item:f,level:l.level+1},null,8,["item","level"])):(s(),i(U,{key:1,item:f,level:l.level+1},null,8,["item","level"]))],64))),128))]),_:1})}}},he={__name:"LogoMain",setup(a){return(l,n)=>(s(),i(ce))}},_e={class:"pa-5"},Ve={class:"pa-4 text-center"},be=z({__name:"VerticalSidebar",setup(a){const l=S(),n=W(me);return(r,u)=>{const f=M("perfect-scrollbar");return s(),i(K,{left:"",modelValue:o(l).Sidebar_drawer,"onUpdate:modelValue":u[0]||(u[0]=d=>o(l).Sidebar_drawer=d),elevation:"0","rail-width":"105","mobile-breakpoint":"960",app:"",class:"leftSidebar",rail:o(l).mini_sidebar,"expand-on-hover":""},{default:t(()=>[_("div",_e,[e(he)]),e(f,{class:"scrollnavbar"},{default:t(()=>[e(H,{class:"pa-4"},{default:t(()=>[(s(!0),k(y,null,j(n.value,(d,x)=>(s(),k(y,{key:x},[d.header?(s(),i(fe,{item:d,key:d.title},null,8,["item"])):d.divider?(s(),i(J,{key:1,class:"my-3"})):d.children?(s(),i(ve,{key:2,class:"leftPadding",item:d,level:0},null,8,["item"])):(s(),i(U,{key:3,item:d,class:"leftPadding"},null,8,["item"]))],64))),128))]),_:1}),_("div",Ve,[e(A,{color:"inputBorder",size:"small"},{default:t(()=>[v(" v1.0.0 ")]),_:1})])]),_:1})]),_:1},8,["modelValue","rail"])}}}),Ce=_("span",{class:"text-h5"},"密码修改",-1),ke=_("small",null,"如果是第一次修改密码,原密码请留空。",-1),ye=_("br",null,null,-1),xe=z({__name:"VerticalHeader",setup(a){const l=S();b(!1);let n=b(!1),r=b(""),u=b(""),f=b("");const d=p=>{window.open(p,"_blank")};function x(){r.value!=""&&(r.value=$.md5(r.value)),u.value=$.md5(u.value),se.post("/api/change_password",{password:r.value,new_password:u.value}).then(p=>{if(p.data.status=="error"){f.value=p.data.message,r.value="",u.value="";return}n.value=!n.value,f.value=p.data.message,setTimeout(()=>{ie().logout()},1e3)}).catch(p=>{console.log(p),f.value=p,r.value="",u.value=""})}return(p,c)=>(s(),i(le,{elevation:"0",height:"80"},{default:t(()=>[e(V,{class:"hidden-md-and-down text-secondary",color:"lightsecondary",icon:"",rounded:"sm",variant:"flat",onClick:c[0]||(c[0]=N(m=>o(l).SET_MINI_SIDEBAR(!o(l).mini_sidebar),["stop"])),size:"small"},{default:t(()=>[e(o(B),{size:"20","stroke-width":"1.5"Line truncated
@@ -1,4 +1,4 @@
import{_ as _t}from"./LogoDark.vue_vue_type_script_setup_true_lang-4faa128a.js";import{x as ke,ad as we,r as Ot,ae as Vt,D as A,af as Ne,a0 as P,B as I,ag as Q,ah as St,I as Be,ai as Ie,aj as Et,ak as jt,al as At,am as G,y as wt,o as Re,c as tt,w as C,a as j,O as qe,b as ge,an as Ft,d as Pt,e as Ge,s as Ct,ao as Tt,t as Nt,k as Bt,S as It,f as Fe,N as Rt,V as Pe,J as Ye,L as kt}from"./index-7c8bc001.js";import{a as Mt}from"./md5-c4ed0ff4.js";/**
import{_ as _t}from"./LogoDark.vue_vue_type_script_setup_true_lang-fb0b037c.js";import{x as ke,ad as we,r as Ot,ae as Vt,D as A,af as Ne,a0 as P,B as I,ag as Q,ah as St,I as Be,ai as Ie,aj as Et,ak as jt,al as At,am as G,y as wt,o as Re,c as tt,w as C,a as j,O as qe,b as ge,an as Ft,d as Pt,e as Ge,s as Ct,ao as Tt,t as Nt,k as Bt,S as It,f as Fe,N as Rt,V as Pe,J as Ye,L as kt}from"./index-f71951bf.js";import{a as Mt}from"./md5-0015f538.js";/**
* vee-validate v4.11.3
* (c) 2023 Abdelrahman Awad
* @license MIT
@@ -1 +1 @@
import{at as _,x as d,D as n,o as c,s as m,a as f,w as p,au as r,b as a,av as o,B as t,aw as h}from"./index-7c8bc001.js";const s={Sidebar_drawer:!0,Customizer_drawer:!1,mini_sidebar:!1,fontTheme:"Roboto",inputBg:!1},l=_({id:"customizer",state:()=>({Sidebar_drawer:s.Sidebar_drawer,Customizer_drawer:s.Customizer_drawer,mini_sidebar:s.mini_sidebar,fontTheme:"Poppins",inputBg:s.inputBg}),getters:{},actions:{SET_SIDEBAR_DRAWER(){this.Sidebar_drawer=!this.Sidebar_drawer},SET_MINI_SIDEBAR(e){this.mini_sidebar=e},SET_FONT(e){this.fontTheme=e}}}),u={class:"logo",style:{display:"flex","align-items":"center"}},b={style:{"font-size":"24px","font-weight":"1000"}},w={style:{"font-size":"20px","font-weight":"1000"}},S={style:{"font-size":"20px"}},z=d({__name:"LogoDark",setup(e){n("rgb(var(--v-theme-primary))"),n("rgb(var(--v-theme-secondary))");const i=l();return(g,B)=>(c(),m("div",u,[f(t(h),{to:"/",style:{"text-decoration":"none",color:"black"}},{default:p(()=>[r(a("span",b,"AstrBot 仪表盘",512),[[o,!t(i).mini_sidebar]]),r(a("span",w,"Astr",512),[[o,t(i).mini_sidebar]]),r(a("span",S,"Bot",512),[[o,t(i).mini_sidebar]])]),_:1})]))}});export{z as _,l as u};
import{at as _,x as d,D as n,o as c,s as m,a as f,w as p,au as r,b as a,av as o,B as t,aw as h}from"./index-f71951bf.js";const s={Sidebar_drawer:!0,Customizer_drawer:!1,mini_sidebar:!1,fontTheme:"Roboto",inputBg:!1},l=_({id:"customizer",state:()=>({Sidebar_drawer:s.Sidebar_drawer,Customizer_drawer:s.Customizer_drawer,mini_sidebar:s.mini_sidebar,fontTheme:"Poppins",inputBg:s.inputBg}),getters:{},actions:{SET_SIDEBAR_DRAWER(){this.Sidebar_drawer=!this.Sidebar_drawer},SET_MINI_SIDEBAR(e){this.mini_sidebar=e},SET_FONT(e){this.fontTheme=e}}}),u={class:"logo",style:{display:"flex","align-items":"center"}},b={style:{"font-size":"24px","font-weight":"1000"}},w={style:{"font-size":"20px","font-weight":"1000"}},S={style:{"font-size":"20px"}},z=d({__name:"LogoDark",setup(e){n("rgb(var(--v-theme-primary))"),n("rgb(var(--v-theme-secondary))");const i=l();return(g,B)=>(c(),m("div",u,[f(t(h),{to:"/",style:{"text-decoration":"none",color:"black"}},{default:p(()=>[r(a("span",b,"AstrBot 仪表盘",512),[[o,!t(i).mini_sidebar]]),r(a("span",w,"Astr",512),[[o,t(i).mini_sidebar]]),r(a("span",S,"Bot",512),[[o,t(i).mini_sidebar]])]),_:1})]))}});export{z as _,l as u};
@@ -1 +1 @@
import{_ as o}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-89ca5198.js";import{_ as i}from"./UiParentCard.vue_vue_type_script_setup_true_lang-03a5c441.js";import{x as n,D as a,o as c,s as m,a as e,w as t,f as d,b as f,V as _,F as u}from"./index-7c8bc001.js";const p=["innerHTML"],v=n({__name:"MaterialIcons",setup(b){const s=a({title:"Material Icons"}),r=a('<iframe src="https://materialdesignicons.com/" frameborder="0" width="100%" height="1000"></iframe>'),l=a([{title:"Icons",disabled:!1,href:"#"},{title:"Material Icons",disabled:!0,href:"#"}]);return(h,M)=>(c(),m(u,null,[e(o,{title:s.value.title,breadcrumbs:l.value},null,8,["title","breadcrumbs"]),e(_,null,{default:t(()=>[e(d,{cols:"12",md:"12"},{default:t(()=>[e(i,{title:"Material Icons"},{default:t(()=>[f("div",{innerHTML:r.value},null,8,p)]),_:1})]),_:1})]),_:1})],64))}});export{v as default};
import{_ as o}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-2b6e2e87.js";import{_ as i}from"./UiParentCard.vue_vue_type_script_setup_true_lang-820f34f1.js";import{x as n,D as a,o as c,s as m,a as e,w as t,f as d,b as f,V as _,F as u}from"./index-f71951bf.js";const p=["innerHTML"],v=n({__name:"MaterialIcons",setup(b){const s=a({title:"Material Icons"}),r=a('<iframe src="https://materialdesignicons.com/" frameborder="0" width="100%" height="1000"></iframe>'),l=a([{title:"Icons",disabled:!1,href:"#"},{title:"Material Icons",disabled:!0,href:"#"}]);return(h,M)=>(c(),m(u,null,[e(o,{title:s.value.title,breadcrumbs:l.value},null,8,["title","breadcrumbs"]),e(_,null,{default:t(()=>[e(d,{cols:"12",md:"12"},{default:t(()=>[e(i,{title:"Material Icons"},{default:t(()=>[f("div",{innerHTML:r.value},null,8,p)]),_:1})]),_:1})]),_:1})],64))}});export{v as default};
@@ -1 +1 @@
import{_ as B}from"./LogoDark.vue_vue_type_script_setup_true_lang-4faa128a.js";import{x as y,D as o,o as b,s as U,a as e,w as a,b as n,B as $,d as u,f as d,A as _,e as f,V as r,O as m,an as A,as as E,F,c as T,N as q,J as V,L as P}from"./index-7c8bc001.js";const z="/assets/social-google-a359a253.svg",N=["src"],S=n("span",{class:"ml-2"},"Sign up with Google",-1),D=n("h5",{class:"text-h5 text-center my-4 mb-8"},"Sign up with Email address",-1),G={class:"d-sm-inline-flex align-center mt-2 mb-7 mb-sm-0 font-weight-bold"},L=n("a",{href:"#",class:"ml-1 text-lightText"},"Terms and Condition",-1),O={class:"mt-5 text-right"},j=y({__name:"AuthRegister",setup(w){const c=o(!1),i=o(!1),p=o(""),v=o(""),g=o(),h=o(""),x=o(""),k=o([s=>!!s||"Password is required",s=>s&&s.length<=10||"Password must be less than 10 characters"]),C=o([s=>!!s||"E-mail is required",s=>/.+@.+\..+/.test(s)||"E-mail must be valid"]);function R(){g.value.validate()}return(s,l)=>(b(),U(F,null,[e(u,{block:"",color:"primary",variant:"outlined",class:"text-lightText googleBtn"},{default:a(()=>[n("img",{src:$(z),alt:"google"},null,8,N),S]),_:1}),e(r,null,{default:a(()=>[e(d,{class:"d-flex align-center"},{default:a(()=>[e(_,{class:"custom-devider"}),e(u,{variant:"outlined",class:"orbtn",rounded:"md",size:"small"},{default:a(()=>[f("OR")]),_:1}),e(_,{class:"custom-devider"})]),_:1})]),_:1}),D,e(E,{ref_key:"Regform",ref:g,"lazy-validation":"",action:"/dashboards/analytical",class:"mt-7 loginForm"},{default:a(()=>[e(r,null,{default:a(()=>[e(d,{cols:"12",sm:"6"},{default:a(()=>[e(m,{modelValue:h.value,"onUpdate:modelValue":l[0]||(l[0]=t=>h.value=t),density:"comfortable","hide-details":"auto",variant:"outlined",color:"primary",label:"Firstname"},null,8,["modelValue"])]),_:1}),e(d,{cols:"12",sm:"6"},{default:a(()=>[e(m,{modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=t=>x.value=t),density:"comfortable","hide-details":"auto",variant:"outlined",color:"primary",label:"Lastname"},null,8,["modelValue"])]),_:1})]),_:1}),e(m,{modelValue:v.value,"onUpdate:modelValue":l[2]||(l[2]=t=>v.value=t),rules:C.value,label:"Email Address / Username",class:"mt-4 mb-4",required:"",density:"comfortable","hide-details":"auto",variant:"outlined",color:"primary"},null,8,["modelValue","rules"]),e(m,{modelValue:p.value,"onUpdate:modelValue":l[3]||(l[3]=t=>p.value=t),rules:k.value,label:"Password",required:"",density:"comfortable",variant:"outlined",color:"primary","hide-details":"auto","append-icon":i.value?"mdi-eye":"mdi-eye-off",type:i.value?"text":"password","onClick:append":l[4]||(l[4]=t=>i.value=!i.value),class:"pwdInput"},null,8,["modelValue","rules","append-icon","type"]),n("div",G,[e(A,{modelValue:c.value,"onUpdate:modelValue":l[5]||(l[5]=t=>c.value=t),rules:[t=>!!t||"You must agree to continue!"],label:"Agree with?",required:"",color:"primary",class:"ms-n2","hide-details":""},null,8,["modelValue","rules"]),L]),e(u,{color:"secondary",block:"",class:"mt-2",variant:"flat",size:"large",onClick:l[6]||(l[6]=t=>R())},{default:a(()=>[f("Sign Up")]),_:1})]),_:1},512),n("div",O,[e(_),e(u,{variant:"plain",to:"/auth/login",class:"mt-2 text-capitalize mr-n2"},{default:a(()=>[f("Already have an account?")]),_:1})])],64))}});const I={class:"pa-7 pa-sm-12"},J=n("h2",{class:"text-secondary text-h2 mt-8"},"Sign up",-1),Y=n("h4",{class:"text-disabled text-h4 mt-3"},"Enter credentials to continue",-1),M=y({__name:"RegisterPage",setup(w){return(c,i)=>(b(),T(r,{class:"h-100vh","no-gutters":""},{default:a(()=>[e(d,{cols:"12",class:"d-flex align-center bg-lightprimary"},{default:a(()=>[e(q,null,{default:a(()=>[n("div",I,[e(r,{justify:"center"},{default:a(()=>[e(d,{cols:"12",lg:"10",xl:"6",md:"7"},{default:a(()=>[e(V,{elevation:"0",class:"loginBox"},{default:a(()=>[e(V,{variant:"outlined"},{default:a(()=>[e(P,{class:"pa-9"},{default:a(()=>[e(r,null,{default:a(()=>[e(d,{cols:"12",class:"text-center"},{default:a(()=>[e(B),J,Y]),_:1})]),_:1}),e(j)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1})]),_:1}))}});export{M as default};
import{_ as B}from"./LogoDark.vue_vue_type_script_setup_true_lang-fb0b037c.js";import{x as y,D as o,o as b,s as U,a as e,w as a,b as n,B as $,d as u,f as d,A as _,e as f,V as r,O as m,an as A,as as E,F,c as T,N as q,J as V,L as P}from"./index-f71951bf.js";const z="/assets/social-google-a359a253.svg",N=["src"],S=n("span",{class:"ml-2"},"Sign up with Google",-1),D=n("h5",{class:"text-h5 text-center my-4 mb-8"},"Sign up with Email address",-1),G={class:"d-sm-inline-flex align-center mt-2 mb-7 mb-sm-0 font-weight-bold"},L=n("a",{href:"#",class:"ml-1 text-lightText"},"Terms and Condition",-1),O={class:"mt-5 text-right"},j=y({__name:"AuthRegister",setup(w){const c=o(!1),i=o(!1),p=o(""),v=o(""),g=o(),h=o(""),x=o(""),k=o([s=>!!s||"Password is required",s=>s&&s.length<=10||"Password must be less than 10 characters"]),C=o([s=>!!s||"E-mail is required",s=>/.+@.+\..+/.test(s)||"E-mail must be valid"]);function R(){g.value.validate()}return(s,l)=>(b(),U(F,null,[e(u,{block:"",color:"primary",variant:"outlined",class:"text-lightText googleBtn"},{default:a(()=>[n("img",{src:$(z),alt:"google"},null,8,N),S]),_:1}),e(r,null,{default:a(()=>[e(d,{class:"d-flex align-center"},{default:a(()=>[e(_,{class:"custom-devider"}),e(u,{variant:"outlined",class:"orbtn",rounded:"md",size:"small"},{default:a(()=>[f("OR")]),_:1}),e(_,{class:"custom-devider"})]),_:1})]),_:1}),D,e(E,{ref_key:"Regform",ref:g,"lazy-validation":"",action:"/dashboards/analytical",class:"mt-7 loginForm"},{default:a(()=>[e(r,null,{default:a(()=>[e(d,{cols:"12",sm:"6"},{default:a(()=>[e(m,{modelValue:h.value,"onUpdate:modelValue":l[0]||(l[0]=t=>h.value=t),density:"comfortable","hide-details":"auto",variant:"outlined",color:"primary",label:"Firstname"},null,8,["modelValue"])]),_:1}),e(d,{cols:"12",sm:"6"},{default:a(()=>[e(m,{modelValue:x.value,"onUpdate:modelValue":l[1]||(l[1]=t=>x.value=t),density:"comfortable","hide-details":"auto",variant:"outlined",color:"primary",label:"Lastname"},null,8,["modelValue"])]),_:1})]),_:1}),e(m,{modelValue:v.value,"onUpdate:modelValue":l[2]||(l[2]=t=>v.value=t),rules:C.value,label:"Email Address / Username",class:"mt-4 mb-4",required:"",density:"comfortable","hide-details":"auto",variant:"outlined",color:"primary"},null,8,["modelValue","rules"]),e(m,{modelValue:p.value,"onUpdate:modelValue":l[3]||(l[3]=t=>p.value=t),rules:k.value,label:"Password",required:"",density:"comfortable",variant:"outlined",color:"primary","hide-details":"auto","append-icon":i.value?"mdi-eye":"mdi-eye-off",type:i.value?"text":"password","onClick:append":l[4]||(l[4]=t=>i.value=!i.value),class:"pwdInput"},null,8,["modelValue","rules","append-icon","type"]),n("div",G,[e(A,{modelValue:c.value,"onUpdate:modelValue":l[5]||(l[5]=t=>c.value=t),rules:[t=>!!t||"You must agree to continue!"],label:"Agree with?",required:"",color:"primary",class:"ms-n2","hide-details":""},null,8,["modelValue","rules"]),L]),e(u,{color:"secondary",block:"",class:"mt-2",variant:"flat",size:"large",onClick:l[6]||(l[6]=t=>R())},{default:a(()=>[f("Sign Up")]),_:1})]),_:1},512),n("div",O,[e(_),e(u,{variant:"plain",to:"/auth/login",class:"mt-2 text-capitalize mr-n2"},{default:a(()=>[f("Already have an account?")]),_:1})])],64))}});const I={class:"pa-7 pa-sm-12"},J=n("h2",{class:"text-secondary text-h2 mt-8"},"Sign up",-1),Y=n("h4",{class:"text-disabled text-h4 mt-3"},"Enter credentials to continue",-1),M=y({__name:"RegisterPage",setup(w){return(c,i)=>(b(),T(r,{class:"h-100vh","no-gutters":""},{default:a(()=>[e(d,{cols:"12",class:"d-flex align-center bg-lightprimary"},{default:a(()=>[e(q,null,{default:a(()=>[n("div",I,[e(r,{justify:"center"},{default:a(()=>[e(d,{cols:"12",lg:"10",xl:"6",md:"7"},{default:a(()=>[e(V,{elevation:"0",class:"loginBox"},{default:a(()=>[e(V,{variant:"outlined"},{default:a(()=>[e(P,{class:"pa-9"},{default:a(()=>[e(r,null,{default:a(()=>[e(d,{cols:"12",class:"text-center"},{default:a(()=>[e(B),J,Y]),_:1})]),_:1}),e(j)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})])]),_:1})]),_:1})]),_:1}))}});export{M as default};
@@ -1 +1 @@
import{_ as c}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-89ca5198.js";import{_ as f}from"./UiParentCard.vue_vue_type_script_setup_true_lang-03a5c441.js";import{x as m,D as s,o as l,s as r,a as e,w as a,f as i,V as o,F as d,u as _,J as p,U as b,b as h,t as g}from"./index-7c8bc001.js";const v=m({__name:"ShadowPage",setup(w){const n=s({title:"Shadow Page"}),u=s([{title:"Utilities",disabled:!1,href:"#"},{title:"Shadow",disabled:!0,href:"#"}]);return(V,x)=>(l(),r(d,null,[e(c,{title:n.value.title,breadcrumbs:u.value},null,8,["title","breadcrumbs"]),e(o,null,{default:a(()=>[e(i,{cols:"12",md:"12"},{default:a(()=>[e(f,{title:"Basic Shadow"},{default:a(()=>[e(o,{justify:"center"},{default:a(()=>[(l(),r(d,null,_(25,t=>e(i,{key:t,cols:"auto"},{default:a(()=>[e(p,{height:"100",width:"100",class:b(["mb-5",["d-flex justify-center align-center bg-primary",`elevation-${t}`]])},{default:a(()=>[h("div",null,g(t-1),1)]),_:2},1032,["class"])]),_:2},1024)),64))]),_:1})]),_:1})]),_:1})]),_:1})],64))}});export{v as default};
import{_ as c}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-2b6e2e87.js";import{_ as f}from"./UiParentCard.vue_vue_type_script_setup_true_lang-820f34f1.js";import{x as m,D as s,o as l,s as r,a as e,w as a,f as i,V as o,F as d,u as _,J as p,U as b,b as h,t as g}from"./index-f71951bf.js";const v=m({__name:"ShadowPage",setup(w){const n=s({title:"Shadow Page"}),u=s([{title:"Utilities",disabled:!1,href:"#"},{title:"Shadow",disabled:!0,href:"#"}]);return(V,x)=>(l(),r(d,null,[e(c,{title:n.value.title,breadcrumbs:u.value},null,8,["title","breadcrumbs"]),e(o,null,{default:a(()=>[e(i,{cols:"12",md:"12"},{default:a(()=>[e(f,{title:"Basic Shadow"},{default:a(()=>[e(o,{justify:"center"},{default:a(()=>[(l(),r(d,null,_(25,t=>e(i,{key:t,cols:"auto"},{default:a(()=>[e(p,{height:"100",width:"100",class:b(["mb-5",["d-flex justify-center align-center bg-primary",`elevation-${t}`]])},{default:a(()=>[h("div",null,g(t-1),1)]),_:2},1032,["class"])]),_:2},1024)),64))]),_:1})]),_:1})]),_:1})]),_:1})],64))}});export{v as default};
@@ -1 +1 @@
import{_ as o}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-89ca5198.js";import{_ as n}from"./UiParentCard.vue_vue_type_script_setup_true_lang-03a5c441.js";import{x as c,D as a,o as i,s as m,a as e,w as t,f as d,b as f,V as _,F as u}from"./index-7c8bc001.js";const b=["innerHTML"],w=c({__name:"TablerIcons",setup(p){const s=a({title:"Tabler Icons"}),r=a('<iframe src="https://tablericons.com/" frameborder="0" width="100%" height="600"></iframe>'),l=a([{title:"Icons",disabled:!1,href:"#"},{title:"Tabler Icons",disabled:!0,href:"#"}]);return(h,T)=>(i(),m(u,null,[e(o,{title:s.value.title,breadcrumbs:l.value},null,8,["title","breadcrumbs"]),e(_,null,{default:t(()=>[e(d,{cols:"12",md:"12"},{default:t(()=>[e(n,{title:"Tabler Icons"},{default:t(()=>[f("div",{innerHTML:r.value},null,8,b)]),_:1})]),_:1})]),_:1})],64))}});export{w as default};
import{_ as o}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-2b6e2e87.js";import{_ as n}from"./UiParentCard.vue_vue_type_script_setup_true_lang-820f34f1.js";import{x as c,D as a,o as i,s as m,a as e,w as t,f as d,b as f,V as _,F as u}from"./index-f71951bf.js";const b=["innerHTML"],w=c({__name:"TablerIcons",setup(p){const s=a({title:"Tabler Icons"}),r=a('<iframe src="https://tablericons.com/" frameborder="0" width="100%" height="600"></iframe>'),l=a([{title:"Icons",disabled:!1,href:"#"},{title:"Tabler Icons",disabled:!0,href:"#"}]);return(h,T)=>(i(),m(u,null,[e(o,{title:s.value.title,breadcrumbs:l.value},null,8,["title","breadcrumbs"]),e(_,null,{default:t(()=>[e(d,{cols:"12",md:"12"},{default:t(()=>[e(n,{title:"Tabler Icons"},{default:t(()=>[f("div",{innerHTML:r.value},null,8,b)]),_:1})]),_:1})]),_:1})],64))}});export{w as default};
@@ -1 +1 @@
import{_ as m}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-89ca5198.js";import{_ as v}from"./UiParentCard.vue_vue_type_script_setup_true_lang-03a5c441.js";import{x as f,o as i,c as g,w as e,a,a6 as y,K as b,e as w,t as d,A as C,L as V,a7 as L,J as _,D as o,s as h,f as k,b as t,F as x,u as B,U as H,V as T}from"./index-7c8bc001.js";const s=f({__name:"UiChildCard",props:{title:String},setup(r){const l=r;return(n,c)=>(i(),g(_,{variant:"outlined"},{default:e(()=>[a(y,{class:"py-3"},{default:e(()=>[a(b,{class:"text-h5"},{default:e(()=>[w(d(l.title),1)]),_:1})]),_:1}),a(C),a(V,null,{default:e(()=>[L(n.$slots,"default")]),_:3})]),_:3}))}}),D={class:"d-flex flex-column gap-1"},S={class:"text-caption pa-2 bg-lightprimary"},z=t("div",{class:"text-grey"},"Class",-1),N={class:"font-weight-medium"},U=t("div",null,[t("p",{class:"text-left"},"Left aligned on all viewport sizes."),t("p",{class:"text-center"},"Center aligned on all viewport sizes."),t("p",{class:"text-right"},"Right aligned on all viewport sizes."),t("p",{class:"text-sm-left"},"Left aligned on viewports SM (small) or wider."),t("p",{class:"text-right text-md-left"},"Left aligned on viewports MD (medium) or wider."),t("p",{class:"text-right text-lg-left"},"Left aligned on viewports LG (large) or wider."),t("p",{class:"text-right text-xl-left"},"Left aligned on viewports XL (extra-large) or wider.")],-1),$=t("div",{class:"d-flex justify-space-between flex-row"},[t("a",{href:"#",class:"text-decoration-none"},"Non-underlined link"),t("div",{class:"text-decoration-line-through"},"Line-through text"),t("div",{class:"text-decoration-overline"},"Overline text"),t("div",{class:"text-decoration-underline"},"Underline text")],-1),M=t("div",null,[t("p",{class:"text-high-emphasis"},"High-emphasis has an opacity of 87% in light theme and 100% in dark."),t("p",{class:"text-medium-emphasis"},"Medium-emphasis text and hint text have opacities of 60% in light theme and 70% in dark."),t("p",{class:"text-disabled"},"Disabled text has an opacity of 38% in light theme and 50% in dark.")],-1),A=f({__name:"TypographyPage",setup(r){const l=o({title:"Typography Page"}),n=o([["Heading 1","text-h1"],["Heading 2","text-h2"],["Heading 3","text-h3"],["Heading 4","text-h4"],["Heading 5","text-h5"],["Heading 6","text-h6"],["Subtitle 1","text-subtitle-1"],["Subtitle 2","text-subtitle-2"],["Body 1","text-body-1"],["Body 2","text-body-2"],["Button","text-button"],["Caption","text-caption"],["Overline","text-overline"]]),c=o([{title:"Utilities",disabled:!1,href:"#"},{title:"Typography",disabled:!0,href:"#"}]);return(O,F)=>(i(),h(x,null,[a(m,{title:l.value.title,breadcrumbs:c.value},null,8,["title","breadcrumbs"]),a(T,null,{default:e(()=>[a(k,{cols:"12",md:"12"},{default:e(()=>[a(v,{title:"Basic Typography"},{default:e(()=>[a(s,{title:"Heading"},{default:e(()=>[t("div",D,[(i(!0),h(x,null,B(n.value,([p,u])=>(i(),g(_,{variant:"outlined",key:p,class:"my-4"},{default:e(()=>[t("div",{class:H([u,"pa-2"])},d(p),3),t("div",S,[z,t("div",N,d(u),1)])]),_:2},1024))),128))])]),_:1}),a(s,{title:"Text-alignment",class:"mt-8"},{default:e(()=>[U]),_:1}),a(s,{title:"Decoration",class:"mt-8"},{default:e(()=>[$]),_:1}),a(s,{title:"Opacity",class:"mt-8"},{default:e(()=>[M]),_:1})]),_:1})]),_:1})]),_:1})],64))}});export{A as default};
import{_ as m}from"./BaseBreadcrumb.vue_vue_type_style_index_0_lang-2b6e2e87.js";import{_ as v}from"./UiParentCard.vue_vue_type_script_setup_true_lang-820f34f1.js";import{x as f,o as i,c as g,w as e,a,a6 as y,K as b,e as w,t as d,A as C,L as V,a7 as L,J as _,D as o,s as h,f as k,b as t,F as x,u as B,U as H,V as T}from"./index-f71951bf.js";const s=f({__name:"UiChildCard",props:{title:String},setup(r){const l=r;return(n,c)=>(i(),g(_,{variant:"outlined"},{default:e(()=>[a(y,{class:"py-3"},{default:e(()=>[a(b,{class:"text-h5"},{default:e(()=>[w(d(l.title),1)]),_:1})]),_:1}),a(C),a(V,null,{default:e(()=>[L(n.$slots,"default")]),_:3})]),_:3}))}}),D={class:"d-flex flex-column gap-1"},S={class:"text-caption pa-2 bg-lightprimary"},z=t("div",{class:"text-grey"},"Class",-1),N={class:"font-weight-medium"},U=t("div",null,[t("p",{class:"text-left"},"Left aligned on all viewport sizes."),t("p",{class:"text-center"},"Center aligned on all viewport sizes."),t("p",{class:"text-right"},"Right aligned on all viewport sizes."),t("p",{class:"text-sm-left"},"Left aligned on viewports SM (small) or wider."),t("p",{class:"text-right text-md-left"},"Left aligned on viewports MD (medium) or wider."),t("p",{class:"text-right text-lg-left"},"Left aligned on viewports LG (large) or wider."),t("p",{class:"text-right text-xl-left"},"Left aligned on viewports XL (extra-large) or wider.")],-1),$=t("div",{class:"d-flex justify-space-between flex-row"},[t("a",{href:"#",class:"text-decoration-none"},"Non-underlined link"),t("div",{class:"text-decoration-line-through"},"Line-through text"),t("div",{class:"text-decoration-overline"},"Overline text"),t("div",{class:"text-decoration-underline"},"Underline text")],-1),M=t("div",null,[t("p",{class:"text-high-emphasis"},"High-emphasis has an opacity of 87% in light theme and 100% in dark."),t("p",{class:"text-medium-emphasis"},"Medium-emphasis text and hint text have opacities of 60% in light theme and 70% in dark."),t("p",{class:"text-disabled"},"Disabled text has an opacity of 38% in light theme and 50% in dark.")],-1),A=f({__name:"TypographyPage",setup(r){const l=o({title:"Typography Page"}),n=o([["Heading 1","text-h1"],["Heading 2","text-h2"],["Heading 3","text-h3"],["Heading 4","text-h4"],["Heading 5","text-h5"],["Heading 6","text-h6"],["Subtitle 1","text-subtitle-1"],["Subtitle 2","text-subtitle-2"],["Body 1","text-body-1"],["Body 2","text-body-2"],["Button","text-button"],["Caption","text-caption"],["Overline","text-overline"]]),c=o([{title:"Utilities",disabled:!1,href:"#"},{title:"Typography",disabled:!0,href:"#"}]);return(O,F)=>(i(),h(x,null,[a(m,{title:l.value.title,breadcrumbs:c.value},null,8,["title","breadcrumbs"]),a(T,null,{default:e(()=>[a(k,{cols:"12",md:"12"},{default:e(()=>[a(v,{title:"Basic Typography"},{default:e(()=>[a(s,{title:"Heading"},{default:e(()=>[t("div",D,[(i(!0),h(x,null,B(n.value,([p,u])=>(i(),g(_,{variant:"outlined",key:p,class:"my-4"},{default:e(()=>[t("div",{class:H([u,"pa-2"])},d(p),3),t("div",S,[z,t("div",N,d(u),1)])]),_:2},1024))),128))])]),_:1}),a(s,{title:"Text-alignment",class:"mt-8"},{default:e(()=>[U]),_:1}),a(s,{title:"Decoration",class:"mt-8"},{default:e(()=>[$]),_:1}),a(s,{title:"Opacity",class:"mt-8"},{default:e(()=>[M]),_:1})]),_:1})]),_:1})]),_:1})],64))}});export{A as default};
@@ -1 +1 @@
import{x as n,o,c as i,w as e,a,a6 as d,b as c,K as u,e as p,t as _,a7 as s,A as f,L as V,J as m}from"./index-7c8bc001.js";const C={class:"d-sm-flex align-center justify-space-between"},h=n({__name:"UiParentCard",props:{title:String},setup(l){const r=l;return(t,x)=>(o(),i(m,{variant:"outlined",elevation:"0",class:"withbg"},{default:e(()=>[a(d,null,{default:e(()=>[c("div",C,[a(u,null,{default:e(()=>[p(_(r.title),1)]),_:1}),s(t.$slots,"action")])]),_:3}),a(f),a(V,null,{default:e(()=>[s(t.$slots,"default")]),_:3})]),_:3}))}});export{h as _};
import{x as n,o,c as i,w as e,a,a6 as d,b as c,K as u,e as p,t as _,a7 as s,A as f,L as V,J as m}from"./index-f71951bf.js";const C={class:"d-sm-flex align-center justify-space-between"},h=n({__name:"UiParentCard",props:{title:String},setup(l){const r=l;return(t,x)=>(o(),i(m,{variant:"outlined",elevation:"0",class:"withbg"},{default:e(()=>[a(d,null,{default:e(()=>[c("div",C,[a(u,null,{default:e(()=>[p(_(r.title),1)]),_:1}),s(t.$slots,"action")])]),_:3}),a(f),a(V,null,{default:e(()=>[s(t.$slots,"default")]),_:3})]),_:3}))}});export{h as _};
@@ -6,11 +6,11 @@
* vue-router v4.2.4
* (c) 2023 Eduardo San Martin Morote
* @license MIT
*/const Wr=typeof window<"u";function t5(n){return n.__esModule||n[Symbol.toStringTag]==="Module"}const fe=Object.assign;function Li(n,l){const r={};for(const h in l){const c=l[h];r[h]=Kn(c)?c.map(n):n(c)}return r}const Wo=()=>{},Kn=Array.isArray,e5=/\/$/,n5=n=>n.replace(e5,"");function Di(n,l,r="/"){let h,c={},g="",v="";const k=l.indexOf("#");let x=l.indexOf("?");return k<x&&k>=0&&(x=-1),x>-1&&(h=l.slice(0,x),g=l.slice(x+1,k>-1?k:l.length),c=n(g)),k>-1&&(h=h||l.slice(0,k),v=l.slice(k,l.length)),h=s5(h??l,r),{fullPath:h+(g&&"?")+g+v,path:h,query:c,hash:v}}function l5(n,l){const r=l.query?n(l.query):"";return l.path+(r&&"?")+r+(l.hash||"")}function A1(n,l){return!l||!n.toLowerCase().startsWith(l.toLowerCase())?n:n.slice(l.length)||"/"}function r5(n,l,r){const h=l.matched.length-1,c=r.matched.length-1;return h>-1&&h===c&&eo(l.matched[h],r.matched[c])&&qu(l.params,r.params)&&n(l.query)===n(r.query)&&l.hash===r.hash}function eo(n,l){return(n.aliasOf||n)===(l.aliasOf||l)}function qu(n,l){if(Object.keys(n).length!==Object.keys(l).length)return!1;for(const r in n)if(!o5(n[r],l[r]))return!1;return!0}function o5(n,l){return Kn(n)?B1(n,l):Kn(l)?B1(l,n):n===l}function B1(n,l){return Kn(l)?n.length===l.length&&n.every((r,h)=>r===l[h]):n.length===1&&n[0]===l}function s5(n,l){if(n.startsWith("/"))return n;if(!n)return l;const r=l.split("/"),h=n.split("/"),c=h[h.length-1];(c===".."||c===".")&&h.push("");let g=r.length-1,v,k;for(v=0;v<h.length;v++)if(k=h[v],k!==".")if(k==="..")g>1&&g--;else break;return r.slice(0,g).join("/")+"/"+h.slice(v-(v===h.length?1:0)).join("/")}var rs;(function(n){n.pop="pop",n.push="push"})(rs||(rs={}));var Xo;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Xo||(Xo={}));function a5(n){if(!n)if(Wr){const l=document.querySelector("base");n=l&&l.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),n5(n)}const i5=/^[^#]+#/;function h5(n,l){return n.replace(i5,"#")+l}function d5(n,l){const r=document.documentElement.getBoundingClientRect(),h=n.getBoundingClientRect();return{behavior:l.behavior,left:h.left-r.left-(l.left||0),top:h.top-r.top-(l.top||0)}}const Ga=()=>({left:window.pageXOffset,top:window.pageYOffset});function c5(n){let l;if("el"in n){const r=n.el,h=typeof r=="string"&&r.startsWith("#"),c=typeof r=="string"?h?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!c)return;l=d5(c,n)}else l=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(l):window.scrollTo(l.left!=null?l.left:window.pageXOffset,l.top!=null?l.top:window.pageYOffset)}function H1(n,l){return(history.state?history.state.position-l:-1)+n}const x0=new Map;function u5(n,l){x0.set(n,l)}function p5(n){const l=x0.get(n);return x0.delete(n),l}let g5=()=>location.protocol+"//"+location.host;function Yu(n,l){const{pathname:r,search:h,hash:c}=l,g=n.indexOf("#");if(g>-1){let k=c.includes(n.slice(g))?n.slice(g).length:1,x=c.slice(k);return x[0]!=="/"&&(x="/"+x),A1(x,"")}return A1(r,n)+h+c}function w5(n,l,r,h){let c=[],g=[],v=null;const k=({state:B})=>{const P=Yu(n,location),D=r.value,F=l.value;let X=0;if(B){if(r.value=P,l.value=B,v&&v===D){v=null;return}X=F?B.position-F.position:0}else h(P);c.forEach(R=>{R(r.value,D,{delta:X,type:rs.pop,direction:X?X>0?Xo.forward:Xo.back:Xo.unknown})})};function x(){v=r.value}function I(B){c.push(B);const P=()=>{const D=c.indexOf(B);D>-1&&c.splice(D,1)};return g.push(P),P}function S(){const{history:B}=window;B.state&&B.replaceState(fe({},B.state,{scroll:Ga()}),"")}function $(){for(const B of g)B();g=[],window.removeEventListener("popstate",k),window.removeEventListener("beforeunload",S)}return window.addEventListener("popstate",k),window.addEventListener("beforeunload",S,{passive:!0}),{pauseListeners:x,listen:I,destroy:$}}function N1(n,l,r,h=!1,c=!1){return{back:n,current:l,forward:r,replaced:h,position:window.history.length,scroll:c?Ga():null}}function v5(n){const{history:l,location:r}=window,h={value:Yu(n,r)},c={value:l.state};c.value||g(h.value,{back:null,current:h.value,forward:null,position:l.length-1,replaced:!0,scroll:null},!0);function g(x,I,S){const $=n.indexOf("#"),B=$>-1?(r.host&&document.querySelector("base")?n:n.slice($))+x:g5()+n+x;try{l[S?"replaceState":"pushState"](I,"",B),c.value=I}catch(P){console.error(P),r[S?"replace":"assign"](B)}}function v(x,I){const S=fe({},l.state,N1(c.value.back,x,c.value.forward,!0),I,{position:c.value.position});g(x,S,!0),h.value=x}function k(x,I){const S=fe({},c.value,l.state,{forward:x,scroll:Ga()});g(S.current,S,!0);const $=fe({},N1(h.value,x,null),{position:S.position+1},I);g(x,$,!1),h.value=x}return{location:h,state:c,push:k,replace:v}}function f5(n){n=a5(n);const l=v5(n),r=w5(n,l.state,l.location,l.replace);function h(g,v=!0){v||r.pauseListeners(),history.go(g)}const c=fe({location:"",base:n,go:h,createHref:h5.bind(null,n)},l,r);return Object.defineProperty(c,"location",{enumerable:!0,get:()=>l.location.value}),Object.defineProperty(c,"state",{enumerLine truncated
*/const Wr=typeof window<"u";function t5(n){return n.__esModule||n[Symbol.toStringTag]==="Module"}const fe=Object.assign;function Li(n,l){const r={};for(const h in l){const c=l[h];r[h]=Kn(c)?c.map(n):n(c)}return r}const Wo=()=>{},Kn=Array.isArray,e5=/\/$/,n5=n=>n.replace(e5,"");function Di(n,l,r="/"){let h,c={},g="",v="";const k=l.indexOf("#");let x=l.indexOf("?");return k<x&&k>=0&&(x=-1),x>-1&&(h=l.slice(0,x),g=l.slice(x+1,k>-1?k:l.length),c=n(g)),k>-1&&(h=h||l.slice(0,k),v=l.slice(k,l.length)),h=s5(h??l,r),{fullPath:h+(g&&"?")+g+v,path:h,query:c,hash:v}}function l5(n,l){const r=l.query?n(l.query):"";return l.path+(r&&"?")+r+(l.hash||"")}function A1(n,l){return!l||!n.toLowerCase().startsWith(l.toLowerCase())?n:n.slice(l.length)||"/"}function r5(n,l,r){const h=l.matched.length-1,c=r.matched.length-1;return h>-1&&h===c&&eo(l.matched[h],r.matched[c])&&qu(l.params,r.params)&&n(l.query)===n(r.query)&&l.hash===r.hash}function eo(n,l){return(n.aliasOf||n)===(l.aliasOf||l)}function qu(n,l){if(Object.keys(n).length!==Object.keys(l).length)return!1;for(const r in n)if(!o5(n[r],l[r]))return!1;return!0}function o5(n,l){return Kn(n)?B1(n,l):Kn(l)?B1(l,n):n===l}function B1(n,l){return Kn(l)?n.length===l.length&&n.every((r,h)=>r===l[h]):n.length===1&&n[0]===l}function s5(n,l){if(n.startsWith("/"))return n;if(!n)return l;const r=l.split("/"),h=n.split("/"),c=h[h.length-1];(c===".."||c===".")&&h.push("");let g=r.length-1,v,k;for(v=0;v<h.length;v++)if(k=h[v],k!==".")if(k==="..")g>1&&g--;else break;return r.slice(0,g).join("/")+"/"+h.slice(v-(v===h.length?1:0)).join("/")}var rs;(function(n){n.pop="pop",n.push="push"})(rs||(rs={}));var Xo;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Xo||(Xo={}));function a5(n){if(!n)if(Wr){const l=document.querySelector("base");n=l&&l.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),n5(n)}const i5=/^[^#]+#/;function h5(n,l){return n.replace(i5,"#")+l}function d5(n,l){const r=document.documentElement.getBoundingClientRect(),h=n.getBoundingClientRect();return{behavior:l.behavior,left:h.left-r.left-(l.left||0),top:h.top-r.top-(l.top||0)}}const Ga=()=>({left:window.pageXOffset,top:window.pageYOffset});function c5(n){let l;if("el"in n){const r=n.el,h=typeof r=="string"&&r.startsWith("#"),c=typeof r=="string"?h?document.getElementById(r.slice(1)):document.querySelector(r):r;if(!c)return;l=d5(c,n)}else l=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(l):window.scrollTo(l.left!=null?l.left:window.pageXOffset,l.top!=null?l.top:window.pageYOffset)}function H1(n,l){return(history.state?history.state.position-l:-1)+n}const x0=new Map;function u5(n,l){x0.set(n,l)}function p5(n){const l=x0.get(n);return x0.delete(n),l}let g5=()=>location.protocol+"//"+location.host;function Yu(n,l){const{pathname:r,search:h,hash:c}=l,g=n.indexOf("#");if(g>-1){let k=c.includes(n.slice(g))?n.slice(g).length:1,x=c.slice(k);return x[0]!=="/"&&(x="/"+x),A1(x,"")}return A1(r,n)+h+c}function w5(n,l,r,h){let c=[],g=[],v=null;const k=({state:B})=>{const P=Yu(n,location),D=r.value,F=l.value;let X=0;if(B){if(r.value=P,l.value=B,v&&v===D){v=null;return}X=F?B.position-F.position:0}else h(P);c.forEach(R=>{R(r.value,D,{delta:X,type:rs.pop,direction:X?X>0?Xo.forward:Xo.back:Xo.unknown})})};function x(){v=r.value}function I(B){c.push(B);const P=()=>{const D=c.indexOf(B);D>-1&&c.splice(D,1)};return g.push(P),P}function S(){const{history:B}=window;B.state&&B.replaceState(fe({},B.state,{scroll:Ga()}),"")}function $(){for(const B of g)B();g=[],window.removeEventListener("popstate",k),window.removeEventListener("beforeunload",S)}return window.addEventListener("popstate",k),window.addEventListener("beforeunload",S,{passive:!0}),{pauseListeners:x,listen:I,destroy:$}}function N1(n,l,r,h=!1,c=!1){return{back:n,current:l,forward:r,replaced:h,position:window.history.length,scroll:c?Ga():null}}function v5(n){const{history:l,location:r}=window,h={value:Yu(n,r)},c={value:l.state};c.value||g(h.value,{back:null,current:h.value,forward:null,position:l.length-1,replaced:!0,scroll:null},!0);function g(x,I,S){const $=n.indexOf("#"),B=$>-1?(r.host&&document.querySelector("base")?n:n.slice($))+x:g5()+n+x;try{l[S?"replaceState":"pushState"](I,"",B),c.value=I}catch(P){console.error(P),r[S?"replace":"assign"](B)}}function v(x,I){const S=fe({},l.state,N1(c.value.back,x,c.value.forward,!0),I,{position:c.value.position});g(x,S,!0),h.value=x}function k(x,I){const S=fe({},c.value,l.state,{forward:x,scroll:Ga()});g(S.current,S,!0);const $=fe({},N1(h.value,x,null),{position:S.position+1},I);g(x,$,!1),h.value=x}return{location:h,state:c,push:k,replace:v}}function f5(n){n=a5(n);const l=v5(n),r=w5(n,l.state,l.location,l.replace);function h(g,v=!0){v||r.pauseListeners(),history.go(g)}const c=fe({location:"",base:n,go:h,createHref:h5.bind(null,n)},l,r);return Object.defineProperty(c,"location",{enumerable:!0,get:()=>l.location.value}),Object.defineProperty(c,"state",{enumerLine truncated
`).forEach(function(v){c=v.indexOf(":"),r=v.substring(0,c).trim().toLowerCase(),h=v.substring(c+1).trim(),!(!r||l[r]&&lk[r])&&(r==="set-cookie"?l[r]?l[r].push(h):l[r]=[h]:l[r]=l[r]?l[r]+", "+h:h)}),l},K1=Symbol("internals");function Ao(n){return n&&String(n).trim().toLowerCase()}function oa(n){return n===!1||n==null?n:St.isArray(n)?n.map(oa):String(n)}function ok(n){const l=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let h;for(;h=r.exec(n);)l[h[1]]=h[2];return l}const sk=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function Ri(n,l,r,h,c){if(St.isFunction(h))return h.call(this,l,r);if(c&&(l=r),!!St.isString(l)){if(St.isString(h))return l.indexOf(h)!==-1;if(St.isRegExp(h))return h.test(l)}}function ak(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(l,r,h)=>r.toUpperCase()+h)}function ik(n,l){const r=St.toCamelCase(" "+l);["get","set","has"].forEach(h=>{Object.defineProperty(n,h+r,{value:function(c,g,v){return this[h].call(this,l,c,g,v)},configurable:!0})})}class ti{constructor(l){l&&this.set(l)}set(l,r,h){const c=this;function g(k,x,I){const S=Ao(x);if(!S)throw new Error("header name must be a non-empty string");const $=St.findKey(c,S);(!$||c[$]===void 0||I===!0||I===void 0&&c[$]!==!1)&&(c[$||x]=oa(k))}const v=(k,x)=>St.forEach(k,(I,S)=>g(I,S,x));return St.isPlainObject(l)||l instanceof this.constructor?v(l,r):St.isString(l)&&(l=l.trim())&&!sk(l)?v(rk(l),r):l!=null&&g(r,l,h),this}get(l,r){if(l=Ao(l),l){const h=St.findKey(this,l);if(h){const c=this[h];if(!r)return c;if(r===!0)return ok(c);if(St.isFunction(r))return r.call(this,c,h);if(St.isRegExp(r))return r.exec(c);throw new TypeError("parser must be boolean|regexp|function")}}}has(l,r){if(l=Ao(l),l){const h=St.findKey(this,l);return!!(h&&this[h]!==void 0&&(!r||Ri(this,this[h],h,r)))}return!1}delete(l,r){const h=this;let c=!1;function g(v){if(v=Ao(v),v){const k=St.findKey(h,v);k&&(!r||Ri(h,h[k],k,r))&&(delete h[k],c=!0)}}return St.isArray(l)?l.forEach(g):g(l),c}clear(l){const r=Object.keys(this);let h=r.length,c=!1;for(;h--;){const g=r[h];(!l||Ri(this,this[g],g,l,!0))&&(delete this[g],c=!0)}return c}normalize(l){const r=this,h={};return St.forEach(this,(c,g)=>{const v=St.findKey(h,g);if(v){r[v]=oa(c),delete r[g];return}const k=l?ak(g):String(g).trim();k!==g&&delete r[g],r[k]=oa(c),h[k]=!0}),this}concat(...l){return this.constructor.concat(this,...l)}toJSON(l){const r=Object.create(null);return St.forEach(this,(h,c)=>{h!=null&&h!==!1&&(r[c]=l&&St.isArray(h)?h.join(", "):h)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([l,r])=>l+": "+r).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(l){return l instanceof this?l:new this(l)}static concat(l,...r){const h=new this(l);return r.forEach(c=>h.set(c)),h}static accessor(l){const h=(this[K1]=this[K1]={accessors:{}}).accessors,c=this.prototype;function g(v){const k=Ao(v);h[k]||(ik(c,v),h[k]=!0)}return St.isArray(l)?l.forEach(g):g(l),this}}ti.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);St.reduceDescriptors(ti.prototype,({value:n},l)=>{let r=l[0].toUpperCase()+l.slice(1);return{get:()=>n,set(h){this[r]=h}}});St.freezeMethods(ti);const ml=ti;function Ti(n,l){const r=this||Zh,h=l||r,c=ml.from(h.headers);let g=h.data;return St.forEach(n,function(k){g=k.call(r,g,c.normalize(),l?l.status:void 0)}),c.normalize(),g}function bp(n){return!!(n&&n.__CANCEL__)}function Cs(n,l,r){pe.call(this,n??"canceled",pe.ERR_CANCELED,l,r),this.name="CanceledError"}St.inherits(Cs,pe,{__CANCEL__:!0});function hk(n,l,r){const h=r.config.validateStatus;!r.status||!h||h(r.status)?n(r):l(new pe("Request failed with status code "+r.status,[pe.ERR_BAD_REQUEST,pe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}const dk=nl.hasStandardBrowserEnv?{write(n,l,r,h,c,g){const v=[n+"="+encodeURIComponent(l)];St.isNumber(r)&&v.push("expires="+new Date(r).toGMTString()),St.isString(h)&&v.push("path="+h),St.isString(c)&&v.push("domain="+c),g===!0&&v.push("secure"),document.cookie=v.join("; ")},read(n){const l=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return l?decodeURIComponent(l[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function ck(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function uk(n,l){return l?n.replace(/\/+$/,"")+"/"+l.replace(/^\/+/,""):n}function Mp(n,l){return n&&!ck(l)?uk(n,l):l}const pk=nl.hasStandardBrowserEnv?function(){const l=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");let h;function c(g){let v=g;return l&&(r.setAttribute("href",v),v=r.href),r.setAttribute("href",v),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return h=c(window.location.href),function(v){const k=St.isString(v)?c(v):v;return k.protocol===h.protocol&&k.host===h.host}}():function(){return function(){return!0}}();function gk(n){const l=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return l&&l[1]||""}function wk(n,l){n=n||10;const r=new Array(n),h=new Array(n);let c=0,g=0,v;return l=l!==void 0?l:1e3,function(x){const I=Date.now(),S=h[g];v||(v=I),r[c]=x,h[c]=I;let $=g,B=0;for(;$!==c;)B+=r[$++],$=$%n;if(c=(c+1)%n,c===g&&(g=(g+1)%n),I-v<l)return;const P=S&&I-S;return P?Math.round(B*1e3/P):void 0}}function Q1(n,l){let r=0;const h=wk(50,250);return c=>{const g=c.loaded,v=c.lengthComputable?c.total:void 0,k=g-r,x=h(k),I=g<=v;r=g;const S={loaded:g,total:v,progress:v?g/v:void 0,bytes:k,rate:x||void 0,estimated:x&&v&&I?(v-g)/x:void 0,event:c};S[l?"download":"upload"]=!0,n(S)}}const vk=typeof XMLHttpRequest<"u",fk=vk&&function(n){return new Promise(function(r,h){let c=n.data;const g=ml.from(n.headers).normalize();let{responseType:v,withXSRFToken:k}=n,x;function I(){n.cancelToken&&n.cancelToken.unsubscribe(x),n.signal&&n.signal.removeEventListener("abort",x)}let S;if(St.isFormData(c)){if(nl.hasStandardBrowserEnv||nl.hasStandardBrowserWebWorkerEnv)g.setContentType(!1);else if((S=g.getContentType())!==!1){const[F,...X]=S?S.split(";").map(R=>R.trim()).filter(Boolean):[];g.setContentType([F||"multipart/form-data",...X].join("; "))}}let $=new XMLHttpRequest;if(n.auth){const F=n.auth.username||"",X=n.auth.password?unescape(encodeURIComponent(n.auth.password)):"";g.set("Authorization","Basic "+btoa(F+":"+X))}const B=Mp(n.baseURL,n.url);$.open(n.method.toUpperCase(),vp(B,n.params,n.paramsSerializer),!0),$.timeout=n.timeout;function P(){if(!$)return;const F=ml.from("getAllResponseHeaders"in $&&$.getAllResponseHeaders()),R={data:!v||v==="text"||v==="json"?$.responseText:$.response,status:$.status,statusText:$.statusText,headers:F,config:n,request:$};hk(function(U){r(U),I()},function(U){h(U),I()},R),$=null}if("onloadend"in $?$.onloadend=P:$.onreadystatechange=function(){!$||$.readyState!==4||$.status===0&&!($.responseURL&&$.responseURL.indexOf("file:")===0)||setTimeout(P)},$.onabort=function(){$&&(h(new pe("Request aborted",pe.ECONNABORTED,n,$)),$=null)},$.onerror=function(){h(new pe("Network Error",pe.ERR_NETWORK,n,$)),$=null},$.ontimeout=function(){let X=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded";const R=n.transitional||fp;n.timeoutErrorMessage&&(X=n.timeoutErrorMessage),h(new pe(X,R.clarifyTimeoutError?pe.ETIMEDOUT:pe.ECONNABORTED,n,$)),$=null},nl.hasStandardBrowserEnv&&(k&&St.isFunction(k)&&(k=k(n)),k||k!==!1&&pk(B))){const F=n.xsrfHeaderName&&n.xsrfCookieName&&dk Line truncated
`+g.map(J1).join(`
`):" "+J1(g[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return h},adapters:S0};function Ei(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Cs(null,n)}function td(n){return Ei(n),n.headers=ml.from(n.headers),n.data=Ti.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),xp.getAdapter(n.adapter||Zh.adapter)(n).then(function(h){return Ei(n),h.data=Ti.call(n,n.transformResponse,h),h.headers=ml.from(h.headers),h},function(h){return bp(h)||(Ei(n),h&&h.response&&(h.response.data=Ti.call(n,n.transformResponse,h.response),h.response.headers=ml.from(h.response.headers))),Promise.reject(h)})}const ed=n=>n instanceof ml?n.toJSON():n;function lo(n,l){l=l||{};const r={};function h(I,S,$){return St.isPlainObject(I)&&St.isPlainObject(S)?St.merge.call({caseless:$},I,S):St.isPlainObject(S)?St.merge({},S):St.isArray(S)?S.slice():S}function c(I,S,$){if(St.isUndefined(S)){if(!St.isUndefined(I))return h(void 0,I,$)}else return h(I,S,$)}function g(I,S){if(!St.isUndefined(S))return h(void 0,S)}function v(I,S){if(St.isUndefined(S)){if(!St.isUndefined(I))return h(void 0,I)}else return h(void 0,S)}function k(I,S,$){if($ in l)return h(I,S);if($ in n)return h(void 0,I)}const x={url:g,method:g,data:g,baseURL:v,transformRequest:v,transformResponse:v,paramsSerializer:v,timeout:v,timeoutMessage:v,withCredentials:v,withXSRFToken:v,adapter:v,responseType:v,xsrfCookieName:v,xsrfHeaderName:v,onUploadProgress:v,onDownloadProgress:v,decompress:v,maxContentLength:v,maxBodyLength:v,beforeRedirect:v,transport:v,httpAgent:v,httpsAgent:v,cancelToken:v,socketPath:v,responseEncoding:v,validateStatus:k,headers:(I,S)=>c(ed(I),ed(S),!0)};return St.forEach(Object.keys(Object.assign({},n,l)),function(S){const $=x[S]||c,B=$(n[S],l[S],S);St.isUndefined(B)&&$!==k||(r[S]=B)}),r}const zp="1.6.2",Kh={};["object","boolean","number","function","string","symbol"].forEach((n,l)=>{Kh[n]=function(h){return typeof h===n||"a"+(l<1?"n ":" ")+n}});const nd={};Kh.transitional=function(l,r,h){function c(g,v){return"[Axios v"+zp+"] Transitional option '"+g+"'"+v+(h?". "+h:"")}return(g,v,k)=>{if(l===!1)throw new pe(c(v," has been removed"+(r?" in "+r:"")),pe.ERR_DEPRECATED);return r&&!nd[v]&&(nd[v]=!0,console.warn(c(v," has been deprecated since v"+r+" and will be removed in the near future"))),l?l(g,v,k):!0}};function kk(n,l,r){if(typeof n!="object")throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const h=Object.keys(n);let c=h.length;for(;c-- >0;){const g=h[c],v=l[g];if(v){const k=n[g],x=k===void 0||v(k,g,n);if(x!==!0)throw new pe("option "+g+" must be "+x,pe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new pe("Unknown option "+g,pe.ERR_BAD_OPTION)}}const $0={assertOptions:kk,validators:Kh},Ll=$0.validators;class va{constructor(l){this.defaults=l,this.interceptors={request:new Z1,response:new Z1}}request(l,r){typeof l=="string"?(r=r||{},r.url=l):r=l||{},r=lo(this.defaults,r);const{transitional:h,paramsSerializer:c,headers:g}=r;h!==void 0&&$0.assertOptions(h,{silentJSONParsing:Ll.transitional(Ll.boolean),forcedJSONParsing:Ll.transitional(Ll.boolean),clarifyTimeoutError:Ll.transitional(Ll.boolean)},!1),c!=null&&(St.isFunction(c)?r.paramsSerializer={serialize:c}:$0.assertOptions(c,{encode:Ll.function,serialize:Ll.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let v=g&&St.merge(g.common,g[r.method]);g&&St.forEach(["delete","get","head","post","put","patch","common"],D=>{delete g[D]}),r.headers=ml.concat(v,g);const k=[];let x=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(r)===!1||(x=x&&F.synchronous,k.unshift(F.fulfilled,F.rejected))});const I=[];this.interceptors.response.forEach(function(F){I.push(F.fulfilled,F.rejected)});let S,$=0,B;if(!x){const D=[td.bind(this),void 0];for(D.unshift.apply(D,k),D.push.apply(D,I),B=D.length,S=Promise.resolve(r);$<B;)S=S.then(D[$++],D[$++]);return S}B=k.length;let P=r;for($=0;$<B;){const D=k[$++],F=k[$++];try{P=D(P)}catch(X){F.call(this,X);break}}try{S=td.call(this,P)}catch(D){return Promise.reject(D)}for($=0,B=I.length;$<B;)S=S.then(I[$++],I[$++]);return S}getUri(l){l=lo(this.defaults,l);const r=Mp(l.baseURL,l.url);return vp(r,l.params,l.paramsSerializer)}}St.forEach(["delete","get","head","options"],function(l){va.prototype[l]=function(r,h){return this.request(lo(h||{},{method:l,url:r,data:(h||{}).data}))}});St.forEach(["post","put","patch"],function(l){function r(h){return function(g,v,k){return this.request(lo(k||{},{method:l,headers:h?{"Content-Type":"multipart/form-data"}:{},url:g,data:v}))}}va.prototype[l]=r(),va.prototype[l+"Form"]=r(!0)});const sa=va;class Qh{constructor(l){if(typeof l!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(g){r=g});const h=this;this.promise.then(c=>{if(!h._list Line truncated
`):" "+J1(g[0]):"as no adapter specified";throw new pe("There is no suitable adapter to dispatch the request "+v,"ERR_NOT_SUPPORT")}return h},adapters:S0};function Ei(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Cs(null,n)}function td(n){return Ei(n),n.headers=ml.from(n.headers),n.data=Ti.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),xp.getAdapter(n.adapter||Zh.adapter)(n).then(function(h){return Ei(n),h.data=Ti.call(n,n.transformResponse,h),h.headers=ml.from(h.headers),h},function(h){return bp(h)||(Ei(n),h&&h.response&&(h.response.data=Ti.call(n,n.transformResponse,h.response),h.response.headers=ml.from(h.response.headers))),Promise.reject(h)})}const ed=n=>n instanceof ml?n.toJSON():n;function lo(n,l){l=l||{};const r={};function h(I,S,$){return St.isPlainObject(I)&&St.isPlainObject(S)?St.merge.call({caseless:$},I,S):St.isPlainObject(S)?St.merge({},S):St.isArray(S)?S.slice():S}function c(I,S,$){if(St.isUndefined(S)){if(!St.isUndefined(I))return h(void 0,I,$)}else return h(I,S,$)}function g(I,S){if(!St.isUndefined(S))return h(void 0,S)}function v(I,S){if(St.isUndefined(S)){if(!St.isUndefined(I))return h(void 0,I)}else return h(void 0,S)}function k(I,S,$){if($ in l)return h(I,S);if($ in n)return h(void 0,I)}const x={url:g,method:g,data:g,baseURL:v,transformRequest:v,transformResponse:v,paramsSerializer:v,timeout:v,timeoutMessage:v,withCredentials:v,withXSRFToken:v,adapter:v,responseType:v,xsrfCookieName:v,xsrfHeaderName:v,onUploadProgress:v,onDownloadProgress:v,decompress:v,maxContentLength:v,maxBodyLength:v,beforeRedirect:v,transport:v,httpAgent:v,httpsAgent:v,cancelToken:v,socketPath:v,responseEncoding:v,validateStatus:k,headers:(I,S)=>c(ed(I),ed(S),!0)};return St.forEach(Object.keys(Object.assign({},n,l)),function(S){const $=x[S]||c,B=$(n[S],l[S],S);St.isUndefined(B)&&$!==k||(r[S]=B)}),r}const zp="1.6.2",Kh={};["object","boolean","number","function","string","symbol"].forEach((n,l)=>{Kh[n]=function(h){return typeof h===n||"a"+(l<1?"n ":" ")+n}});const nd={};Kh.transitional=function(l,r,h){function c(g,v){return"[Axios v"+zp+"] Transitional option '"+g+"'"+v+(h?". "+h:"")}return(g,v,k)=>{if(l===!1)throw new pe(c(v," has been removed"+(r?" in "+r:"")),pe.ERR_DEPRECATED);return r&&!nd[v]&&(nd[v]=!0,console.warn(c(v," has been deprecated since v"+r+" and will be removed in the near future"))),l?l(g,v,k):!0}};function kk(n,l,r){if(typeof n!="object")throw new pe("options must be an object",pe.ERR_BAD_OPTION_VALUE);const h=Object.keys(n);let c=h.length;for(;c-- >0;){const g=h[c],v=l[g];if(v){const k=n[g],x=k===void 0||v(k,g,n);if(x!==!0)throw new pe("option "+g+" must be "+x,pe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new pe("Unknown option "+g,pe.ERR_BAD_OPTION)}}const $0={assertOptions:kk,validators:Kh},Ll=$0.validators;class va{constructor(l){this.defaults=l,this.interceptors={request:new Z1,response:new Z1}}request(l,r){typeof l=="string"?(r=r||{},r.url=l):r=l||{},r=lo(this.defaults,r);const{transitional:h,paramsSerializer:c,headers:g}=r;h!==void 0&&$0.assertOptions(h,{silentJSONParsing:Ll.transitional(Ll.boolean),forcedJSONParsing:Ll.transitional(Ll.boolean),clarifyTimeoutError:Ll.transitional(Ll.boolean)},!1),c!=null&&(St.isFunction(c)?r.paramsSerializer={serialize:c}:$0.assertOptions(c,{encode:Ll.function,serialize:Ll.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let v=g&&St.merge(g.common,g[r.method]);g&&St.forEach(["delete","get","head","post","put","patch","common"],D=>{delete g[D]}),r.headers=ml.concat(v,g);const k=[];let x=!0;this.interceptors.request.forEach(function(F){typeof F.runWhen=="function"&&F.runWhen(r)===!1||(x=x&&F.synchronous,k.unshift(F.fulfilled,F.rejected))});const I=[];this.interceptors.response.forEach(function(F){I.push(F.fulfilled,F.rejected)});let S,$=0,B;if(!x){const D=[td.bind(this),void 0];for(D.unshift.apply(D,k),D.push.apply(D,I),B=D.length,S=Promise.resolve(r);$<B;)S=S.then(D[$++],D[$++]);return S}B=k.length;let P=r;for($=0;$<B;){const D=k[$++],F=k[$++];try{P=D(P)}catch(X){F.call(this,X);break}}try{S=td.call(this,P)}catch(D){return Promise.reject(D)}for($=0,B=I.length;$<B;)S=S.then(I[$++],I[$++]);return S}getUri(l){l=lo(this.defaults,l);const r=Mp(l.baseURL,l.url);return vp(r,l.params,l.paramsSerializer)}}St.forEach(["delete","get","head","options"],function(l){va.prototype[l]=function(r,h){return this.request(lo(h||{},{method:l,url:r,data:(h||{}).data}))}});St.forEach(["post","put","patch"],function(l){function r(h){return function(g,v,k){return this.request(lo(k||{},{method:l,headers:h?{"Content-Type":"multipart/form-data"}:{},url:g,data:v}))}}va.prototype[l]=r(),va.prototype[l+"Form"]=r(!0)});const sa=va;class Qh{constructor(l){if(typeof l!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(g){r=g});const h=this;this.promise.then(c=>{if(!h._list Line truncated
Expected #hex, #hexa, rgb(), rgba(), hsl(), hsla(), object or number`)}function bl(n){const{h:l,s:r,v:h,a:c}=n,g=k=>{const x=(k+l/60)%6;return h-h*r*Math.max(Math.min(x,4-x,1),0)},v=[g(5),g(3),g(1)].map(k=>Math.round(k*255));return{r:v[0],g:v[1],b:v[2],a:c}}function xd(n){return bl(o2(n))}function ei(n){if(!n)return{h:0,s:1,v:1,a:1};const l=n.r/255,r=n.g/255,h=n.b/255,c=Math.max(l,r,h),g=Math.min(l,r,h);let v=0;c!==g&&(c===l?v=60*(0+(r-h)/(c-g)):c===r?v=60*(2+(h-l)/(c-g)):c===h&&(v=60*(4+(l-r)/(c-g)))),v<0&&(v=v+360);const k=c===0?0:(c-g)/c,x=[v,k,c];return{h:x[0],s:x[1],v:x[2],a:n.a}}function Op(n){const{h:l,s:r,v:h,a:c}=n,g=h-h*r/2,v=g===1||g===0?0:(h-g)/Math.min(g,1-g);return{h:l,s:v,l:g,a:c}}function o2(n){const{h:l,s:r,l:h,a:c}=n,g=h+r*Math.min(h,1-h),v=g===0?0:2-2*h/g;return{h:l,s:v,v:g,a:c}}function Fp(n){let{r:l,g:r,b:h,a:c}=n;return c===void 0?`rgb(${l}, ${r}, ${h})`:`rgba(${l}, ${r}, ${h}, ${c})`}function Rp(n){return Fp(bl(n))}function Ks(n){const l=Math.round(n).toString(16);return("00".substr(0,2-l.length)+l).toUpperCase()}function Tp(n){let{r:l,g:r,b:h,a:c}=n;return`#${[Ks(l),Ks(r),Ks(h),c!==void 0?Ks(Math.round(c*255)):""].join("")}`}function Ep(n){n=t6(n);let[l,r,h,c]=Nk(n,2).map(g=>parseInt(g,16));return c=c===void 0?c:c/255,{r:l,g:r,b:h,a:c}}function Jk(n){const l=Ep(n);return ei(l)}function Vp(n){return Tp(bl(n))}function t6(n){return n.startsWith("#")&&(n=n.slice(1)),n=n.replace(/([^0-9a-f])/gi,"F"),(n.length===3||n.length===4)&&(n=n.split("").map(l=>l+l).join("")),n.length!==6&&(n=sd(sd(n,6),8,"F")),n}function e6(n,l){const r=Pp(r2(n));return r[0]=r[0]+l*10,Dp(Lp(r))}function n6(n,l){const r=Pp(r2(n));return r[0]=r[0]-l*10,Dp(Lp(r))}function D0(n){const l=Yn(n);return r2(l)[1]}function l6(n,l){const r=D0(n),h=D0(l),c=Math.max(r,h),g=Math.min(r,h);return(c+.05)/(g+.05)}function _p(n){const l=Math.abs(kd(Yn(0),Yn(n)));return Math.abs(kd(Yn(16777215),Yn(n)))>Math.min(l,50)?"#fff":"#000"}function mt(n,l){return r=>Object.keys(n).reduce((h,c)=>{const v=typeof n[c]=="object"&&n[c]!=null&&!Array.isArray(n[c])?n[c]:{type:n[c]};return r&&c in r?h[c]={...v,default:r[c]}:h[c]=v,l&&!h[c].source&&(h[c].source=l),h},{})}const Xt=mt({class:[String,Array],style:{type:[String,Array,Object],default:null}},"component");function Fn(n){if(n._setup=n._setup??n.setup,!n.name)return n;if(n._setup){n.props=mt(n.props??{},n.name)();const l=Object.keys(n.props);n.filterProps=function(h){return Mr(h,l,["class","style"])},n.props._as=String,n.setup=function(h,c){const g=i2();if(!g.value)return n._setup(h,c);const{props:v,provideSubDefaults:k}=c6(h,h._as??n.name,g),x=n._setup(v,c);return k(),x}}return n}function Bt(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return l=>(n?Fn:Cr)(l)}function Qn(n){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"div",r=arguments.length>2?arguments[2]:void 0;return Bt()({name:r??Il(Sn(n.replace(/__/g,"-"))),props:{tag:{type:String,default:l},...Xt()},setup(h,c){let{slots:g}=c;return()=>{var v;return Ln(h.tag,{class:[n,h.class],style:h.style},(v=g.default)==null?void 0:v.call(g))}}})}function Wp(n){if(typeof n.getRootNode!="function"){for(;n.parentNode;)n=n.parentNode;return n!==document?null:document}const l=n.getRootNode();return l!==document&&l.getRootNode({composed:!0})!==document?null:l}const as="cubic-bezier(0.4, 0, 0.2, 1)",r6="cubic-bezier(0.0, 0, 0.2, 1)",o6="cubic-bezier(0.4, 0, 1, 1)";function Ye(n,l){const r=al();if(!r)throw new Error(`[Vuetify] ${n} ${l||"must be called from inside a setup function"}`);return r}function Cl(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"composables";const l=Ye(n).type;return vr((l==null?void 0:l.aliasName)||(l==null?void 0:l.name))}let Xp=0,ia=new WeakMap;function hn(){const n=Ye("getUid");if(ia.has(n))return ia.get(n);{const l=Xp++;return ia.set(n,l),l}}hn.reset=()=>{Xp=0,ia=new WeakMap};function s2(n){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;for(;n;){if(l?s6(n):a2(n))return n;n=n.parentElement}return document.scrollingElement}function Ma(n,l){const r=[];if(l&&n&&!l.contains(n))return r;for(;n&&(a2(n)&&r.push(n),n!==l);)n=n.parentElement;return r}function a2(n){if(!n||n.nodeType!==Node.ELEMENT_NODE)return!1;const l=window.getComputedStyle(n);return l.overflowY==="scroll"||l.overflowY==="auto"&&n.scrollHeight>n.clientHeight}function s6(n){if(!n||n.nodeType!==Node.ELEMENT_NODE)return!1;const l=window.getComputedStyle(n);return["scroll","auto"].includes(l.overflowY)}function a6(n){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ye("injectSelf");const{provides:r}=l;if(r&&n in r)return r[n]}function i6(n){for(;n;){if(window.getComputedStyle(n).position==="fixed")return!0;n=n.offsetParent}return!1}function Dt(n){const l=Ye("useRender");l.render=n}const oo=Symbol.for("vuetify:defaults");function h6(n){return Lt(n)}function i2(){const n=de(oo);if(!n)throw new Error("[Vuetify] Could not find defaults instance");return n}function Te(n,l){const r=i2(),h=Lt(n),c=q( Line truncated
`,...r.map(h=>` ${h};
`),`}
@@ -1,4 +1,4 @@
import{ap as K,aq as Y,ar as V}from"./index-7c8bc001.js";var C={exports:{}};const $={},k=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"})),z=K(k);/**
import{ap as K,aq as Y,ar as V}from"./index-f71951bf.js";var C={exports:{}};const $={},k=Object.freeze(Object.defineProperty({__proto__:null,default:$},Symbol.toStringTag,{value:"Module"})),z=K(k);/**
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
+1 -1
View File
@@ -11,7 +11,7 @@
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap"
/>
<title>AstrBot - 仪表盘</title>
<script type="module" crossorigin src="/assets/index-7c8bc001.js"></script>
<script type="module" crossorigin src="/assets/index-f71951bf.js"></script>
<link rel="stylesheet" href="/assets/index-0f1523f3.css">
</head>
<body>
+3 -2
View File
@@ -27,13 +27,14 @@ class DashBoardConfig():
val_type: Optional[str] = None # 仅 item 才需要
class DashBoardHelper():
def __init__(self, dashboard_data: DashBoardData, config: dict):
def __init__(self, global_object, config: dict):
dashboard_data = global_object.dashboard_data
dashboard_data.configs = {
"data": []
}
self.parse_default_config(dashboard_data, config)
self.dashboard_data: DashBoardData = dashboard_data
self.dashboard = AstrBotDashBoard(self.dashboard_data)
self.dashboard = AstrBotDashBoard(global_object)
self.key_map = {} # key: uuid, value: config key name
self.cc = CmdConfig()
+55 -20
View File
@@ -8,6 +8,11 @@ import logging
from cores.database.conn import dbConn
from util.cmd_config import CmdConfig
import util.plugin_util as putil
import websockets
import json
import threading
import asyncio
import time
@dataclass
class DashBoardData():
@@ -23,14 +28,19 @@ class Response():
data: dict
class AstrBotDashBoard():
def __init__(self, dashboard_data: DashBoardData):
self.dashboard_data = dashboard_data
def __init__(self, global_object):
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(self.loop)
self.dashboard_data = global_object.dashboard_data
self.dashboard_be = Flask(__name__, static_folder="dist", static_url_path="/")
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
self.funcs = {}
self.cc = CmdConfig()
self.logger = global_object.logger
self.ws_clients = {} # remote_ip: ws
# 启动 websocket 服务器
self.ws_server = websockets.serve(self.__handle_msg, "localhost", 6186)
@self.dashboard_be.get("/")
def index():
@@ -132,15 +142,6 @@ class AstrBotDashBoard():
@self.dashboard_be.get("/api/extensions")
def get_plugins():
"""
{
"name": "GoodPlugins",
"repo": "https://gitee.com/soulter/goodplugins",
"author": "soulter",
"desc": "一些好用的插件",
"version": "1.0"
}
"""
_plugin_resp = []
for plugin in self.dashboard_data.plugins:
_p = self.dashboard_data.plugins[plugin]
@@ -163,9 +164,9 @@ class AstrBotDashBoard():
post_data = request.json
repo_url = post_data["url"]
try:
gu.log(f"正在安装插件 {repo_url}", tag="可视化面板")
self.logger.log(f"正在安装插件 {repo_url}", tag="可视化面板")
putil.install_plugin(repo_url, self.dashboard_data.plugins)
gu.log(f"安装插件 {repo_url} 成功", tag="可视化面板")
self.logger.log(f"安装插件 {repo_url} 成功", tag="可视化面板")
return Response(
status="success",
message="安装成功~",
@@ -183,9 +184,9 @@ class AstrBotDashBoard():
post_data = request.json
plugin_name = post_data["name"]
try:
gu.log(f"正在卸载插件 {plugin_name}", tag="可视化面板")
self.logger.log(f"正在卸载插件 {plugin_name}", tag="可视化面板")
putil.uninstall_plugin(plugin_name, self.dashboard_data.plugins)
gu.log(f"卸载插件 {plugin_name} 成功", tag="可视化面板")
self.logger.log(f"卸载插件 {plugin_name} 成功", tag="可视化面板")
return Response(
status="success",
message="卸载成功~",
@@ -203,9 +204,9 @@ class AstrBotDashBoard():
post_data = request.json
plugin_name = post_data["name"]
try:
gu.log(f"正在更新插件 {plugin_name}", tag="可视化面板")
self.logger.log(f"正在更新插件 {plugin_name}", tag="可视化面板")
putil.update_plugin(plugin_name, self.dashboard_data.plugins)
gu.log(f"更新插件 {plugin_name} 成功", tag="可视化面板")
self.logger.log(f"更新插件 {plugin_name} 成功", tag="可视化面板")
return Response(
status="success",
message="更新成功~",
@@ -217,6 +218,15 @@ class AstrBotDashBoard():
message=e.__str__(),
data=None
).__dict__
@self.dashboard_be.post("/api/log")
def log():
for item in self.ws_clients:
try:
asyncio.run_coroutine_threadsafe(self.ws_clients[item].send(request.data.decode()), self.loop)
except Exception as e:
pass
return 'ok'
def register(self, name: str):
def decorator(func):
@@ -224,10 +234,35 @@ class AstrBotDashBoard():
return func
return decorator
async def __handle_msg(self, websocket, path):
address = websocket.remote_address
# self.logger.log(f"和 {address} 建立了 websocket 连接", tag="可视化面板")
self.ws_clients[address] = websocket
data = ''.join(self.logger.history).replace('\n', '\r\n')
await websocket.send(data)
while True:
try:
msg = await websocket.recv()
except websockets.exceptions.ConnectionClosedError:
# self.logger.log(f"和 {address} 的 websocket 连接已断开", tag="可视化面板")
del self.ws_clients[address]
break
except Exception as e:
# self.logger.log(f"和 {path} 的 websocket 连接发生了错误: {e.__str__()}", tag="可视化面板")
del self.ws_clients[address]
break
def run_ws_server(self, loop):
asyncio.set_event_loop(loop)
loop.run_until_complete(self.ws_server)
loop.run_forever()
def run(self):
threading.Thread(target=self.run_ws_server, args=(self.loop,)).start()
self.logger.log("已启动 websocket 服务器", tag="可视化面板")
ip_address = gu.get_local_ip_addresses()
ip_str = f"http://{ip_address}:6185\n\thttp://localhost:6185"
gu.log(f"\n\n==================\n您可以访问:\n\n\t{ip_str}\n\n来登录可视化面板。\n注意: 所有配置项现已全量迁移至 cmd_config.json 文件下。您可以登录可视化面板在线修改配置。\n==================\n\n", tag="可视化面板")
# self.dashboard_be.run(host="0.0.0.0", port=6185)
self.logger.log(f"\n==================\n您可访问:\n\n\t{ip_str}\n\n来登录可视化面板,默认账号密码为空。\n注意: 所有配置项现已全量迁移至 cmd_config.json 文件下,可登录可视化面板在线修改配置。\n==================\n", tag="可视化面板")
http_server = make_server('0.0.0.0', 6185, self.dashboard_be)
http_server.serve_forever()
+45 -46
View File
@@ -19,6 +19,7 @@ from nakuru.entities.components import Plain,At,Image
from model.provider.provider import Provider
from model.command.command import Command
from util import general_utils as gu
from util.general_utils import Logger
from util.cmd_config import CmdConfig as cc
from util.cmd_config import init_astrbot_config_items
import util.function_calling.gplugin as gplugin
@@ -68,6 +69,7 @@ init_astrbot_config_items()
# 全局对象
_global_object: GlobalObject = None
logger: Logger = Logger()
# 统计消息数据
def upload():
@@ -90,7 +92,7 @@ def upload():
"others": o_j,
"sys": sys.platform,
}
gu.log(res, gu.LEVEL_DEBUG, tag="Upload", fg = gu.FG_COLORS['yellow'], bg=gu.BG_COLORS['black'])
logger.log(res, gu.LEVEL_DEBUG, tag="Uploader")
resp = requests.post('https://api.soulter.top/upload', data=json.dumps(res), timeout=5)
if resp.status_code == 200:
ok = resp.json()
@@ -98,8 +100,7 @@ def upload():
_global_object.cnt_total = 0
except BaseException as e:
gu.log("上传统计信息时出现错误: " + str(e), gu.LEVEL_ERROR, tag="Upload")
pass
logger.log("上传统计信息时出现错误: " + str(e), gu.LEVEL_ERROR, tag="Uploader")
time.sleep(10*60)
# 语言模型选择
@@ -123,6 +124,7 @@ def initBot(cfg):
global baidu_judge, chosen_provider
global frequency_count, frequency_time
global keywords, _global_object
global logger
# 迁移旧配置
gu.try_migrate_config(cfg)
@@ -138,6 +140,8 @@ def initBot(cfg):
_global_object.stat['session'] = {}
_global_object.stat['message'] = {}
_global_object.stat['platform'] = {}
_global_object.logger = logger
logger.log("AstrBot v"+version, gu.LEVEL_INFO)
if 'reply_prefix' in cfg:
# 适配旧版配置
@@ -149,10 +153,10 @@ def initBot(cfg):
_global_object.reply_prefix = cfg['reply_prefix']
# 语言模型提供商
gu.log("--------加载语言模型--------", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow'])
logger.log("正在载入语言模型...", gu.LEVEL_INFO)
prov = privider_chooser(cfg)
if REV_CHATGPT in prov:
gu.log("- 逆向ChatGPT库 -", gu.LEVEL_INFO)
logger.log("初始化:逆向 ChatGPT", gu.LEVEL_INFO)
if cfg['rev_ChatGPT']['enable']:
if 'account' in cfg['rev_ChatGPT']:
from model.provider.rev_chatgpt import ProviderRevChatGPT
@@ -161,11 +165,11 @@ def initBot(cfg):
llm_command_instance[REV_CHATGPT] = CommandRevChatGPT(llm_instance[REV_CHATGPT], _global_object)
chosen_provider = REV_CHATGPT
else:
input("[System-err] 请退出本程序, 然后在配置文件中填写rev_ChatGPT相关配置")
input("请退出本程序, 然后在配置文件中填写rev_ChatGPT相关配置")
if REV_EDGEGPT in prov:
gu.log("- New Bing -", gu.LEVEL_INFO)
logger.log("初始化:New Bing", gu.LEVEL_INFO)
if not os.path.exists('./cookies.json'):
input("[System-err] 导入Bing模型时发生错误, 没有找到cookies文件或者cookies文件放置位置错误。windows启动器启动的用户请把cookies.json文件放到和启动器相同的目录下。\n如何获取请看https://github.com/Soulter/QQChannelChatGPT仓库介绍。")
input("导入Bing模型时发生错误, 没有找到cookies文件或者cookies文件放置位置错误。windows启动器启动的用户请把cookies.json文件放到和启动器相同的目录下。\n如何获取请看https://github.com/Soulter/QQChannelChatGPT仓库介绍。")
else:
if cfg['rev_edgegpt']['enable']:
try:
@@ -176,9 +180,9 @@ def initBot(cfg):
chosen_provider = REV_EDGEGPT
except BaseException as e:
print(traceback.format_exc())
gu.log("加载Bing模型时发生错误, 请检查1. cookies文件是否正确放置 2. 是否设置了代理(梯子)。", gu.LEVEL_ERROR, max_len=60)
logger.log("加载Bing模型时发生错误, 请检查1. cookies文件是否正确放置 2. 是否设置了代理(梯子)。", gu.LEVEL_ERROR)
if OPENAI_OFFICIAL in prov:
gu.log("- OpenAI官方 -", gu.LEVEL_INFO)
logger.log("初始化:OpenAI官方", gu.LEVEL_INFO)
if cfg['openai']['key'] is not None and cfg['openai']['key'] != [None]:
from model.provider.openai_official import ProviderOpenAIOfficial
from model.command.openai_official import CommandOpenAIOfficial
@@ -186,7 +190,6 @@ def initBot(cfg):
llm_command_instance[OPENAI_OFFICIAL] = CommandOpenAIOfficial(llm_instance[OPENAI_OFFICIAL], _global_object)
chosen_provider = OPENAI_OFFICIAL
gu.log("--------加载配置--------", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow'])
# 得到关键词
if os.path.exists("keyword.json"):
with open("keyword.json", 'r', encoding='utf-8') as f:
@@ -196,25 +199,19 @@ def initBot(cfg):
p = cc.get("chosen_provider", None)
if p is not None and p in llm_instance:
chosen_provider = p
gu.log(f"将使用 {chosen_provider} 语言模型。", gu.LEVEL_INFO)
# 百度内容审核
if 'baidu_aip' in cfg and 'enable' in cfg['baidu_aip'] and cfg['baidu_aip']['enable']:
try:
baidu_judge = BaiduJudge(cfg['baidu_aip'])
gu.log("百度内容审核初始化成功", gu.LEVEL_INFO)
logger.log("百度内容审核初始化成功", gu.LEVEL_INFO)
except BaseException as e:
gu.log("百度内容审核初始化失败", gu.LEVEL_ERROR)
logger.log("百度内容审核初始化失败", gu.LEVEL_ERROR)
threading.Thread(target=upload, daemon=True).start()
# 得到私聊模式配置
if 'direct_message_mode' in cfg:
gu.log("私聊功能: "+str(cfg['direct_message_mode']), gu.LEVEL_INFO)
# 得到发言频率配置
if 'limit' in cfg:
gu.log("发言频率配置: "+str(cfg['limit']), gu.LEVEL_INFO)
if 'count' in cfg['limit']:
frequency_count = cfg['limit']['count']
if 'time' in cfg['limit']:
@@ -225,12 +222,8 @@ def initBot(cfg):
_global_object.uniqueSession = True
else:
_global_object.uniqueSession = False
gu.log("独立会话: "+str(_global_object.uniqueSession), gu.LEVEL_INFO)
except BaseException as e:
gu.log("独立会话配置错误: "+str(e), gu.LEVEL_ERROR)
if chosen_provider is None:
gu.log("检测到没有启动任何语言模型。", gu.LEVEL_CRITICAL)
logger.log("独立会话配置错误: "+str(e), gu.LEVEL_ERROR)
nick_qq = cc.get("nick_qq", None)
if nick_qq == None:
@@ -245,32 +238,33 @@ def initBot(cfg):
global llm_wake_prefix
llm_wake_prefix = cc.get("llm_wake_prefix", "")
gu.log("--------加载插件--------", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow'])
logger.log("正在载入插件...", gu.LEVEL_INFO)
# 加载插件
_command = Command(None, _global_object)
ok, err = putil.plugin_reload(_global_object.cached_plugins)
if ok:
gu.log("加载插件完成", gu.LEVEL_INFO)
logger.log(f"成功载入{len(_global_object.cached_plugins)}个插件", gu.LEVEL_INFO)
else:
gu.log(err, gu.LEVEL_ERROR)
logger.log(err, gu.LEVEL_ERROR)
if chosen_provider is None:
llm_command_instance[NONE_LLM] = _command
chosen_provider = NONE_LLM
gu.log("--------加载机器人平台--------", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow'])
gu.log("提示:需要添加管理员 ID 才能使用 update/plugin 等指令),可在可视化面板添加。(如已添加可忽略)", gu.LEVEL_WARNING)
logger.log("正在载入机器人消息平台", gu.LEVEL_INFO)
# logger.log("提示:需要添加管理员 ID 才能使用 update/plugin 等指令),可在可视化面板添加。(如已添加可忽略)", gu.LEVEL_WARNING)
platform_str = ""
# GOCQ
if 'gocqbot' in cfg and cfg['gocqbot']['enable']:
gu.log("- 启用 QQ_GOCQ 机器人 -", gu.LEVEL_INFO)
logger.log("启用 QQ_GOCQ 机器人消息平台", gu.LEVEL_INFO)
threading.Thread(target=run_gocq_bot, args=(cfg, _global_object), daemon=True).start()
platform_str += "QQ_GOCQ,"
# QQ频道
if 'qqbot' in cfg and cfg['qqbot']['enable']:
gu.log("- 启用 QQ_OFFICIAL 机器人 -", gu.LEVEL_INFO)
if 'qqbot' in cfg and cfg['qqbot']['enable'] and cfg['qqbot']['appid'] != None:
logger.log("启用 QQ_OFFICIAL 机器人消息平台", gu.LEVEL_INFO)
threading.Thread(target=run_qqchan_bot, args=(cfg, _global_object), daemon=True).start()
platform_str += "QQ_OFFICIAL,"
default_personality_str = cc.get("default_personality_str", "")
if default_personality_str == "":
@@ -287,16 +281,21 @@ def initBot(cfg):
logs={},
plugins=_global_object.cached_plugins,
)
dashboard_helper = DashBoardHelper(_global_object.dashboard_data, config=cc.get_all())
dashboard_helper = DashBoardHelper(_global_object, config=cc.get_all())
dashboard_thread = threading.Thread(target=dashboard_helper.run, daemon=True)
dashboard_thread.start()
# 运行 monitor
threading.Thread(target=run_monitor, args=(_global_object,), daemon=False).start()
gu.log("如果有任何问题, 请在 https://github.com/Soulter/AstrBot 上提交 issue 或加群 322154837。", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow'])
gu.log("请给 https://github.com/Soulter/AstrBot 点个 star。", gu.LEVEL_INFO, fg=gu.FG_COLORS['yellow'])
gu.log("🎉 项目启动完成。")
logger.log("如果有任何问题, 请在 https://github.com/Soulter/AstrBot 上提交 issue 或加群 322154837。", gu.LEVEL_INFO)
logger.log("请给 https://github.com/Soulter/AstrBot 点个 star。", gu.LEVEL_INFO)
if platform_str == '':
platform_str = "(未启动任何平台,请前往面板添加)"
logger.log(f"🎉 项目启动完成\n - 启动的LLM: {len(llm_instance)}个\n - 启动的平台: {platform_str}\n - 启动的插件: {len(_global_object.cached_plugins)}个")
if chosen_provider is None:
logger.log("没有启动任何语言模型。", gu.LEVEL_WARNING)
dashboard_thread.join()
@@ -338,8 +337,8 @@ def run_qqchan_bot(cfg: dict, global_object: GlobalObject):
global_object.platform_qqchan = qqchannel_bot
qqchannel_bot.run()
except BaseException as e:
gu.log("启动QQ频道机器人时出现错误, 原因如下: " + str(e), gu.LEVEL_CRITICAL, tag="QQ频道")
gu.log(r"如果您是初次启动,请前往可视化面板填写配置。详情请看:https://astrbot.soulter.top/center/。" + str(e), gu.LEVEL_CRITICAL, tag="System")
logger.log("启动QQ频道机器人时出现错误, 原因如下: " + str(e), gu.LEVEL_CRITICAL, tag="QQ频道")
logger.log(r"如果您是初次启动,请前往可视化面板填写配置。详情请看:https://astrbot.soulter.top/center/。" + str(e), gu.LEVEL_CRITICAL)
'''
运行 QQ_GOCQ 机器人
@@ -347,16 +346,16 @@ def run_qqchan_bot(cfg: dict, global_object: GlobalObject):
def run_gocq_bot(cfg: dict, _global_object: GlobalObject):
from model.platform.qq_gocq import QQGOCQ
gu.log("正在检查本地GO-CQHTTP连接...端口5700, 6700", tag="QQ")
logger.log("正在检查本地GO-CQHTTP连接...端口5700, 6700", tag="QQ")
noticed = False
while True:
if not gu.port_checker(5700, cc.get("gocq_host", "127.0.0.1")) or not gu.port_checker(6700, cc.get("gocq_host", "127.0.0.1")):
if not noticed:
noticed = True
gu.log("与GO-CQHTTP通信失败, 请检查GO-CQHTTP是否启动并正确配置。程序会每隔 5s 自动重试。", gu.LEVEL_CRITICAL, tag="QQ")
logger.log("与GO-CQHTTP通信失败, 请检查GO-CQHTTP是否启动并正确配置。程序会每隔 5s 自动重试。", gu.LEVEL_CRITICAL, tag="QQ")
time.sleep(5)
else:
gu.log("检查完毕,未发现问题。", tag="QQ")
logger.log("检查完毕,未发现问题。", tag="QQ")
break
try:
qq_gocq = QQGOCQ(cfg=cfg, message_handler=oper_msg)
@@ -422,7 +421,7 @@ async def oper_msg(message: Union[GroupMessage, FriendMessage, GuildMessage, Nak
for i in message.message:
if isinstance(i, Plain):
message_str += i.text.strip()
gu.log(f"收到消息:{message_str}", gu.LEVEL_INFO, tag=platform)
logger.log(message_str, gu.LEVEL_INFO, tag=platform)
if message_str == "":
return MessageResult("Hi~")
@@ -522,7 +521,7 @@ async def oper_msg(message: Union[GroupMessage, FriendMessage, GuildMessage, Nak
llm_result_str = _global_object.reply_prefix + llm_result_str
except BaseException as e:
gu.log(f"调用异常:{traceback.format_exc()}", gu.LEVEL_ERROR, max_len=100000)
logger.log(f"调用异常:{traceback.format_exc()}", gu.LEVEL_ERROR)
return MessageResult(f"调用语言模型例程时出现异常。原因: {str(e)}")
# 切换回原来的语言模型
@@ -585,4 +584,4 @@ async def oper_msg(message: Union[GroupMessage, FriendMessage, GuildMessage, Nak
try:
return MessageResult(llm_result_str)
except BaseException as e:
gu.log("回复消息错误: \n"+str(e), gu.LEVEL_ERROR)
logger.log("回复消息错误: \n"+str(e), gu.LEVEL_ERROR)
+1
View File
@@ -30,6 +30,7 @@ class GlobalObject:
default_personality: dict
dashboard_data: DashBoardData
stat: dict
logger: None
def __init__(self):
self.nick = None # gocq 的昵称
+3 -4
View File
@@ -3,7 +3,6 @@ from pip._internal import main as pipmain
import warnings
import traceback
import threading
import logging
warnings.filterwarnings("ignore")
abs_path = os.path.dirname(os.path.realpath(sys.argv[0])) + '/'
@@ -53,13 +52,13 @@ def check_env(ch_mirror=False):
pth = 'requirements.txt'
else:
pth = 'QQChannelChatGPT'+ os.sep +'requirements.txt'
print("正在检查更新第三方库...")
print("正在检查或下载第三方库,请耐心等待...")
try:
if ch_mirror:
print("使用阿里云镜像")
pipmain(['install', '-r', pth, '-i', 'https://mirrors.aliyun.com/pypi/simple/', '--quiet'])
pipmain(['install', '-r', pth, '-i', 'https://mirrors.aliyun.com/pypi/simple/'])
else:
pipmain(['install', '-r', pth, '--quiet'])
pipmain(['install', '-r', pth])
except BaseException as e:
print(e)
while True:
+5 -6
View File
@@ -13,10 +13,8 @@ import requests
from model.provider.provider import Provider
import json
import util.plugin_util as putil
import shutil
import importlib
from util.cmd_config import CmdConfig as cc
import stat
from util.general_utils import Logger
from nakuru.entities.components import (
Plain,
Image
@@ -34,6 +32,7 @@ class Command:
def __init__(self, provider: Provider, global_object: GlobalObject = None):
self.provider = provider
self.global_object = global_object
self.logger: Logger = global_object.logger
def check_command(self,
message,
@@ -73,9 +72,9 @@ class Command:
if hit:
return True, res
except BaseException as e:
gu.log(f"{k}插件异常,原因: {str(e)}\n已安装插件: {cached_plugins.keys}\n如果你没有相关装插件的想法, 请直接忽略此报错, 不影响其他功能的运行。", level=gu.LEVEL_WARNING)
self.logger.log(f"{k}插件异常,原因: {str(e)}\n已安装插件: {cached_plugins.keys}\n如果你没有相关装插件的想法, 请直接忽略此报错, 不影响其他功能的运行。", level=gu.LEVEL_WARNING)
except BaseException as e:
gu.log(f"{k} 插件异常,原因: {str(e)}\n已安装插件: {cached_plugins.keys}\n如果你没有相关装插件的想法, 请直接忽略此报错, 不影响其他功能的运行。", level=gu.LEVEL_WARNING)
self.logger.log(f"{k} 插件异常,原因: {str(e)}\n已安装插件: {cached_plugins.keys}\n如果你没有相关装插件的想法, 请直接忽略此报错, 不影响其他功能的运行。", level=gu.LEVEL_WARNING)
if self.command_start_with(message, "nick"):
return True, self.set_nick(message, platform, role)
@@ -253,7 +252,7 @@ class Command:
p = gu.create_markdown_image(msg)
return [Image.fromFileSystem(p)]
except BaseException as e:
gu.log(str(e))
self.logger.log(str(e))
finally:
return msg
+3 -2
View File
@@ -33,6 +33,7 @@ class QQGOCQ(Platform):
self.gocq_cnt = 0
self.cc = CmdConfig()
self.cfg = cfg
self.logger = gu.Logger()
try:
self.nick_qq = cfg['nick_qq']
@@ -177,8 +178,8 @@ class QQGOCQ(Platform):
res = result_message
self.gocq_cnt += 1
gu.log("回复GOCQ消息: "+str(res), level=gu.LEVEL_INFO, tag="GOCQ", max_len=300)
self.logger.log(f"{source.user_id} <- {res}", tag="GOCQ")
if isinstance(source, int):
source = FakeSource("GroupMessage", source)
+4 -3
View File
@@ -13,9 +13,9 @@ import time
from ._platfrom import Platform
from ._nakuru_translation_layer import(
NakuruGuildMessage,
NakuruGuildMember,
gocq_compatible_receive,
gocq_compatible_send,
NakuruGuildMember
gocq_compatible_send
)
# QQ 机器人官方框架
@@ -56,6 +56,7 @@ class QQOfficial(Platform):
self.token = cfg['qqbot']['token']
self.secret = cfg['qqbot_secret']
self.unique_session = cfg['uniqueSessionMode']
self.logger = gu.Logger()
self.intents = botpy.Intents(
public_guild_messages=True,
@@ -125,7 +126,7 @@ class QQOfficial(Platform):
'''
回复频道消息
'''
gu.log("回复QQ频道消息: "+str(res), level=gu.LEVEL_INFO, tag="QQ频道", max_len=500)
self.logger.log(f"{message.sender.nickname}({message.sender.tiny_id}) <- {res}", tag="QQ频道")
self.qqchan_cnt += 1
plain_text = ''
+19 -17
View File
@@ -10,6 +10,7 @@ from model.provider.provider import Provider
import threading
from util import general_utils as gu
from util.cmd_config import CmdConfig
from util.general_utils import Logger
import traceback
import tiktoken
@@ -19,6 +20,7 @@ abs_path = os.path.dirname(os.path.realpath(sys.argv[0])) + '/'
class ProviderOpenAIOfficial(Provider):
def __init__(self, cfg):
self.cc = CmdConfig()
self.logger = Logger()
self.key_list = []
# 如果 cfg['key']中有长度为1的字符串,那么是格式错误,直接报错
@@ -40,7 +42,7 @@ class ProviderOpenAIOfficial(Provider):
self.api_base = None
if 'api_base' in cfg and cfg['api_base'] != 'none' and cfg['api_base'] != '':
self.api_base = cfg['api_base']
gu.log(f"设置 api_base 为: {self.api_base}")
self.logger.log(f"设置 api_base 为: {self.api_base}", tag="OpenAI")
# openai client
self.client = OpenAI(
api_key=self.key_list[0],
@@ -48,7 +50,7 @@ class ProviderOpenAIOfficial(Provider):
)
self.openai_model_configs: dict = cfg['chatGPTConfigs']
gu.log(f'加载 OpenAI Chat Configs: {self.openai_model_configs}')
self.logger.log(f'加载 OpenAI Chat Configs: {self.openai_model_configs}', tag="OpenAI")
self.openai_configs = cfg
# 会话缓存
self.session_dict = {}
@@ -64,9 +66,9 @@ class ProviderOpenAIOfficial(Provider):
db1 = dbConn()
for session in db1.get_all_session():
self.session_dict[session[0]] = json.loads(session[1])['data']
gu.log("读取历史记录成功。")
self.logger.log("读取历史记录成功。", tag="OpenAI")
except BaseException as e:
gu.log("读取历史记录失败,但不影响使用。", level=gu.LEVEL_ERROR)
self.logger.log("读取历史记录失败,但不影响使用。", level=gu.LEVEL_ERROR, tag="OpenAI")
# 读取统计信息
@@ -169,11 +171,11 @@ class ProviderOpenAIOfficial(Provider):
_encoded_prompt = self.enc.encode(prompt)
if self.openai_model_configs['max_tokens'] < len(_encoded_prompt):
prompt = self.enc.decode(_encoded_prompt[:int(self.openai_model_configs['max_tokens']*0.80)])
gu.log(f"注意,有一部分 prompt 文本由于超出 token 限制而被截断。", level=gu.LEVEL_WARNING, max_len=300)
self.logger.log(f"注意,有一部分 prompt 文本由于超出 token 限制而被截断。", level=gu.LEVEL_WARNING, tag="OpenAI")
cache_data_list, new_record, req = self.wrap(prompt, session_id, image_url)
gu.log(f"CACHE_DATA_: {str(cache_data_list)}", level=gu.LEVEL_DEBUG, max_len=99999)
gu.log(f"OPENAI REQUEST: {str(req)}", level=gu.LEVEL_DEBUG, max_len=9999)
self.logger.log(f"CACHE_DATA_: {str(cache_data_list)}", level=gu.LEVEL_DEBUG, tag="OpenAI")
self.logger.log(f"OPENAI REQUEST: {str(req)}", level=gu.LEVEL_DEBUG, tag="OpenAI")
retry = 0
response = None
err = ''
@@ -216,7 +218,7 @@ class ProviderOpenAIOfficial(Provider):
if 'Invalid content type. image_url is only supported by certain models.' in str(e):
raise e
if 'You exceeded' in str(e) or 'Billing hard limit has been reached' in str(e) or 'No API key provided' in str(e) or 'Incorrect API key provided' in str(e):
gu.log("当前Key已超额或异常, 正在切换", level=gu.LEVEL_WARNING)
self.logger.log("当前 Key 已超额或异常, 正在切换", level=gu.LEVEL_WARNING, tag="OpenAI")
self.key_stat[self.client.api_key]['exceed'] = True
is_switched = self.handle_switch_key()
if not is_switched:
@@ -224,7 +226,7 @@ class ProviderOpenAIOfficial(Provider):
raise e
retry -= 1
elif 'maximum context length' in str(e):
gu.log("token超限, 清空对应缓存,并进行消息截断")
self.logger.log("token 超限, 清空对应缓存,并进行消息截断", tag="OpenAI")
self.session_dict[session_id] = []
prompt = prompt[:int(len(prompt)*truncate_rate)]
truncate_rate -= 0.05
@@ -234,15 +236,15 @@ class ProviderOpenAIOfficial(Provider):
time.sleep(30)
continue
else:
gu.log(str(e), level=gu.LEVEL_ERROR)
self.logger.log(str(e), level=gu.LEVEL_ERROR, tag="OpenAI")
time.sleep(2)
err = str(e)
retry += 1
if retry >= 10:
gu.log(r"如果报错, 且您的机器在中国大陆内, 请确保您的电脑已经设置好代理软件(梯子), 并在配置文件设置了系统代理地址。详见 https://github.com/Soulter/QQChannelChatGPT/wiki", max_len=999)
self.logger.log(r"如果报错, 且您的机器在中国大陆内, 请确保您的电脑已经设置好代理软件(梯子), 并在配置文件设置了系统代理地址。详见 https://github.com/Soulter/QQChannelChatGPT/wiki", tag="OpenAI")
raise BaseException("连接出错: "+str(err))
assert isinstance(response, ChatCompletion)
gu.log(f"OPENAI RESPONSE: {response.usage}", level=gu.LEVEL_DEBUG, max_len=9999)
self.logger.log(f"OPENAI RESPONSE: {response.usage}", level=gu.LEVEL_DEBUG, tag="OpenAI")
# 结果分类
choice = response.choices[0]
@@ -307,17 +309,17 @@ class ProviderOpenAIOfficial(Provider):
image_url.append(response.data[i].url)
break
except Exception as e:
gu.log(str(e), level=gu.LEVEL_ERROR)
self.logger.log(str(e), level=gu.LEVEL_ERROR)
if 'You exceeded' in str(e) or 'Billing hard limit has been reached' in str(
e) or 'No API key provided' in str(e) or 'Incorrect API key provided' in str(e):
gu.log("当前 Key 已超额或者不正常, 正在切换", level=gu.LEVEL_WARNING)
self.logger.log("当前 Key 已超额或者不正常, 正在切换", level=gu.LEVEL_WARNING, tag="OpenAI")
self.key_stat[self.client.api_key]['exceed'] = True
is_switched = self.handle_switch_key()
if not is_switched:
# 所有Key都超额或不正常
raise e
elif 'Your request was rejected as a result of our safety system.' in str(e):
gu.log("您的请求被 OpenAI 安全系统拒绝, 请稍后再试", level=gu.LEVEL_WARNING)
self.logger.log("您的请求被 OpenAI 安全系统拒绝, 请稍后再试", level=gu.LEVEL_WARNING, tag="OpenAI")
raise e
else:
retry += 1
@@ -431,10 +433,10 @@ class ProviderOpenAIOfficial(Provider):
continue
is_all_exceed = False
self.client.api_key = key
gu.log(f"切换到Key: {key}, 已使用token: {self.key_stat[key]['used']}", level=gu.LEVEL_INFO)
self.logger.log(f"切换到 Key: {key}(已使用 token: {self.key_stat[key]['used']})", level=gu.LEVEL_INFO, tag="OpenAI")
break
if is_all_exceed:
gu.log("所有Key已超额", level=gu.LEVEL_CRITICAL)
self.logger.log("所有 Key 已超额", level=gu.LEVEL_CRITICAL, tag="OpenAI")
return False
return True
+8
View File
@@ -0,0 +1,8 @@
from pip._internal.operations.freeze import freeze
# 获取已安装包的信息
installed_packages = freeze()
# 输出已安装包的信息
for package in installed_packages:
print(package)
+81 -64
View File
@@ -9,6 +9,8 @@ from util.cmd_config import CmdConfig
import socket
from cores.qqbot.global_object import GlobalObject
import platform
import requests
import logging
PLATFORM_GOCQ = 'gocq'
PLATFORM_QQCHAN = 'qqchan'
@@ -39,83 +41,96 @@ BG_COLORS = {
LEVEL_DEBUG = "DEBUG"
LEVEL_INFO = "INFO"
LEVEL_WARNING = "WARNING"
LEVEL_WARNING = "WARN"
LEVEL_ERROR = "ERROR"
LEVEL_CRITICAL = "CRITICAL"
# 为了兼容旧版
level_codes = {
LEVEL_DEBUG: 0,
LEVEL_INFO: 1,
LEVEL_WARNING: 2,
LEVEL_ERROR: 3,
LEVEL_CRITICAL: 4
LEVEL_DEBUG: logging.DEBUG,
LEVEL_INFO: logging.INFO,
LEVEL_WARNING: logging.WARNING,
LEVEL_ERROR: logging.ERROR,
LEVEL_CRITICAL: logging.CRITICAL,
}
level_colors = {
"INFO": "green",
"WARNING": "yellow",
"WARN": "yellow",
"ERROR": "red",
"CRITICAL": "purple",
}
def log(
msg: str,
level: str = "INFO",
tag: str = "System",
fg: str = None,
bg: str = None,
max_len: int = 500,
err: Exception = None,):
"""
日志打印函数
"""
_set_level_code = level_codes[LEVEL_INFO]
if 'LOG_LEVEL' in os.environ and os.environ['LOG_LEVEL'] in level_codes:
_set_level_code = level_codes[os.environ['LOG_LEVEL']]
if level in level_codes and level_codes[level] < _set_level_code:
return
class Logger:
def __init__(self) -> None:
self.history = []
if err is not None:
msg += "\n异常原因: " + str(err)
level = LEVEL_ERROR
def log(
self,
msg: str,
level: str = "INFO",
tag: str = "System",
fg: str = None,
bg: str = None,
max_len: int = 50000,
err: Exception = None,):
"""
日志打印函数
"""
_set_level_code = level_codes[LEVEL_INFO]
if 'LOG_LEVEL' in os.environ and os.environ['LOG_LEVEL'] in level_codes:
_set_level_code = level_codes[os.environ['LOG_LEVEL']]
if len(msg) > max_len:
msg = msg[:max_len] + "..."
now = datetime.datetime.now().strftime("%m-%d %H:%M:%S")
pres = []
for line in msg.split("\n"):
if line == "\n":
pres.append("")
else:
pres.append(f"[{now}] [{level}] [{tag}]: {line}")
if level in level_codes and level_codes[level] < _set_level_code:
return
if err is not None:
msg += "\n异常原因: " + str(err)
level = LEVEL_ERROR
if level == "INFO":
if fg is None:
fg = FG_COLORS["green"]
if bg is None:
bg = BG_COLORS["default"]
elif level == "WARNING":
if fg is None:
fg = FG_COLORS["yellow"]
if bg is None:
bg = BG_COLORS["default"]
elif level == "ERROR":
if fg is None:
fg = FG_COLORS["red"]
if bg is None:
bg = BG_COLORS["default"]
elif level == "CRITICAL":
if fg is None:
fg = FG_COLORS["purple"]
if bg is None:
bg = BG_COLORS["default"]
ret = ""
for line in pres:
ret += f"\033[{fg};{bg}m{line}\033[0m\n"
print(ret[:-1])
if len(msg) > max_len:
msg = msg[:max_len] + "..."
now = datetime.datetime.now().strftime("%H:%M:%S")
pres = []
for line in msg.split("\n"):
if line == "\n":
pres.append("")
else:
pres.append(f"[{now}] [{tag}/{level}] {line}")
if level == "INFO":
if fg is None:
fg = FG_COLORS["green"]
if bg is None:
bg = BG_COLORS["default"]
elif level == "WARN":
if fg is None:
fg = FG_COLORS["yellow"]
if bg is None:
bg = BG_COLORS["default"]
elif level == "ERROR":
if fg is None:
fg = FG_COLORS["red"]
if bg is None:
bg = BG_COLORS["default"]
elif level == "CRITICAL":
if fg is None:
fg = FG_COLORS["purple"]
if bg is None:
bg = BG_COLORS["default"]
ret = ""
for line in pres:
ret += f"\033[{fg};{bg}m{line}\033[0m\n"
try:
requests.post("http://localhost:6185/api/log", data=ret[:-1].encode())
except BaseException as e:
pass
self.history.append(ret)
if len(self.history) > 100:
self.history = self.history[-100:]
print(ret[:-1])
def port_checker(port: int, host: str = "localhost"):
@@ -466,7 +481,7 @@ def save_temp_img(img: Image) -> str:
if time.time() - ctime > 3600:
os.remove(path)
except Exception as e:
log(f"清除临时文件失败: {e}", level=LEVEL_WARNING, tag="GeneralUtils")
print(f"清除临时文件失败: {e}", level=LEVEL_WARNING, tag="GeneralUtils")
# 获得时间戳
timestamp = int(time.time())
@@ -514,13 +529,15 @@ def try_migrate_config(old_config: dict):
cc.put(k, old_config[k])
def get_local_ip_addresses():
ip = ''
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('8.8.8.8', 80))
ip = s.getsockname()[0]
except BaseException as e:
pass
finally:
s.close()
return ip
def get_sys_info(global_object: GlobalObject):