feat(frontend): add the view runs buttons for operators (#2932)

* feat(frontend): add the view runs buttons for operators

* Update +page.svelte

* Update +page.svelte

---------

Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
This commit is contained in:
Faton Ramadani
2023-12-30 03:39:22 +01:00
committed by GitHub
co-authored by Ruben Fiszel
parent 0299c656c3
commit 821d2d7ea1
2 changed files with 21 additions and 3 deletions
@@ -119,7 +119,7 @@
function getMainButtons(flow: Flow | undefined, args: object | undefined) {
const buttons: any = []
if (flow) {
if (flow && !$userStore?.operator) {
buttons.push({
label: 'Fork',
buttonProps: {
@@ -132,7 +132,7 @@
})
}
if (!flow || $userStore?.operator || !can_write) {
if (!flow) {
return buttons
}
@@ -146,6 +146,10 @@
}
})
if (!flow || $userStore?.operator || !can_write) {
return buttons
}
if (!$userStore?.operator) {
buttons.push({
label: 'Build App',
@@ -211,7 +211,7 @@
function getMainButtons(script: Script | undefined, args: object | undefined, topHash?: string) {
const buttons: any = []
if (!topHash && script) {
if (!topHash && script && !$userStore?.operator) {
buttons.push({
label: 'Fork',
buttonProps: {
@@ -223,6 +223,20 @@
})
}
if (!script) {
return buttons
}
buttons.push({
label: `View runs`,
buttonProps: {
href: `/runs/${script.path}`,
size: 'xs',
color: 'light',
startIcon: History
}
})
if (!script || $userStore?.operator || !can_write) {
return buttons
}