feat: 添加代码片段.
This commit is contained in:
@@ -12,11 +12,13 @@ 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';
|
||||
import { getCommandSnippetGroupList } from '@/api/asset/command-snippet-group';
|
||||
|
||||
export type CacheType = 'users' | 'menus' | 'roles'
|
||||
| 'hosts' | 'hostGroups' | 'hostKeys' | 'hostIdentities'
|
||||
| 'dictKeys'
|
||||
| 'authorizedHostKeys' | 'authorizedHostIdentities'
|
||||
| 'commandSnippetGroups'
|
||||
| string
|
||||
|
||||
export default defineStore('cache', {
|
||||
@@ -111,5 +113,10 @@ export default defineStore('cache', {
|
||||
return await this.load('authorizedHostIdentities', getCurrentAuthorizedHostIdentity, force);
|
||||
},
|
||||
|
||||
// 获取命令片段分组
|
||||
async loadCommandSnippetGroups(force = false) {
|
||||
return await this.load('commandSnippetGroups', getCommandSnippetGroupList, force);
|
||||
},
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user