-
-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: move debug panel to outside * refactor: extract debug panel into independent component
- Loading branch information
1 parent
fd59030
commit 1165899
Showing
4 changed files
with
85 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
packages/web/src/pages/app/[appid]/cloudfunction/components/DebugPanel.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<script lang="ts" setup> | ||
import JsonEditor from '~/components/JsonEditor/param.vue' | ||
const props = defineProps<{ | ||
invokeParams: any | ||
invokeRequestId?: string | ||
invokeTimeUsage?: number | ||
invokeResult?: string | ||
}>() | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-col h-full"> | ||
<div> | ||
调用参数 | ||
</div> | ||
<div class="h-300px"> | ||
<JsonEditor v-model="props.invokeParams" :line-numbers="false" :height="300" :dark="false" /> | ||
</div> | ||
<div v-if="props.invokeRequestId" class="invoke-result"> | ||
<div class="title"> | ||
执行日志 | ||
<span v-if="props.invokeRequestId">( RequestId: {{ props.invokeRequestId }} )</span> | ||
</div> | ||
<div v-if="invokeLogs" class="logs"> | ||
<div v-for="(log, index) in invokeLogs" :key="index" class="log-item"> | ||
<pre>- {{ log }}</pre> | ||
</div> | ||
</div> | ||
<div class="title" style="margin-top: 20px"> | ||
调用结果 | ||
<span v-if="props.invokeTimeUsage"> ( {{ props.invokeTimeUsage }} ms )</span> | ||
</div> | ||
<div class="result overflow-auto"> | ||
<pre>{{ props.invokeResult }}</pre> | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
.invoke-result { | ||
margin-top: 20px; | ||
.logs { | ||
margin-top: 10px; | ||
padding: 10px; | ||
padding-left: 20px; | ||
background: rgba(233, 243, 221, 0.472); | ||
border-radius: 10px; | ||
overflow-x: auto; | ||
} | ||
.result { | ||
margin-top: 10px; | ||
padding: 16px; | ||
background: rgba(233, 243, 221, 0.472); | ||
border-radius: 10px; | ||
overflow-x: auto; | ||
} | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters