tianxincode 1.0.44 → 1.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/package.json +1 -1
  2. package/web/dist/assets/{AiLogsView-D4q7SeY_.js → AiLogsView-CGChYsCu.js} +1 -1
  3. package/web/dist/assets/{ConfirmDialog-BG4cU7oU.js → ConfirmDialog-i764Fe1J.js} +1 -1
  4. package/web/dist/assets/{CustomActionsView-DTvj_4OE.js → CustomActionsView-DK90gPZQ.js} +1 -1
  5. package/web/dist/assets/DevWorkflowView-Dlx87j1J.css +1 -0
  6. package/web/dist/assets/DevWorkflowView-DrB-43Yj.js +32 -0
  7. package/web/dist/assets/{DevWorkflowViewApp-CPTC7cf7.css → DevWorkflowViewApp-Dh8RmDTn.css} +1 -1
  8. package/web/dist/assets/{DevWorkflowViewApp-D8czrLj2.js → DevWorkflowViewApp-_HnmCVhK.js} +14 -3
  9. package/web/dist/assets/{GitChanges-DxJT8Ng9.js → GitChanges-SeV5YkQj.js} +1 -1
  10. package/web/dist/assets/{GitChangesApp-DGRKqsrc.js → GitChangesApp-DKYWSFuu.js} +1 -1
  11. package/web/dist/assets/{Layout-CIntssMR.js → Layout-Dac-0iLp.js} +1 -1
  12. package/web/dist/assets/{TasksView-DuTglEsf.js → TasksView-Czet5EAj.js} +1 -1
  13. package/web/dist/assets/{TerminalView-RG937_-M.js → TerminalView-D0lsGhmz.js} +1 -1
  14. package/web/dist/assets/{WikiView-wDIfjQT_.js → WikiView-Dv89zXYv.js} +1 -1
  15. package/web/dist/assets/{cssMode-DAdY-5X0.js → cssMode-DMbMrSuH.js} +1 -1
  16. package/web/dist/assets/{deployView-OlhJU698.js → deployView-3xv4omoq.js} +1 -1
  17. package/web/dist/assets/{fileZihao-Bm-uB2BS.js → fileZihao-BtiZhQPu.js} +1 -1
  18. package/web/dist/assets/{freemarker2-OIgEfGdK.js → freemarker2-SNlo5J8Q.js} +1 -1
  19. package/web/dist/assets/{handlebars-CwUrtebj.js → handlebars-BpK8If7E.js} +1 -1
  20. package/web/dist/assets/{html-DplPIfs6.js → html-nEQAifNW.js} +1 -1
  21. package/web/dist/assets/{htmlMode-BpbIfVaE.js → htmlMode-DEqGTpB2.js} +1 -1
  22. package/web/dist/assets/{index-D4xhVePW.css → index-BBtbYgnN.css} +1 -1
  23. package/web/dist/assets/{index-Dtkc_ka-.js → index-Ch_-1SCN.js} +170 -168
  24. package/web/dist/assets/{javascript-B_eZzRqF.js → javascript-BwcOXj_g.js} +1 -1
  25. package/web/dist/assets/{jsonMode-9MZfSMtt.js → jsonMode-53JPwHSr.js} +1 -1
  26. package/web/dist/assets/{liquid-Q68k40m8.js → liquid-V_os1vrB.js} +1 -1
  27. package/web/dist/assets/{mdx-BH-rWx_x.js → mdx-CPetceIt.js} +1 -1
  28. package/web/dist/assets/{python-DvT3SN5P.js → python-CMN0i-H4.js} +1 -1
  29. package/web/dist/assets/{razor-C2wZYTc7.js → razor-BNIl4Aha.js} +1 -1
  30. package/web/dist/assets/{tsMode-Cm8eLc0y.js → tsMode-DIXOnfbq.js} +1 -1
  31. package/web/dist/assets/{typescript-B5qDQjhx.js → typescript-eB2uDNeR.js} +1 -1
  32. package/web/dist/assets/{xml-CZxclJkM.js → xml-BsumxOS3.js} +1 -1
  33. package/web/dist/assets/{yaml-BAVixhgZ.js → yaml-CzHP1b1B.js} +1 -1
  34. package/web/dist/index.html +2 -2
  35. package/web/dist/assets/DevWorkflowView-BjUv5lsU.js +0 -16
  36. package/web/dist/assets/DevWorkflowView-Cc_t3ltj.css +0 -1
@@ -1,4 +1,4 @@
1
- import{n as pe,a as re}from"./index-Dtkc_ka-.js";var ge={exports:{}};(function(N,F){(function(j,Y){N.exports=Y()})(self,()=>(()=>{var j={4567:function(O,r,a){var c=this&&this.__decorate||function(i,o,l,v){var m,h=arguments.length,p=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,l,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(p=(h<3?m(p):h>3?m(o,l,p):m(o,l))||p);return h>3&&p&&Object.defineProperty(o,l,p),p},_=this&&this.__param||function(i,o){return function(l,v){o(l,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),g=a(844),u=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends g.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 l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,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(l=>this._handleResize(l.rows))),this.register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(l=>this._handleChar(l))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
1
+ import{n as pe,a as re}from"./index-Ch_-1SCN.js";var ge={exports:{}};(function(N,F){(function(j,Y){N.exports=Y()})(self,()=>(()=>{var j={4567:function(O,r,a){var c=this&&this.__decorate||function(i,o,l,v){var m,h=arguments.length,p=h<3?o:v===null?v=Object.getOwnPropertyDescriptor(o,l):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,o,l,v);else for(var b=i.length-1;b>=0;b--)(m=i[b])&&(p=(h<3?m(p):h>3?m(o,l,p):m(o,l))||p);return h>3&&p&&Object.defineProperty(o,l,p),p},_=this&&this.__param||function(i,o){return function(l,v){o(l,v,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const n=a(9042),d=a(6114),f=a(9924),g=a(844),u=a(5596),e=a(4725),s=a(3656);let t=r.AccessibilityManager=class extends g.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 l=0;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);if(this._topBoundaryFocusListener=l=>this._handleBoundaryFocus(l,0),this._bottomBoundaryFocusListener=l=>this._handleBoundaryFocus(l,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(l=>this._handleResize(l.rows))),this.register(this._terminal.onRender(l=>this._refreshRows(l.start,l.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(l=>this._handleChar(l))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
2
2
  `))),this.register(this._terminal.onA11yTab(l=>this._handleTab(l))),this.register(this._terminal.onKey(l=>this._handleKey(l.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new u.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,g.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===`
3
3
  `&&(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(),new RegExp("\\p{Control}","u").test(i)||this._charsToConsume.push(i)}_refreshRows(i,o){this._liveRegionDebouncer.refresh(i,o,this._terminal.rows)}_renderRows(i,o){const l=this._terminal.buffer,v=l.lines.length.toString();for(let m=i;m<=o;m++){const h=l.translateBufferLineToString(l.ydisp+m,!0),p=(l.ydisp+m+1).toString(),b=this._rowElements[m];b&&(h.length===0?b.innerText=" ":b.textContent=h,b.setAttribute("aria-posinset",p),b.setAttribute("aria-setsize",v))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(i,o){const l=i.target,v=this._rowElements[o===0?1:this._rowElements.length-2];if(l.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||i.relatedTarget!==v)return;let m,h;if(o===0?(m=l,h=this._rowElements.pop(),this._rowContainer.removeChild(h)):(m=this._rowElements.shift(),h=l,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),h.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const p=this._createAccessibilityTreeNode();this._rowElements.unshift(p),this._rowContainer.insertAdjacentElement("afterbegin",p)}else{const p=this._createAccessibilityTreeNode();this._rowElements.push(p),this._rowContainer.appendChild(p)}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=c([_(1,e.IRenderService)],t)},3614:(O,r)=>{function a(d){return d.replace(/\r?\n/g,"\r")}function c(d,f){return f?"\x1B[200~"+d+"\x1B[201~":d}function _(d,f,g,u){d=c(d=a(d),g.decPrivateModes.bracketedPasteMode&&u.rawOptions.ignoreBracketedPasteMode!==!0),g.triggerDataEvent(d,!0),f.value=""}function n(d,f,g){const u=g.getBoundingClientRect(),e=d.clientX-u.left-10,s=d.clientY-u.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=c,r.copyHandler=function(d,f){d.clipboardData&&d.clipboardData.setData("text/plain",f.selectionText),d.preventDefault()},r.handlePasteEvent=function(d,f,g,u){d.stopPropagation(),d.clipboardData&&_(d.clipboardData.getData("text/plain"),f,g,u)},r.paste=_,r.moveTextAreaUnderMouseCursor=n,r.rightClickHandler=function(d,f,g,u,e){n(d,f,g),e&&u.rightClickSelect(d),f.value=u.selectionText,f.select()}},7239:(O,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=a(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(_,n,d){this._css.set(_,n,d)}getCss(_,n){return this._css.get(_,n)}setColor(_,n,d){this._color.set(_,n,d)}getColor(_,n){return this._color.get(_,n)}clear(){this._color.clear(),this._css.clear()}}},3656:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,c,_,n){a.addEventListener(c,_,n);let d=!1;return{dispose:()=>{d||(d=!0,a.removeEventListener(c,_,n))}}}},6465:function(O,r,a){var c=this&&this.__decorate||function(e,s,t,i){var o,l=arguments.length,v=l<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,t):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,s,t,i);else for(var m=e.length-1;m>=0;m--)(o=e[m])&&(v=(l<3?o(v):l>3?o(s,t,v):o(s,t))||v);return l>3&&v&&Object.defineProperty(s,t,v),v},_=this&&this.__param||function(e,s){return function(t,i){s(t,i,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const n=a(3656),d=a(8460),f=a(844),g=a(2585);let u=r.Linkifier2=class extends f.Disposable{get currentLink(){return this._currentLink}constructor(e){super(),this._bufferService=e,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new d.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new d.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,f.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,f.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(e){return this._linkProviders.push(e),{dispose:()=>{const s=this._linkProviders.indexOf(e);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(e,s,t){this._element=e,this._mouseService=s,this._renderService=t,this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){if(this._lastMouseEvent=e,!this._element||!this._mouseService)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;const t=e.composedPath();for(let i=0;i<t.length;i++){const o=t[i];if(o.classList.contains("xterm"))break;if(o.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._handleHover(s),this._lastBufferCell=s)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(e,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,s){var t,i;this._activeProviderReplies&&s||((t=this._activeProviderReplies)===null||t===void 0||t.forEach(l=>{l==null||l.forEach(v=>{v.link.dispose&&v.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let o=!1;for(const[l,v]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(l)&&(o=this._checkLinkProviderResult(l,e,o)):v.provideLinks(e.y,m=>{var h,p;if(this._isMouseOut)return;const b=m==null?void 0:m.map(L=>({link:L}));(h=this._activeProviderReplies)===null||h===void 0||h.set(l,b),o=this._checkLinkProviderResult(l,e,o),((p=this._activeProviderReplies)===null||p===void 0?void 0:p.size)===this._linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,s){const t=new Set;for(let i=0;i<s.size;i++){const o=s.get(i);if(o)for(let l=0;l<o.length;l++){const v=o[l],m=v.link.range.start.y<e?0:v.link.range.start.x,h=v.link.range.end.y>e?this._bufferService.cols:v.link.range.end.x;for(let p=m;p<=h;p++){if(t.has(p)){o.splice(l--,1);break}t.add(p)}}}}_checkLinkProviderResult(e,s,t){var i;if(!this._activeProviderReplies)return t;const o=this._activeProviderReplies.get(e);let l=!1;for(let v=0;v<e;v++)this._activeProviderReplies.has(v)&&!this._activeProviderReplies.get(v)||(l=!0);if(!l&&o){const v=o.find(m=>this._linkAtPosition(m.link,s));v&&(t=!0,this._handleNewLink(v))}if(this._activeProviderReplies.size===this._linkProviders.length&&!t)for(let v=0;v<this._activeProviderReplies.size;v++){const m=(i=this._activeProviderReplies.get(v))===null||i===void 0?void 0:i.find(h=>this._linkAtPosition(h.link,s));if(m){t=!0,this._handleNewLink(m);break}}return t}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._element||!this._mouseService||!this._currentLink)return;const s=this._positionFromMouseEvent(e,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!e||!s||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,f.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(e.link,s)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:t=>{var i,o;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==t&&(this._currentLink.state.decorations.pointerCursor=t,this._currentLink.state.isHovered&&((o=this._element)===null||o===void 0||o.classList.toggle("xterm-cursor-pointer",t)))}},underline:{get:()=>{var t,i;return(i=(t=this._currentLink)===null||t===void 0?void 0:t.state)===null||i===void 0?void 0:i.decorations.underline},set:t=>{var i,o,l;!((i=this._currentLink)===null||i===void 0)&&i.state&&((l=(o=this._currentLink)===null||o===void 0?void 0:o.state)===null||l===void 0?void 0:l.decorations.underline)!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(t=>{if(!this._currentLink)return;const i=t.start===0?0:t.start+1+this._bufferService.buffer.ydisp,o=this._bufferService.buffer.ydisp+1+t.end;if(this._currentLink.link.range.start.y>=i&&this._currentLink.link.range.end.y<=o&&(this._clearCurrentLink(i,o),this._lastMouseEvent&&this._element)){const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._askForLink(l,!1)}})))}_linkHover(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(t,s.text)}_fireUnderlineEvent(e,s){const t=e.range,i=this._bufferService.buffer.ydisp,o=this._createLinkUnderlineEvent(t.start.x-1,t.start.y-i-1,t.end.x,t.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(o)}_linkLeave(e,s,t){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(t,s.text)}_linkAtPosition(e,s){const t=e.range.start.y*this._bufferService.cols+e.range.start.x,i=e.range.end.y*this._bufferService.cols+e.range.end.x,o=s.y*this._bufferService.cols+s.x;return t<=o&&o<=i}_positionFromMouseEvent(e,s,t){const i=t.getCoords(e,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,s,t,i,o){return{x1:e,y1:s,x2:t,y2:i,cols:this._bufferService.cols,fg:o}}};r.Linkifier2=u=c([_(0,g.IBufferService)],u)},9042:(O,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(O,r,a){var c=this&&this.__decorate||function(u,e,s,t){var i,o=arguments.length,l=o<3?e:t===null?t=Object.getOwnPropertyDescriptor(e,s):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(u,e,s,t);else for(var v=u.length-1;v>=0;v--)(i=u[v])&&(l=(o<3?i(l):o>3?i(e,s,l):i(e,s))||l);return o>3&&l&&Object.defineProperty(e,s,l),l},_=this&&this.__param||function(u,e){return function(s,t){e(s,t,u)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const n=a(511),d=a(2585);let f=r.OscLinkProvider=class{constructor(u,e,s){this._bufferService=u,this._optionsService=e,this._oscLinkService=s}provideLinks(u,e){var s;const t=this._bufferService.buffer.lines.get(u-1);if(!t)return void e(void 0);const i=[],o=this._optionsService.rawOptions.linkHandler,l=new n.CellData,v=t.getTrimmedLength();let m=-1,h=-1,p=!1;for(let b=0;b<v;b++)if(h!==-1||t.hasContent(b)){if(t.loadCell(b,l),l.hasExtendedAttrs()&&l.extended.urlId){if(h===-1){h=b,m=l.extended.urlId;continue}p=l.extended.urlId!==m}else h!==-1&&(p=!0);if(p||h!==-1&&b===v-1){const L=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(L){const y={start:{x:h+1,y:u},end:{x:b+(p||b!==v-1?0:1),y:u}};let k=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const x=new URL(L);["http:","https:"].includes(x.protocol)||(k=!0)}catch{k=!0}k||i.push({text:L,range:y,activate:(x,T)=>o?o.activate(x,T,y):g(0,T),hover:(x,T)=>{var P;return(P=o==null?void 0:o.hover)===null||P===void 0?void 0:P.call(o,x,T,y)},leave:(x,T)=>{var P;return(P=o==null?void 0:o.leave)===null||P===void 0?void 0:P.call(o,x,T,y)}})}p=!1,l.hasExtendedAttrs()&&l.extended.urlId?(h=b,m=l.extended.urlId):(h=-1,m=-1)}}e(i)}};function g(u,e){if(confirm(`Do you want to navigate to ${e}?
4
4
 
@@ -1 +1 @@
1
- import{n,a as o,g as s}from"./index-Dtkc_ka-.js";const c={name:"WikiSidebar",data(){return{menuData:[],treeProps:{children:"children",label:"title"},currentPath:""}},methods:{async loadMenu(){try{const e=await o.getWikiMenu();e.success&&e.data&&(this.menuData=e.data.nav||[],this.menuData.length>0&&!this.currentPath&&(this.currentPath=this.menuData[0].url))}catch(e){console.error("Failed to load wiki menu:",e)}},handleNodeClick(e){const t=e.url;if(t){const r=t.match(/\/txcode\/(.+)\.html?$/);if(r){const i=r[1]+".md";this.$router.push({name:"wiki",query:{path:i}})}else this.$router.push({name:"wiki",query:{path:t}})}},setCurrentPath(e){this.currentPath=e}},created(){this.loadMenu()}};var d=function(){var t=this,r=t._self._c;return r("div",{staticClass:"wiki-sidebar"},[t._m(0),r("el-tree",{staticClass:"wiki-tree",attrs:{data:t.menuData,props:t.treeProps,"node-key":"url","current-node-key":t.currentPath,"highlight-current":!0},on:{"node-click":t.handleNodeClick},scopedSlots:t._u([{key:"default",fn:function({node:i,data:a}){return[r("div",{staticClass:"tree-node"},[a.icon?r("i",{class:a.icon}):t._e(),r("span",[t._v(t._s(a.title))])])]}}])})],1)},l=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"sidebar-header"},[t("i",{staticClass:"fa-solid fa-book"}),t("span",[e._v("文档中心")])])}],h=n(c,d,l,!1,null,"6cebe44d");const u=h.exports,_={name:"WikiContent",props:{filePath:{type:String,default:""}},data(){return{content:"",loading:!1,error:""}},computed:{renderedContent(){if(!this.content)return"";const e=new s.Renderer;return e.link=(t,r,i)=>t&&t.endsWith(".md")?(t.replace(/^\.\//,"").replace(".md",".html"),`<a href="javascript:void(0)" onclick="window.__wikiNavigate__('${t}')" title="${r||""}">${i}</a>`):t&&!t.startsWith("http")?`<a href="${t}" target="_blank" title="${r||""}">${i}</a>`:`<a href="${t}" target="_blank" title="${r||""}">${i}</a>`,e.image=(t,r,i)=>{let a=t;return t&&!t.startsWith("http")&&!t.startsWith("/")&&(a=this.filePath.replace(/[^/\\]*$/,"")+t),`<img src="${a}" alt="${i}" title="${r||""}" />`},s.setOptions({renderer:e,gfm:!0,breaks:!0}),s.parse(this.content)}},watch:{filePath:{immediate:!0,handler(e){e&&this.loadContent(e)}}},methods:{async loadContent(e){this.loading=!0,this.error="",this.content="";try{const t=await o.getWikiContent(e);t.success?this.content=t.data:this.error=t.error||"加载文档失败"}catch(t){console.error("Failed to load wiki content:",t),this.error="加载文档失败: "+t.message}finally{this.loading=!1}},setupNavigation(){window.__wikiNavigate__=e=>{const t=e.replace(/^\.\//,"").replace(".md",".html");this.$router.push({name:"wiki",query:{path:t}})}}},mounted(){this.setupNavigation()},beforeDestroy(){window.__wikiNavigate__&&delete window.__wikiNavigate__}};var m=function(){var t=this,r=t._self._c;return r("div",{staticClass:"wiki-content"},[t.loading?r("div",{staticClass:"loading"},[r("i",{staticClass:"fa-solid fa-spinner fa-spin"}),r("span",[t._v("加载中...")])]):t.error?r("div",{staticClass:"error"},[r("i",{staticClass:"fa-solid fa-exclamation-triangle"}),r("span",[t._v(t._s(t.error))])]):r("div",{staticClass:"markdown-body",domProps:{innerHTML:t._s(t.renderedContent)}})])},f=[],p=n(_,m,f,!1,null,"e31d4f07");const v=p.exports,k={name:"WikiView",components:{WikiSidebar:u,WikiContent:v},data(){return{currentPath:""}},watch:{"$route.query.path":{immediate:!0,handler(e){e?(this.currentPath=e,this.$refs.sidebar&&this.$refs.sidebar.setCurrentPath(e)):this.currentPath||(this.currentPath="getting-started/index.md")}}},mounted(){!this.currentPath&&this.$route.query.path?this.currentPath=this.$route.query.path:this.currentPath||(this.currentPath="getting-started/index.md")}};var $=function(){var t=this,r=t._self._c;return r("div",{staticClass:"wiki-view"},[r("WikiSidebar",{ref:"sidebar"}),r("WikiContent",{attrs:{"file-path":t.currentPath}})],1)},g=[],w=n(k,$,g,!1,null,"0d0371e5");const b=w.exports;export{b as default};
1
+ import{n,a as o,g as s}from"./index-Ch_-1SCN.js";const c={name:"WikiSidebar",data(){return{menuData:[],treeProps:{children:"children",label:"title"},currentPath:""}},methods:{async loadMenu(){try{const e=await o.getWikiMenu();e.success&&e.data&&(this.menuData=e.data.nav||[],this.menuData.length>0&&!this.currentPath&&(this.currentPath=this.menuData[0].url))}catch(e){console.error("Failed to load wiki menu:",e)}},handleNodeClick(e){const t=e.url;if(t){const r=t.match(/\/txcode\/(.+)\.html?$/);if(r){const i=r[1]+".md";this.$router.push({name:"wiki",query:{path:i}})}else this.$router.push({name:"wiki",query:{path:t}})}},setCurrentPath(e){this.currentPath=e}},created(){this.loadMenu()}};var d=function(){var t=this,r=t._self._c;return r("div",{staticClass:"wiki-sidebar"},[t._m(0),r("el-tree",{staticClass:"wiki-tree",attrs:{data:t.menuData,props:t.treeProps,"node-key":"url","current-node-key":t.currentPath,"highlight-current":!0},on:{"node-click":t.handleNodeClick},scopedSlots:t._u([{key:"default",fn:function({node:i,data:a}){return[r("div",{staticClass:"tree-node"},[a.icon?r("i",{class:a.icon}):t._e(),r("span",[t._v(t._s(a.title))])])]}}])})],1)},l=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"sidebar-header"},[t("i",{staticClass:"fa-solid fa-book"}),t("span",[e._v("文档中心")])])}],h=n(c,d,l,!1,null,"6cebe44d");const u=h.exports,_={name:"WikiContent",props:{filePath:{type:String,default:""}},data(){return{content:"",loading:!1,error:""}},computed:{renderedContent(){if(!this.content)return"";const e=new s.Renderer;return e.link=(t,r,i)=>t&&t.endsWith(".md")?(t.replace(/^\.\//,"").replace(".md",".html"),`<a href="javascript:void(0)" onclick="window.__wikiNavigate__('${t}')" title="${r||""}">${i}</a>`):t&&!t.startsWith("http")?`<a href="${t}" target="_blank" title="${r||""}">${i}</a>`:`<a href="${t}" target="_blank" title="${r||""}">${i}</a>`,e.image=(t,r,i)=>{let a=t;return t&&!t.startsWith("http")&&!t.startsWith("/")&&(a=this.filePath.replace(/[^/\\]*$/,"")+t),`<img src="${a}" alt="${i}" title="${r||""}" />`},s.setOptions({renderer:e,gfm:!0,breaks:!0}),s.parse(this.content)}},watch:{filePath:{immediate:!0,handler(e){e&&this.loadContent(e)}}},methods:{async loadContent(e){this.loading=!0,this.error="",this.content="";try{const t=await o.getWikiContent(e);t.success?this.content=t.data:this.error=t.error||"加载文档失败"}catch(t){console.error("Failed to load wiki content:",t),this.error="加载文档失败: "+t.message}finally{this.loading=!1}},setupNavigation(){window.__wikiNavigate__=e=>{const t=e.replace(/^\.\//,"").replace(".md",".html");this.$router.push({name:"wiki",query:{path:t}})}}},mounted(){this.setupNavigation()},beforeDestroy(){window.__wikiNavigate__&&delete window.__wikiNavigate__}};var m=function(){var t=this,r=t._self._c;return r("div",{staticClass:"wiki-content"},[t.loading?r("div",{staticClass:"loading"},[r("i",{staticClass:"fa-solid fa-spinner fa-spin"}),r("span",[t._v("加载中...")])]):t.error?r("div",{staticClass:"error"},[r("i",{staticClass:"fa-solid fa-exclamation-triangle"}),r("span",[t._v(t._s(t.error))])]):r("div",{staticClass:"markdown-body",domProps:{innerHTML:t._s(t.renderedContent)}})])},f=[],p=n(_,m,f,!1,null,"e31d4f07");const v=p.exports,k={name:"WikiView",components:{WikiSidebar:u,WikiContent:v},data(){return{currentPath:""}},watch:{"$route.query.path":{immediate:!0,handler(e){e?(this.currentPath=e,this.$refs.sidebar&&this.$refs.sidebar.setCurrentPath(e)):this.currentPath||(this.currentPath="getting-started/index.md")}}},mounted(){!this.currentPath&&this.$route.query.path?this.currentPath=this.$route.query.path:this.currentPath||(this.currentPath="getting-started/index.md")}};var $=function(){var t=this,r=t._self._c;return r("div",{staticClass:"wiki-view"},[r("WikiSidebar",{ref:"sidebar"}),r("WikiContent",{attrs:{"file-path":t.currentPath}})],1)},g=[],w=n(k,$,g,!1,null,"0d0371e5");const b=w.exports;export{b as default};
@@ -1,4 +1,4 @@
1
- import{m as et}from"./index-Dtkc_ka-.js";/*!-----------------------------------------------------------------------------
1
+ import{m as et}from"./index-Ch_-1SCN.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1 +1 @@
1
- import{n as c,a as d,e as _,K as m,c as y,R as v,g}from"./index-Dtkc_ka-.js";const C="/api";async function h(s,t,e=null,a=!1){const n={method:s,headers:a?{}:{"Content-Type":"application/json"}};e&&s!=="GET"&&(n.body=a?e:JSON.stringify(e));const i=await(await fetch(`${C}${t}`,n)).json();if(i.success===!1)throw new Error(i.error||i.message||"请求失败");return i}const p={checkRelease(s){const t=s?`?projectPath=${encodeURIComponent(s)}`:"";return h("GET",`/deploy/check-release${t}`)},downloadUrl(s,t){return h("POST","/deploy/download-url",{url:s,projectPath:t})},async uploadArchive(s,t){const e=new FormData;return e.append("file",s),t&&e.append("projectPath",t),h("POST","/deploy/upload-archive",e,!0)}},w={name:"DeployEditor",props:{content:{type:String,default:""},filePath:{type:String,default:""}},data(){return{editor:null,saved:!0}},computed:{displayPath(){return this.filePath||"RELEASE.md"}},watch:{content(s){this.editor&&s!==this.editor.getValue()&&(this.editor.setValue(s),this.saved=!0)}},mounted(){this.$nextTick(()=>this.initEditor())},beforeDestroy(){this.editor&&(this.editor.dispose(),this.editor=null)},methods:{initEditor(){this.editor||(this.editor=_.create(this.$refs.editorContainer,{value:this.content||"",language:"markdown",theme:"vs-dark",fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Monaco, Consolas, monospace",minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:16}}),this.editor.addCommand(m.CtrlCmd|y.KeyS,()=>{this.save()}),this.editor.onDidChangeModelContent(()=>{this.saved=!1,this.$emit("content-change",this.editor.getValue())}))},getContent(){return this.editor?this.editor.getValue():this.content},async save(){if(!this.editor||!this.filePath)return;const s=this.editor.getValue();try{await d.writeFile(this.filePath,s),this.saved=!0,this.$emit("saved",s)}catch(t){this.$message.error("保存失败: "+t.message)}}}};var b=function(){var t=this,e=t._self._c;return e("div",{staticClass:"editor-panel"},[e("div",{staticClass:"editor-header"},[e("i",{staticClass:"fa-solid fa-file-lines"}),e("span",[t._v(t._s(t.displayPath))]),e("span",{staticClass:"save-status",class:t.saved?"saved":""},[t._v(" "+t._s(t.saved?"已保存":"未保存")+" ")])]),e("div",{ref:"editorContainer",staticClass:"editor-container"})])},k=[],S=c(w,b,k,!1,null,"6615be35");const x=S.exports,M={name:"DeployAssistant",components:{ResizableTextarea:v},props:{hasContent:{type:Boolean,default:!1},docContent:{type:String,default:""},projectPath:{type:String,default:""},releasePath:{type:String,default:""}},data(){return{ws:null,sessionId:"",inputMessage:"",messages:[],disabled:!1,stopping:!1,modelName:"",promptTokens:0,sessionStatus:"idle",heartbeatTimer:null}},computed:{displaySessionId(){return this.sessionId?this.sessionId.slice(0,8):"--------"}},async mounted(){const s=await this.loadSavedSession();s&&(this.sessionId=s),this.connect()},beforeDestroy(){this.disconnect(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer)},methods:{connect(){const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/caller`;this.ws=new WebSocket(t),this.ws.onopen=()=>{this.sessionId||(this.sessionId="deploy-"+Date.now()+"-"+Math.random().toString(36).slice(2,8)),this.ws.send(JSON.stringify({type:"init",data:{callbackUrl:"http://localhost:40000",projectPath:this.projectPath||"",tools:[],sessionId:this.sessionId,title:"部署助手"}})),this.heartbeatTimer=setInterval(()=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"ping"}))},3e4)},this.ws.onmessage=e=>{try{const a=JSON.parse(e.data);this.handleMessage(a)}catch(a){console.error("Parse WS message error:",a)}},this.ws.onclose=()=>{this.sessionStatus="idle",this.disabled=!1,this.heartbeatTimer&&clearInterval(this.heartbeatTimer)},this.ws.onerror=e=>{console.error("WS error:",e),this.sessionStatus="idle",this.disabled=!1}},disconnect(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),this.ws&&(this.ws.close(),this.ws=null)},handleMessage(s){var t,e,a,n,o,i,r,l,u,f;switch(s.type){case"connected":break;case"init_ready":this.sessionId=((t=s.data)==null?void 0:t.sessionId)||this.sessionId,this.saveSessionId(this.sessionId),this.loadHistoryMessages();break;case"step":this.messages.push({type:"step",thought:(e=s.data)==null?void 0:e.thought,toolCalls:((a=s.data)==null?void 0:a.toolCalls)||[],success:(n=s.data)==null?void 0:n.success}),(i=(o=s.data)==null?void 0:o.usage)!=null&&i.promptTokens&&(this.promptTokens=s.data.usage.promptTokens),this.scrollToBottom();break;case"done":this.disabled=!1,this.stopping=!1,this.sessionStatus="completed",this.messages.push({type:"done",content:((r=s.data)==null?void 0:r.response)||""}),(l=s.data)!=null&&l.modelName&&(this.modelName=s.data.modelName),(f=(u=s.data)==null?void 0:u.usage)!=null&&f.promptTokens&&(this.promptTokens=s.data.usage.promptTokens),this.scrollToBottom();break;case"error":this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.messages.push({type:"error",content:s.error||"发生错误"}),this.scrollToBottom();break}},sendMessage(s){s&&s.preventDefault();const t=this.inputMessage.trim();!t||this.disabled||!this.ws||(this.messages.push({type:"user",content:t}),this.inputMessage="",this.disabled=!0,this.stopping=!1,this.sessionStatus="processing",this.ws.send(JSON.stringify({type:"chat",data:{sessionId:this.sessionId,message:t}})),this.scrollToBottom())},deployByDoc(){this.disabled||(this.inputMessage=`请按 ${this.releasePath} 文档进行部署`)},stopChat(){!this.sessionId||this.stopping||!this.ws||(this.stopping=!0,this.ws.send(JSON.stringify({type:"stop",data:{sessionId:this.sessionId}})))},handleKeydown(s){if(s.key==="Enter"){if(s.ctrlKey)return;s.preventDefault(),this.sendMessage()}},scrollToBottom(){this.$nextTick(()=>{const s=this.$refs.messagesContainer;s&&(s.scrollTop=s.scrollHeight)})},async loadSavedSession(){var s;if(!this.projectPath)return null;try{const t=`${this.projectPath}/.txcode/release/deploy.json`,e=await d.getFileContent(t);if((s=e==null?void 0:e.data)!=null&&s.content)return JSON.parse(e.data.content).sessionId||null}catch{}return null},async saveSessionId(s){if(this.projectPath)try{const t=`${this.projectPath}/.txcode/release/deploy.json`;await d.writeFile(t,JSON.stringify({sessionId:s},null,2))}catch(t){console.error("保存 sessionId 失败:",t)}},async loadHistoryMessages(){if(this.sessionId)try{const s=await d.getMessages(this.sessionId),t=(s==null?void 0:s.data)||[];t.length>0&&(this.messages=t.map(e=>e.type==="chat"&&e.role==="user"?{type:"user",content:e.content}:e.role==="assistant"?{type:"done",content:e.content}:e))}catch(s){console.error("加载历史消息失败:",s)}},renderMarkdown(s){return s?g(s):""},formatArgs(s,t){try{const e=JSON.parse(t);return s==="bash"||s==="execute_bash"?e.command+(e.workdir?` (${e.workdir})`:""):s==="read_file"?e.file_path+(e.offset?`:${e.offset}`:""):s==="edit_file"||s==="write_file"?e.file_path:s==="glob"?e.pattern:s==="grep"?`"${e.pattern}"`:t}catch{return t}}}};var P=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat-panel"},[t._m(0),e("div",{ref:"messagesContainer",staticClass:"chat-messages"},[t.messages.length?t._e():e("div",{staticClass:"empty-state"},[e("i",{staticClass:"fa-solid fa-rocket text-3xl text-textMuted opacity-30 mb-4"}),e("p",[t._v('点击"按部署文档部署"开始自动化部署')])]),t._l(t.messages,function(a,n){return[a.type==="user"?e("div",{staticClass:"user-message"},[t._v(" "+t._s(a.content)+" ")]):a.type==="step"?e("div",{staticClass:"ai-step"},[a.thought?e("div",{staticClass:"ai-thought",domProps:{innerHTML:t._s(t.renderMarkdown(a.thought))}}):t._e(),t._l(a.toolCalls,function(o,i){var r,l;return e("div",{key:i,staticClass:"log-mute"},[e("span",{class:a.success!==!1?"tool-success":"tool-fail"},[t._v(" "+t._s(a.success!==!1?"✓":"✗")+" ")]),t._v(" "+t._s(((r=o.function)==null?void 0:r.name)||"")+" "),(l=o.function)!=null&&l.arguments?e("span",{staticClass:"tool-input"},[t._v(" "+t._s(t.formatArgs(o.function.name,o.function.arguments))+" ")]):t._e()])})],2):a.type==="done"?e("div",{staticClass:"ai-done",domProps:{innerHTML:t._s(t.renderMarkdown(a.content))}}):a.type==="error"?e("div",{staticClass:"ai-error"},[t._v(" "+t._s(a.content)+" ")]):t._e()]}),t.modelName?e("div",{staticClass:"build-info"},[e("span",[t._v("▣")]),t._v(" Build · "+t._s(t.modelName)+" ")]):t._e()],2),e("div",{staticClass:"chat-input-area"},[e("div",{staticClass:"input-row"},[e("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,"min-rows":2,"max-rows":15,placeholder:"输入消息... (Enter 发送, Ctrl+Enter 换行)",disabled:t.disabled&&!t.stopping},nativeOn:{keydown:function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"enter",13,a.key,"Enter")?null:t.handleKeydown.apply(null,arguments)}},model:{value:t.inputMessage,callback:function(a){t.inputMessage=a},expression:"inputMessage"}}),e("div",{staticClass:"input-actions"},[t.disabled&&!t.stopping?e("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.stopChat}},[t._v(" ■ 停止 ")]):t.stopping?e("el-button",{attrs:{type:"info",disabled:"",size:"small"}},[t._v(" 停止中... ")]):e("el-button",{attrs:{type:"default",disabled:!t.inputMessage.trim()||t.disabled,size:"small"},on:{click:t.sendMessage}},[t._v(" 发送 ")])],1)],1),e("div",{staticClass:"deploy-doc-link",on:{click:t.deployByDoc}},[e("i",{staticClass:"fa-solid fa-file-arrow-up"}),t._v(" 按部署文档部署 ")])]),e("div",{staticClass:"status-bar"},[e("span",{class:t.sessionStatus==="processing"?"status-thinking":"status-ready"},[t.sessionStatus==="processing"?e("span",{staticClass:"thinking-spinner"}):t._e(),t._v(" "+t._s(t.sessionStatus==="processing"?"思考中":"✓ 就绪")+" ")]),e("span",{staticClass:"separator"},[t._v("|")]),e("span",[t._v("模型:"+t._s(t.modelName||"-"))]),e("span",{staticClass:"separator"},[t._v("|")]),e("span",[t._v("会话:"+t._s(t.displaySessionId))]),e("span",{staticClass:"separator"},[t._v("|")]),e("span",[t._v("token:"+t._s(t.promptTokens))])])])},T=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"panel-header"},[t("span",[t("i",{staticClass:"fa-solid fa-robot"}),s._v(" AI 部署助手")])])}],I=c(M,P,T,!1,null,"362ef7aa");const $=I.exports,j={name:"DeployImport",props:{projectPath:{type:String,default:""}},data(){return{downloadUrl:"",downloading:!1,fileList:[],statusMessage:"",statusType:"info"}},methods:{async handleDownload(){if(this.downloadUrl.trim()){this.downloading=!0,this.statusMessage="";try{const s=await p.downloadUrl(this.downloadUrl.trim(),this.projectPath);this.statusMessage="部署文档已导入成功!",this.statusType="success",this.$emit("imported",s.data)}catch(s){this.statusMessage="下载失败: "+s.message,this.statusType="error"}finally{this.downloading=!1}}},async handleFileChange(s){this.statusMessage="";try{const t=await p.uploadArchive(s.raw,this.projectPath);this.statusMessage="部署文档已导入成功!",this.statusType="success",this.fileList=[],this.$emit("imported",t.data)}catch(t){this.statusMessage="上传失败: "+t.message,this.statusType="error"}}}};var E=function(){var t=this,e=t._self._c;return e("div",{staticClass:"deploy-import"},[e("div",{staticClass:"import-container"},[t._m(0),e("h2",{staticClass:"text-xl font-bold text-white mb-2"},[t._v("未找到部署文档")]),e("p",{staticClass:"text-textMuted mb-8"},[t._v("请导入部署文档到 .txcode/release/ 目录")]),e("div",{staticClass:"import-card"},[t._m(1),e("div",{staticClass:"import-card-body"},[e("div",{staticClass:"flex gap-2"},[e("el-input",{staticClass:"flex-1",attrs:{placeholder:"https://...",disabled:t.downloading},model:{value:t.downloadUrl,callback:function(a){t.downloadUrl=a},expression:"downloadUrl"}}),e("el-button",{attrs:{type:"primary",loading:t.downloading,disabled:!t.downloadUrl.trim()},on:{click:t.handleDownload}},[t._v(" "+t._s(t.downloading?"下载中...":"下载")+" ")])],1)])]),t._m(2),e("div",{staticClass:"import-card"},[t._m(3),e("div",{staticClass:"import-card-body"},[e("el-upload",{attrs:{drag:"","auto-upload":!1,"show-file-list":!0,accept:".tar.gz,.tgz,.zip","on-change":t.handleFileChange,"file-list":t.fileList,limit:1}},[e("i",{staticClass:"el-icon-upload"}),e("div",{staticClass:"el-upload__text"},[t._v("将 tar.gz / zip 文件拖到此处,或"),e("em",[t._v("点击上传")])]),e("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("上传后自动解压到 .txcode/release/ 目录")])])],1)]),t.statusMessage?e("div",{staticClass:"import-status",class:t.statusType},[t._v(" "+t._s(t.statusMessage)+" ")]):t._e()])])},D=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-icon"},[t("i",{staticClass:"fa-solid fa-cloud-arrow-down text-5xl text-textMuted opacity-50"})])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-card-title"},[t("i",{staticClass:"fa-solid fa-link"}),s._v(" 输入链接下载部署文档 ")])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-divider"},[t("span",[s._v("—— 或 ——")])])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-card-title"},[t("i",{staticClass:"fa-solid fa-upload"}),s._v(" 选择压缩包上传(tar.gz / zip) ")])}],N=c(j,E,D,!1,null,"ac9f9af6");const R=N.exports,z={name:"deployView",components:{DeployEditor:x,DeployAssistant:$,DeployImport:R},data(){return{loading:!0,releaseExists:!1,releaseContent:"",releasePath:"",editorContent:"",projectPath:""}},async mounted(){await this.loadProjectPath(),await this.checkRelease()},methods:{async loadProjectPath(){try{const s=await d.getCurrentProject();s.data&&s.data.path&&(this.projectPath=s.data.path)}catch(s){console.error("获取项目路径失败:",s)}},async checkRelease(){this.loading=!0;try{const s=await p.checkRelease(this.projectPath);s.data&&s.data.exists?(this.releaseExists=!0,this.releaseContent=s.data.content||"",this.editorContent=this.releaseContent,this.releasePath=s.data.path||""):this.releaseExists=!1}catch(s){console.error("检查部署文档失败:",s),this.releaseExists=!1}finally{this.loading=!1}},onContentChange(s){this.editorContent=s},onImported(){this.checkRelease()}}};var O=function(){var t=this,e=t._self._c;return e("div",{staticClass:"deploy-container"},[t.loading?e("div",{staticClass:"loading-state"},[e("i",{staticClass:"fa-solid fa-spinner fa-spin text-2xl text-textMuted"})]):t.releaseExists?[e("div",{staticClass:"deploy-main"},[e("DeployEditor",{ref:"editorRef",attrs:{content:t.releaseContent,"file-path":t.releasePath},on:{"content-change":t.onContentChange}}),e("DeployAssistant",{ref:"assistantRef",attrs:{"has-content":!!t.editorContent,"doc-content":t.editorContent,"project-path":t.projectPath,"release-path":t.releasePath}})],1)]:[e("DeployImport",{attrs:{"project-path":t.projectPath},on:{imported:t.onImported}})]],2)},A=[],B=c(z,O,A,!1,null,"4e75b69e");const U=B.exports;export{U as default};
1
+ import{n as c,a as d,e as _,K as m,c as y,R as v,g}from"./index-Ch_-1SCN.js";const C="/api";async function h(s,t,e=null,a=!1){const n={method:s,headers:a?{}:{"Content-Type":"application/json"}};e&&s!=="GET"&&(n.body=a?e:JSON.stringify(e));const i=await(await fetch(`${C}${t}`,n)).json();if(i.success===!1)throw new Error(i.error||i.message||"请求失败");return i}const p={checkRelease(s){const t=s?`?projectPath=${encodeURIComponent(s)}`:"";return h("GET",`/deploy/check-release${t}`)},downloadUrl(s,t){return h("POST","/deploy/download-url",{url:s,projectPath:t})},async uploadArchive(s,t){const e=new FormData;return e.append("file",s),t&&e.append("projectPath",t),h("POST","/deploy/upload-archive",e,!0)}},w={name:"DeployEditor",props:{content:{type:String,default:""},filePath:{type:String,default:""}},data(){return{editor:null,saved:!0}},computed:{displayPath(){return this.filePath||"RELEASE.md"}},watch:{content(s){this.editor&&s!==this.editor.getValue()&&(this.editor.setValue(s),this.saved=!0)}},mounted(){this.$nextTick(()=>this.initEditor())},beforeDestroy(){this.editor&&(this.editor.dispose(),this.editor=null)},methods:{initEditor(){this.editor||(this.editor=_.create(this.$refs.editorContainer,{value:this.content||"",language:"markdown",theme:"vs-dark",fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Monaco, Consolas, monospace",minimap:{enabled:!1},lineNumbers:"on",wordWrap:"on",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:16}}),this.editor.addCommand(m.CtrlCmd|y.KeyS,()=>{this.save()}),this.editor.onDidChangeModelContent(()=>{this.saved=!1,this.$emit("content-change",this.editor.getValue())}))},getContent(){return this.editor?this.editor.getValue():this.content},async save(){if(!this.editor||!this.filePath)return;const s=this.editor.getValue();try{await d.writeFile(this.filePath,s),this.saved=!0,this.$emit("saved",s)}catch(t){this.$message.error("保存失败: "+t.message)}}}};var b=function(){var t=this,e=t._self._c;return e("div",{staticClass:"editor-panel"},[e("div",{staticClass:"editor-header"},[e("i",{staticClass:"fa-solid fa-file-lines"}),e("span",[t._v(t._s(t.displayPath))]),e("span",{staticClass:"save-status",class:t.saved?"saved":""},[t._v(" "+t._s(t.saved?"已保存":"未保存")+" ")])]),e("div",{ref:"editorContainer",staticClass:"editor-container"})])},k=[],S=c(w,b,k,!1,null,"6615be35");const x=S.exports,M={name:"DeployAssistant",components:{ResizableTextarea:v},props:{hasContent:{type:Boolean,default:!1},docContent:{type:String,default:""},projectPath:{type:String,default:""},releasePath:{type:String,default:""}},data(){return{ws:null,sessionId:"",inputMessage:"",messages:[],disabled:!1,stopping:!1,modelName:"",promptTokens:0,sessionStatus:"idle",heartbeatTimer:null}},computed:{displaySessionId(){return this.sessionId?this.sessionId.slice(0,8):"--------"}},async mounted(){const s=await this.loadSavedSession();s&&(this.sessionId=s),this.connect()},beforeDestroy(){this.disconnect(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer)},methods:{connect(){const t=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/caller`;this.ws=new WebSocket(t),this.ws.onopen=()=>{this.sessionId||(this.sessionId="deploy-"+Date.now()+"-"+Math.random().toString(36).slice(2,8)),this.ws.send(JSON.stringify({type:"init",data:{callbackUrl:"http://localhost:40000",projectPath:this.projectPath||"",tools:[],sessionId:this.sessionId,title:"部署助手"}})),this.heartbeatTimer=setInterval(()=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"ping"}))},3e4)},this.ws.onmessage=e=>{try{const a=JSON.parse(e.data);this.handleMessage(a)}catch(a){console.error("Parse WS message error:",a)}},this.ws.onclose=()=>{this.sessionStatus="idle",this.disabled=!1,this.heartbeatTimer&&clearInterval(this.heartbeatTimer)},this.ws.onerror=e=>{console.error("WS error:",e),this.sessionStatus="idle",this.disabled=!1}},disconnect(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),this.ws&&(this.ws.close(),this.ws=null)},handleMessage(s){var t,e,a,n,o,i,r,l,u,f;switch(s.type){case"connected":break;case"init_ready":this.sessionId=((t=s.data)==null?void 0:t.sessionId)||this.sessionId,this.saveSessionId(this.sessionId),this.loadHistoryMessages();break;case"step":this.messages.push({type:"step",thought:(e=s.data)==null?void 0:e.thought,toolCalls:((a=s.data)==null?void 0:a.toolCalls)||[],success:(n=s.data)==null?void 0:n.success}),(i=(o=s.data)==null?void 0:o.usage)!=null&&i.promptTokens&&(this.promptTokens=s.data.usage.promptTokens),this.scrollToBottom();break;case"done":this.disabled=!1,this.stopping=!1,this.sessionStatus="completed",this.messages.push({type:"done",content:((r=s.data)==null?void 0:r.response)||""}),(l=s.data)!=null&&l.modelName&&(this.modelName=s.data.modelName),(f=(u=s.data)==null?void 0:u.usage)!=null&&f.promptTokens&&(this.promptTokens=s.data.usage.promptTokens),this.scrollToBottom();break;case"error":this.disabled=!1,this.stopping=!1,this.sessionStatus="idle",this.messages.push({type:"error",content:s.error||"发生错误"}),this.scrollToBottom();break}},sendMessage(s){s&&s.preventDefault();const t=this.inputMessage.trim();!t||this.disabled||!this.ws||(this.messages.push({type:"user",content:t}),this.inputMessage="",this.disabled=!0,this.stopping=!1,this.sessionStatus="processing",this.ws.send(JSON.stringify({type:"chat",data:{sessionId:this.sessionId,message:t}})),this.scrollToBottom())},deployByDoc(){this.disabled||(this.inputMessage=`请按 ${this.releasePath} 文档进行部署`)},stopChat(){!this.sessionId||this.stopping||!this.ws||(this.stopping=!0,this.ws.send(JSON.stringify({type:"stop",data:{sessionId:this.sessionId}})))},handleKeydown(s){if(s.key==="Enter"){if(s.ctrlKey)return;s.preventDefault(),this.sendMessage()}},scrollToBottom(){this.$nextTick(()=>{const s=this.$refs.messagesContainer;s&&(s.scrollTop=s.scrollHeight)})},async loadSavedSession(){var s;if(!this.projectPath)return null;try{const t=`${this.projectPath}/.txcode/release/deploy.json`,e=await d.getFileContent(t);if((s=e==null?void 0:e.data)!=null&&s.content)return JSON.parse(e.data.content).sessionId||null}catch{}return null},async saveSessionId(s){if(this.projectPath)try{const t=`${this.projectPath}/.txcode/release/deploy.json`;await d.writeFile(t,JSON.stringify({sessionId:s},null,2))}catch(t){console.error("保存 sessionId 失败:",t)}},async loadHistoryMessages(){if(this.sessionId)try{const s=await d.getMessages(this.sessionId),t=(s==null?void 0:s.data)||[];t.length>0&&(this.messages=t.map(e=>e.type==="chat"&&e.role==="user"?{type:"user",content:e.content}:e.role==="assistant"?{type:"done",content:e.content}:e))}catch(s){console.error("加载历史消息失败:",s)}},renderMarkdown(s){return s?g(s):""},formatArgs(s,t){try{const e=JSON.parse(t);return s==="bash"||s==="execute_bash"?e.command+(e.workdir?` (${e.workdir})`:""):s==="read_file"?e.file_path+(e.offset?`:${e.offset}`:""):s==="edit_file"||s==="write_file"?e.file_path:s==="glob"?e.pattern:s==="grep"?`"${e.pattern}"`:t}catch{return t}}}};var P=function(){var t=this,e=t._self._c;return e("div",{staticClass:"chat-panel"},[t._m(0),e("div",{ref:"messagesContainer",staticClass:"chat-messages"},[t.messages.length?t._e():e("div",{staticClass:"empty-state"},[e("i",{staticClass:"fa-solid fa-rocket text-3xl text-textMuted opacity-30 mb-4"}),e("p",[t._v('点击"按部署文档部署"开始自动化部署')])]),t._l(t.messages,function(a,n){return[a.type==="user"?e("div",{staticClass:"user-message"},[t._v(" "+t._s(a.content)+" ")]):a.type==="step"?e("div",{staticClass:"ai-step"},[a.thought?e("div",{staticClass:"ai-thought",domProps:{innerHTML:t._s(t.renderMarkdown(a.thought))}}):t._e(),t._l(a.toolCalls,function(o,i){var r,l;return e("div",{key:i,staticClass:"log-mute"},[e("span",{class:a.success!==!1?"tool-success":"tool-fail"},[t._v(" "+t._s(a.success!==!1?"✓":"✗")+" ")]),t._v(" "+t._s(((r=o.function)==null?void 0:r.name)||"")+" "),(l=o.function)!=null&&l.arguments?e("span",{staticClass:"tool-input"},[t._v(" "+t._s(t.formatArgs(o.function.name,o.function.arguments))+" ")]):t._e()])})],2):a.type==="done"?e("div",{staticClass:"ai-done",domProps:{innerHTML:t._s(t.renderMarkdown(a.content))}}):a.type==="error"?e("div",{staticClass:"ai-error"},[t._v(" "+t._s(a.content)+" ")]):t._e()]}),t.modelName?e("div",{staticClass:"build-info"},[e("span",[t._v("▣")]),t._v(" Build · "+t._s(t.modelName)+" ")]):t._e()],2),e("div",{staticClass:"chat-input-area"},[e("div",{staticClass:"input-row"},[e("ResizableTextarea",{staticClass:"input-area",attrs:{rows:5,"min-rows":2,"max-rows":15,placeholder:"输入消息... (Enter 发送, Ctrl+Enter 换行)",disabled:t.disabled&&!t.stopping},nativeOn:{keydown:function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"enter",13,a.key,"Enter")?null:t.handleKeydown.apply(null,arguments)}},model:{value:t.inputMessage,callback:function(a){t.inputMessage=a},expression:"inputMessage"}}),e("div",{staticClass:"input-actions"},[t.disabled&&!t.stopping?e("el-button",{attrs:{type:"danger",size:"small"},on:{click:t.stopChat}},[t._v(" ■ 停止 ")]):t.stopping?e("el-button",{attrs:{type:"info",disabled:"",size:"small"}},[t._v(" 停止中... ")]):e("el-button",{attrs:{type:"default",disabled:!t.inputMessage.trim()||t.disabled,size:"small"},on:{click:t.sendMessage}},[t._v(" 发送 ")])],1)],1),e("div",{staticClass:"deploy-doc-link",on:{click:t.deployByDoc}},[e("i",{staticClass:"fa-solid fa-file-arrow-up"}),t._v(" 按部署文档部署 ")])]),e("div",{staticClass:"status-bar"},[e("span",{class:t.sessionStatus==="processing"?"status-thinking":"status-ready"},[t.sessionStatus==="processing"?e("span",{staticClass:"thinking-spinner"}):t._e(),t._v(" "+t._s(t.sessionStatus==="processing"?"思考中":"✓ 就绪")+" ")]),e("span",{staticClass:"separator"},[t._v("|")]),e("span",[t._v("模型:"+t._s(t.modelName||"-"))]),e("span",{staticClass:"separator"},[t._v("|")]),e("span",[t._v("会话:"+t._s(t.displaySessionId))]),e("span",{staticClass:"separator"},[t._v("|")]),e("span",[t._v("token:"+t._s(t.promptTokens))])])])},T=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"panel-header"},[t("span",[t("i",{staticClass:"fa-solid fa-robot"}),s._v(" AI 部署助手")])])}],I=c(M,P,T,!1,null,"362ef7aa");const $=I.exports,j={name:"DeployImport",props:{projectPath:{type:String,default:""}},data(){return{downloadUrl:"",downloading:!1,fileList:[],statusMessage:"",statusType:"info"}},methods:{async handleDownload(){if(this.downloadUrl.trim()){this.downloading=!0,this.statusMessage="";try{const s=await p.downloadUrl(this.downloadUrl.trim(),this.projectPath);this.statusMessage="部署文档已导入成功!",this.statusType="success",this.$emit("imported",s.data)}catch(s){this.statusMessage="下载失败: "+s.message,this.statusType="error"}finally{this.downloading=!1}}},async handleFileChange(s){this.statusMessage="";try{const t=await p.uploadArchive(s.raw,this.projectPath);this.statusMessage="部署文档已导入成功!",this.statusType="success",this.fileList=[],this.$emit("imported",t.data)}catch(t){this.statusMessage="上传失败: "+t.message,this.statusType="error"}}}};var E=function(){var t=this,e=t._self._c;return e("div",{staticClass:"deploy-import"},[e("div",{staticClass:"import-container"},[t._m(0),e("h2",{staticClass:"text-xl font-bold text-white mb-2"},[t._v("未找到部署文档")]),e("p",{staticClass:"text-textMuted mb-8"},[t._v("请导入部署文档到 .txcode/release/ 目录")]),e("div",{staticClass:"import-card"},[t._m(1),e("div",{staticClass:"import-card-body"},[e("div",{staticClass:"flex gap-2"},[e("el-input",{staticClass:"flex-1",attrs:{placeholder:"https://...",disabled:t.downloading},model:{value:t.downloadUrl,callback:function(a){t.downloadUrl=a},expression:"downloadUrl"}}),e("el-button",{attrs:{type:"primary",loading:t.downloading,disabled:!t.downloadUrl.trim()},on:{click:t.handleDownload}},[t._v(" "+t._s(t.downloading?"下载中...":"下载")+" ")])],1)])]),t._m(2),e("div",{staticClass:"import-card"},[t._m(3),e("div",{staticClass:"import-card-body"},[e("el-upload",{attrs:{drag:"","auto-upload":!1,"show-file-list":!0,accept:".tar.gz,.tgz,.zip","on-change":t.handleFileChange,"file-list":t.fileList,limit:1}},[e("i",{staticClass:"el-icon-upload"}),e("div",{staticClass:"el-upload__text"},[t._v("将 tar.gz / zip 文件拖到此处,或"),e("em",[t._v("点击上传")])]),e("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("上传后自动解压到 .txcode/release/ 目录")])])],1)]),t.statusMessage?e("div",{staticClass:"import-status",class:t.statusType},[t._v(" "+t._s(t.statusMessage)+" ")]):t._e()])])},D=[function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-icon"},[t("i",{staticClass:"fa-solid fa-cloud-arrow-down text-5xl text-textMuted opacity-50"})])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-card-title"},[t("i",{staticClass:"fa-solid fa-link"}),s._v(" 输入链接下载部署文档 ")])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-divider"},[t("span",[s._v("—— 或 ——")])])},function(){var s=this,t=s._self._c;return t("div",{staticClass:"import-card-title"},[t("i",{staticClass:"fa-solid fa-upload"}),s._v(" 选择压缩包上传(tar.gz / zip) ")])}],N=c(j,E,D,!1,null,"ac9f9af6");const R=N.exports,z={name:"deployView",components:{DeployEditor:x,DeployAssistant:$,DeployImport:R},data(){return{loading:!0,releaseExists:!1,releaseContent:"",releasePath:"",editorContent:"",projectPath:""}},async mounted(){await this.loadProjectPath(),await this.checkRelease()},methods:{async loadProjectPath(){try{const s=await d.getCurrentProject();s.data&&s.data.path&&(this.projectPath=s.data.path)}catch(s){console.error("获取项目路径失败:",s)}},async checkRelease(){this.loading=!0;try{const s=await p.checkRelease(this.projectPath);s.data&&s.data.exists?(this.releaseExists=!0,this.releaseContent=s.data.content||"",this.editorContent=this.releaseContent,this.releasePath=s.data.path||""):this.releaseExists=!1}catch(s){console.error("检查部署文档失败:",s),this.releaseExists=!1}finally{this.loading=!1}},onContentChange(s){this.editorContent=s},onImported(){this.checkRelease()}}};var O=function(){var t=this,e=t._self._c;return e("div",{staticClass:"deploy-container"},[t.loading?e("div",{staticClass:"loading-state"},[e("i",{staticClass:"fa-solid fa-spinner fa-spin text-2xl text-textMuted"})]):t.releaseExists?[e("div",{staticClass:"deploy-main"},[e("DeployEditor",{ref:"editorRef",attrs:{content:t.releaseContent,"file-path":t.releasePath},on:{"content-change":t.onContentChange}}),e("DeployAssistant",{ref:"assistantRef",attrs:{"has-content":!!t.editorContent,"doc-content":t.editorContent,"project-path":t.projectPath,"release-path":t.releasePath}})],1)]:[e("DeployImport",{attrs:{"project-path":t.projectPath},on:{imported:t.onImported}})]],2)},A=[],B=c(z,O,A,!1,null,"4e75b69e");const U=B.exports;export{U as default};
@@ -1,2 +1,2 @@
1
- import{n as g,d as C,a as u}from"./index-Dtkc_ka-.js";const m="/api";async function c(t,e,a=null){const i={method:t,headers:{"Content-Type":"application/json"}};a&&t!=="GET"&&(i.body=JSON.stringify(a));const o=await(await fetch(`${m}${e}`,i)).json();if(o.success===!1)throw new Error(o.error||o.message||"请求失败");return o}const h={getZihaoConfig(){return c("GET","/zihao/config")},saveZihaoConfig(t){return c("POST","/zihao/config",t)},deleteZihaoConfig(t){return c("POST","/zihao/config/delete",{id:t})},setActiveConfig(t){return c("POST","/zihao/config/active",{id:t})},connect(){return c("POST","/zihao/connect")},browse(t="/"){return c("GET",`/zihao/browse?path=${encodeURIComponent(t)}`)},viewFile(t){return c("GET",`/zihao/view?path=${encodeURIComponent(t)}`)},create(t,e,a){return c("POST","/zihao/create",{name:t,path:e,type:a})},rename(t,e){return c("POST","/zihao/rename",{oldPath:t,newName:e})},deleteFile(t,e){return c("POST","/zihao/delete",{path:t,type:e})},saveContent(t,e){return c("POST","/zihao/save-content",{path:t,content:e})},getHomeDir(){return c("GET","/zihao/home-dir")},uploadChunk(t,e,a,i,l){const o=new FormData;return o.append("targetDir",t),o.append("fileName",encodeURIComponent(e)),o.append("chunkIndex",String(a)),o.append("totalChunks",String(i)),o.append("chunk",l),fetch(`${m}/zihao/chunk-upload`,{method:"POST",body:o}).then(n=>n.json()).then(n=>{if(n.success===!1)throw new Error(n.error||"上传分片失败");return n})},uploadWithProgress(t,e,a,i){const o=t,n=Math.ceil(o.size/1048576);return(async()=>{for(let r=0;r<n;r++){const f=r*1048576,x=Math.min(f+1048576,o.size),p=o.slice(f,x);await this.uploadChunk(a,e,r,n,p),i&&i(Math.round((r+1)/n*100))}return{success:!0}})()},async download(t,e,a){var s;const i=`${m}/zihao/download?path=${encodeURIComponent(t)}&localPath=${encodeURIComponent(e)}`,l=await fetch(i);if(!l.ok)throw new Error("下载失败");const o=(s=l.body)==null?void 0:s.getReader();if(!o)throw new Error("无法读取响应");const n=new TextDecoder;for(;;){const{done:r,value:f}=await o.read();if(r)break;const p=n.decode(f,{stream:!0}).split(`
1
+ import{n as g,d as C,a as u}from"./index-Ch_-1SCN.js";const m="/api";async function c(t,e,a=null){const i={method:t,headers:{"Content-Type":"application/json"}};a&&t!=="GET"&&(i.body=JSON.stringify(a));const o=await(await fetch(`${m}${e}`,i)).json();if(o.success===!1)throw new Error(o.error||o.message||"请求失败");return o}const h={getZihaoConfig(){return c("GET","/zihao/config")},saveZihaoConfig(t){return c("POST","/zihao/config",t)},deleteZihaoConfig(t){return c("POST","/zihao/config/delete",{id:t})},setActiveConfig(t){return c("POST","/zihao/config/active",{id:t})},connect(){return c("POST","/zihao/connect")},browse(t="/"){return c("GET",`/zihao/browse?path=${encodeURIComponent(t)}`)},viewFile(t){return c("GET",`/zihao/view?path=${encodeURIComponent(t)}`)},create(t,e,a){return c("POST","/zihao/create",{name:t,path:e,type:a})},rename(t,e){return c("POST","/zihao/rename",{oldPath:t,newName:e})},deleteFile(t,e){return c("POST","/zihao/delete",{path:t,type:e})},saveContent(t,e){return c("POST","/zihao/save-content",{path:t,content:e})},getHomeDir(){return c("GET","/zihao/home-dir")},uploadChunk(t,e,a,i,l){const o=new FormData;return o.append("targetDir",t),o.append("fileName",encodeURIComponent(e)),o.append("chunkIndex",String(a)),o.append("totalChunks",String(i)),o.append("chunk",l),fetch(`${m}/zihao/chunk-upload`,{method:"POST",body:o}).then(n=>n.json()).then(n=>{if(n.success===!1)throw new Error(n.error||"上传分片失败");return n})},uploadWithProgress(t,e,a,i){const o=t,n=Math.ceil(o.size/1048576);return(async()=>{for(let r=0;r<n;r++){const f=r*1048576,x=Math.min(f+1048576,o.size),p=o.slice(f,x);await this.uploadChunk(a,e,r,n,p),i&&i(Math.round((r+1)/n*100))}return{success:!0}})()},async download(t,e,a){var s;const i=`${m}/zihao/download?path=${encodeURIComponent(t)}&localPath=${encodeURIComponent(e)}`,l=await fetch(i);if(!l.ok)throw new Error("下载失败");const o=(s=l.body)==null?void 0:s.getReader();if(!o)throw new Error("无法读取响应");const n=new TextDecoder;for(;;){const{done:r,value:f}=await o.read();if(r)break;const p=n.decode(f,{stream:!0}).split(`
2
2
  `).filter(Boolean);for(const v of p)try{const d=JSON.parse(v);if(typeof d.progress=="number")a(d.progress);else if(d.done)a(100);else if(d.success===!1)throw new Error(d.error)}catch{}}}},b={name:"ZihaoConfigDialog",data(){return{dialogVisible:!1,editingConfig:null,loading:!1,form:{name:"",url:"",username:"",password:""},rules:{name:[{required:!0,message:"请输入配置名称",trigger:"blur"}],url:[{required:!0,message:"请输入服务地址",trigger:"blur"}],username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"}]}}},methods:{open(t=null){this.editingConfig=t,t?this.form={name:t.name||"",url:t.url||"",username:t.username||"",password:""}:this.form={name:"",url:"",username:"",password:""},this.dialogVisible=!0},handleClose(){var t;(t=this.$refs.formRef)==null||t.resetFields(),this.dialogVisible=!1,this.editingConfig=null},async handleSubmit(){var t;try{await this.$refs.formRef.validate()}catch{return}this.loading=!0;try{const e={...this.form};(t=this.editingConfig)!=null&&t.id&&(e.id=this.editingConfig.id,e.password||delete e.password),await h.saveZihaoConfig(e),this.$message.success("保存成功"),this.$emit("success"),this.handleClose()}catch(e){this.$message.error("保存失败: "+e.message)}finally{this.loading=!1}}}};var y=function(){var e=this,a=e._self._c;return a("el-dialog",{attrs:{title:e.editingConfig?"编辑梓豪配置":"新增梓豪配置",visible:e.dialogVisible,width:"500px","close-on-click-modal":!1},on:{"update:visible":function(i){e.dialogVisible=i},close:e.handleClose}},[a("el-form",{ref:"formRef",attrs:{model:e.form,rules:e.rules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"配置名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"例如:我的梓豪服务器"},model:{value:e.form.name,callback:function(i){e.$set(e.form,"name",i)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"服务地址",prop:"url"}},[a("el-input",{attrs:{placeholder:"例如:http://192.168.1.100:5000"},model:{value:e.form.url,callback:function(i){e.$set(e.form,"url",i)},expression:"form.url"}})],1),a("el-form-item",{attrs:{label:"用户名",prop:"username"}},[a("el-input",{attrs:{placeholder:"远程平台用户名"},model:{value:e.form.username,callback:function(i){e.$set(e.form,"username",i)},expression:"form.username"}})],1),a("el-form-item",{attrs:{label:"密码",prop:"password"}},[a("el-input",{attrs:{placeholder:"远程平台密码","show-password":""},model:{value:e.form.password,callback:function(i){e.$set(e.form,"password",i)},expression:"form.password"}})],1)],1),a("span",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.handleClose}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:e.handleSubmit}},[e._v("确定")])],1)],1)},w=[],_=g(b,y,w,!1,null,null);const P=_.exports,D={name:"ZihaoContextMenu",components:{CopyPathDialog:C},data(){return{visible:!1,x:0,y:0,target:null,onRename:null,onDelete:null,onDownload:null}},methods:{show(t,e,a={}){this.target=e,this.x=t.pageX,this.y=t.pageY,this.visible=!0,this.onRename=a.onRename||null,this.onDelete=a.onDelete||null,this.onDownload=a.onDownload||null},hide(){this.visible=!1},handleRename(){this.hide(),this.onRename&&this.onRename(this.target)},handleDelete(){this.hide(),this.onDelete&&this.onDelete(this.target)},handleDownload(){this.hide(),this.onDownload&&this.onDownload(this.target)},handleCopyPath(){var t;this.hide(),(t=this.target)!=null&&t.path&&this.$refs.copyPathDialog.open(this.target.path)}}};var z=function(){var i;var e=this,a=e._self._c;return a("div",[a("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"fixed bg-[#252526] border border-[#3c3c3c] rounded shadow-lg py-1 z-50 min-w-[160px]",style:{left:e.x+"px",top:e.y+"px"}},[a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-[#cccccc] hover:bg-[#094771] flex items-center gap-2",on:{click:e.handleCopyPath}},[a("i",{staticClass:"fa-solid fa-copy text-xs w-4"}),e._v(" 复制路径 ")]),a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-[#cccccc] hover:bg-[#094771] flex items-center gap-2",on:{click:e.handleRename}},[a("i",{staticClass:"fa-solid fa-pen text-xs w-4"}),e._v(" 重命名 ")]),a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-[#094771] flex items-center gap-2",on:{click:e.handleDelete}},[a("i",{staticClass:"fa-solid fa-trash text-xs w-4"}),e._v(" 删除 ")]),((i=e.target)==null?void 0:i.type)==="file"?a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-[#cccccc] hover:bg-[#094771] flex items-center gap-2",on:{click:e.handleDownload}},[a("i",{staticClass:"fa-solid fa-download text-xs w-4"}),e._v(" 下载到本地 ")]):e._e()]),a("CopyPathDialog",{ref:"copyPathDialog"})],1)},Z=[],k=g(D,z,Z,!1,null,null);const L=k.exports,$={name:"FileZihao",components:{ZihaoConfigDialog:P,ZihaoContextMenu:L},data(){return{localItems:[],localLoading:!1,localPath:"",localCurrentPath:"",localParentPath:null,selectedLocalPath:null,localDragOver:!1,dragFile:null,zihaoConfig:null,zihaoItems:[],zihaoLoading:!1,zihaoPath:"/",zihaoPathInput:"/",selectedZihaoPath:null,isDragOver:!1,localContextMenu:{visible:!1,x:0,y:0,target:null},renameDialog:{visible:!1,title:"",value:"",target:null,isZihao:!1},uploadProgress:{visible:!1,percent:0,filename:"",isDownload:!1}}},async created(){document.addEventListener("click",this.hideLocalContextMenu),await this.loadZihaoConfig(),await this.loadLocalFiles()},beforeDestroy(){document.removeEventListener("click",this.hideLocalContextMenu)},methods:{async loadLocalFiles(){this.localLoading=!0;try{const t=await u.browseFilesystem(this.localPath);let e=t.data.items||[];this.localCurrentPath=t.data.current_path||"",this.localParentPath=t.data.parent_path,this.localParentPath!==void 0&&(e=[{name:"..",is_directory:!0,path:this.localParentPath||"",size:0},...e]),this.localItems=e.sort((a,i)=>a.name===".."?-1:i.name===".."?1:a.is_directory===i.is_directory?a.name.localeCompare(i.name):a.is_directory?-1:1)}catch(t){console.error("加载本地文件失败:",t)}finally{this.localLoading=!1}},refreshLocal(){this.loadLocalFiles()},goLocalUp(){this.localParentPath!==null&&(this.localPath=this.localParentPath===""?"":this.localParentPath,this.loadLocalFiles())},goLocalHome(){this.localPath="",this.loadLocalFiles()},selectLocalItem(t){this.selectedLocalPath=t.path},openLocalItem(t){t.name===".."?(this.localPath=t.path===""?"":t.path,this.loadLocalFiles()):t.is_directory&&(this.localPath=t.path,this.loadLocalFiles())},showLocalContextMenu(t,e){this.localContextMenu={visible:!0,x:t.pageX,y:t.pageY,target:e}},hideLocalContextMenu(){this.localContextMenu.visible=!1},copyLocalPath(){this.hideLocalContextMenu(),this.localContextMenu.target&&(navigator.clipboard.writeText(this.localContextMenu.target.path).catch(()=>{}),this.$message.success("已复制路径"))},showLocalRenameDialog(){const t=this.localContextMenu.target;!t||t.name===".."||(this.renameDialog={visible:!0,title:"重命名",value:t.name,target:t,isZihao:!1},this.hideLocalContextMenu(),this.$nextTick(()=>{var e,a;(e=this.$refs.renameInput)==null||e.focus(),(a=this.$refs.renameInput)==null||a.select()}))},async deleteLocalItem(){const t=this.localContextMenu.target;if(!(!t||t.name==="..")){try{await this.$confirm(`确定要删除 "${t.name}" 吗?`,"确认删除",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await u.deleteFile(t.path),this.$message.success("删除成功"),this.loadLocalFiles()}catch(e){e!=="cancel"&&this.$message.error("删除失败: "+e.message)}this.hideLocalContextMenu()}},async uploadToZihao(){this.hideLocalContextMenu();const t=this.localContextMenu.target;if(!t||t.is_directory||t.name==="..")return;if(!this.zihaoConfig){this.$message.warning("请先配置梓豪平台");return}const e=t.name,a=this.zihaoPath||"/";this.uploadProgress={visible:!0,percent:0,filename:e,isDownload:!1};try{const i=await fetch(`/api/filesystem/download?path=${encodeURIComponent(t.path)}`);if(!i.ok)throw new Error("读取文件失败");const l=await i.blob(),o=new File([l],e);await h.uploadWithProgress(o,e,a,n=>{this.uploadProgress.percent=n}),this.$message.success("上传成功"),this.loadZihaoFiles()}catch(i){this.$message.error("上传失败: "+i.message)}finally{this.uploadProgress.visible=!1}},handleLocalDragStart(t,e){if(e.is_directory){t.preventDefault();return}this.dragFile=e,t.dataTransfer.effectAllowed="copy"},handleLocalDragOver(t){t.preventDefault(),this.localDragOver=!0,t.dataTransfer.dropEffect="copy"},handleLocalDragLeave(){this.localDragOver=!1},async handleLocalDrop(t){t.preventDefault(),this.localDragOver=!1;const e=t.dataTransfer.files;if(e.length===0)return;const a=this.localCurrentPath||this.localPath;if(!a){this.$message.warning("无法确定上传目录");return}for(const i of e){this.uploadProgress={visible:!0,percent:0,filename:i.name,isDownload:!1};try{await u.uploadFilesystemWithProgress(a,i,l=>{this.uploadProgress.percent=l})}catch(l){this.uploadProgress.visible=!1,this.$message.error(`上传 ${i.name} 失败: `+l.message);return}this.uploadProgress.visible=!1}this.$message.success(`已上传 ${e.length} 个文件`),this.loadLocalFiles()},async loadZihaoConfig(){try{const t=await h.getZihaoConfig();this.zihaoConfig=t.data.active,this.zihaoConfig&&await this.loadZihaoFiles()}catch(t){console.error("加载梓豪配置失败:",t)}},async loadZihaoFiles(){if(this.zihaoConfig){this.zihaoLoading=!0;try{let e=(await h.browse(this.zihaoPath)).data.items||[];if(this.zihaoPath!=="/"){const a=this.zihaoPath.split("/").filter(Boolean).slice(0,-1).join("/");e=[{name:"..",type:"folder",path:a?"/"+a:"/",size:0,modify_time:""},...e]}this.zihaoItems=e}catch(t){this.$message.error("加载梓豪文件失败: "+t.message)}finally{this.zihaoLoading=!1}}},refreshZihao(){this.loadZihaoFiles()},navigateZihaoPath(){let t=this.zihaoPathInput.trim();t&&(t.startsWith("/")||(t="/"+t),this.zihaoPath=t,this.zihaoPathInput=t,this.loadZihaoFiles())},goZihaoUp(){if(this.zihaoPath==="/")return;const t=this.zihaoPath.split("/").filter(Boolean);t.pop(),this.zihaoPath=t.length>0?"/"+t.join("/"):"/",this.zihaoPathInput=this.zihaoPath,this.loadZihaoFiles()},selectZihaoItem(t){this.selectedZihaoPath=t.path},openZihaoItem(t){t.type==="folder"&&(this.zihaoPath=t.path,this.zihaoPathInput=t.path,this.loadZihaoFiles())},showZihaoContextMenu(t,e){this.selectedZihaoPath=e.path,this.$refs.zihaoContextMenu.show(t,e,{onRename:this.showZihaoRenameDialog,onDelete:this.handleZihaoDelete,onDownload:e.type==="file"?this.downloadZihaoToLocal:null})},showZihaoRenameDialog(t){this.renameDialog={visible:!0,title:"重命名",value:t.name,target:t,isZihao:!0},this.$nextTick(()=>{var e,a;(e=this.$refs.renameInput)==null||e.focus(),(a=this.$refs.renameInput)==null||a.select()})},async handleZihaoDelete(t){try{await this.$confirm(`确定要删除 "${t.name}" 吗?`,"确认删除",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await h.deleteFile(t.path,t.type),this.$message.success("删除成功"),this.loadZihaoFiles()}catch(e){e!=="cancel"&&this.$message.error("删除失败: "+e.message)}},async downloadZihaoToLocal(t){const e=this.localCurrentPath||this.localPath;if(!e){this.$message.warning("请先进入一个本地文件夹");return}this.uploadProgress={visible:!0,percent:0,filename:t.name,isDownload:!0};try{const a=e.endsWith("\\")||e.endsWith("/")?"":"\\",i=e+a+t.name;await h.download(t.path,i,l=>{this.uploadProgress.percent=l}),this.$message.success("已下载到本地: "+i),this.loadLocalFiles()}catch(a){this.$message.error("下载失败: "+a.message)}finally{this.uploadProgress.visible=!1}},async confirmRename(){const{value:t,target:e,isZihao:a}=this.renameDialog;if(!t.trim()||!e){this.cancelRename();return}try{a?(await h.rename(e.path,t.trim()),this.$message.success("重命名成功"),this.loadZihaoFiles()):(await u.renameFile(e.path,t.trim()),this.$message.success("重命名成功"),this.loadLocalFiles())}catch(i){this.$message.error("重命名失败: "+i.message)}this.renameDialog.visible=!1},cancelRename(){this.renameDialog.visible=!1},handleZihaoDragOver(t){t.preventDefault(),this.isDragOver=!0,t.dataTransfer.dropEffect="copy"},handleZihaoDragLeave(){this.isDragOver=!1},async handleZihaoDrop(t){if(t.preventDefault(),this.isDragOver=!1,!this.dragFile||!this.zihaoConfig){this.$message.warning("请先从左侧拖拽文件");return}const e=this.dragFile.name,a=this.zihaoPath||"/";this.uploadProgress={visible:!0,percent:0,filename:e,isDownload:!1};try{const i=await fetch(`/api/filesystem/download?path=${encodeURIComponent(this.dragFile.path)}`);if(!i.ok)throw new Error("读取文件失败");const l=await i.blob(),o=new File([l],e);await h.uploadWithProgress(o,e,a,n=>{this.uploadProgress.percent=n}),this.$message.success("上传成功"),this.loadZihaoFiles()}catch(i){this.$message.error("上传失败: "+i.message)}finally{this.uploadProgress.visible=!1,this.dragFile=null}},openZihaoConfig(){this.$refs.zihaoConfigDialog.open(this.zihaoConfig)},formatSize(t){if(!t)return"-";const e=["B","KB","MB","GB"];let a=0,i=t;for(;i>=1024&&a<e.length-1;)i/=1024,a++;return`${i.toFixed(1)}${e[a]}`},getFileIcon(t){var i;const e=(i=t.split(".").pop())==null?void 0:i.toLowerCase();return{js:"fa-brands fa-js text-yellow-400",ts:"fa-brands fa-js text-blue-400",html:"fa-brands fa-html5 text-orange-500",css:"fa-brands fa-css3 text-blue-400",json:"fa-solid fa-file-code text-yellow-300",md:"fa-solid fa-file-lines text-gray-400",py:"fa-brands fa-python text-blue-500",vue:"fa-brands fa-vuejs text-green-400",png:"fa-solid fa-image text-purple-400",jpg:"fa-solid fa-image text-purple-400",pdf:"fa-solid fa-file-pdf text-red-400"}[e]||"fa-solid fa-file text-gray-400"}}};var M=function(){var i,l,o,n;var e=this,a=e._self._c;return a("div",{staticClass:"flex-1 flex overflow-hidden"},[a("aside",{staticClass:"bg-sidebar border-r border-border flex flex-col shrink-0",staticStyle:{width:"50%"}},[e._m(0),a("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[a("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"上级目录"},on:{click:e.goLocalUp}},[a("i",{staticClass:"fa-solid fa-arrow-up"})]),a("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.refreshLocal}},[a("i",{staticClass:"fa-solid fa-refresh"})]),a("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"我的电脑"},on:{click:e.goLocalHome}},[a("i",{staticClass:"fa-solid fa-home"})])]),a("div",{staticClass:"flex-1 overflow-auto py-1",class:{"bg-blue-900/20":e.localDragOver},on:{dragover:function(s){return s.preventDefault(),e.handleLocalDragOver.apply(null,arguments)},dragleave:e.handleLocalDragLeave,drop:e.handleLocalDrop}},[e.localLoading?a("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[a("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.localItems.length===0?a("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 此目录为空 ")]):a("table",{staticClass:"w-full text-sm"},[e._m(1),a("tbody",e._l(e.localItems,function(s){return a("tr",{key:s.path,staticClass:"cursor-pointer border-b border-[#3c3c3c]/50 hover:bg-[#2a2a2a]",class:{"bg-[#094771]":e.selectedLocalPath===s.path},attrs:{draggable:!s.is_directory},on:{click:function(r){return e.selectLocalItem(s)},dblclick:function(r){return e.openLocalItem(s)},contextmenu:function(r){return r.preventDefault(),e.showLocalContextMenu(r,s)},dragstart:function(r){return e.handleLocalDragStart(r,s)}}},[a("td",{staticClass:"px-3 py-1"},[a("div",{staticClass:"flex items-center gap-2"},[a("i",{staticClass:"text-xs text-textMuted w-4",class:s.is_directory?"fa-solid fa-folder text-yellow-500":e.getFileIcon(s.name)}),a("span",{staticClass:"text-[#cccccc] truncate",attrs:{title:s.name}},[e._v(e._s(s.name))])])]),a("td",{staticClass:"px-3 py-1 text-[#808080] text-xs"},[e._v(e._s(s.is_directory?"文件夹":"文件"))]),a("td",{staticClass:"px-3 py-1 text-[#808080] text-xs text-right"},[e._v(e._s(s.is_directory?"-":e.formatSize(s.size)))]),a("td",{staticClass:"px-3 py-1 text-[#808080] text-xs"},[e._v("-")])])}),0)])]),a("div",{directives:[{name:"show",rawName:"v-show",value:e.localContextMenu.visible,expression:"localContextMenu.visible"}],staticClass:"fixed bg-[#252526] border border-[#3c3c3c] rounded shadow-lg py-1 z-50 min-w-[160px]",style:{left:e.localContextMenu.x+"px",top:e.localContextMenu.y+"px"}},[a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-[#cccccc] hover:bg-[#094771] flex items-center gap-2",on:{click:e.copyLocalPath}},[a("i",{staticClass:"fa-solid fa-copy text-xs w-4"}),e._v(" 复制路径 ")]),((i=e.localContextMenu.target)==null?void 0:i.name)!==".."?a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-[#cccccc] hover:bg-[#094771] flex items-center gap-2",on:{click:e.showLocalRenameDialog}},[a("i",{staticClass:"fa-solid fa-pen text-xs w-4"}),e._v(" 重命名 ")]):e._e(),((l=e.localContextMenu.target)==null?void 0:l.name)!==".."?a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-red-400 hover:bg-[#094771] flex items-center gap-2",on:{click:e.deleteLocalItem}},[a("i",{staticClass:"fa-solid fa-trash text-xs w-4"}),e._v(" 删除 ")]):e._e(),a("div",{staticClass:"border-t border-[#3c3c3c] my-1"}),((o=e.localContextMenu.target)==null?void 0:o.name)!==".."&&!((n=e.localContextMenu.target)!=null&&n.is_directory)?a("button",{staticClass:"w-full text-left px-4 py-2 text-sm text-[#cccccc] hover:bg-[#094771] flex items-center gap-2",on:{click:e.uploadToZihao}},[a("i",{staticClass:"fa-solid fa-server text-xs w-4"}),e._v(" 上传到梓豪 ")]):e._e()])]),a("main",{staticClass:"flex-1 flex flex-col min-w-0 bg-[#1e1e1e]"},[a("div",{staticClass:"flex border-b border-border bg-sidebar shrink-0"},[e._m(2),a("div",{staticClass:"flex-1"}),a("button",{staticClass:"p-1 mr-2 text-textMuted hover:text-white",attrs:{title:"梓豪配置"},on:{click:e.openZihaoConfig}},[a("i",{staticClass:"fa-solid fa-gear"})])]),a("div",{staticClass:"flex items-center gap-1 px-2 py-2 border-b border-border"},[a("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"上级目录"},on:{click:e.goZihaoUp}},[a("i",{staticClass:"fa-solid fa-arrow-up"})]),a("button",{staticClass:"p-1 text-textMuted hover:text-white",attrs:{title:"刷新"},on:{click:e.refreshZihao}},[a("i",{staticClass:"fa-solid fa-refresh"})]),a("input",{directives:[{name:"model",rawName:"v-model",value:e.zihaoPathInput,expression:"zihaoPathInput"}],staticClass:"flex-1 px-2 py-1 mx-1 bg-[#3c3c3c] border border-[#3c3c3c] rounded text-xs text-[#cccccc] focus:outline-none focus:border-[#0e639c]",attrs:{placeholder:"输入路径后回车跳转..."},domProps:{value:e.zihaoPathInput},on:{keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.navigateZihaoPath.apply(null,arguments)},input:function(s){s.target.composing||(e.zihaoPathInput=s.target.value)}}})]),a("div",{staticClass:"flex-1 overflow-auto py-1",class:{"bg-blue-900/20":e.isDragOver},on:{dragover:function(s){return s.preventDefault(),e.handleZihaoDragOver.apply(null,arguments)},dragleave:e.handleZihaoDragLeave,drop:e.handleZihaoDrop}},[e.zihaoConfig?e.zihaoLoading?a("div",{staticClass:"flex items-center justify-center py-8 text-textMuted"},[a("i",{staticClass:"fa-solid fa-spinner fa-spin mr-2"}),e._v(" 加载中... ")]):e.zihaoItems.length===0?a("div",{staticClass:"flex items-center justify-center py-8 text-textMuted text-sm"},[e._v(" 此目录为空 ")]):a("table",{staticClass:"w-full text-sm"},[e._m(3),a("tbody",e._l(e.zihaoItems,function(s){return a("tr",{key:s.path,staticClass:"cursor-pointer border-b border-[#3c3c3c]/50 hover:bg-[#2a2a2a]",class:{"bg-[#094771]":e.selectedZihaoPath===s.path},on:{click:function(r){return e.selectZihaoItem(s)},dblclick:function(r){return e.openZihaoItem(s)},contextmenu:function(r){return r.preventDefault(),e.showZihaoContextMenu(r,s)}}},[a("td",{staticClass:"px-3 py-1"},[a("div",{staticClass:"flex items-center gap-2"},[a("i",{staticClass:"text-xs text-textMuted w-4",class:s.type==="folder"?"fa-solid fa-folder text-yellow-500":e.getFileIcon(s.name)}),a("span",{staticClass:"text-[#cccccc] truncate",attrs:{title:s.name}},[e._v(e._s(s.name))])])]),a("td",{staticClass:"px-3 py-1 text-[#808080] text-xs"},[e._v(e._s(s.type==="folder"?"文件夹":"文件"))]),a("td",{staticClass:"px-3 py-1 text-[#808080] text-xs text-right"},[e._v(e._s(s.type==="file"?e.formatSize(s.size):"-"))]),a("td",{staticClass:"px-3 py-1 text-[#808080] text-xs"},[e._v(e._s(s.modify_time||"-"))])])}),0)]):a("div",{staticClass:"flex items-center justify-center h-full text-textMuted"},[a("div",{staticClass:"text-center"},[a("i",{staticClass:"fa-solid fa-server text-4xl mb-4 opacity-30"}),a("p",{staticClass:"mb-2"},[e._v("未配置梓豪平台")]),a("button",{staticClass:"px-4 py-2 bg-[#0e639c] text-white rounded hover:bg-[#1177bb] text-sm",on:{click:e.openZihaoConfig}},[e._v(" 配置梓豪 ")])])])]),a("ZihaoConfigDialog",{ref:"zihaoConfigDialog",on:{success:e.loadZihaoConfig}}),a("ZihaoContextMenu",{ref:"zihaoContextMenu"})],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.renameDialog.visible,expression:"renameDialog.visible"}],staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",on:{click:function(s){return s.target!==s.currentTarget?null:e.cancelRename.apply(null,arguments)}}},[a("div",{staticClass:"bg-[#252526] border border-[#3c3c3c] rounded p-4 w-80"},[a("p",{staticClass:"text-[#cccccc] text-sm mb-3"},[e._v(e._s(e.renameDialog.title))]),a("input",{directives:[{name:"model",rawName:"v-model",value:e.renameDialog.value,expression:"renameDialog.value"}],ref:"renameInput",staticClass:"w-full px-3 py-2 bg-[#3c3c3c] border border-[#3c3c3c] rounded text-[#cccccc] text-sm focus:outline-none focus:border-[#0e639c]",domProps:{value:e.renameDialog.value},on:{keyup:[function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.confirmRename.apply(null,arguments)},function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"escape",void 0,s.key,void 0)?null:e.cancelRename.apply(null,arguments)}],input:function(s){s.target.composing||e.$set(e.renameDialog,"value",s.target.value)}}}),a("div",{staticClass:"flex justify-end gap-2 mt-4"},[a("button",{staticClass:"px-3 py-1 text-xs text-[#808080] hover:text-white",on:{click:e.cancelRename}},[e._v("取消")]),a("button",{staticClass:"px-3 py-1 text-xs bg-[#0e639c] text-white rounded hover:bg-[#1177bb]",on:{click:e.confirmRename}},[e._v("确定")])])])]),e.uploadProgress.visible?a("div",{staticClass:"fixed inset-0 bg-black/50 flex items-center justify-center z-50"},[a("div",{staticClass:"bg-[#252526] border border-[#3c3c3c] rounded p-4 w-80"},[a("p",{staticClass:"text-[#cccccc] text-sm mb-3"},[e._v("正在 "+e._s(e.uploadProgress.isDownload?"下载":"上传")+" "+e._s(e.uploadProgress.filename))]),a("div",{staticClass:"w-full bg-[#3c3c3c] rounded-full h-2"},[a("div",{staticClass:"bg-[#0e639c] h-2 rounded-full transition-all",style:{width:e.uploadProgress.percent+"%"}})]),a("p",{staticClass:"text-[#808080] text-xs mt-2 text-center"},[e._v(e._s(e.uploadProgress.percent.toFixed(2))+"%")])])]):e._e()])},I=[function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex border-b border-border"},[e("div",{staticClass:"px-4 py-2 text-xs uppercase font-bold text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-folder-open text-accent"}),t._v(" 本地文件 ")])])},function(){var t=this,e=t._self._c;return e("thead",{staticClass:"sticky top-0 bg-[#252526] z-10"},[e("tr",{staticClass:"text-textMuted text-xs border-b border-[#3c3c3c]"},[e("th",{staticClass:"text-left px-3 py-1 font-medium"},[t._v("名称")]),e("th",{staticClass:"text-left px-3 py-1 w-16 font-medium"},[t._v("类型")]),e("th",{staticClass:"text-right px-3 py-1 w-20 font-medium"},[t._v("大小")]),e("th",{staticClass:"text-left px-3 py-1 w-32 font-medium"},[t._v("修改时间")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"px-4 py-2 text-xs uppercase font-bold text-white flex items-center gap-2"},[e("i",{staticClass:"fa-solid fa-server text-accent"}),t._v(" 梓豪远程平台 ")])},function(){var t=this,e=t._self._c;return e("thead",{staticClass:"sticky top-0 bg-[#252526] z-10"},[e("tr",{staticClass:"text-textMuted text-xs border-b border-[#3c3c3c]"},[e("th",{staticClass:"text-left px-3 py-1 font-medium"},[t._v("名称")]),e("th",{staticClass:"text-left px-3 py-1 w-16 font-medium"},[t._v("类型")]),e("th",{staticClass:"text-right px-3 py-1 w-20 font-medium"},[t._v("大小")]),e("th",{staticClass:"text-left px-3 py-1 w-32 font-medium"},[t._v("修改时间")])])])}],F=g($,M,I,!1,null,null);const T=F.exports;export{T as default};
@@ -1,4 +1,4 @@
1
- import{m as f}from"./index-Dtkc_ka-.js";/*!-----------------------------------------------------------------------------
1
+ import{m as f}from"./index-Ch_-1SCN.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as l}from"./index-Dtkc_ka-.js";/*!-----------------------------------------------------------------------------
1
+ import{m as l}from"./index-Ch_-1SCN.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as s}from"./index-Dtkc_ka-.js";/*!-----------------------------------------------------------------------------
1
+ import{m as s}from"./index-Ch_-1SCN.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -1,4 +1,4 @@
1
- import{m as lt}from"./index-Dtkc_ka-.js";/*!-----------------------------------------------------------------------------
1
+ import{m as lt}from"./index-Ch_-1SCN.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license