Skip to content

Commit 36e9d9d

Browse files
committed
Show run output
Signed-off-by: Vincent Fiduccia <[email protected]>
1 parent 32b6ba0 commit 36e9d9d

File tree

4 files changed

+28
-10
lines changed

4 files changed

+28
-10
lines changed

ui/components/call.vue

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ const outputTruncated = computed(() => {
105105
<div class="flex-1">
106106
<div>
107107
<UButton v-if="children.length || call.messages?.length || inputTruncated || outputTruncated" size="xs" :icon="icon" @click="toggle" class="align-baseline mr-1"/>
108-
{{displayName}}
109-
<template v-if="!isExpanded">({{inputShort}}) <i class="i-heroicons-arrow-right align-text-bottom"/> {{outputShort}}</template>
108+
{{displayName}}<template v-if="!isExpanded">({{inputShort}}) <i class="i-heroicons-arrow-right align-text-bottom"/> {{outputShort}}</template>
110109
</div>
111110
</div>
112111
<div class="flex-inline text-right">
@@ -124,10 +123,10 @@ const outputTruncated = computed(() => {
124123
</div>
125124

126125
<div v-if="isExpanded">
127-
<b>Input:</b> <span class="whitespace-pre-wrap">{{call.input || '<none>'}}</span>
126+
<b>Input:&nbsp;</b><Content v-model="call.input"/>
128127
</div>
129128
<div v-if="isExpanded">
130-
<b>Output:</b> <span class="whitespace-pre-wrap">{{call.output || '<none>'}}</span>
129+
<b>Output:&nbsp;</b><Content v-model="call.output"/>
131130
</div>
132131

133132
<template v-if="isExpanded">

ui/components/content.vue

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<script lang="ts" setup>
2+
3+
interface Props {
4+
modelValue: any
5+
}
6+
7+
const { modelValue } = defineProps<Props>()
8+
9+
const content = computed(() => {
10+
return `${modelValue}`.trim()
11+
})
12+
13+
</script>
14+
15+
<template>
16+
<span class="whitespace-pre-wrap">{{content || '<none>'}}</span>
17+
</template>

ui/components/message.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ const { run, /*call,*/ msg, referredTo, depth=0 } = defineProps<Props>()
3232
/>
3333
<template v-else>
3434
<UCard v-if="typeof msg.content === 'string'" class="mt-2">
35-
<b>{{ucFirst(msg.role)}}:&nbsp;</b>
36-
<span class="whitespace-pre-wrap">{{`${msg.content}`.trim()}}</span>
35+
<b>{{ucFirst(msg.role)}}:&nbsp;</b><Content v-model="msg.content" />
3736
</UCard>
3837
<template v-else>
3938
<UCard v-for="(c, idx) in msg.content" :key="idx">

ui/pages/run/[run].vue

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
1717
const run = (await useRuns().find(id))!
1818
19-
window.run = run
20-
2119
const callMap = reactive<Record<string, Call>>({})
2220
const referredTo = reactive<MapBool>({})
2321
@@ -104,7 +102,7 @@
104102
<div class="clearfix">
105103
<div class="float-left">
106104
<h1 class="text-xl">
107-
Run: {{id}}
105+
{{run.program?.name}} #{{id}}
108106
</h1>
109107
</div>
110108
<div class="float-right">
@@ -115,7 +113,7 @@
115113
@click="toggleAll()"
116114
/>
117115

118-
<UButton size="sm" icon="i-heroicons-pencil" label="Edit" @click="edit" class="ml-2"/>
116+
<UButton size="sm" icon="i-heroicons-pencil" label="Run Again…" @click="edit" class="ml-2"/>
119117

120118
<UBadge :color="colorForState(run.state)" size="lg" class="align-top ml-2" variant="subtle">
121119
<i :class="iconForState(run.state)"/>&nbsp;{{ucFirst(run.state)}}
@@ -133,6 +131,11 @@
133131
:description="run.err"
134132
/>
135133

134+
<UDivider class="my-4" />
135+
<UCard>
136+
<Content v-if="run.output || run.state === 'finished'" v-model="run.output"/>
137+
<UProgress v-else class="p-2" animation="swing" />
138+
</UCard>
136139

137140
<UDivider class="my-4" />
138141

0 commit comments

Comments
 (0)