diff --git a/frontend/src/lib/components/common/actionRow/ActionRow.svelte b/frontend/src/lib/components/common/actionRow/ActionRow.svelte
new file mode 100644
index 0000000000..3203443ee0
--- /dev/null
+++ b/frontend/src/lib/components/common/actionRow/ActionRow.svelte
@@ -0,0 +1,27 @@
+
+
+
+
+ {#if $$slots.left}
+
+
+
+ {/if}
+ {#if $$slots.middle}
+
+
+
+ {/if}
+ {#if $$slots.right}
+
+
+
+ {/if}
+
+
diff --git a/frontend/src/lib/components/common/button/Button.svelte b/frontend/src/lib/components/common/button/Button.svelte
index e2a0b108c9..c44de641ae 100644
--- a/frontend/src/lib/components/common/button/Button.svelte
+++ b/frontend/src/lib/components/common/button/Button.svelte
@@ -1,81 +1,108 @@
{#if href}
-
+
{#if startIcon}
-
+
{/if}
{#if endIcon}
-
+
{/if}
{:else}
{/if}
diff --git a/frontend/src/lib/components/common/button/model.ts b/frontend/src/lib/components/common/button/model.ts
new file mode 100644
index 0000000000..1f3a4e808f
--- /dev/null
+++ b/frontend/src/lib/components/common/button/model.ts
@@ -0,0 +1,6 @@
+export namespace Button {
+ export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
+ export type Color = 'blue' | 'red' | 'dark' | 'light'
+ export type Variant = 'contained' | 'border'
+ export type Target = '_self' | '_blank'
+}
diff --git a/frontend/src/lib/components/common/index.ts b/frontend/src/lib/components/common/index.ts
new file mode 100644
index 0000000000..5751954c59
--- /dev/null
+++ b/frontend/src/lib/components/common/index.ts
@@ -0,0 +1,15 @@
+export { default as ActionRow } from './actionRow/ActionRow.svelte'
+export { default as Badge } from './badge/Badge.svelte'
+export { default as Button } from './button/Button.svelte'
+export { default as Drawer } from './drawer/Drawer.svelte'
+export { default as DrawerContent } from './drawer/DrawerContent.svelte'
+export { default as Menu } from './menu/Menu.svelte'
+export { default as MenuItem } from './menu/MenuItem.svelte'
+export { default as Tab } from './tabs/Tab.svelte'
+export { default as TabContent } from './tabs/TabContent.svelte'
+export { default as Tabs } from './tabs/Tabs.svelte'
+export { default as ToggleButton } from './toggleButton/ToggleButton.svelte'
+export { default as ToggleButtonGroup } from './toggleButton/ToggleButtonGroup.svelte'
+
+export * from './badge/model'
+export * from './button/model'
diff --git a/frontend/src/routes/flows/get/[...path].svelte b/frontend/src/routes/flows/get/[...path].svelte
index 70376386d2..2a5326fb44 100644
--- a/frontend/src/routes/flows/get/[...path].svelte
+++ b/frontend/src/routes/flows/get/[...path].svelte
@@ -38,6 +38,7 @@
import CenteredPage from '$lib/components/CenteredPage.svelte'
import FlowViewer from '$lib/components/FlowViewer.svelte'
import ObjectViewer from '$lib/components/propertyPicker/ObjectViewer.svelte'
+ import { Button, ActionRow } from '$lib/components/common'
let flow: Flow | undefined
let schedule: Schedule | undefined
@@ -45,6 +46,7 @@
let path = $page.params.path
let shareModal: ShareModal
+ let scrollY: number
$: {
if ($workspaceStore && $userStore) {
@@ -88,105 +90,101 @@
}
+
+
+{#if flow}
+ = 30 ? 'border-b' : '')}>
+
+
+
+
+
+
+
+
+ {
+ shareModal.openModal()
+ },
+ disabled: !can_write
+ },
+ {
+ displayName: 'Schedule',
+ icon: faCalendar,
+ href: `/schedule/add?path=${flow.path}&isFlow=true`
+ },
+ {
+ displayName: 'Archive',
+ icon: faArchive,
+ type: 'delete',
+ action: () => {
+ flow?.path && archiveFlow()
+ },
+ disabled: flow.archived || !can_write
+ }
+ ]}
+ />
+
+
+{/if}
+
-
-
- {flow?.path ?? 'Loading...'}
+
-
- {#if flow}
-
-
{
- shareModal.openModal()
- },
- disabled: !can_write
- },
- {
- displayName: 'Schedule',
- icon: faCalendar,
- href: `/schedule/add?path=${flow.path}&isFlow=true`
- },
- {
- displayName: 'Archive',
- icon: faArchive,
- type: 'delete',
- action: () => {
- flow?.path && archiveFlow()
- },
- disabled: flow.archived || !can_write
- }
- ]}
- />
-
-
-
-
-
- {/if}
-
+
+
diff --git a/frontend/src/routes/scripts/get/[...hash].svelte b/frontend/src/routes/scripts/get/[...hash].svelte
index aaeb69343a..a7628c6acf 100644
--- a/frontend/src/routes/scripts/get/[...hash].svelte
+++ b/frontend/src/routes/scripts/get/[...hash].svelte
@@ -18,7 +18,6 @@
scriptToHubUrl,
copyToClipboard
} from '$lib/utils'
- import Icon from 'svelte-awesome'
import {
faPlay,
faEdit,
@@ -43,16 +42,14 @@
import CenteredPage from '$lib/components/CenteredPage.svelte'
import { onDestroy } from 'svelte'
import HighlightCode from '$lib/components/HighlightCode.svelte'
- import Badge from '$lib/components/common/badge/Badge.svelte'
- import Tabs from '$lib/components/common/tabs/Tabs.svelte'
- import Tab from '$lib/components/common/tabs/Tab.svelte'
- import TabContent from '$lib/components/common/tabs/TabContent.svelte'
+ import { Badge, Tabs, Tab, TabContent, Button, ActionRow } from '$lib/components/common'
let script: Script | undefined
let topHash: string | undefined
let can_write = false
let deploymentInProgress = false
let intervalId: NodeJS.Timer
+ let scrollY: number
let shareModal: ShareModal
@@ -131,6 +128,111 @@
})
+
+
+{#if script}
+ = 30 ? 'border-b' : '')}>
+
+
+
+ {#if !topHash}
+
+ {/if}
+
+
+
+
+ {
+ shareModal.openModal()
+ },
+ disabled: !can_write
+ },
+ {
+ displayName: 'Schedule',
+ icon: faCalendar,
+ href: `/schedule/add?path=${script.path}`
+ },
+ {
+ displayName: 'Archive',
+ icon: faArchive,
+ type: 'delete',
+ action: () => {
+ script?.hash && archiveScript(script.hash)
+ },
+ disabled: script.archived || !can_write
+ },
+ {
+ displayName: 'Delete',
+ icon: faTrash,
+ type: 'delete',
+ action: () => {
+ script?.hash && deleteScript(script.hash)
+ },
+ disabled: script.deleted || !($userStore?.is_admin ?? false)
+ }
+ ]}
+ />
+
+
+{/if}
+
@@ -169,115 +271,16 @@
-
- {#if script}
-
-
-
-
- Run
-
-
-
-
-
- Edit
-
-
- {#if !topHash}
-
-
-
- Use as template/Fork
-
-
- {/if}
-
-
-
- View runs
-
-
-
-
-
- Publish to Hub
-
-
-
{
- shareModal.openModal()
- },
- disabled: !can_write
- },
- {
- displayName: 'Schedule',
- icon: faCalendar,
- href: `/schedule/add?path=${script.path}`
- },
- {
- displayName: 'Archive',
- icon: faArchive,
- type: 'delete',
- action: () => {
- script?.hash && archiveScript(script.hash)
- },
- disabled: script.archived || !can_write
- },
- {
- displayName: 'Delete',
- icon: faTrash,
- type: 'delete',
- action: () => {
- script?.hash && deleteScript(script.hash)
- },
- disabled: script.deleted || !($userStore?.is_admin ?? false)
- }
- ]}
- />
-
- {/if}
-
+
{#if script === undefined}
loading
{:else}
-
{script.summary}
+
{script.summary}
@@ -343,13 +346,15 @@
{type}
-
{/each}