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

View File

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