feat: 保存主机分组数据.
This commit is contained in:
@@ -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: [],
|
||||
|
||||
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user