autoglm-gui 1.5.7__py3-none-any.whl → 1.5.8__py3-none-any.whl
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.
- AutoGLM_GUI/static/assets/{about-BN7TF-uS.js → about-DLIoLF4H.js} +1 -1
- AutoGLM_GUI/static/assets/{alert-dialog-D62FbnlZ.js → alert-dialog-CP0Ln6uE.js} +1 -1
- AutoGLM_GUI/static/assets/{chat-OpHm69J3.js → chat-BeQeCo9v.js} +3 -3
- AutoGLM_GUI/static/assets/{dialog-LOCyYNCR.js → dialog-owGgcHW-.js} +1 -1
- AutoGLM_GUI/static/assets/{eye-CphvL3Nj.js → eye-DRVKMcGF.js} +1 -1
- AutoGLM_GUI/static/assets/{folder-open-1SAaazEb.js → folder-open-DWIBudK5.js} +1 -1
- AutoGLM_GUI/static/assets/{history-Ef0dqgi8.js → history-D-6VV8AF.js} +1 -1
- AutoGLM_GUI/static/assets/{index-DGbZjnSP.js → index-DSGEx4xN.js} +2 -2
- AutoGLM_GUI/static/assets/{index-CGykihaE.js → index-Dulms-G2.js} +1 -1
- AutoGLM_GUI/static/assets/{label-YliMUBOr.js → label-DPhMxT1N.js} +1 -1
- AutoGLM_GUI/static/assets/{logs-DeHKldwN.js → logs-DfpuXl5p.js} +1 -1
- AutoGLM_GUI/static/assets/{popover-DQ7GD1WC.js → popover-BVLk9lq7.js} +1 -1
- AutoGLM_GUI/static/assets/{scheduled-tasks-DL6pE9tE.js → scheduled-tasks-Cw40Sske.js} +1 -1
- AutoGLM_GUI/static/assets/{textarea-thgveQFy.js → textarea-D8pE3YVl.js} +1 -1
- AutoGLM_GUI/static/assets/{workflows-DRsmfMuf.js → workflows-C25VCn09.js} +1 -1
- AutoGLM_GUI/static/index.html +1 -1
- {autoglm_gui-1.5.7.dist-info → autoglm_gui-1.5.8.dist-info}/METADATA +1 -1
- {autoglm_gui-1.5.7.dist-info → autoglm_gui-1.5.8.dist-info}/RECORD +21 -21
- {autoglm_gui-1.5.7.dist-info → autoglm_gui-1.5.8.dist-info}/WHEEL +0 -0
- {autoglm_gui-1.5.7.dist-info → autoglm_gui-1.5.8.dist-info}/entry_points.txt +0 -0
- {autoglm_gui-1.5.7.dist-info → autoglm_gui-1.5.8.dist-info}/licenses/LICENSE +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ap as o,r as s,j as t}from"./index-
|
|
1
|
+
import{ap as o,r as s,j as t}from"./index-DSGEx4xN.js";function n(){const e=o();return s.useEffect(()=>{e({to:"/chat"})},[e]),t.jsx("div",{className:"p-2",children:t.jsx("h3",{children:"Welcome Home!"})})}export{n as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,j as r,e as o,r as s,aw as d}from"./index-
|
|
1
|
+
import{b as i,j as r,e as o,r as s,aw as d}from"./index-DSGEx4xN.js";const u=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],x=i("plus",u);const c=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],g=i("square-pen",c);function v({className:a,type:t,...e}){return r.jsx("input",{type:t,"data-slot":"input",className:o("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",a),...e})}var p="Label",n=s.forwardRef((a,t)=>r.jsx(d.label,{...a,ref:t,onMouseDown:e=>{e.target.closest("button, input, select, textarea")||(a.onMouseDown?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));n.displayName=p;var l=n;const f=s.forwardRef(({className:a,...t},e)=>r.jsx(l,{ref:e,className:o("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 text-slate-900 dark:text-slate-100",a),...t}));f.displayName=l.displayName;export{v as I,f as L,x as P,g as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as S,u as I,r as l,j as e,B as i,F as u}from"./index-
|
|
1
|
+
import{b as S,u as I,r as l,j as e,B as i,F as u}from"./index-DSGEx4xN.js";import{C as d,F as A}from"./folder-open-DWIBudK5.js";const E=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],M=S("refresh-cw",E);function B(){const r=I(),[x,j]=l.useState([]),[o,v]=l.useState(null),[N,p]=l.useState(""),[m,h]=l.useState(!1),[w,g]=l.useState(!1),[f,a]=l.useState(""),[b,F]=l.useState(!1),n=l.useCallback(async()=>{try{h(!0),a("");const s=window.electronAPI;if(!s?.logs)return;const t=await s.logs.listFiles();j(t)}catch(s){const t=s instanceof Error?s.message:String(s);a(r.logs.loadFailed.replace("{error}",t))}finally{h(!1)}},[r.logs.loadFailed]);l.useEffect(()=>{window.electronAPI?.logs&&(F(!0),n())},[n]);const k=async s=>{g(!0),a("");try{const t=window.electronAPI;if(!t?.logs)return;const c=await t.logs.readFile(s);v(s),p(c)}catch(t){const c=t instanceof Error?t.message:String(t);a(r.logs.readFailed.replace("{error}",c))}finally{g(!1)}},L=async()=>{try{const s=window.electronAPI;if(!s?.logs)return;const t=await s.logs.openFolder();t.success||a(r.logs.openFolderFailed.replace("{error}",t.error||""))}catch(s){const t=s instanceof Error?s.message:String(s);a(r.logs.openFolderFailed.replace("{error}",t))}},y=s=>s<1024?s+" B":s<1024*1024?(s/1024).toFixed(1)+" KB":(s/(1024*1024)).toFixed(1)+" MB",C=s=>new Date(s).toLocaleString("zh-CN");return b?e.jsxs("div",{className:"h-full flex",children:[e.jsxs("div",{className:"w-80 border-r border-slate-200 dark:border-slate-800 flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("h2",{className:"text-lg font-semibold",children:r.logs.title}),e.jsx(i,{variant:"ghost",size:"icon",onClick:n,disabled:m,title:r.logs.refresh,children:e.jsx(M,{className:`w-4 h-4 ${m?"animate-spin":""}`})})]}),e.jsxs(i,{variant:"outline",className:"w-full",onClick:L,children:[e.jsx(A,{className:"w-4 h-4 mr-2"}),r.logs.openFolder]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:x.length===0?e.jsx("div",{className:"p-4 text-center text-slate-500 text-sm",children:r.logs.noLogs}):e.jsx("div",{className:"divide-y divide-slate-200 dark:divide-slate-800",children:x.map(s=>e.jsxs("div",{className:`p-4 hover:bg-slate-50 dark:hover:bg-slate-900 cursor-pointer transition-colors ${o===s.name?"bg-slate-50 dark:bg-slate-900":""}`,onClick:()=>!s.isCompressed&&k(s.name),children:[e.jsxs("div",{className:"flex items-start gap-3",children:[s.isError?e.jsx(d,{className:"w-5 h-5 text-red-500 flex-shrink-0 mt-0.5"}):e.jsx(u,{className:"w-5 h-5 text-slate-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"font-medium text-sm truncate",children:s.name}),e.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[y(s.size)," •"," ",C(s.modified)]})]})]}),s.isCompressed&&e.jsx("div",{className:"text-xs text-slate-400 mt-2 ml-8",children:r.logs.compressedFileNote})]},s.name))})})]}),e.jsx("div",{className:"flex-1 flex flex-col",children:o?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"p-4 border-b border-slate-200 dark:border-slate-800",children:e.jsx("h3",{className:"font-semibold",children:o})}),e.jsx("div",{className:"flex-1 overflow-auto p-4 bg-slate-50 dark:bg-slate-950",children:w?e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsx("div",{className:"text-slate-500",children:r.logs.loading})}):e.jsx("pre",{className:"text-xs font-mono whitespace-pre-wrap break-all",children:N})})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-slate-500",children:e.jsxs("div",{className:"text-center",children:[e.jsx(u,{className:"w-12 h-12 mx-auto mb-4 text-slate-300"}),e.jsx("p",{children:r.logs.selectLog})]})})}),f&&e.jsx("div",{className:"fixed bottom-4 right-4 max-w-md bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg p-4 shadow-lg",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(d,{className:"w-5 h-5 text-red-500 flex-shrink-0 mt-0.5"}),e.jsx("div",{className:"flex-1 text-sm text-red-600 dark:text-red-400",children:f}),e.jsx(i,{variant:"ghost",size:"icon",className:"h-6 w-6 text-red-400 hover:text-red-600",onClick:()=>a(""),children:"✕"})]})})]}):e.jsx("div",{className:"flex items-center justify-center h-full",children:e.jsxs("div",{className:"text-center",children:[e.jsx(d,{className:"w-12 h-12 mx-auto mb-4 text-slate-400"}),e.jsx("p",{className:"text-slate-600",dangerouslySetInnerHTML:{__html:r.logs.webVersionNotice}})]})})}export{B as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as R,r as i,J as _,H as z,j as s,K as L,z as $,E as G,A as O,P as b,G as P,L as w,M as j,N as H,D as K,Q as q,S as U,U as B,e as J}from"./index-
|
|
1
|
+
import{b as R,r as i,J as _,H as z,j as s,K as L,z as $,E as G,A as O,P as b,G as P,L as w,M as j,N as H,D as K,Q as q,S as U,U as B,e as J}from"./index-DSGEx4xN.js";import{i as Q,R as V,u as W,F as X}from"./dialog-owGgcHW-.js";const Z=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],he=R("chevron-down",Z);const Y=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Ce=R("circle-check-big",Y);const ee=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],me=R("circle-x",ee);var m="Popover",[y]=$(m,[_]),g=_(),[oe,l]=y(m),E=e=>{const{__scopePopover:n,children:o,open:a,defaultOpen:t,onOpenChange:r,modal:c=!1}=e,p=g(n),f=i.useRef(null),[v,h]=i.useState(!1),[C,d]=z({prop:a,defaultProp:t??!1,onChange:r,caller:m});return s.jsx(L,{...p,children:s.jsx(oe,{scope:n,contentId:G(),triggerRef:f,open:C,onOpenChange:d,onOpenToggle:i.useCallback(()=>d(x=>!x),[d]),hasCustomAnchor:v,onCustomAnchorAdd:i.useCallback(()=>h(!0),[]),onCustomAnchorRemove:i.useCallback(()=>h(!1),[]),modal:c,children:o})})};E.displayName=m;var N="PopoverAnchor",te=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=l(N,o),r=g(o),{onCustomAnchorAdd:c,onCustomAnchorRemove:p}=t;return i.useEffect(()=>(c(),()=>p()),[c,p]),s.jsx(w,{...r,...a,ref:n})});te.displayName=N;var k="PopoverTrigger",F=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=l(k,o),r=g(o),c=O(n,t.triggerRef),p=s.jsx(b.button,{type:"button","aria-haspopup":"dialog","aria-expanded":t.open,"aria-controls":t.contentId,"data-state":T(t.open),...a,ref:c,onClick:P(e.onClick,t.onOpenToggle)});return t.hasCustomAnchor?p:s.jsx(w,{asChild:!0,...r,children:p})});F.displayName=k;var A="PopoverPortal",[re,ne]=y(A,{forceMount:void 0}),S=e=>{const{__scopePopover:n,forceMount:o,children:a,container:t}=e,r=l(A,n);return s.jsx(re,{scope:n,forceMount:o,children:s.jsx(j,{present:o||r.open,children:s.jsx(H,{asChild:!0,container:t,children:a})})})};S.displayName=A;var u="PopoverContent",D=i.forwardRef((e,n)=>{const o=ne(u,e.__scopePopover),{forceMount:a=o.forceMount,...t}=e,r=l(u,e.__scopePopover);return s.jsx(j,{present:a||r.open,children:r.modal?s.jsx(se,{...t,ref:n}):s.jsx(ce,{...t,ref:n})})});D.displayName=u;var ae=K("PopoverContent.RemoveScroll"),se=i.forwardRef((e,n)=>{const o=l(u,e.__scopePopover),a=i.useRef(null),t=O(n,a),r=i.useRef(!1);return i.useEffect(()=>{const c=a.current;if(c)return Q(c)},[]),s.jsx(V,{as:ae,allowPinchZoom:!0,children:s.jsx(M,{...e,ref:t,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,c=>{c.preventDefault(),r.current||o.triggerRef.current?.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,c=>{const p=c.detail.originalEvent,f=p.button===0&&p.ctrlKey===!0,v=p.button===2||f;r.current=v},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),ce=i.forwardRef((e,n)=>{const o=l(u,e.__scopePopover),a=i.useRef(!1),t=i.useRef(!1);return s.jsx(M,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{e.onCloseAutoFocus?.(r),r.defaultPrevented||(a.current||o.triggerRef.current?.focus(),r.preventDefault()),a.current=!1,t.current=!1},onInteractOutside:r=>{e.onInteractOutside?.(r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(t.current=!0));const c=r.target;o.triggerRef.current?.contains(c)&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&t.current&&r.preventDefault()}})}),M=i.forwardRef((e,n)=>{const{__scopePopover:o,trapFocus:a,onOpenAutoFocus:t,onCloseAutoFocus:r,disableOutsidePointerEvents:c,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:v,onInteractOutside:h,...C}=e,d=l(u,o),x=g(o);return W(),s.jsx(X,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:t,onUnmountAutoFocus:r,children:s.jsx(q,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:h,onEscapeKeyDown:p,onPointerDownOutside:f,onFocusOutside:v,onDismiss:()=>d.onOpenChange(!1),children:s.jsx(U,{"data-state":T(d.open),role:"dialog",id:d.contentId,...x,...C,ref:n,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),I="PopoverClose",ie=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=l(I,o);return s.jsx(b.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>t.onOpenChange(!1))})});ie.displayName=I;var pe="PopoverArrow",le=i.forwardRef((e,n)=>{const{__scopePopover:o,...a}=e,t=g(o);return s.jsx(B,{...t,...a,ref:n})});le.displayName=pe;function T(e){return e?"open":"closed"}var de=E,ue=F,fe=S,ve=D;function xe({...e}){return s.jsx(de,{"data-slot":"popover",...e})}function Re({...e}){return s.jsx(ue,{"data-slot":"popover-trigger",...e})}function Ae({className:e,align:n="center",sideOffset:o=4,...a}){return s.jsx(fe,{children:s.jsx(ve,{"data-slot":"popover-content",align:n,sideOffset:o,className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...a})})}export{Ce as C,xe as P,me as a,he as b,Re as c,Ae as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ne,r as t,j as e,e as P,u as te,f as re,l as ce,g as ie,h as de,B as i,i as oe,C as ue,k as me,m as he,n as xe,o as pe,p as ge}from"./index-DGbZjnSP.js";import{P as ve,S as je,L as g,I as G}from"./label-YliMUBOr.js";import{L as H,C as fe,a as _e,b as ke,c as we,T as Ne,D as be,d as Te,e as ye,f as De,g as Ce}from"./dialog-LOCyYNCR.js";import{S as M,a as O,b as R,c as W,d as $,A as Se,e as Fe,f as Ae,g as Le,h as ze,i as Ee,j as Pe,k as Ge}from"./alert-dialog-D62FbnlZ.js";import{C as He,a as Me}from"./popover-DQ7GD1WC.js";const Oe=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Re=ne("triangle-alert",Oe),B=t.forwardRef(({className:a,checked:d=!1,onCheckedChange:_,disabled:m,...k},h)=>e.jsx("button",{ref:h,role:"switch",type:"button","aria-checked":d,disabled:m,className:P("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",d?"bg-slate-900 dark:bg-slate-50":"bg-slate-200 dark:bg-slate-800",a),onClick:()=>_?.(!d),...k,children:e.jsx("span",{className:P("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform dark:bg-slate-950",d?"translate-x-5":"translate-x-0")})}));B.displayName="Switch";const We=[{key:"everyHour",cron:"0 * * * *"},{key:"daily8am",cron:"0 8 * * *"},{key:"daily12pm",cron:"0 12 * * *"},{key:"daily6pm",cron:"0 18 * * *"},{key:"weeklyMonday",cron:"0 9 * * 1"}];function Xe(){const a=te(),[d,_]=t.useState([]),[m,k]=t.useState([]),[h,V]=t.useState([]),[v,q]=t.useState([]),[I,y]=t.useState(!0),[X,x]=t.useState(!1),[w,D]=t.useState(null),[n,c]=t.useState({name:"",workflow_uuid:"",device_serialnos:[],device_group_id:null,cron_expression:"",enabled:!0}),[o,j]=t.useState("devices"),[C,S]=t.useState(!1),[J,N]=t.useState(!1),[F,A]=t.useState(null);t.useEffect(()=>{f()},[]);const f=async()=>{try{y(!0);const[s,l,r,u]=await Promise.all([re(),ce(),ie(),de()]);_(s.tasks),k(l.workflows),V(r),q(u.groups)}catch(s){console.error("Failed to load data:",s)}finally{y(!1)}},K=()=>{D(null),c({name:"",workflow_uuid:"",device_serialnos:[],device_group_id:null,cron_expression:"",enabled:!0}),j("devices"),x(!0)},Q=s=>{D(s),c({name:s.name,workflow_uuid:s.workflow_uuid,device_serialnos:s.device_serialnos,device_group_id:s.device_group_id||null,cron_expression:s.cron_expression,enabled:s.enabled}),j(s.device_group_id?"group":"devices"),x(!0)},U=async()=>{try{S(!0);const s={name:n.name,workflow_uuid:n.workflow_uuid,cron_expression:n.cron_expression,enabled:n.enabled,device_serialnos:o==="devices"?n.device_serialnos:null,device_group_id:o==="group"?n.device_group_id:null};w?await xe(w.id,s):await pe(s),x(!1),f()}catch(s){console.error("Failed to save task:",s)}finally{S(!1)}},Y=async()=>{if(F){try{await ge(F),f()}catch(s){console.error("Failed to delete task:",s)}N(!1),A(null)}},Z=async s=>{try{s.enabled?await me(s.id):await he(s.id),f()}catch(l){console.error("Failed to toggle task:",l)}},ee=s=>m.find(r=>r.uuid===s)?.name||s,b=s=>h.find(r=>r.serial===s)?.model||s,L=s=>v.find(r=>r.id===s)?.name||s,se=(s,l)=>{if(l){const p=v.find(le=>le.id===l);return p?`${p.name} (${p.device_count} ${a.scheduledTasks.groupDevices||"devices"})`:L(l)}if(s.length===0)return"-";if(s.length===1)return b(s[0]);const r=s.map(p=>b(p)),u=r[0],T=r.length-1;return`${u} (+${T})`},z=s=>s?new Date(s).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):a.scheduledTasks.never,E=s=>s.last_run_status?s.last_run_status:s.last_run_success===!0?"success":s.last_run_success===!1?"failure":null,ae=n.name.trim()&&n.workflow_uuid&&(o==="devices"&&n.device_serialnos.length>0||o==="group"&&n.device_group_id)&&n.cron_expression.trim();return e.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:a.scheduledTasks.title}),e.jsxs(i,{onClick:K,children:[e.jsx(ve,{className:"w-4 h-4 mr-2"}),a.scheduledTasks.create]})]}),I?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(H,{className:"w-8 h-8 animate-spin text-slate-400"})}):d.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:a.scheduledTasks.noTasks}),e.jsx("p",{className:"text-sm text-slate-400 dark:text-slate-500 mt-2",children:a.scheduledTasks.noTasksDesc})]}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:d.map(s=>e.jsxs(fe,{className:"hover:shadow-md transition-shadow",children:[e.jsx(_e,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ke,{className:"text-lg truncate flex-1 mr-2",children:s.name}),e.jsx(B,{checked:s.enabled,onCheckedChange:()=>Z(s)})]})}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.workflow,":"," "]}),e.jsx("span",{className:"font-medium",children:ee(s.workflow_uuid)})]}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.device,":"," "]}),e.jsx("span",{className:"font-medium",title:s.device_group_id?L(s.device_group_id):s.device_serialnos.map(l=>b(l)).join(", "),children:se(s.device_serialnos,s.device_group_id)})]}),e.jsx("div",{className:"text-sm",children:e.jsxs(oe,{variant:"outline",className:"font-mono",children:[e.jsx(ue,{className:"w-3 h-3 mr-1"}),s.cron_expression]})}),e.jsxs("div",{className:"text-sm flex items-center gap-2",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.lastRun,":"]}),s.last_run_time?e.jsxs(e.Fragment,{children:[E(s)==="success"?e.jsx(He,{className:"w-4 h-4 text-green-500"}):E(s)==="partial"?e.jsx(Re,{className:"w-4 h-4 text-amber-500"}):e.jsx(Me,{className:"w-4 h-4 text-red-500"}),e.jsx("span",{title:s.last_run_message||void 0,children:z(s.last_run_time)}),typeof s.last_run_success_count=="number"&&typeof s.last_run_total_count=="number"&&s.last_run_total_count>1&&e.jsxs("span",{className:"text-xs text-slate-500",children:["(",s.last_run_success_count,"/",s.last_run_total_count,")"]})]}):e.jsx("span",{className:"text-slate-400",children:a.scheduledTasks.never})]}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.nextRun,":"," "]}),e.jsx("span",{children:z(s.next_run_time)})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>Q(s),children:[e.jsx(je,{className:"w-3 h-3 mr-1"}),a.common.edit]}),e.jsxs(i,{variant:"destructive",size:"sm",onClick:()=>{A(s.id),N(!0)},children:[e.jsx(Ne,{className:"w-3 h-3 mr-1"}),a.common.delete]})]})]})})]},s.id))}),e.jsx(be,{open:X,onOpenChange:x,children:e.jsxs(Te,{className:"sm:max-w-[500px]",children:[e.jsx(ye,{children:e.jsx(De,{children:w?a.scheduledTasks.edit:a.scheduledTasks.create})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"name",children:a.scheduledTasks.taskName}),e.jsx(G,{id:"name",value:n.name,onChange:s=>c(l=>({...l,name:s.target.value})),placeholder:a.scheduledTasks.taskNamePlaceholder})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{children:a.scheduledTasks.workflow}),m.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:a.scheduledTasks.noWorkflows}):e.jsxs(M,{value:n.workflow_uuid,onValueChange:s=>c(l=>({...l,workflow_uuid:s})),children:[e.jsx(O,{children:e.jsx(R,{placeholder:a.scheduledTasks.selectWorkflow})}),e.jsx(W,{children:m.map(s=>e.jsx($,{value:s.uuid,children:s.name},s.uuid))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{children:a.scheduledTasks.device}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(i,{type:"button",variant:o==="devices"?"default":"outline",size:"sm",onClick:()=>{j("devices"),c(s=>({...s,device_group_id:null}))},children:a.scheduledTasks.selectDevice||"选择设备"}),e.jsx(i,{type:"button",variant:o==="group"?"default":"outline",size:"sm",onClick:()=>{j("group"),c(s=>({...s,device_serialnos:[]}))},children:a.scheduledTasks.selectGroup||"选择分组"})]}),o==="devices"?h.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:a.scheduledTasks.noDevicesOnline}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border rounded-md p-2 space-y-1 max-h-40 overflow-y-auto",children:h.map(s=>e.jsxs("label",{className:"flex items-center gap-2 p-2 hover:bg-slate-100 dark:hover:bg-slate-800 rounded cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:n.device_serialnos.includes(s.serial),onChange:l=>{const r=l.target.checked;c(u=>({...u,device_serialnos:r?[...u.device_serialnos,s.serial]:u.device_serialnos.filter(T=>T!==s.serial)}))},className:"rounded border-gray-300"}),e.jsx("span",{className:"text-sm",children:s.model||s.serial}),s.state==="online"&&e.jsx("span",{className:"ml-auto w-2 h-2 bg-green-500 rounded-full"})]},s.serial))}),n.device_serialnos.length>0&&e.jsxs("p",{className:"text-xs text-slate-500",children:[n.device_serialnos.length," ",a.scheduledTasks.devicesSelected||"devices selected"]})]}):v.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:"暂无分组"}):e.jsxs(M,{value:n.device_group_id||"",onValueChange:s=>c(l=>({...l,device_group_id:s||null})),children:[e.jsx(O,{children:e.jsx(R,{placeholder:a.scheduledTasks.selectGroup||"选择分组"})}),e.jsx(W,{children:v.map(s=>e.jsxs($,{value:s.id,children:[s.name," (",s.device_count," ",a.deviceGroups?.deviceCount||"台设备",")"]},s.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"cron",children:a.scheduledTasks.cronExpression}),e.jsx(G,{id:"cron",value:n.cron_expression,onChange:s=>c(l=>({...l,cron_expression:s.target.value})),placeholder:a.scheduledTasks.cronPlaceholder,className:"font-mono"}),e.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:a.scheduledTasks.cronHelp})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{children:a.scheduledTasks.presets}),e.jsx("div",{className:"flex flex-wrap gap-2",children:We.map(s=>e.jsx(i,{variant:"outline",size:"sm",onClick:()=>c(l=>({...l,cron_expression:s.cron})),children:a.scheduledTasks.preset[s.key]},s.key))})]})]}),e.jsxs(Ce,{children:[e.jsx(i,{variant:"outline",onClick:()=>x(!1),children:a.common.cancel}),e.jsx(i,{onClick:U,disabled:!ae||C,children:C?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),a.common.loading]}):a.common.save})]})]})}),e.jsx(Se,{open:J,onOpenChange:N,children:e.jsxs(Fe,{children:[e.jsxs(Ae,{children:[e.jsx(Le,{children:a.common.delete}),e.jsx(ze,{children:a.scheduledTasks.deleteConfirm})]}),e.jsxs(Ee,{children:[e.jsx(Pe,{children:a.common.cancel}),e.jsx(Ge,{onClick:Y,children:a.common.confirm})]})]})})]})}export{Xe as component};
|
|
1
|
+
import{b as ne,r as t,j as e,e as P,u as te,f as re,l as ce,g as ie,h as de,B as i,i as oe,C as ue,k as me,m as he,n as xe,o as pe,p as ge}from"./index-DSGEx4xN.js";import{P as ve,S as je,L as g,I as G}from"./label-DPhMxT1N.js";import{L as H,C as fe,a as _e,b as ke,c as we,T as Ne,D as be,d as Te,e as ye,f as De,g as Ce}from"./dialog-owGgcHW-.js";import{S as M,a as O,b as R,c as W,d as $,A as Se,e as Fe,f as Ae,g as Le,h as ze,i as Ee,j as Pe,k as Ge}from"./alert-dialog-CP0Ln6uE.js";import{C as He,a as Me}from"./popover-BVLk9lq7.js";const Oe=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Re=ne("triangle-alert",Oe),B=t.forwardRef(({className:a,checked:d=!1,onCheckedChange:_,disabled:m,...k},h)=>e.jsx("button",{ref:h,role:"switch",type:"button","aria-checked":d,disabled:m,className:P("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-950 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50",d?"bg-slate-900 dark:bg-slate-50":"bg-slate-200 dark:bg-slate-800",a),onClick:()=>_?.(!d),...k,children:e.jsx("span",{className:P("pointer-events-none block h-5 w-5 rounded-full bg-white shadow-lg ring-0 transition-transform dark:bg-slate-950",d?"translate-x-5":"translate-x-0")})}));B.displayName="Switch";const We=[{key:"everyHour",cron:"0 * * * *"},{key:"daily8am",cron:"0 8 * * *"},{key:"daily12pm",cron:"0 12 * * *"},{key:"daily6pm",cron:"0 18 * * *"},{key:"weeklyMonday",cron:"0 9 * * 1"}];function Xe(){const a=te(),[d,_]=t.useState([]),[m,k]=t.useState([]),[h,V]=t.useState([]),[v,q]=t.useState([]),[I,y]=t.useState(!0),[X,x]=t.useState(!1),[w,D]=t.useState(null),[n,c]=t.useState({name:"",workflow_uuid:"",device_serialnos:[],device_group_id:null,cron_expression:"",enabled:!0}),[o,j]=t.useState("devices"),[C,S]=t.useState(!1),[J,N]=t.useState(!1),[F,A]=t.useState(null);t.useEffect(()=>{f()},[]);const f=async()=>{try{y(!0);const[s,l,r,u]=await Promise.all([re(),ce(),ie(),de()]);_(s.tasks),k(l.workflows),V(r),q(u.groups)}catch(s){console.error("Failed to load data:",s)}finally{y(!1)}},K=()=>{D(null),c({name:"",workflow_uuid:"",device_serialnos:[],device_group_id:null,cron_expression:"",enabled:!0}),j("devices"),x(!0)},Q=s=>{D(s),c({name:s.name,workflow_uuid:s.workflow_uuid,device_serialnos:s.device_serialnos,device_group_id:s.device_group_id||null,cron_expression:s.cron_expression,enabled:s.enabled}),j(s.device_group_id?"group":"devices"),x(!0)},U=async()=>{try{S(!0);const s={name:n.name,workflow_uuid:n.workflow_uuid,cron_expression:n.cron_expression,enabled:n.enabled,device_serialnos:o==="devices"?n.device_serialnos:null,device_group_id:o==="group"?n.device_group_id:null};w?await xe(w.id,s):await pe(s),x(!1),f()}catch(s){console.error("Failed to save task:",s)}finally{S(!1)}},Y=async()=>{if(F){try{await ge(F),f()}catch(s){console.error("Failed to delete task:",s)}N(!1),A(null)}},Z=async s=>{try{s.enabled?await me(s.id):await he(s.id),f()}catch(l){console.error("Failed to toggle task:",l)}},ee=s=>m.find(r=>r.uuid===s)?.name||s,b=s=>h.find(r=>r.serial===s)?.model||s,L=s=>v.find(r=>r.id===s)?.name||s,se=(s,l)=>{if(l){const p=v.find(le=>le.id===l);return p?`${p.name} (${p.device_count} ${a.scheduledTasks.groupDevices||"devices"})`:L(l)}if(s.length===0)return"-";if(s.length===1)return b(s[0]);const r=s.map(p=>b(p)),u=r[0],T=r.length-1;return`${u} (+${T})`},z=s=>s?new Date(s).toLocaleString("zh-CN",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):a.scheduledTasks.never,E=s=>s.last_run_status?s.last_run_status:s.last_run_success===!0?"success":s.last_run_success===!1?"failure":null,ae=n.name.trim()&&n.workflow_uuid&&(o==="devices"&&n.device_serialnos.length>0||o==="group"&&n.device_group_id)&&n.cron_expression.trim();return e.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:a.scheduledTasks.title}),e.jsxs(i,{onClick:K,children:[e.jsx(ve,{className:"w-4 h-4 mr-2"}),a.scheduledTasks.create]})]}),I?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(H,{className:"w-8 h-8 animate-spin text-slate-400"})}):d.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:a.scheduledTasks.noTasks}),e.jsx("p",{className:"text-sm text-slate-400 dark:text-slate-500 mt-2",children:a.scheduledTasks.noTasksDesc})]}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:d.map(s=>e.jsxs(fe,{className:"hover:shadow-md transition-shadow",children:[e.jsx(_e,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(ke,{className:"text-lg truncate flex-1 mr-2",children:s.name}),e.jsx(B,{checked:s.enabled,onCheckedChange:()=>Z(s)})]})}),e.jsx(we,{children:e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.workflow,":"," "]}),e.jsx("span",{className:"font-medium",children:ee(s.workflow_uuid)})]}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.device,":"," "]}),e.jsx("span",{className:"font-medium",title:s.device_group_id?L(s.device_group_id):s.device_serialnos.map(l=>b(l)).join(", "),children:se(s.device_serialnos,s.device_group_id)})]}),e.jsx("div",{className:"text-sm",children:e.jsxs(oe,{variant:"outline",className:"font-mono",children:[e.jsx(ue,{className:"w-3 h-3 mr-1"}),s.cron_expression]})}),e.jsxs("div",{className:"text-sm flex items-center gap-2",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.lastRun,":"]}),s.last_run_time?e.jsxs(e.Fragment,{children:[E(s)==="success"?e.jsx(He,{className:"w-4 h-4 text-green-500"}):E(s)==="partial"?e.jsx(Re,{className:"w-4 h-4 text-amber-500"}):e.jsx(Me,{className:"w-4 h-4 text-red-500"}),e.jsx("span",{title:s.last_run_message||void 0,children:z(s.last_run_time)}),typeof s.last_run_success_count=="number"&&typeof s.last_run_total_count=="number"&&s.last_run_total_count>1&&e.jsxs("span",{className:"text-xs text-slate-500",children:["(",s.last_run_success_count,"/",s.last_run_total_count,")"]})]}):e.jsx("span",{className:"text-slate-400",children:a.scheduledTasks.never})]}),e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-slate-500 dark:text-slate-400",children:[a.scheduledTasks.nextRun,":"," "]}),e.jsx("span",{children:z(s.next_run_time)})]}),e.jsxs("div",{className:"flex gap-2 pt-2",children:[e.jsxs(i,{variant:"outline",size:"sm",onClick:()=>Q(s),children:[e.jsx(je,{className:"w-3 h-3 mr-1"}),a.common.edit]}),e.jsxs(i,{variant:"destructive",size:"sm",onClick:()=>{A(s.id),N(!0)},children:[e.jsx(Ne,{className:"w-3 h-3 mr-1"}),a.common.delete]})]})]})})]},s.id))}),e.jsx(be,{open:X,onOpenChange:x,children:e.jsxs(Te,{className:"sm:max-w-[500px]",children:[e.jsx(ye,{children:e.jsx(De,{children:w?a.scheduledTasks.edit:a.scheduledTasks.create})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"name",children:a.scheduledTasks.taskName}),e.jsx(G,{id:"name",value:n.name,onChange:s=>c(l=>({...l,name:s.target.value})),placeholder:a.scheduledTasks.taskNamePlaceholder})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{children:a.scheduledTasks.workflow}),m.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:a.scheduledTasks.noWorkflows}):e.jsxs(M,{value:n.workflow_uuid,onValueChange:s=>c(l=>({...l,workflow_uuid:s})),children:[e.jsx(O,{children:e.jsx(R,{placeholder:a.scheduledTasks.selectWorkflow})}),e.jsx(W,{children:m.map(s=>e.jsx($,{value:s.uuid,children:s.name},s.uuid))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{children:a.scheduledTasks.device}),e.jsxs("div",{className:"flex gap-2 mb-2",children:[e.jsx(i,{type:"button",variant:o==="devices"?"default":"outline",size:"sm",onClick:()=>{j("devices"),c(s=>({...s,device_group_id:null}))},children:a.scheduledTasks.selectDevice||"选择设备"}),e.jsx(i,{type:"button",variant:o==="group"?"default":"outline",size:"sm",onClick:()=>{j("group"),c(s=>({...s,device_serialnos:[]}))},children:a.scheduledTasks.selectGroup||"选择分组"})]}),o==="devices"?h.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:a.scheduledTasks.noDevicesOnline}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border rounded-md p-2 space-y-1 max-h-40 overflow-y-auto",children:h.map(s=>e.jsxs("label",{className:"flex items-center gap-2 p-2 hover:bg-slate-100 dark:hover:bg-slate-800 rounded cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:n.device_serialnos.includes(s.serial),onChange:l=>{const r=l.target.checked;c(u=>({...u,device_serialnos:r?[...u.device_serialnos,s.serial]:u.device_serialnos.filter(T=>T!==s.serial)}))},className:"rounded border-gray-300"}),e.jsx("span",{className:"text-sm",children:s.model||s.serial}),s.state==="online"&&e.jsx("span",{className:"ml-auto w-2 h-2 bg-green-500 rounded-full"})]},s.serial))}),n.device_serialnos.length>0&&e.jsxs("p",{className:"text-xs text-slate-500",children:[n.device_serialnos.length," ",a.scheduledTasks.devicesSelected||"devices selected"]})]}):v.length===0?e.jsx("p",{className:"text-sm text-amber-600 dark:text-amber-400",children:"暂无分组"}):e.jsxs(M,{value:n.device_group_id||"",onValueChange:s=>c(l=>({...l,device_group_id:s||null})),children:[e.jsx(O,{children:e.jsx(R,{placeholder:a.scheduledTasks.selectGroup||"选择分组"})}),e.jsx(W,{children:v.map(s=>e.jsxs($,{value:s.id,children:[s.name," (",s.device_count," ",a.deviceGroups?.deviceCount||"台设备",")"]},s.id))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"cron",children:a.scheduledTasks.cronExpression}),e.jsx(G,{id:"cron",value:n.cron_expression,onChange:s=>c(l=>({...l,cron_expression:s.target.value})),placeholder:a.scheduledTasks.cronPlaceholder,className:"font-mono"}),e.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:a.scheduledTasks.cronHelp})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{children:a.scheduledTasks.presets}),e.jsx("div",{className:"flex flex-wrap gap-2",children:We.map(s=>e.jsx(i,{variant:"outline",size:"sm",onClick:()=>c(l=>({...l,cron_expression:s.cron})),children:a.scheduledTasks.preset[s.key]},s.key))})]})]}),e.jsxs(Ce,{children:[e.jsx(i,{variant:"outline",onClick:()=>x(!1),children:a.common.cancel}),e.jsx(i,{onClick:U,disabled:!ae||C,children:C?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"w-4 h-4 mr-2 animate-spin"}),a.common.loading]}):a.common.save})]})]})}),e.jsx(Se,{open:J,onOpenChange:N,children:e.jsxs(Fe,{children:[e.jsxs(Ae,{children:[e.jsx(Le,{children:a.common.delete}),e.jsx(ze,{children:a.scheduledTasks.deleteConfirm})]}),e.jsxs(Ee,{children:[e.jsx(Pe,{children:a.common.cancel}),e.jsx(Ge,{onClick:Y,children:a.common.confirm})]})]})})]})}export{Xe as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as a,e as i}from"./index-
|
|
1
|
+
import{r as s,j as a,e as i}from"./index-DSGEx4xN.js";const l=s.forwardRef(({className:e,...r},t)=>a.jsx("textarea",{className:i("flex min-h-[40px] w-full rounded-full border border-slate-200 bg-white px-3 py-2 text-sm ring-offset-white file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-slate-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#1d9bf0] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-slate-800 dark:bg-slate-950 dark:text-slate-100 dark:ring-offset-slate-950 dark:placeholder:text-slate-400 dark:focus-visible:ring-[#1d9bf0] resize-none",e),ref:t,...r}));l.displayName="Textarea";export{l as T};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as D,r as t,l as S,j as e,B as n,d as W,a as F,c as b}from"./index-
|
|
1
|
+
import{u as D,r as t,l as S,j as e,B as n,d as W,a as F,c as b}from"./index-DSGEx4xN.js";import{P as T,S as E,L as u,I as L}from"./label-DPhMxT1N.js";import{T as P}from"./textarea-D8pE3YVl.js";import{L as j,C as z,a as B,b as H,c as I,T as q,D as O,d as R,e as A,f as G,g as J}from"./dialog-owGgcHW-.js";function V(){const a=D(),[m,p]=t.useState([]),[g,x]=t.useState(!0),[k,o]=t.useState(!1),[c,h]=t.useState(null),[l,i]=t.useState({name:"",text:""}),[w,f]=t.useState(!1);t.useEffect(()=>{d()},[]);const d=async()=>{try{x(!0);const s=await S();p(s.workflows)}catch(s){console.error("Failed to load workflows:",s)}finally{x(!1)}},v=()=>{h(null),i({name:"",text:""}),o(!0)},N=s=>{h(s),i({name:s.name,text:s.text}),o(!0)},C=async()=>{try{f(!0),c?await F(c.uuid,l):await b(l),o(!1),d()}catch(s){console.error("Failed to save workflow:",s)}finally{f(!1)}},y=async s=>{if(window.confirm(a.workflows.deleteConfirm))try{await W(s),d()}catch(r){console.error("Failed to delete workflow:",r)}};return e.jsxs("div",{className:"container mx-auto p-6 max-w-7xl",children:[e.jsxs("div",{className:"flex justify-between items-center mb-6",children:[e.jsx("h1",{className:"text-3xl font-bold",children:a.workflows.title}),e.jsxs(n,{onClick:v,children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),a.workflows.createNew]})]}),g?e.jsx("div",{className:"flex justify-center items-center h-64",children:e.jsx(j,{className:"w-8 h-8 animate-spin text-slate-400"})}):m.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-slate-500 dark:text-slate-400",children:a.workflows.empty})}):e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:m.map(s=>e.jsxs(z,{className:"hover:shadow-md transition-shadow",children:[e.jsx(B,{children:e.jsx(H,{className:"text-lg",children:s.name})}),e.jsxs(I,{children:[e.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mb-4 line-clamp-3",children:s.text}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(n,{variant:"outline",size:"sm",onClick:()=>N(s),children:[e.jsx(E,{className:"w-3 h-3 mr-1"}),a.common.edit]}),e.jsxs(n,{variant:"destructive",size:"sm",onClick:()=>y(s.uuid),children:[e.jsx(q,{className:"w-3 h-3 mr-1"}),a.common.delete]})]})]})]},s.uuid))}),e.jsx(O,{open:k,onOpenChange:o,children:e.jsxs(R,{className:"sm:max-w-[600px]",children:[e.jsx(A,{children:e.jsx(G,{children:c?a.workflows.edit:a.workflows.create})}),e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"name",children:a.workflows.name}),e.jsx(L,{id:"name",value:l.name,onChange:s=>i(r=>({...r,name:s.target.value})),placeholder:a.workflows.namePlaceholder})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(u,{htmlFor:"text",children:a.workflows.text}),e.jsx(P,{id:"text",value:l.text,onChange:s=>i(r=>({...r,text:s.target.value})),placeholder:a.workflows.textPlaceholder,rows:6,className:"resize-none !rounded-lg"})]})]}),e.jsxs(J,{children:[e.jsx(n,{variant:"outline",onClick:()=>o(!1),children:a.common.cancel}),e.jsx(n,{onClick:C,disabled:!l.name.trim()||!l.text.trim()||w,children:w?e.jsxs(e.Fragment,{children:[e.jsx(j,{className:"w-4 h-4 mr-2 animate-spin"}),a.common.loading]}):a.common.save})]})]})})]})}export{V as component};
|
AutoGLM_GUI/static/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<link rel="icon" type="image/png" sizes="192x192" href="/logo-192.png" />
|
|
12
12
|
<link rel="icon" type="image/png" sizes="512x512" href="/logo-512.png" />
|
|
13
13
|
<meta name="theme-color" content="#f5f1e8" />
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-DSGEx4xN.js"></script>
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/index-84TrNz7w.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autoglm-gui
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.8
|
|
4
4
|
Summary: Web GUI for AutoGLM Phone Agent - AI-powered Android automation
|
|
5
5
|
Project-URL: Homepage, https://github.com/suyiiyii/AutoGLM-GUI
|
|
6
6
|
Project-URL: Repository, https://github.com/suyiiyii/AutoGLM-GUI
|
|
@@ -92,30 +92,30 @@ AutoGLM_GUI/parsers/base.py,sha256=3HGsMAhIv5oQU9GjLGPzMDtDmhScpFQKYK1kaRhNm8w,1
|
|
|
92
92
|
AutoGLM_GUI/parsers/phone_parser.py,sha256=JEgfZfpolmGM_j9F1gNZC1nxBNWXlo4h1k_JIyNuLCE,2053
|
|
93
93
|
AutoGLM_GUI/prompts/__init__.py,sha256=GtS7Ek3ds5G8orJj4R-2odjm1Hchje3cF1-1YaxZD38,1069
|
|
94
94
|
AutoGLM_GUI/static/favicon.ico,sha256=uB4wrcENiFaF-K4V-FzNp51XLW8GC4-ujpBDHgISfGM,781
|
|
95
|
-
AutoGLM_GUI/static/index.html,sha256=
|
|
95
|
+
AutoGLM_GUI/static/index.html,sha256=AmmRx4G5QanxnpSEYwLLqaugRNfy3OZ1gzWMZxKVcGg,761
|
|
96
96
|
AutoGLM_GUI/static/logo-192.png,sha256=FOXgZxFrN0ZleO0VjlCnvD5cDkd1okJPkwPDZqsflNs,35243
|
|
97
97
|
AutoGLM_GUI/static/logo-512.png,sha256=HlwSg09dQ3_Jtb09Ght4l2VK3YNLZlP_941LCdpDkWk,251598
|
|
98
|
-
AutoGLM_GUI/static/assets/about-
|
|
99
|
-
AutoGLM_GUI/static/assets/alert-dialog-
|
|
100
|
-
AutoGLM_GUI/static/assets/chat-
|
|
101
|
-
AutoGLM_GUI/static/assets/dialog-
|
|
102
|
-
AutoGLM_GUI/static/assets/eye-
|
|
103
|
-
AutoGLM_GUI/static/assets/folder-open-
|
|
104
|
-
AutoGLM_GUI/static/assets/history-
|
|
98
|
+
AutoGLM_GUI/static/assets/about-DLIoLF4H.js,sha256=Y6V7qQGM7cVOn0JDjPKq_tksFSkNRUdR1o1RgHyyYdw,155
|
|
99
|
+
AutoGLM_GUI/static/assets/alert-dialog-CP0Ln6uE.js,sha256=EO_5_7wRe9yrukZE0onPGULAp-YggGjqd1BrxNGoJtw,3140
|
|
100
|
+
AutoGLM_GUI/static/assets/chat-BeQeCo9v.js,sha256=Jxvm6vThv3bI3MNYrWJFxntsuBCq2bhXvImjgFvbKqc,338373
|
|
101
|
+
AutoGLM_GUI/static/assets/dialog-owGgcHW-.js,sha256=lBQYPdoSowFaFLKbmDa2v81jEytC0HF27JqZisz98mE,25379
|
|
102
|
+
AutoGLM_GUI/static/assets/eye-DRVKMcGF.js,sha256=j0q9AeJrVf5lAdpTQW8-fs3T0sl4ZPioYMa_aYtagbg,339
|
|
103
|
+
AutoGLM_GUI/static/assets/folder-open-DWIBudK5.js,sha256=dm5weI7mnT_ziLA4jTgm9beEYRZ5ZPAIXbs2qNq8Bso,495
|
|
104
|
+
AutoGLM_GUI/static/assets/history-D-6VV8AF.js,sha256=Lak0uY2MrIEL3yEsm0kCgqfU01mcvqoeBqY1yPpvTzk,10787
|
|
105
105
|
AutoGLM_GUI/static/assets/index-84TrNz7w.css,sha256=A3Emm3UzHtWI05YYsiX9VozvtHI6nRk6i4_sr_OJ6rw,88104
|
|
106
|
-
AutoGLM_GUI/static/assets/index-
|
|
107
|
-
AutoGLM_GUI/static/assets/index-
|
|
108
|
-
AutoGLM_GUI/static/assets/label-
|
|
106
|
+
AutoGLM_GUI/static/assets/index-DSGEx4xN.js,sha256=QGZZH8L-EjeUUUo1cvxpvnSQjkskWyNsLgRmwecDg2Y,401456
|
|
107
|
+
AutoGLM_GUI/static/assets/index-Dulms-G2.js,sha256=HgtCX7tN8XDTRdzqZ-uT0e5gvUL9mUOW9djg4KOGlBQ,229
|
|
108
|
+
AutoGLM_GUI/static/assets/label-DPhMxT1N.js,sha256=oSCJRGMiavyKEYSePvstSraYB5LIJrKRMvvAwFpDOds,1679
|
|
109
109
|
AutoGLM_GUI/static/assets/logo-Cyfm06Ym.png,sha256=6GRUFH2KNmB4ZmnrmJ1wxpoIYEmOW-__XlmKImyAMKM,4955675
|
|
110
|
-
AutoGLM_GUI/static/assets/logs-
|
|
111
|
-
AutoGLM_GUI/static/assets/popover-
|
|
112
|
-
AutoGLM_GUI/static/assets/scheduled-tasks-
|
|
113
|
-
AutoGLM_GUI/static/assets/textarea-
|
|
110
|
+
AutoGLM_GUI/static/assets/logs-DfpuXl5p.js,sha256=3SMdMVaYYhghSKEWfG2BsP9mTJe62eaOWoCbwWyhhBw,4817
|
|
111
|
+
AutoGLM_GUI/static/assets/popover-BVLk9lq7.js,sha256=HkGRjXZ04wY0iZU9Vy8rjRVr2XVMD8ipI7WLz9QpvQI,5775
|
|
112
|
+
AutoGLM_GUI/static/assets/scheduled-tasks-Cw40Sske.js,sha256=0miifqygwJrote4YGGnI-djLbb8M-p_HdGuVpvUCWIw,11395
|
|
113
|
+
AutoGLM_GUI/static/assets/textarea-D8pE3YVl.js,sha256=8KOOwra87iubr-1AwdttYavsFX86nRSAxz6SAZPPFJM,705
|
|
114
114
|
AutoGLM_GUI/static/assets/worker-D6BRitjy.js,sha256=RL1NIRIks9dXdDhXOHK1cCg-OELT0uv9a6u_UEHfQ0Q,173494
|
|
115
|
-
AutoGLM_GUI/static/assets/workflows-
|
|
115
|
+
AutoGLM_GUI/static/assets/workflows-C25VCn09.js,sha256=V2PbNSTL6OzAaGCZJ89cdx9Xaq8ES6LlRepq6mmVFmM,3263
|
|
116
116
|
scrcpy-server-v3.3.3,sha256=fnAyO6fyWWSd1KzOl6xP77roECssbZHi575hP9U1S-A,90164
|
|
117
|
-
autoglm_gui-1.5.
|
|
118
|
-
autoglm_gui-1.5.
|
|
119
|
-
autoglm_gui-1.5.
|
|
120
|
-
autoglm_gui-1.5.
|
|
121
|
-
autoglm_gui-1.5.
|
|
117
|
+
autoglm_gui-1.5.8.dist-info/METADATA,sha256=K8xVNwrNxgzaRWUpZs5_WVgcSKjTilHQREllpcsEmc8,33767
|
|
118
|
+
autoglm_gui-1.5.8.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
119
|
+
autoglm_gui-1.5.8.dist-info/entry_points.txt,sha256=sz4rBO_kgrYmOiT0QnhCCv0b9QqBdWyCjugJgY8AEOI,58
|
|
120
|
+
autoglm_gui-1.5.8.dist-info/licenses/LICENSE,sha256=0IkSHDewdtmXnmYzTNq4U47EJYjTuhjQNpT0bZKuqWc,11342
|
|
121
|
+
autoglm_gui-1.5.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|