adjust the iotdb query

This commit is contained in:
rick 2025-03-27 03:48:21 +00:00
parent c4eca6cbc1
commit 739e356f5d
2 changed files with 600 additions and 592 deletions

View File

@ -111,6 +111,7 @@ const executeQuery = async () => {
break;
}
console.log('sqlisql' + sqlQuery.value)
API.DataQuery(store.value, kind.value, currentDatabase.value, sqlQuery.value, (data) => {
switch (kind.value) {
case 'atest-store-orm':
@ -118,7 +119,6 @@ const executeQuery = async () => {
break;
case 'atest-store-iotdb':
ormDataHandler(data)
success = true
break;
case 'atest-store-etcd':
keyValueDataHandler(data)
@ -146,13 +146,13 @@ const executeQuery = async () => {
<template>
<div>
<el-container style="height: calc(100vh - 45px);">
<el-aside v-if="kind === 'atest-store-orm'">
<el-aside v-if="kind === 'atest-store-orm' || kind === 'atest-store-iotdb'">
<el-scrollbar>
<el-select v-model="currentDatabase" placeholder="Select database" @change="queryTables" filterable>
<el-option v-for="item in databases" :key="item" :label="item"
:value="item"></el-option>
<el-option v-for="item in databases" :key="item" :label="item" :value="item"></el-option>
</el-select>
<el-tree :data="tablesTree" node-key="label" @node-click="queryDataFromTable" highlight-current draggable/>
<el-tree :data="tablesTree" node-key="label" @node-click="queryDataFromTable" highlight-current
draggable />
</el-scrollbar>
</el-aside>
<el-container>
@ -161,15 +161,18 @@ const executeQuery = async () => {
<el-row :gutter="10">
<el-col :span="4">
<el-form-item>
<el-select v-model="store" placeholder="Select store" filterable :loading="loadingStores">
<el-select v-model="store" placeholder="Select store" filterable
:loading="loadingStores">
<el-option v-for="item in stores" :key="item.name" :label="item.name"
:value="item.name" :disabled="!item.ready" :kind="item.kind.name"></el-option>
:value="item.name" :disabled="!item.ready"
:kind="item.kind.name"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="17">
<el-form-item>
<el-input v-model="sqlQuery" :placeholder="queryTip" @keyup.enter="executeQuery"></el-input>
<el-input v-model="sqlQuery" :placeholder="queryTip"
@keyup.enter="executeQuery"></el-input>
</el-form-item>
</el-col>
<el-col :span="2">

View File

@ -22,7 +22,7 @@ async function DefaultResponseProcess(response: any) {
throw new Error("Unauthenticated")
}
const message = await response.json().then((data :any) => data.message)
const message = await response.json().then((data: any) => data.message)
throw new Error(message)
} else {
return response.json()
@ -37,7 +37,7 @@ interface AppVersion {
function safeToggleFunc(toggle?: (e: boolean) => void) {
if (!toggle) {
return (e: boolean) => {}
return (e: boolean) => { }
}
return toggle
}
@ -204,7 +204,7 @@ export interface TestCase {
}
interface HistoryTestCase {
historyCaseID : string,
historyCaseID: string,
suiteName: string
caseName: string
}
@ -366,7 +366,7 @@ const BatchRunTestCase = (request: BatchRunTestCaseRequest,
function DuplicateTestCase(sourceSuiteName: string, targetSuiteName: string,
sourceTestCaseName: string, targetTestCaseName: string,
callback: (d: any) => void, errHandle?: ((reason: any) => PromiseLike<never>) | undefined | null ) {
callback: (d: any) => void, errHandle?: ((reason: any) => PromiseLike<never>) | undefined | null) {
const requestOptions = {
method: 'POST',
headers: {
@ -387,7 +387,7 @@ function DuplicateTestCase(sourceSuiteName: string, targetSuiteName: string,
function RenameTestCase(sourceSuiteName: string, targetSuiteName: string,
sourceTestCaseName: string, targetTestCaseName: string,
callback: (d: any) => void, errHandle?: ((reason: any) => PromiseLike<never>) | undefined | null ) {
callback: (d: any) => void, errHandle?: ((reason: any) => PromiseLike<never>) | undefined | null) {
const requestOptions = {
method: 'POST',
headers: {
@ -674,7 +674,7 @@ function emptyOrDefault(fn: any) {
if (fn) {
return fn
}
return () => {}
return () => { }
}
function GetHistoryTestCaseWithResult(req: HistoryTestCase,
@ -712,7 +712,7 @@ function DeleteHistoryTestCase(req: HistoryTestCase,
'X-Auth': getToken()
},
body: JSON.stringify({
ID : req.historyCaseID
ID: req.historyCaseID
})
}
fetch(`/api/v1/historyTestCase/${req.historyCaseID}`, requestOptions)
@ -728,7 +728,7 @@ function DeleteAllHistoryTestCase(suiteName: string, caseName: string,
'X-Auth': getToken()
},
body: JSON.stringify({
suiteName : suiteName,
suiteName: suiteName,
caseName: caseName,
})
}
@ -779,8 +779,6 @@ var SBOM = (callback: (d: any) => void) => {
.then(callback)
}
<<<<<<< Updated upstream
=======
interface QueryObject {
sql: string
key: string
@ -815,14 +813,21 @@ var DataQueryAsync = (store: string, kind: string, currentDatabase: string, quer
.then(DefaultResponseProcess)
}
>>>>>>> Stashed changes
interface QueryObject {
sql: string
}
var DataQuery = (store: string, kind: string, currentDatabase: string, query: string, callback: (d: any) => void, errHandler: (d: any) => void) => {
const queryObj = {}
const queryObj = {} as QueryObject
switch (kind) {
case 'atest-store-orm':
queryObj['sql'] = query;
queryObj['key'] = currentDatabase;
break;
case 'atest-store-iotdb':
queryObj['sql'] = query;
queryObj['key'] = currentDatabase;
break;
case 'atest-store-etcd':
queryObj['key'] = query;
break;
@ -849,7 +854,7 @@ export const API = {
GetVersion,
CreateTestSuite, UpdateTestSuite, ImportTestSuite, GetTestSuite, DeleteTestSuite, ConvertTestSuite, DuplicateTestSuite, RenameTestSuite, GetTestSuiteYaml,
CreateTestCase, UpdateTestCase, GetTestCase, ListTestCase, DeleteTestCase, DuplicateTestCase, RenameTestCase, RunTestCase, BatchRunTestCase,
GetHistoryTestCaseWithResult, DeleteHistoryTestCase,GetHistoryTestCase, GetTestCaseAllHistory, DeleteAllHistoryTestCase, DownloadResponseFile,
GetHistoryTestCaseWithResult, DeleteHistoryTestCase, GetHistoryTestCase, GetTestCaseAllHistory, DeleteAllHistoryTestCase, DownloadResponseFile,
GenerateCode, ListCodeGenerator, HistoryGenerateCode,
PopularHeaders,
CreateOrUpdateStore, GetStores, DeleteStore, VerifyStore,