fix: polish pages and bugs fix (#36)

This commit is contained in:
Fine0830
2022-03-24 21:35:22 +08:00
committed by GitHub
parent 33365f2a14
commit 4380a874de
26 changed files with 314 additions and 134 deletions

View File

@@ -32,6 +32,7 @@ interface AppState {
timer: Nullable<any>;
autoRefresh: boolean;
pageTitle: string;
version: string;
}
export const appStore = defineStore({
@@ -49,6 +50,7 @@ export const appStore = defineStore({
timer: null,
autoRefresh: false,
pageTitle: "",
version: "",
}),
getters: {
duration(): Duration {
@@ -155,6 +157,16 @@ export const appStore = defineStore({
return res.data;
},
async fetchVersion(): Promise<void> {
const res: AxiosResponse = await graphql
.query("queryOAPVersion")
.params({});
if (res.data.errors) {
return res.data;
}
this.version = res.data.data.version;
return res.data;
},
},
});
export function useAppStoreWithOut(): any {

View File

@@ -65,15 +65,15 @@ export const logStore = defineStore({
if (res.data.errors) {
return res.data;
}
this.services = [
{ value: "0", label: "All" },
...res.data.data.services,
] || [{ value: "0", label: "All" }];
this.services = res.data.data.services;
return res.data;
},
async getInstances() {
async getInstances(id: string) {
const serviceId = this.selectorStore.currentService
? this.selectorStore.currentService.id
: id;
const res: AxiosResponse = await graphql.query("queryInstances").params({
serviceId: this.selectorStore.currentService.id,
serviceId,
duration: this.durationTime,
});
@@ -86,9 +86,12 @@ export const logStore = defineStore({
] || [{ value: " 0", label: "All" }];
return res.data;
},
async getEndpoints() {
async getEndpoints(id: string) {
const serviceId = this.selectorStore.currentService
? this.selectorStore.currentService.id
: id;
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
serviceId: this.selectorStore.currentService.id,
serviceId,
duration: this.durationTime,
keyword: "",
});

View File

@@ -82,10 +82,7 @@ export const profileStore = defineStore({
if (res.data.errors) {
return res.data;
}
this.services = [
{ value: "0", label: "All" },
...res.data.data.services,
] || [{ value: "0", label: "All" }];
this.services = res.data.data.services;
return res.data;
},
async getTaskList() {

View File

@@ -80,15 +80,15 @@ export const traceStore = defineStore({
if (res.data.errors) {
return res.data;
}
this.services = [
{ value: "0", label: "All" },
...res.data.data.services,
] || [{ value: "0", label: "All" }];
this.services = res.data.data.services;
return res.data;
},
async getInstances() {
async getInstances(id: string) {
const serviceId = this.selectorStore.currentService
? this.selectorStore.currentService.id
: id;
const res: AxiosResponse = await graphql.query("queryInstances").params({
serviceId: this.selectorStore.currentService.id,
serviceId: serviceId,
duration: this.durationTime,
});
@@ -101,9 +101,12 @@ export const traceStore = defineStore({
] || [{ value: " 0", label: "All" }];
return res.data;
},
async getEndpoints() {
async getEndpoints(id: string) {
const serviceId = this.selectorStore.currentService
? this.selectorStore.currentService.id
: id;
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
serviceId: this.selectorStore.currentService.id,
serviceId,
duration: this.durationTime,
keyword: "",
});