1
1
<script lang="ts">
2
- import { ArrowDown , ArrowUp , RefreshRight , Check , DocumentCopy } from ' @element-plus/icons-vue'
2
+ import { ArrowDown , ArrowUp , RefreshRight , Check , DocumentCopy , User } from ' @element-plus/icons-vue'
3
3
import VueJsonPretty from ' vue-json-pretty' ;
4
4
import { ElMessage } from ' element-plus' ;
5
5
import ' vue-json-pretty/lib/styles.css' ;
@@ -32,6 +32,11 @@ export default {
32
32
expanded: false ,
33
33
}
34
34
},
35
+ mounted() {
36
+ if (this .status === ' awaiting_approval' ) {
37
+ this .expanded = true ;
38
+ }
39
+ },
35
40
methods: {
36
41
toggleExpanded() {
37
42
this .expanded = ! this .expanded ;
@@ -64,15 +69,21 @@ export default {
64
69
65
70
66
71
<template >
67
- <div class =" tool-message-container" v-bind:class =" expanded? 'expanded':''" >
72
+ <div class =" tool-message-container" v-bind:class =" ( expanded || status === 'awaiting_approval' ) ? 'expanded':''" >
68
73
69
74
<div class =" tool-message-header" >
70
75
<div class =" tool-name" >Tool Call: {{ name }}</div >
71
76
<div class =" right-aligned" >
77
+ <div v-if =" status === 'awaiting_approval'" style =" margin-right : 10px ;" >
78
+ <p style =" color : #ffb400 ; font-size : small ;" >Awaiting Approval</p >
79
+ </div >
72
80
<div class =" status" v-bind:class =" status" >
73
81
<div v-if =" status === 'pending'" >
74
82
<el-icon class =" is-loading" color =" #20cbeb" ><RefreshRight /></el-icon >
75
83
</div >
84
+ <div v-else-if =" status === 'awaiting_approval'" >
85
+ <el-icon color =" #ffb400" ><User /></el-icon >
86
+ </div >
76
87
<div v-else-if =" status === 'success'" >
77
88
<el-icon color =" #00ff18" ><Check /></el-icon >
78
89
</div >
@@ -96,7 +107,14 @@ export default {
96
107
<vue-json-pretty :data =" args" :expand-depth =" 2" />
97
108
</el-scrollbar >
98
109
</div >
99
- <h4 >Result:</h4 >
110
+ <div v-if =" status === 'awaiting_approval'" class =" tool-approval-container" >
111
+ <h4 >Approve this tool call?</h4 >
112
+ <el-button type =" primary" >Approve</el-button >
113
+ <el-button type =" danger" >Deny</el-button >
114
+ </div >
115
+ <div v-else >
116
+ <h4 >Result:</h4 >
117
+ </div >
100
118
<div v-if =" result" class =" tool-result-container" >
101
119
<div class =" copy-to-clipboard" >
102
120
<el-button size =" small" circle @click =" copyToClipboard(JSON.stringify(result, null, 2))" :dark =" true" ><el-icon ><DocumentCopy /></el-icon ></el-button >
0 commit comments