feat: 修改主机额外配置.

This commit is contained in:
lijiahang
2023-12-25 19:03:24 +08:00
parent b2a697f6ba
commit f7cbd7b507
34 changed files with 321 additions and 59 deletions

View File

@@ -11,10 +11,13 @@ import { getHostIdentityList } from '@/api/asset/host-identity';
import { getHostList } from '@/api/asset/host';
import { getHostGroupTree } from '@/api/asset/host-group';
import { getMenuList } from '@/api/system/menu';
import { getCurrentAuthorizedHostIdentity, getCurrentAuthorizedHostKey } from '@/api/asset/asset-authorized-data';
export type CacheType = 'users' | 'menus' | 'roles'
| 'host' | 'hostGroups' | 'hostKeys' | 'hostIdentities'
| 'dictKeys' | string
| 'dictKeys'
| 'authorizedHostKeys' | 'authorizedHostIdentities'
| string
export default defineStore('cache', {
state: (): CacheState => ({}),
@@ -98,5 +101,15 @@ export default defineStore('cache', {
return await this.load(`${type}_Tags`, () => getTagList(type), force);
},
// 获取已授权的主机秘钥列表
async loadAuthorizedHostKeys(force = false) {
return await this.load('authorizedHostKeys', getCurrentAuthorizedHostKey, force);
},
// 获取已授权的主机身份列表
async loadAuthorizedHostIdentities(force = false) {
return await this.load('authorizedHostIdentities', getCurrentAuthorizedHostIdentity, force);
},
}
});

View File

@@ -16,6 +16,8 @@ export interface CacheState {
hostKeys?: HostKeyQueryResponse[];
hostIdentities?: HostIdentityQueryResponse[];
dictKeys?: DictKeyQueryResponse[];
authorizedHostKeys?: HostKeyQueryResponse[];
authorizedHostIdentities?: HostIdentityQueryResponse[];
[key: string]: unknown;
}