update types

This commit is contained in:
Fine 2025-05-28 10:10:27 +08:00
parent 2c5f145f5c
commit cd191866a9
2 changed files with 15 additions and 1 deletions

View File

@ -17,11 +17,13 @@
import { defineStore } from "pinia";
import { store } from "@/store";
import fetchQuery from "@/graphql/http";
import type { Cluster } from "@/types/settings";
import type { Cluster, ConfigTTL } from "@/types/settings";
interface SettingsState {
loading: boolean;
clusterNodes: Cluster[];
debuggingConfig: Indexable<string>;
configTTL: Recordable<ConfigTTL>;
}
export const settingsStore = defineStore({
@ -29,6 +31,8 @@ export const settingsStore = defineStore({
state: (): SettingsState => ({
clusterNodes: [],
loading: false,
debuggingConfig: {},
configTTL: {},
}),
actions: {
async getClusterNodes() {
@ -47,6 +51,7 @@ export const settingsStore = defineStore({
path: "ConfigTTL",
});
this.loading = false;
this.configTTL = res;
return res;
},
async getDebuggingConfigDump() {
@ -56,6 +61,7 @@ export const settingsStore = defineStore({
path: "DebuggingConfigDump",
});
this.loading = false;
this.debuggingConfig = res;
return res;
},
},

View File

@ -14,8 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { MetricsTTL, RecordsTTL } from "@/types/app";
export type Cluster = {
host: string;
port: number;
isSelf: boolean;
};
export type ConfigTTL = {
metrics: MetricsTTL;
records: RecordsTTL;
};