Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions console/atest-ui/src/views/DataManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const queryResultAsJSON = ref('')
const columns = ref([] as string[])
const queryTip = ref('')
const loadingStores = ref(true)
const globalLoading = ref(false)
const showOverflowTooltip = ref(true)
const complexEditor = ref(false)
const dataFormat = ref('table')
Expand Down Expand Up @@ -241,7 +242,10 @@ const executeWithQuery = async (sql: string) => {
query.value.sql = sql

try {
const data = await API.DataQueryAsync(query.value);
globalLoading.value = true
const data = await API.DataQueryAsync(query.value, () => {
globalLoading.value = false
});
switch (kind.value) {
case ExtensionKind.ExtensionKindORM:
case ExtensionKind.ExtensionKindCassandra:
Expand Down Expand Up @@ -308,7 +312,7 @@ Magic.AdvancedKeys([{
<div class="page-header">
<span class="page-title">{{t('title.dataManager')}}</span>
</div>
<el-container style="height: calc(100vh - 80px);">
<el-container style="height: calc(100vh - 80px);" v-loading="globalLoading">
<el-aside v-if="kind === 'atest-store-orm' || kind === 'atest-store-iotdb' || kind === 'atest-store-cassandra' || kind === 'atest-store-elasticsearch' || kind === 'atest-store-opengemini'">
<el-scrollbar>
<el-select v-model="queryDataMeta.currentDatabase" placeholder="Select database"
Expand Down
6 changes: 3 additions & 3 deletions console/atest-ui/src/views/cache.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2023 API Testing Authors.
Copyright 2023-2025 API Testing Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -153,7 +153,7 @@ interface DataManagerPreference {

const DataManagerPreferenceKey = "data-manager-preference"
export function GetDataManagerPreference(): DataManagerPreference {
const val = localStorage.getItem(DataManagerPreferenceKey)
const val = sessionStorage.getItem(DataManagerPreferenceKey)
if (val && val !== '') {
return JSON.parse(val)
} else {
Expand All @@ -178,7 +178,7 @@ export function SetDataManagerPreference(field: string, value: string) {
default:
return
}
localStorage.setItem(DataManagerPreferenceKey, JSON.stringify(preference))
sessionStorage.setItem(DataManagerPreferenceKey, JSON.stringify(preference))
return
}

Expand Down
4 changes: 2 additions & 2 deletions console/atest-ui/src/views/net.ts
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ export interface QueryObject {
offset: number
limit: number
}
const DataQueryAsync = (query: QueryObject) => {
const DataQueryAsync = (query: QueryObject, final?: () => void | undefined | null) => {
const requestOptions = {
method: 'POST',
headers: {
Expand All @@ -863,7 +863,7 @@ const DataQueryAsync = (query: QueryObject) => {
body: JSON.stringify(query)
}
return fetch(`/api/v1/data/query`, requestOptions)
.then(DefaultResponseProcess)
.then(DefaultResponseProcess).finally(final)
}

var DataQuery = (store: string, kind: string, currentDatabase: string, query: string, callback: (d: any) => void, errHandler: (d: any) => void) => {
Expand Down
Loading