feat: 添加代码片段.

This commit is contained in:
lijiahangmax
2024-01-26 00:35:05 +08:00
parent ac2376842a
commit 6497124554
11 changed files with 271 additions and 55 deletions

View File

@@ -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);
},
}
});