-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support query template functions on UI (#131)
- Loading branch information
1 parent
b1c4479
commit 800d310
Showing
14 changed files
with
645 additions
and
113 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
import type { Pair } from './types' | ||
const dialogVisible = ref(false) | ||
const query = ref('') | ||
const funcs = ref([] as Pair[]) | ||
function queryFuncs() { | ||
const requestOptions = { | ||
method: 'POST', | ||
body: JSON.stringify({ | ||
name: query.value | ||
}) | ||
} | ||
fetch('/server.Runner/FunctionsQuery', requestOptions) | ||
.then((response) => response.json()) | ||
.then((e) => { | ||
funcs.value = e.data | ||
}) | ||
} | ||
</script> | ||
|
||
<template> | ||
<el-affix position="bottom" :offset="20"> | ||
<el-button type="primary" @click="dialogVisible = !dialogVisible">Tool Box</el-button> | ||
</el-affix> | ||
|
||
|
||
<el-dialog v-model="dialogVisible" title="Template Functions Query" width="40%" draggable destroy-on-close> | ||
<template #footer> | ||
<el-input v-model="query" placeholder="Query after enter" v-on:keyup.enter="queryFuncs" /> | ||
<span class="dialog-footer"> | ||
<el-table :data="funcs" style="width: 100%"> | ||
<el-table-column label="Key" width="250"> | ||
<template #default="scope"> | ||
<el-input v-model="scope.row.key" placeholder="Value" /> | ||
</template> | ||
</el-table-column> | ||
<el-table-column label="Value"> | ||
<template #default="scope"> | ||
<div style="display: flex; align-items: center"> | ||
<el-input v-model="scope.row.value" placeholder="Value" /> | ||
</div> | ||
</template> | ||
</el-table-column> | ||
</el-table> | ||
</span> | ||
</template> | ||
</el-dialog> | ||
</template> |
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
Oops, something went wrong.