本文整理匯總了Golang中github.com/dorzheh/deployer/ui/dialog_ui.DialogUi.SetExtraLabel方法的典型用法代碼示例。如果您正苦於以下問題:Golang DialogUi.SetExtraLabel方法的具體用法?Golang DialogUi.SetExtraLabel怎麽用?Golang DialogUi.SetExtraLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/dorzheh/deployer/ui/dialog_ui.DialogUi
的用法示例。
在下文中一共展示了DialogUi.SetExtraLabel方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: uiNUMATopologyHeader
func uiNUMATopologyHeader(ui *gui.DialogUi, c *guest.Config) string {
ui.HelpButton(true)
ui.SetHelpLabel("Back")
ui.SetTitle("VA NUMA Configuration")
ui.SetExtraLabel("Edit")
var hdr string
for _, n := range c.NUMAs {
for _, nic := range n.NICs {
if nic.HostNIC.Type == host.NicTypePhys || nic.HostNIC.Type == host.NicTypePhysVF {
hdr += fmt.Sprintf("\nNUMA %d: %s", nic.HostNIC.NUMANode, nic.HostNIC.PCIAddr)
}
}
}
hdr += "\n"
if hdr != "\n" {
hdr = " \n---------------- PCI Devices Topology ---------------" + hdr
hdr += "-----------------------------------------------------\n\n"
}
hdr += " __________________ CPU/NUMA Topology ________________\n"
hdr += "|____________ VA ___________|_________ Host __________|\n"
hdr += "|____ vCPU ___|___ vNUMA ___|_________CPU(s) _________|"
return hdr
}
示例2: UiEulaMsg
// UiEulaMsg prints out appropriate EULA message
func UiEulaMsg(ui *gui.DialogUi, pathToEula string) {
ui.SetOkLabel("Agree")
ui.SetExtraLabel("Disagree")
ui.SetTitle("End User License Agreement")
ui.SetSize(30, 80)
if err := ui.Textbox(pathToEula); err != nil {
os.Exit(1)
}
}
示例3: uiHeaderSelectNics
func uiHeaderSelectNics(ui *gui.DialogUi) int {
str := " ___________________________________________________________________________________________________________________________"
width := len(str)
str += "\n|____________________________________________________HOST__________________________________________________________|___VM___|"
str += fmt.Sprintf("\n|________%s________|__%s__|_______________ %s _________________|__%s__|__%s__|", "Port Name", "PCI Address", "Network Interface Description", "NUMA", "Port")
ui.SetLabel(str)
ui.SetExtraLabel("Next")
ui.SetOkLabel("Select")
ui.HelpButton(true)
ui.SetHelpLabel("Back")
return width
}
示例4: uiNetworkPolicySelector
func uiNetworkPolicySelector(ui *gui.DialogUi, net *xmlinput.Network) ([]xmlinput.ConnectionMode, error) {
matrix := make(map[string][]xmlinput.ConnectionMode)
for _, mode := range net.UiModeBinding {
if _, ok := matrix[mode.Appear]; !ok {
matrix[mode.Appear] = make([]xmlinput.ConnectionMode, 0)
}
matrix[mode.Appear] = append(matrix[mode.Appear], mode.Type)
}
var temp []string
index := 1
for appear, _ := range matrix {
temp = append(temp, strconv.Itoa(index), appear)
index++
}
length := len(matrix)
ui.SetSize(length+8, 50)
ui.SetTitle(fmt.Sprintf("Network interface type for network \"%s\"", net.Name))
ui.HelpButton(true)
ui.SetHelpLabel("Back")
if net.Optional {
ui.SetExtraLabel("Skip")
}
val, err := ui.Menu(length, temp[0:]...)
if err != nil {
return nil, err
}
resultInt, err := strconv.Atoi(val)
if err != nil {
return nil, utils.FormatError(err)
}
if resultInt != 1 {
resultInt++
}
return matrix[temp[resultInt]], nil
}
示例5: UiNUMATopology
//.........這裏部分代碼省略.........
// file.WriteString("k: " + strconv.Itoa(k) + " v: " + v + " \n")
}
}
hCPUnotOnce = ""
for k_dup, v_dup := range duplicate_frequency {
if v_dup > 1 {
hCPUnotOnce = k_dup
break
}
}
ui.SetLabel(uiNUMATopologyHeader(ui, c))
result, err := ui.Menu(len(list), list[0:]...)
// file.WriteString("[UiNUMATopology] result: " + result + " err: " + err.Error() + " len(list): " + strconv.Itoa(len(list)) + " \n")
if err == nil {
if hCPUnotOnce != "" && isChanged && CheckIfCPUdoubleUsed {
ui.Output(gui.Warning, "CPU "+hCPUnotOnce+" is assigned to more than one vCPU")
continue
}
break
}
if err.Error() != gui.DialogNext {
// file.WriteString("[UiNUMATopology] err.Error() != gui.DialogNext " + err.Error() + " \n")
return isChanged, err
}
InternalLoop:
for {
// file.WriteString("[UiNUMATopology] InternalLoop: \n")
ui.SetTitle("VA vCPU Configuration")
ui.SetExtraLabel("Help")
// file.WriteString("result: (" + result + ") \n")
resultInt, err := strconv.Atoi(result)
if err != nil {
// file.WriteString("[UiNUMATopology] strconv.Atoi(result) " + err.Error() + "\n")
return isChanged, err
}
var vnumaStr string
var cpusStr string
tempDataLen := len(tempData)
for k, v := range tempData[resultInt] {
vnumaStr = strconv.Itoa(k)
cpusStr = v
// tempDataLen++
}
// file.WriteString("resultInt: (" + result + ") \n")
// DE11527
index := resultInt
resultInt--
// var vnumaPredecStr string
// for k, _ := range tempData[resultInt] {
// vnumaPredecStr = strconv.Itoa(k)
// // file.WriteString("vnumaPredecStr: (" + vnumaPredecStr + ") ")
// }
var lst []string
label := "Set affinity for vCPU " + result
var vnumaMinus1 string
var vnumaPlus1 string
var vnumaIndex string