Merge branch 'dev' into beta

This commit is contained in:
Weixuan Fu
2024-04-08 03:21:00 +08:00
25 changed files with 64 additions and 61 deletions
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{r as l,j as S}from"./input.js";import{app as s}from"/scripts/app.js";import{Z as D,f as C,ah as j,i as x,T as W,E as d,ai as _,aj as I,x as r,k as h,ak as L}from"./App-YT7a4Gj6.js";import{u as R}from"./useDebounceFn-ld478fd0.js";import"/scripts/api.js";function F(){const{isDirty:p,setIsDirty:w,setRoute:g,saveCurWorkflow:y}=l.useContext(D),k=l.useRef(p),[m,E]=l.useState(!1);C();const v=l.useRef(null);l.useEffect(()=>{k.current=p},[p]),l.useEffect(()=>{var i,c;const n=t=>{var u;if(document.visibilityState==="hidden")return;const e=I(t);if(e)switch(e===d.openSpotlightSearch&&t.preventDefault(),window.dispatchEvent(new CustomEvent(_,{detail:{shortcutType:e}})),e){case d.SAVE:y();break;case d.SAVE_AS:g("saveAsModal");break;case d.openSpotlightSearch:g("spotlightSearch");break}else(u=t.target)!=null&&u.matches("input, textarea")&&Object.keys(s.canvas.selected_nodes??{}).length&&f()},o=s.canvas.onAfterChange;s.graph.onAfterChange=function(){o==null||o.apply(this,arguments),f()};const a=s.graph.onConfigure;return s.graph.onConfigure=function(){a==null||a.apply(this,arguments),setTimeout(()=>{var e,u;j(s.graph.serialize(),JSON.parse(((u=(e=r)==null?void 0:e.curWorkflow)==null?void 0:u.json)??"{}"))||f()},1e3)},document.addEventListener("click",t=>{Object.keys(s.canvas.selected_nodes??{}).length&&(s.canvas.node_over!=null||s.canvas.node_capturing_input!=null||s.canvas.node_widget!=null)&&f()}),document.addEventListener("keydown",n),(c=(i=h)==null?void 0:i.settings)!=null&&c.autoSave&&h.settings.autoSaveDuration&&(v.current=setInterval(()=>{T()},h.settings.autoSaveDuration*1e3)),()=>{document.removeEventListener("keydown",n),v.current&&clearInterval(v.current)}},[]);const T=async()=>{var o,a,i,c,t,e;if((a=(o=r)==null?void 0:o.curWorkflow)!=null&&a.saveLock||!((c=(i=r)==null?void 0:i.curWorkflow)!=null&&c.id)||!k.current)return;const n=JSON.stringify(s.graph.serialize());await((t=r)==null?void 0:t.updateFlow(r.curWorkflow.id,{json:n})),(e=L)==null||e.create({workflowID:r.curWorkflow.id,isAutoSave:!0,json:n}),w(!1)},b=async()=>{var n,o,a,i,c,t,e;(o=(n=r)==null?void 0:n.curWorkflow)!=null&&o.saveLock||k.current||(w(!0),(i=(a=h)==null?void 0:a.settings)!=null&&i.autoSave&&((t=(c=r)==null?void 0:c.curWorkflow)!=null&&t.id)&&!m&&(await((e=r)==null?void 0:e.latestVersionCheck())||E(!0)))},[f,A]=R(b,900);return m?S.jsx(x,{label:"This workflow was changed by another tab, so you are not working on the latest version. Please refresh page to see the latest version of this workflow.",children:S.jsx(W,{colorScheme:"yellow",children:"⚠️Outdated version"})}):null}export{F as default};
import{r as l,j as S}from"./input.js";import{app as s}from"/scripts/app.js";import{Z as D,f as C,ah as j,i as x,T as W,E as d,ai as _,aj as I,x as r,k as h,ak as L}from"./App-bXo9NVT7.js";import{u as R}from"./useDebounceFn-ld478fd0.js";import"/scripts/api.js";function F(){const{isDirty:p,setIsDirty:w,setRoute:g,saveCurWorkflow:y}=l.useContext(D),k=l.useRef(p),[m,E]=l.useState(!1);C();const v=l.useRef(null);l.useEffect(()=>{k.current=p},[p]),l.useEffect(()=>{var i,c;const n=t=>{var u;if(document.visibilityState==="hidden")return;const e=I(t);if(e)switch(e===d.openSpotlightSearch&&t.preventDefault(),window.dispatchEvent(new CustomEvent(_,{detail:{shortcutType:e}})),e){case d.SAVE:y();break;case d.SAVE_AS:g("saveAsModal");break;case d.openSpotlightSearch:g("spotlightSearch");break}else(u=t.target)!=null&&u.matches("input, textarea")&&Object.keys(s.canvas.selected_nodes??{}).length&&f()},o=s.canvas.onAfterChange;s.graph.onAfterChange=function(){o==null||o.apply(this,arguments),f()};const a=s.graph.onConfigure;return s.graph.onConfigure=function(){a==null||a.apply(this,arguments),setTimeout(()=>{var e,u;j(s.graph.serialize(),JSON.parse(((u=(e=r)==null?void 0:e.curWorkflow)==null?void 0:u.json)??"{}"))||f()},1e3)},document.addEventListener("click",t=>{Object.keys(s.canvas.selected_nodes??{}).length&&(s.canvas.node_over!=null||s.canvas.node_capturing_input!=null||s.canvas.node_widget!=null)&&f()}),document.addEventListener("keydown",n),(c=(i=h)==null?void 0:i.settings)!=null&&c.autoSave&&h.settings.autoSaveDuration&&(v.current=setInterval(()=>{T()},h.settings.autoSaveDuration*1e3)),()=>{document.removeEventListener("keydown",n),v.current&&clearInterval(v.current)}},[]);const T=async()=>{var o,a,i,c,t,e;if((a=(o=r)==null?void 0:o.curWorkflow)!=null&&a.saveLock||!((c=(i=r)==null?void 0:i.curWorkflow)!=null&&c.id)||!k.current)return;const n=JSON.stringify(s.graph.serialize());await((t=r)==null?void 0:t.updateFlow(r.curWorkflow.id,{json:n})),(e=L)==null||e.create({workflowID:r.curWorkflow.id,isAutoSave:!0,json:n}),w(!1)},b=async()=>{var n,o,a,i,c,t,e;(o=(n=r)==null?void 0:n.curWorkflow)!=null&&o.saveLock||k.current||(w(!0),(i=(a=h)==null?void 0:a.settings)!=null&&i.autoSave&&((t=(c=r)==null?void 0:c.curWorkflow)!=null&&t.id)&&!m&&(await((e=r)==null?void 0:e.latestVersionCheck())||E(!0)))},[f,A]=R(b,900);return m?S.jsx(x,{label:"This workflow was changed by another tab, so you are not working on the latest version. Please refresh page to see the latest version of this workflow.",children:S.jsx(W,{colorScheme:"yellow",children:"⚠️Outdated version"})}):null}export{F as default};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{d as a}from"./App-YT7a4Gj6.js";var p=a("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);export{p as I};
import{d as a}from"./App-bXo9NVT7.js";var p=a("copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);export{p as I};
@@ -1 +1 @@
import{d as a}from"./App-YT7a4Gj6.js";var r=a("search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);export{r as I};
import{d as a}from"./App-bXo9NVT7.js";var r=a("search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);export{r as I};
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{f as x,j as l,g as i,h as b,l as C,o as E,n as I,r as f,a3 as P}from"./input.js";import{aa as z}from"./App-YT7a4Gj6.js";var v=x(function(o,s){const{children:t,placeholder:n,className:r,...a}=o;return l.jsxs(i.select,{...a,ref:s,className:b("chakra-select",r),children:[n&&l.jsx("option",{value:"",children:n}),t]})});v.displayName="SelectField";function F(e,o){const s={},t={};for(const[n,r]of Object.entries(e))o.includes(n)?s[n]=r:t[n]=r;return[s,t]}var H=x((e,o)=>{var s;const t=C("Select",e),{rootProps:n,placeholder:r,icon:a,color:c,height:_,h:d,minH:h,minHeight:y,iconColor:p,iconSize:u,...j}=E(e),[g,N]=F(j,P),m=z(N),k={width:"100%",height:"fit-content",position:"relative",color:c},w={paddingEnd:"2rem",...t.field,_focus:{zIndex:"unset",...(s=t.field)==null?void 0:s._focus}};return l.jsxs(i.div,{className:"chakra-select__wrapper",__css:k,...g,...n,children:[l.jsx(v,{ref:o,height:d??_,minH:h??y,placeholder:r,...m,__css:w,children:e.children}),l.jsx(S,{"data-disabled":I(m.disabled),...(p||c)&&{color:p||c},__css:t.icon,...u&&{fontSize:u},children:a})]})});H.displayName="Select";var M=e=>l.jsx("svg",{viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),R=i("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),S=e=>{const{children:o=l.jsx(M,{}),...s}=e,t=f.cloneElement(o,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return l.jsx(R,{...s,className:"chakra-select__icon-wrapper",children:f.isValidElement(o)?t:null})};S.displayName="SelectIcon";export{H as S};
import{f as x,j as l,g as i,h as b,l as C,o as E,n as I,r as f,a3 as P}from"./input.js";import{aa as z}from"./App-bXo9NVT7.js";var v=x(function(o,s){const{children:t,placeholder:n,className:r,...a}=o;return l.jsxs(i.select,{...a,ref:s,className:b("chakra-select",r),children:[n&&l.jsx("option",{value:"",children:n}),t]})});v.displayName="SelectField";function F(e,o){const s={},t={};for(const[n,r]of Object.entries(e))o.includes(n)?s[n]=r:t[n]=r;return[s,t]}var H=x((e,o)=>{var s;const t=C("Select",e),{rootProps:n,placeholder:r,icon:a,color:c,height:_,h:d,minH:h,minHeight:y,iconColor:p,iconSize:u,...j}=E(e),[g,N]=F(j,P),m=z(N),k={width:"100%",height:"fit-content",position:"relative",color:c},w={paddingEnd:"2rem",...t.field,_focus:{zIndex:"unset",...(s=t.field)==null?void 0:s._focus}};return l.jsxs(i.div,{className:"chakra-select__wrapper",__css:k,...g,...n,children:[l.jsx(v,{ref:o,height:d??_,minH:h??y,placeholder:r,...m,__css:w,children:e.children}),l.jsx(S,{"data-disabled":I(m.disabled),...(p||c)&&{color:p||c},__css:t.icon,...u&&{fontSize:u},children:a})]})});H.displayName="Select";var M=e=>l.jsx("svg",{viewBox:"0 0 24 24",...e,children:l.jsx("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})}),R=i("div",{baseStyle:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)"}}),S=e=>{const{children:o=l.jsx(M,{}),...s}=e,t=f.cloneElement(o,{role:"presentation",className:"chakra-select__icon",focusable:!1,"aria-hidden":!0,style:{width:"1em",height:"1em",color:"currentColor"}});return l.jsx(R,{...s,className:"chakra-select__icon-wrapper",children:f.isValidElement(o)?t:null})};S.displayName="SelectIcon";export{H as S};
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
import{g as t}from"./App-YT7a4Gj6.js";import{f as o,j as s}from"./input.js";var e=o((a,r)=>s.jsx(t,{align:"center",...a,direction:"column",ref:r}));e.displayName="VStack";export{e as V};
import{g as t}from"./App-bXo9NVT7.js";import{f as o,j as s}from"./input.js";var e=o((a,r)=>s.jsx(t,{align:"center",...a,direction:"column",ref:r}));e.displayName="VStack";export{e as V};
+2 -2
View File
@@ -679,10 +679,10 @@ Error generating stack: `+i.message+`
}
${aB}
`}),zw=document.createElement("div");document.body.append(zw);const lB=Ar.lazy(()=>Xk(()=>import("./App-YT7a4Gj6.js").then(e=>e.aQ),__vite__mapDeps([0,1])).then(({default:e})=>({default:e}))),uB={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e7,sticky:11e6,banner:12e6,overlay:13e6,modal:14e6,popover:15e6,skipLink:16e6,toast:17e6,tooltip:18e6},cB=Pz({zIndices:uB});gd.createRoot(zw).render(E.jsx(Ar.StrictMode,{children:E.jsxs(BI,{resetCSS:!1,disableGlobalStyle:!0,theme:cB,children:[E.jsx(sB,{scope:".workspace_manager"}),E.jsx(DP,{initialColorMode:"dark"}),E.jsx(iB,{children:E.jsx(S.Suspense,{children:E.jsx(lB,{})})})]})}));const Hf=document.body,dB={attributes:!0,attributeFilter:["class"]},fB=function(e,t){const r=document.documentElement;r.style.colorScheme==="dark"&&r.style.removeProperty("color-scheme");for(const n of e)if(n.type==="attributes"&&n.attributeName==="class")for(const o of Hf.classList)o.includes("chakra")&&Hf.classList.remove(o)},hB=new MutationObserver(fB);hB.observe(Hf,dB);export{Qh as $,PB as A,CB as B,TB as C,_B as D,TP as E,lr as F,oi as G,vB as H,Ya as I,Ap as J,yB as K,Ka as L,yw as M,Ew as N,_w as O,ja as P,Tw as Q,Aw as R,$w as S,Pw as T,Tp as U,xb as V,EB as W,os as X,Ar as Y,pB as Z,Xk as _,kB as a,vP as a0,rB as a1,nB as a2,gB as a3,mn as b,wB as c,i3 as d,Bl as e,pt as f,_e as g,Be as h,Mx as i,E as j,SB as k,Xb as l,If as m,_v as n,Iu as o,Bu as p,mB as q,S as r,Ei as s,Gf as t,IP as u,uw as v,bB as w,Kt as x,yg as y,uO as z};
`}),zw=document.createElement("div");document.body.append(zw);const lB=Ar.lazy(()=>Xk(()=>import("./App-bXo9NVT7.js").then(e=>e.aQ),__vite__mapDeps([0,1])).then(({default:e})=>({default:e}))),uB={hide:-1,auto:"auto",base:0,docked:10,dropdown:1e7,sticky:11e6,banner:12e6,overlay:13e6,modal:14e6,popover:15e6,skipLink:16e6,toast:17e6,tooltip:18e6},cB=Pz({zIndices:uB});gd.createRoot(zw).render(E.jsx(Ar.StrictMode,{children:E.jsxs(BI,{resetCSS:!1,disableGlobalStyle:!0,theme:cB,children:[E.jsx(sB,{scope:".workspace_manager"}),E.jsx(DP,{initialColorMode:"dark"}),E.jsx(iB,{children:E.jsx(S.Suspense,{children:E.jsx(lB,{})})})]})}));const Hf=document.body,dB={attributes:!0,attributeFilter:["class"]},fB=function(e,t){const r=document.documentElement;r.style.colorScheme==="dark"&&r.style.removeProperty("color-scheme");for(const n of e)if(n.type==="attributes"&&n.attributeName==="class")for(const o of Hf.classList)o.includes("chakra")&&Hf.classList.remove(o)},hB=new MutationObserver(fB);hB.observe(Hf,dB);export{Qh as $,PB as A,CB as B,TB as C,_B as D,TP as E,lr as F,oi as G,vB as H,Ya as I,Ap as J,yB as K,Ka as L,yw as M,Ew as N,_w as O,ja as P,Tw as Q,Aw as R,$w as S,Pw as T,Tp as U,xb as V,EB as W,os as X,Ar as Y,pB as Z,Xk as _,kB as a,vP as a0,rB as a1,nB as a2,gB as a3,mn as b,wB as c,i3 as d,Bl as e,pt as f,_e as g,Be as h,Mx as i,E as j,SB as k,Xb as l,If as m,_v as n,Iu as o,Bu as p,mB as q,S as r,Ei as s,Gf as t,IP as u,uw as v,bB as w,Kt as x,yg as y,uO as z};
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = ["workspace_web/App-YT7a4Gj6.js","workspace_web/assets/App-JXePnJiV.css"]
__vite__mapDeps.viteFileDeps = ["workspace_web/App-bXo9NVT7.js","workspace_web/assets/App-JXePnJiV.css"]
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
+1 -1
View File
@@ -176,7 +176,7 @@ def dedupe_workflow_ids():
@server.PromptServer.instance.routes.get('/workspace/deduplicate_workflow_ids')
async def deduplicate_workflow_ids(request):
dedupe_workflow_ids()
await asyncio.to_thread(dedupe_workflow_ids)
return web.json_response(text="success", content_type='application/json')
@server.PromptServer.instance.routes.post('/workspace/get_workflow_file')
+9 -1
View File
@@ -11,6 +11,7 @@ import {
import {
IconCopy,
IconDotsVertical,
IconExternalLink,
IconLock,
IconLockOpen,
IconUpload,
@@ -19,6 +20,7 @@ import AddTagToWorkflowPopover from "./AddTagToWorkflowPopover";
import { Workflow } from "../types/dbTypes";
import { mediaTable, workflowsTable } from "../db-tables/WorkspaceDB";
import { WorkspaceContext } from "../WorkspaceContext";
import { openWorkflowInNewTab } from "../utils";
type Props = {
workflow: Workflow;
@@ -71,7 +73,7 @@ export default function MoreActionMenu({ workflow }: Props) {
return (
<>
<Menu isLazy closeOnSelect={false}>
<Menu isLazy closeOnSelect={false} placement="right" gutter={0}>
<MenuButton
border={0}
as={IconButton}
@@ -89,6 +91,12 @@ export default function MoreActionMenu({ workflow }: Props) {
>
Duplicate
</MenuItem>
<MenuItem
icon={<IconExternalLink size={20} />}
onClick={() => openWorkflowInNewTab(workflow.id)}
>
Open in new tab
</MenuItem>
{/* <AddTagToWorkflowPopover workflow={workflow} /> */}
<Tooltip
hasArrow
+22 -16
View File
@@ -5,7 +5,6 @@ import {
Text,
Checkbox,
Flex,
Stack,
} from "@chakra-ui/react";
import { IconLock } from "@tabler/icons-react";
import { formatTimestamp } from "../utils";
@@ -45,7 +44,7 @@ export default memo(function WorkflowListItem({ workflow }: Props) {
onDragStart={() => setDraggingFile?.(workflow)}
borderRadius={6}
px={1}
py={"3px"}
py={"5px"}
onClick={() => {
!isMultiSelecting && loadWorkflowID(workflow.id);
}}
@@ -53,7 +52,7 @@ export default memo(function WorkflowListItem({ workflow }: Props) {
bg: hoverBgColor,
}}
>
<HStack>
<HStack flexGrow={1}>
{!userSettingsTable?.settings?.hideCoverImage &&
(workflow.coverMediaPath?.length || workflow.latestImage?.length) && (
<MediaPreview
@@ -66,24 +65,21 @@ export default memo(function WorkflowListItem({ workflow }: Props) {
/>
)}
<Stack textAlign={"left"} gap={0}>
<HStack
textAlign={"left"}
gap={0}
justifyContent={"space-between"}
flexGrow={1}
>
<Flex alignItems={"center"}>
<Text
fontWeight={"500"}
noOfLines={2}
style={{ display: "inline-block" }}
>
<Text fontWeight={"500"} noOfLines={2} wordBreak={"break-all"}>
{workflow.name ?? "untitled"}
</Text>
{workflow.saveLock && (
<IconLock size={18} style={{ display: "inline-block" }} />
)}
</Flex>
<Text color={"GrayText"} ml={2} fontSize={"sm"}>
Updated: {formatTimestamp(workflow.updateTime)}
</Text>
</Stack>
</HStack>
</HStack>
</Box>
);
@@ -91,9 +87,11 @@ export default memo(function WorkflowListItem({ workflow }: Props) {
return (
<HStack
w={"100%"}
mb={1}
justify={"space-between"}
borderBottom={"1px solid"}
borderColor={colorMode == "dark" ? "gray.900" : "gray.200"}
onMouseEnter={() => setIsHovering(true)}
onMouseLeave={() => setIsHovering(false)}
>
{isMultiSelecting ? (
<Checkbox
@@ -109,7 +107,15 @@ export default memo(function WorkflowListItem({ workflow }: Props) {
) : (
<>
{basicInfoComp}
{isHovering && <WorkflowListItemActionButtons workflow={workflow} />}
<div style={{ width: "80px" }}>
{isHovering ? (
<WorkflowListItemActionButtons workflow={workflow} />
) : (
<Text color={"GrayText"} ml={"2px"} fontSize={"sm"}>
{formatTimestamp(workflow.updateTime, false, false, "/")}
</Text>
)}
</div>
</>
)}
</HStack>
@@ -1,8 +1,6 @@
import { Flex, IconButton, Tooltip } from "@chakra-ui/react";
import { IconExternalLink } from "@tabler/icons-react";
import DeleteConfirm from "../components/DeleteConfirm";
import MoreActionMenu from "./MoreActionMenu";
import { openWorkflowInNewTab } from "../utils";
import { useContext } from "react";
import { RecentFilesContext } from "../WorkspaceContext";
import { Workflow } from "../types/dbTypes";
@@ -14,17 +12,7 @@ export default function WorkflowListItemActionButtons({
}) {
const { onDeleteFlow } = useContext(RecentFilesContext);
return (
<Flex width={"90px"} justifyContent={"flex-end"}>
<Tooltip label="Open in new tab">
<IconButton
aria-label="Open in new tab"
size={"sm"}
variant="ghost"
onClick={() => openWorkflowInNewTab(workflow.id)}
icon={<IconExternalLink color={"#718096"} size={23} />}
/>
</Tooltip>
<Flex justifyContent={"flex-end"}>
<DeleteConfirm
promptMessage="Are you sure you want to delete this workflow?"
onDelete={() => {
+1 -1
View File
@@ -40,7 +40,7 @@ export default function DeleteConfirm(props: Props) {
<IconButton
aria-label="Delete confirm"
size={"sm"}
icon={<IconTrash color="#F56565" />}
icon={<IconTrash color="#F56565" size={"20px"} />}
isDisabled={isDisabled}
variant={variant}
/>
+2 -1
View File
@@ -103,6 +103,7 @@ export function formatTimestamp(
unixTimestamp: number,
showHourMinue: boolean = true,
showSec: boolean = false,
splitChar: string = "-",
) {
// Create a new Date object from the UNIX timestamp
const date = new Date(unixTimestamp);
@@ -115,7 +116,7 @@ export function formatTimestamp(
const minutes = String(date.getMinutes()).padStart(2, "0");
const seconds = String(date.getSeconds()).padStart(2, "0");
// Format the date and time string
const res = `${month}-${day}-${year}`;
const res = `${month}${splitChar}${day}${splitChar}${year}`;
if (showHourMinue) {
return res + ` ${hours}:${minutes}`;
}