feat: 保存主机分组数据.

This commit is contained in:
lijiahang
2023-11-14 15:05:47 +08:00
parent b07d1d1d19
commit 4202890d07
13 changed files with 148 additions and 85 deletions

View File

@@ -1,13 +1,16 @@
import type { CacheState } from './types';
import { defineStore } from 'pinia';
export type CacheType = 'users' | 'menus' | 'roles' | 'hostTags' | 'hostKeys' | 'hostIdentities' | 'dictKeys' | string
export type CacheType = 'users' | 'menus' | 'roles'
| 'host' | 'hostTags' | 'hostKeys' | 'hostIdentities'
| 'dictKeys' | string
export default defineStore('cache', {
state: (): CacheState => ({
users: [],
menus: [],
roles: [],
hosts: [],
hostTags: [],
hostKeys: [],
hostIdentities: [],

View File

@@ -5,12 +5,14 @@ import type { TagQueryResponse } from '@/api/meta/tag';
import type { HostKeyQueryResponse } from '@/api/asset/host-key';
import type { HostIdentityQueryResponse } from '@/api/asset/host-identity';
import type { DictKeyQueryResponse } from '@/api/system/dict-key';
import type { HostQueryResponse } from '@/api/asset/host';
export interface CacheState {
users: UserQueryResponse[];
menus: MenuQueryResponse[];
roles: RoleQueryResponse[];
hostTags: TagQueryResponse[];
hosts: HostQueryResponse[];
hostKeys: HostKeyQueryResponse[];
hostIdentities: HostIdentityQueryResponse[];
dictKeys: DictKeyQueryResponse[];