adjust the iotdb query
This commit is contained in:
parent
c4eca6cbc1
commit
739e356f5d
|
@ -111,6 +111,7 @@ const executeQuery = async () => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('sqlisql' + sqlQuery.value)
|
||||||
API.DataQuery(store.value, kind.value, currentDatabase.value, sqlQuery.value, (data) => {
|
API.DataQuery(store.value, kind.value, currentDatabase.value, sqlQuery.value, (data) => {
|
||||||
switch (kind.value) {
|
switch (kind.value) {
|
||||||
case 'atest-store-orm':
|
case 'atest-store-orm':
|
||||||
|
@ -118,7 +119,6 @@ const executeQuery = async () => {
|
||||||
break;
|
break;
|
||||||
case 'atest-store-iotdb':
|
case 'atest-store-iotdb':
|
||||||
ormDataHandler(data)
|
ormDataHandler(data)
|
||||||
success = true
|
|
||||||
break;
|
break;
|
||||||
case 'atest-store-etcd':
|
case 'atest-store-etcd':
|
||||||
keyValueDataHandler(data)
|
keyValueDataHandler(data)
|
||||||
|
@ -146,13 +146,13 @@ const executeQuery = async () => {
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-container style="height: calc(100vh - 45px);">
|
<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-scrollbar>
|
||||||
<el-select v-model="currentDatabase" placeholder="Select database" @change="queryTables" filterable>
|
<el-select v-model="currentDatabase" placeholder="Select database" @change="queryTables" filterable>
|
||||||
<el-option v-for="item in databases" :key="item" :label="item"
|
<el-option v-for="item in databases" :key="item" :label="item" :value="item"></el-option>
|
||||||
:value="item"></el-option>
|
|
||||||
</el-select>
|
</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-scrollbar>
|
||||||
</el-aside>
|
</el-aside>
|
||||||
<el-container>
|
<el-container>
|
||||||
|
@ -161,15 +161,18 @@ const executeQuery = async () => {
|
||||||
<el-row :gutter="10">
|
<el-row :gutter="10">
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item>
|
<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"
|
<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-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="17">
|
<el-col :span="17">
|
||||||
<el-form-item>
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2">
|
<el-col :span="2">
|
||||||
|
|
|
@ -22,7 +22,7 @@ async function DefaultResponseProcess(response: any) {
|
||||||
throw new Error("Unauthenticated")
|
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)
|
throw new Error(message)
|
||||||
} else {
|
} else {
|
||||||
return response.json()
|
return response.json()
|
||||||
|
@ -37,7 +37,7 @@ interface AppVersion {
|
||||||
|
|
||||||
function safeToggleFunc(toggle?: (e: boolean) => void) {
|
function safeToggleFunc(toggle?: (e: boolean) => void) {
|
||||||
if (!toggle) {
|
if (!toggle) {
|
||||||
return (e: boolean) => {}
|
return (e: boolean) => { }
|
||||||
}
|
}
|
||||||
return toggle
|
return toggle
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ export interface TestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface HistoryTestCase {
|
interface HistoryTestCase {
|
||||||
historyCaseID : string,
|
historyCaseID: string,
|
||||||
suiteName: string
|
suiteName: string
|
||||||
caseName: string
|
caseName: string
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ const BatchRunTestCase = (request: BatchRunTestCaseRequest,
|
||||||
|
|
||||||
function DuplicateTestCase(sourceSuiteName: string, targetSuiteName: string,
|
function DuplicateTestCase(sourceSuiteName: string, targetSuiteName: string,
|
||||||
sourceTestCaseName: string, targetTestCaseName: 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 = {
|
const requestOptions = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -387,7 +387,7 @@ function DuplicateTestCase(sourceSuiteName: string, targetSuiteName: string,
|
||||||
|
|
||||||
function RenameTestCase(sourceSuiteName: string, targetSuiteName: string,
|
function RenameTestCase(sourceSuiteName: string, targetSuiteName: string,
|
||||||
sourceTestCaseName: string, targetTestCaseName: 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 = {
|
const requestOptions = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -674,7 +674,7 @@ function emptyOrDefault(fn: any) {
|
||||||
if (fn) {
|
if (fn) {
|
||||||
return fn
|
return fn
|
||||||
}
|
}
|
||||||
return () => {}
|
return () => { }
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetHistoryTestCaseWithResult(req: HistoryTestCase,
|
function GetHistoryTestCaseWithResult(req: HistoryTestCase,
|
||||||
|
@ -712,7 +712,7 @@ function DeleteHistoryTestCase(req: HistoryTestCase,
|
||||||
'X-Auth': getToken()
|
'X-Auth': getToken()
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
ID : req.historyCaseID
|
ID: req.historyCaseID
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
fetch(`/api/v1/historyTestCase/${req.historyCaseID}`, requestOptions)
|
fetch(`/api/v1/historyTestCase/${req.historyCaseID}`, requestOptions)
|
||||||
|
@ -728,7 +728,7 @@ function DeleteAllHistoryTestCase(suiteName: string, caseName: string,
|
||||||
'X-Auth': getToken()
|
'X-Auth': getToken()
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
suiteName : suiteName,
|
suiteName: suiteName,
|
||||||
caseName: caseName,
|
caseName: caseName,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -779,8 +779,6 @@ var SBOM = (callback: (d: any) => void) => {
|
||||||
.then(callback)
|
.then(callback)
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< Updated upstream
|
|
||||||
=======
|
|
||||||
interface QueryObject {
|
interface QueryObject {
|
||||||
sql: string
|
sql: string
|
||||||
key: string
|
key: string
|
||||||
|
@ -815,14 +813,21 @@ var DataQueryAsync = (store: string, kind: string, currentDatabase: string, quer
|
||||||
.then(DefaultResponseProcess)
|
.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) => {
|
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) {
|
switch (kind) {
|
||||||
case 'atest-store-orm':
|
case 'atest-store-orm':
|
||||||
queryObj['sql'] = query;
|
queryObj['sql'] = query;
|
||||||
queryObj['key'] = currentDatabase;
|
queryObj['key'] = currentDatabase;
|
||||||
break;
|
break;
|
||||||
|
case 'atest-store-iotdb':
|
||||||
|
queryObj['sql'] = query;
|
||||||
|
queryObj['key'] = currentDatabase;
|
||||||
|
break;
|
||||||
case 'atest-store-etcd':
|
case 'atest-store-etcd':
|
||||||
queryObj['key'] = query;
|
queryObj['key'] = query;
|
||||||
break;
|
break;
|
||||||
|
@ -849,7 +854,7 @@ export const API = {
|
||||||
GetVersion,
|
GetVersion,
|
||||||
CreateTestSuite, UpdateTestSuite, ImportTestSuite, GetTestSuite, DeleteTestSuite, ConvertTestSuite, DuplicateTestSuite, RenameTestSuite, GetTestSuiteYaml,
|
CreateTestSuite, UpdateTestSuite, ImportTestSuite, GetTestSuite, DeleteTestSuite, ConvertTestSuite, DuplicateTestSuite, RenameTestSuite, GetTestSuiteYaml,
|
||||||
CreateTestCase, UpdateTestCase, GetTestCase, ListTestCase, DeleteTestCase, DuplicateTestCase, RenameTestCase, RunTestCase, BatchRunTestCase,
|
CreateTestCase, UpdateTestCase, GetTestCase, ListTestCase, DeleteTestCase, DuplicateTestCase, RenameTestCase, RunTestCase, BatchRunTestCase,
|
||||||
GetHistoryTestCaseWithResult, DeleteHistoryTestCase,GetHistoryTestCase, GetTestCaseAllHistory, DeleteAllHistoryTestCase, DownloadResponseFile,
|
GetHistoryTestCaseWithResult, DeleteHistoryTestCase, GetHistoryTestCase, GetTestCaseAllHistory, DeleteAllHistoryTestCase, DownloadResponseFile,
|
||||||
GenerateCode, ListCodeGenerator, HistoryGenerateCode,
|
GenerateCode, ListCodeGenerator, HistoryGenerateCode,
|
||||||
PopularHeaders,
|
PopularHeaders,
|
||||||
CreateOrUpdateStore, GetStores, DeleteStore, VerifyStore,
|
CreateOrUpdateStore, GetStores, DeleteStore, VerifyStore,
|
||||||
|
|
Loading…
Reference in New Issue