feat: 修改主机额外配置.
This commit is contained in:
15
orion-ops-ui/src/store/modules/cache/index.ts
vendored
15
orion-ops-ui/src/store/modules/cache/index.ts
vendored
@@ -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);
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -16,6 +16,8 @@ export interface CacheState {
|
||||
hostKeys?: HostKeyQueryResponse[];
|
||||
hostIdentities?: HostIdentityQueryResponse[];
|
||||
dictKeys?: DictKeyQueryResponse[];
|
||||
authorizedHostKeys?: HostKeyQueryResponse[];
|
||||
authorizedHostIdentities?: HostIdentityQueryResponse[];
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user