mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-01 17:34:23 +00:00
fix: set duration time (#88)
This commit is contained in:
parent
918791f7ed
commit
7f474984c4
@ -21,19 +21,6 @@ limitations under the License. -->
|
|||||||
</router-view>
|
</router-view>
|
||||||
</section>
|
</section>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
|
||||||
import { ElMessage } from "element-plus";
|
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
|
||||||
|
|
||||||
const appStore = useAppStoreWithOut();
|
|
||||||
if (!appStore.utc) {
|
|
||||||
const res = appStore.queryOAPTimeInfo();
|
|
||||||
|
|
||||||
if (res.errors) {
|
|
||||||
ElMessage.error(res.errors);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.app-main {
|
.app-main {
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px);
|
||||||
|
@ -94,9 +94,6 @@ watch(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
async function getVersion() {
|
async function getVersion() {
|
||||||
if (appStore.version) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const res = await appStore.fetchVersion();
|
const res = await appStore.fetchVersion();
|
||||||
if (res.errors) {
|
if (res.errors) {
|
||||||
ElMessage.error(res.errors);
|
ElMessage.error(res.errors);
|
||||||
|
@ -20,11 +20,18 @@ import router from "./router";
|
|||||||
import { store } from "./store";
|
import { store } from "./store";
|
||||||
import components from "@/components";
|
import components from "@/components";
|
||||||
import i18n from "./locales";
|
import i18n from "./locales";
|
||||||
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
import "./styles/index.ts";
|
import "./styles/index.ts";
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
|
const appStore = useAppStoreWithOut();
|
||||||
|
|
||||||
app.use(components);
|
app.use(components);
|
||||||
app.use(i18n);
|
app.use(i18n);
|
||||||
app.use(store);
|
app.use(store);
|
||||||
app.use(router).mount("#app");
|
mountApp();
|
||||||
|
|
||||||
|
async function mountApp() {
|
||||||
|
await appStore.queryOAPTimeInfo();
|
||||||
|
app.use(router).mount("#app");
|
||||||
|
}
|
||||||
|
@ -20,10 +20,8 @@ import { LayoutConfig } from "@/types/dashboard";
|
|||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
import query from "@/graphql/fetch";
|
import query from "@/graphql/fetch";
|
||||||
import { DashboardItem } from "@/types/dashboard";
|
import { DashboardItem } from "@/types/dashboard";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
|
||||||
import { useSelectorStore } from "@/store/modules/selectors";
|
import { useSelectorStore } from "@/store/modules/selectors";
|
||||||
import { NewControl, TextConfig } from "../data";
|
import { NewControl, TextConfig } from "../data";
|
||||||
import { Duration } from "@/types/app";
|
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
@ -35,7 +33,6 @@ interface DashboardState {
|
|||||||
entity: string;
|
entity: string;
|
||||||
layerId: string;
|
layerId: string;
|
||||||
activedGridItem: string;
|
activedGridItem: string;
|
||||||
durationTime: Duration;
|
|
||||||
selectorStore: any;
|
selectorStore: any;
|
||||||
showTopology: boolean;
|
showTopology: boolean;
|
||||||
currentTabItems: LayoutConfig[];
|
currentTabItems: LayoutConfig[];
|
||||||
@ -53,7 +50,6 @@ export const dashboardStore = defineStore({
|
|||||||
entity: "",
|
entity: "",
|
||||||
layerId: "",
|
layerId: "",
|
||||||
activedGridItem: "",
|
activedGridItem: "",
|
||||||
durationTime: useAppStoreWithOut().durationTime,
|
|
||||||
selectorStore: useSelectorStore(),
|
selectorStore: useSelectorStore(),
|
||||||
showTopology: false,
|
showTopology: false,
|
||||||
currentTabItems: [],
|
currentTabItems: [],
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Duration, Option } from "@/types/app";
|
import { Option } from "@/types/app";
|
||||||
import {
|
import {
|
||||||
EBPFTaskCreationRequest,
|
EBPFTaskCreationRequest,
|
||||||
EBPFProfilingSchedule,
|
EBPFProfilingSchedule,
|
||||||
@ -26,10 +26,8 @@ import { Trace, Span } from "@/types/trace";
|
|||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
|
||||||
|
|
||||||
interface EbpfStore {
|
interface EbpfStore {
|
||||||
durationTime: Duration;
|
|
||||||
taskList: EBPFTaskList[];
|
taskList: EBPFTaskList[];
|
||||||
eBPFSchedules: EBPFProfilingSchedule[];
|
eBPFSchedules: EBPFProfilingSchedule[];
|
||||||
currentSchedule: EBPFProfilingSchedule | Record<string, never>;
|
currentSchedule: EBPFProfilingSchedule | Record<string, never>;
|
||||||
@ -42,7 +40,6 @@ interface EbpfStore {
|
|||||||
export const ebpfStore = defineStore({
|
export const ebpfStore = defineStore({
|
||||||
id: "eBPF",
|
id: "eBPF",
|
||||||
state: (): EbpfStore => ({
|
state: (): EbpfStore => ({
|
||||||
durationTime: useAppStoreWithOut().durationTime,
|
|
||||||
taskList: [],
|
taskList: [],
|
||||||
eBPFSchedules: [],
|
eBPFSchedules: [],
|
||||||
currentSchedule: {},
|
currentSchedule: {},
|
||||||
|
@ -42,7 +42,6 @@ export const eventStore = defineStore({
|
|||||||
instances: [{ value: "", label: "All" }],
|
instances: [{ value: "", label: "All" }],
|
||||||
endpoints: [{ value: "", label: "All" }],
|
endpoints: [{ value: "", label: "All" }],
|
||||||
condition: {
|
condition: {
|
||||||
time: useAppStoreWithOut().durationTime,
|
|
||||||
paging: { pageNum: 1, pageSize: 15, needTotal: true },
|
paging: { pageNum: 1, pageSize: 15, needTotal: true },
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -94,9 +93,12 @@ export const eventStore = defineStore({
|
|||||||
},
|
},
|
||||||
async getEvents() {
|
async getEvents() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const res: AxiosResponse = await graphql
|
const res: AxiosResponse = await graphql.query("queryEvents").params({
|
||||||
.query("queryEvents")
|
condition: {
|
||||||
.params({ condition: this.condition });
|
...this.condition,
|
||||||
|
time: useAppStoreWithOut().durationTime,
|
||||||
|
},
|
||||||
|
});
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
return res.data;
|
return res.data;
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Duration } from "@/types/app";
|
|
||||||
import { Instance, Endpoint, Service } from "@/types/selector";
|
import { Instance, Endpoint, Service } from "@/types/selector";
|
||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
@ -29,7 +28,6 @@ interface LogState {
|
|||||||
instances: Instance[];
|
instances: Instance[];
|
||||||
endpoints: Endpoint[];
|
endpoints: Endpoint[];
|
||||||
conditions: any;
|
conditions: any;
|
||||||
durationTime: Duration;
|
|
||||||
selectorStore: any;
|
selectorStore: any;
|
||||||
supportQueryLogsByKeywords: boolean;
|
supportQueryLogsByKeywords: boolean;
|
||||||
logs: any[];
|
logs: any[];
|
||||||
@ -48,7 +46,6 @@ export const logStore = defineStore({
|
|||||||
paging: { pageNum: 1, pageSize: 15, needTotal: true },
|
paging: { pageNum: 1, pageSize: 15, needTotal: true },
|
||||||
},
|
},
|
||||||
supportQueryLogsByKeywords: true,
|
supportQueryLogsByKeywords: true,
|
||||||
durationTime: useAppStoreWithOut().durationTime,
|
|
||||||
selectorStore: useSelectorStore(),
|
selectorStore: useSelectorStore(),
|
||||||
logs: [],
|
logs: [],
|
||||||
logsTotal: 0,
|
logsTotal: 0,
|
||||||
@ -74,7 +71,7 @@ export const logStore = defineStore({
|
|||||||
: id;
|
: id;
|
||||||
const res: AxiosResponse = await graphql.query("queryInstances").params({
|
const res: AxiosResponse = await graphql.query("queryInstances").params({
|
||||||
serviceId,
|
serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
@ -92,7 +89,7 @@ export const logStore = defineStore({
|
|||||||
: id;
|
: id;
|
||||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
||||||
serviceId,
|
serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
keyword: keyword || "",
|
keyword: keyword || "",
|
||||||
});
|
});
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Duration } from "@/types/app";
|
|
||||||
import { Endpoint } from "@/types/selector";
|
import { Endpoint } from "@/types/selector";
|
||||||
import {
|
import {
|
||||||
TaskListItem,
|
TaskListItem,
|
||||||
@ -33,7 +32,6 @@ import { useAppStoreWithOut } from "@/store/modules/app";
|
|||||||
interface ProfileState {
|
interface ProfileState {
|
||||||
endpoints: Endpoint[];
|
endpoints: Endpoint[];
|
||||||
taskEndpoints: Endpoint[];
|
taskEndpoints: Endpoint[];
|
||||||
durationTime: Duration;
|
|
||||||
condition: { serviceId: string; endpointName: string };
|
condition: { serviceId: string; endpointName: string };
|
||||||
taskList: TaskListItem[];
|
taskList: TaskListItem[];
|
||||||
segmentList: Trace[];
|
segmentList: Trace[];
|
||||||
@ -50,7 +48,6 @@ export const profileStore = defineStore({
|
|||||||
state: (): ProfileState => ({
|
state: (): ProfileState => ({
|
||||||
endpoints: [{ value: "", label: "All" }],
|
endpoints: [{ value: "", label: "All" }],
|
||||||
taskEndpoints: [{ value: "", label: "All" }],
|
taskEndpoints: [{ value: "", label: "All" }],
|
||||||
durationTime: useAppStoreWithOut().durationTime,
|
|
||||||
condition: { serviceId: "", endpointName: "" },
|
condition: { serviceId: "", endpointName: "" },
|
||||||
taskList: [],
|
taskList: [],
|
||||||
segmentList: [],
|
segmentList: [],
|
||||||
@ -80,7 +77,7 @@ export const profileStore = defineStore({
|
|||||||
async getEndpoints(serviceId: string, keyword?: string) {
|
async getEndpoints(serviceId: string, keyword?: string) {
|
||||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
||||||
serviceId,
|
serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
keyword: keyword || "",
|
keyword: keyword || "",
|
||||||
});
|
});
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
@ -92,7 +89,7 @@ export const profileStore = defineStore({
|
|||||||
async getTaskEndpoints(serviceId: string, keyword?: string) {
|
async getTaskEndpoints(serviceId: string, keyword?: string) {
|
||||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
||||||
serviceId,
|
serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
keyword: keyword || "",
|
keyword: keyword || "",
|
||||||
});
|
});
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
|
@ -15,13 +15,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Duration } from "@/types/app";
|
|
||||||
import { Service, Instance, Endpoint } from "@/types/selector";
|
import { Service, Instance, Endpoint } from "@/types/selector";
|
||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
import graphql from "@/graphql";
|
import graphql from "@/graphql";
|
||||||
import { AxiosResponse } from "axios";
|
import { AxiosResponse } from "axios";
|
||||||
import { useAppStoreWithOut } from "@/store/modules/app";
|
import { useAppStoreWithOut } from "@/store/modules/app";
|
||||||
|
|
||||||
interface SelectorState {
|
interface SelectorState {
|
||||||
services: Service[];
|
services: Service[];
|
||||||
destServices: Service[];
|
destServices: Service[];
|
||||||
@ -31,7 +29,6 @@ interface SelectorState {
|
|||||||
currentDestService: Nullable<Service>;
|
currentDestService: Nullable<Service>;
|
||||||
currentDestPod: Nullable<Instance | Endpoint>;
|
currentDestPod: Nullable<Instance | Endpoint>;
|
||||||
destPods: Array<Instance | Endpoint>;
|
destPods: Array<Instance | Endpoint>;
|
||||||
durationTime: Duration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const selectorStore = defineStore({
|
export const selectorStore = defineStore({
|
||||||
@ -45,7 +42,6 @@ export const selectorStore = defineStore({
|
|||||||
currentPod: null,
|
currentPod: null,
|
||||||
currentDestService: null,
|
currentDestService: null,
|
||||||
currentDestPod: null,
|
currentDestPod: null,
|
||||||
durationTime: useAppStoreWithOut().durationTime,
|
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setCurrentService(service: Nullable<Service>) {
|
setCurrentService(service: Nullable<Service>) {
|
||||||
@ -86,7 +82,7 @@ export const selectorStore = defineStore({
|
|||||||
}
|
}
|
||||||
const res: AxiosResponse = await graphql.query("queryInstances").params({
|
const res: AxiosResponse = await graphql.query("queryInstances").params({
|
||||||
serviceId,
|
serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
});
|
});
|
||||||
if (!res.data.errors) {
|
if (!res.data.errors) {
|
||||||
if (param && param.isRelation) {
|
if (param && param.isRelation) {
|
||||||
@ -112,7 +108,7 @@ export const selectorStore = defineStore({
|
|||||||
}
|
}
|
||||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
||||||
serviceId,
|
serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
keyword: params.keyword || "",
|
keyword: params.keyword || "",
|
||||||
limit: params.limit,
|
limit: params.limit,
|
||||||
});
|
});
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import { Duration } from "@/types/app";
|
|
||||||
import { Instance, Endpoint, Service } from "@/types/selector";
|
import { Instance, Endpoint, Service } from "@/types/selector";
|
||||||
import { Trace, Span } from "@/types/trace";
|
import { Trace, Span } from "@/types/trace";
|
||||||
import { store } from "@/store";
|
import { store } from "@/store";
|
||||||
@ -35,10 +34,6 @@ interface TraceState {
|
|||||||
conditions: any;
|
conditions: any;
|
||||||
traceSpanLogs: any[];
|
traceSpanLogs: any[];
|
||||||
traceSpanLogsTotal: number;
|
traceSpanLogsTotal: number;
|
||||||
// traceListErrors: string;
|
|
||||||
// traceSpanErrors: string;
|
|
||||||
// traceSpanLogErrors: string;
|
|
||||||
durationTime: Duration;
|
|
||||||
selectorStore: any;
|
selectorStore: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,12 +55,11 @@ export const traceStore = defineStore({
|
|||||||
},
|
},
|
||||||
traceSpanLogs: [],
|
traceSpanLogs: [],
|
||||||
traceSpanLogsTotal: 0,
|
traceSpanLogsTotal: 0,
|
||||||
durationTime: useAppStoreWithOut().durationTime,
|
|
||||||
selectorStore: useSelectorStore(),
|
selectorStore: useSelectorStore(),
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
setTraceCondition(data: any) {
|
setTraceCondition(data: any) {
|
||||||
this.condition = { ...this.condition, ...data };
|
this.conditions = { ...this.conditions, ...data };
|
||||||
},
|
},
|
||||||
setCurrentTrace(trace: Trace) {
|
setCurrentTrace(trace: Trace) {
|
||||||
this.currentTrace = trace;
|
this.currentTrace = trace;
|
||||||
@ -89,7 +83,7 @@ export const traceStore = defineStore({
|
|||||||
: id;
|
: id;
|
||||||
const res: AxiosResponse = await graphql.query("queryInstances").params({
|
const res: AxiosResponse = await graphql.query("queryInstances").params({
|
||||||
serviceId: serviceId,
|
serviceId: serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
@ -104,7 +98,7 @@ export const traceStore = defineStore({
|
|||||||
: id;
|
: id;
|
||||||
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
const res: AxiosResponse = await graphql.query("queryEndpoints").params({
|
||||||
serviceId,
|
serviceId,
|
||||||
duration: this.durationTime,
|
duration: useAppStoreWithOut().durationTime,
|
||||||
keyword: keyword || "",
|
keyword: keyword || "",
|
||||||
});
|
});
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
@ -116,7 +110,7 @@ export const traceStore = defineStore({
|
|||||||
async getTraces() {
|
async getTraces() {
|
||||||
const res: AxiosResponse = await graphql
|
const res: AxiosResponse = await graphql
|
||||||
.query("queryTraces")
|
.query("queryTraces")
|
||||||
.params({ condition: this.condition });
|
.params({ condition: this.conditions });
|
||||||
if (res.data.errors) {
|
if (res.data.errors) {
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user