UNPKG

@sentry0/qemu-hook-manager

Version:
2 lines (1 loc) 744 B
import{fetchIommuGroups as a,fetchActiveDomains as i}from"./general.js";import{fetchAllDomains as l}from"./virsh.js";const m=async()=>{const t=await a(),o=await l(),s=await i();return[{type:"toggle",name:"useOwnHooks",message:"Will you use your own hooks?",initial:!1,active:"yes",inactive:"no"},{type:e=>e?"text":null,name:"hooksDir",message:"Enter the path to your hooks"},{type:"multiselect",name:"iommuGroups",message:"Select the hardware to toggle passthrough for",choices:t.map(e=>({title:e,value:e.substring(0,7),selected:!1})),min:1},{type:"multiselect",name:"domains",message:"Select a domain to toggle passthrough on or unselect to disable",choices:o.map(e=>({title:e,value:e,selected:s.includes(e)}))}]};export{m as buildQuestions};