2 lines
77 KiB
JavaScript
2 lines
77 KiB
JavaScript
|
|
var xt=Object.defineProperty;var wt=(t,e,i)=>e in t?xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var B=(t,e,i)=>wt(t,typeof e!="symbol"?e+"":e,i);import{a4 as Et,r as H,c as G,k as D,aw as St,l as Pe,$ as S,Z as $,_ as a,aa as _,ak as ue,n as Ee,o as ge,a0 as F,ai as De,X as se,S as x,a9 as ne,j as L,F as me,P as Ie,L as ae,R as Q,a6 as K,m as kt,al as Ce,w as ye,an as gt,aj as je,ao as Fe,G as Lt,y as mt,b as $t,ax as Tt,e as Mt,a8 as Le,K as Ft,v as Be}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{i as te,m as j,h as he,a3 as At,co as qe,c as R,h8 as ie,w as we,_ as It,h9 as Ot}from"./index-BTglIPU2.js?v=1773287522785";import{b as $e,r as zt,d as He,c as Ht,a as Nt,e as We,f as vt,h as Pt}from"./files-BUbkyTRl.js?v=1773287522785";import{p as Dt,_ as bt,B as Rt,ay as Ke,n as Oe,ai as Gt,b as Ut,al as Vt,b5 as jt,aI as Bt}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{a as fe}from"./ace-CNnfDSio.js?v=1773287522785";import{_ as qt}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{u as Wt}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const Je={supportedModes:{Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],CSS:["css"],HTML:["html|htm|xhtml|vue|we|wpy"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSP:["jsp"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],MySQL:["mysql"],Nginx:["nginx|conf"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Powershell:["ps1"],Python:["py"],SQL:["sql"],SQLServer:["sqlserver"],Text:["txt"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],YAML:["yaml|yml"],images:["icon|jpg|jpeg|png|bmp|gif|tif|emf"]},nameOverrides:{PHP_Laravel_blade:"PHP (Blade Template)"},encodingList:["ASCII","UTF-8","GBK","GB2312","BIG5"],themeList:["chrome","monokai","tomorrow_night_bright"],aceEditor:{editorTheme:"monokai",fontSize:14,softLabel:!1,useSoftTabs:!0,tabSize:4,wrap:!0,enableSnippets:!0,enableLiveAutocompletion:!0,highlightActiveLine:!0,highlightSelectedWord:!0,animatedScroll:!1,showInvisibles:!0,showFoldWidgets:!0,showLineNumbers:!0,showGutter:!0,displayIndentGuides:!1},fontFamily:"12px/normal 'Consolas', 'Menlo', 'Monaco', 'Ubuntu Mono', 'source-code-pro', 'Courier New', monospace",encoding:"utf-8"},Ye="/www/server/panel/YakPanel/static/ace/ace.editor.config.json",{t:q}=At.global,W=Et("fileEditor",()=>{const t=H([]),e=H(-1),i=H("/www"),o=H(0),n=H(!1),s=H(Dt(Je)),l=H(null),c=H(!1),f=H(""),d=H(!1),r=G(()=>e.value>=0&&e.value<t.value.length?t.value[e.value]:null),u=v=>{const E=v.split("/").pop()||q("fileEditor.store.untitled"),N=v.split(".").pop()||"text";return{path:v,type:N,name:E,loading:!1,lineEnding:"LF",content:"",originalContent:"",encoding:"",st_mtime:0,onlyRead:!1,history:[]}},h=async v=>{const E=t.value.findIndex(z=>z.path===v);if(E!==-1){e.value=E;return}const N=u(v),P=e.value+1;t.value.splice(P,0,N),e.value=P;const{message:U}=await $e({path:v});if(te(U)){const z=t.value[P];z.content=U.data,z.originalContent=U.data,z.encoding=U.encoding,z.st_mtime=Number(U.st_mtime),z.onlyRead=U.only_read,z.history=U.historys||[],z.onlyRead&&j.warning(q("fileEditor.store.fileTooLarge"))}},g=()=>{const v="__shortcut__",E=t.value.findIndex(U=>U.path===v);if(E!==-1){e.value=E;return}const N={path:v,type:"shortcut",name:q("fileEditor.store.shortcutTabName"),loading:!1,lineEnding:"LF",content:"",originalContent:"",encoding:"UTF-8",st_mtime:0,onlyRead:!1,history:[]},P=e.value+1;t.value.splice(P,0,N),e.value=P},b=async(v,E)=>{var ee,Ve;const N=v.split("/").pop()||"Untitled",P="__diff__".concat(v,"__").concat(E),U=t.value.findIndex(re=>re.path===P);if(U!==-1){e.value=U;return}const z={path:P,type:"diff",n
|