refactor: optimize data types for widgets and dashboards (#490)

This commit is contained in:
Fine0830
2025-08-14 18:25:40 +08:00
committed by GitHub
parent e885b61353
commit 54a700bf19
141 changed files with 972 additions and 743 deletions

View File

@@ -88,7 +88,7 @@ export const selectorStore = defineStore({
}
return res.data;
},
async getServiceInstances(param?: { serviceId: string; isRelation: boolean }) {
async getServiceInstances(param?: { serviceId: string; isRelation?: boolean }) {
const serviceId = param ? param.serviceId : this.currentService?.id;
if (!serviceId) {
return new Promise((resolve) => resolve({ errors: "Service ID is required" }));
@@ -106,7 +106,7 @@ export const selectorStore = defineStore({
}
return resp;
},
async getProcesses(param?: { instanceId: string; isRelation: boolean }) {
async getProcesses(param?: { instanceId: string | undefined; isRelation?: boolean }) {
const instanceId = param ? param.instanceId : this.currentPod?.id;
if (!instanceId) {
return null;
@@ -147,7 +147,7 @@ export const selectorStore = defineStore({
}
return res;
},
async getService(serviceId: string, isRelation: boolean) {
async getService(serviceId: string, isRelation?: boolean) {
if (!serviceId) {
return;
}
@@ -185,7 +185,7 @@ export const selectorStore = defineStore({
return res;
},
async getEndpoint(endpointId: string, isRelation?: string) {
async getEndpoint(endpointId: string, isRelation?: boolean) {
if (!endpointId) {
return;
}
@@ -226,6 +226,6 @@ export const selectorStore = defineStore({
},
});
export function useSelectorStore(): Recordable {
export function useSelectorStore() {
return selectorStore(store);
}