From c60ab4d2b8e6a6f549114e3e4b03e85b574318d7 Mon Sep 17 00:00:00 2001 From: Alexander Schulz Date: Sat, 11 May 2019 23:05:20 +0200 Subject: [PATCH] show bios strings as a new panel in the hosts general tab https://github.com/xcp-ng/xenadmin/issues/147 --- XenAdmin/TabPages/GeneralTabPage.Designer.cs | 20 ++++ XenAdmin/TabPages/GeneralTabPage.cs | 18 ++++ XenAdmin/TabPages/GeneralTabPage.resx | 104 +++++++++++++++---- 3 files changed, 123 insertions(+), 19 deletions(-) diff --git a/XenAdmin/TabPages/GeneralTabPage.Designer.cs b/XenAdmin/TabPages/GeneralTabPage.Designer.cs index 8caa89ee7..a9d39594a 100644 --- a/XenAdmin/TabPages/GeneralTabPage.Designer.cs +++ b/XenAdmin/TabPages/GeneralTabPage.Designer.cs @@ -79,6 +79,8 @@ namespace XenAdmin.TabPages this.pdSectionCustomFields = new XenAdmin.Controls.PDSection(); this.panelGeneral = new System.Windows.Forms.Panel(); this.pdSectionGeneral = new XenAdmin.Controls.PDSection(); + this.panelBios = new System.Windows.Forms.Panel(); + this.pdSectionBios = new XenAdmin.Controls.PDSection(); this.pageContainerPanel.SuspendLayout(); this.panel1.SuspendLayout(); this.panel3.SuspendLayout(); @@ -103,6 +105,7 @@ namespace XenAdmin.TabPages this.panelManagementInterfaces.SuspendLayout(); this.panelCustomFields.SuspendLayout(); this.panelGeneral.SuspendLayout(); + this.panelBios.SuspendLayout(); this.SuspendLayout(); // // pageContainerPanel @@ -188,6 +191,7 @@ namespace XenAdmin.TabPages this.panel2.Controls.Add(this.panelVersion); this.panel2.Controls.Add(this.panelMemory); this.panel2.Controls.Add(this.panelManagementInterfaces); + this.panel2.Controls.Add(this.panelBios); this.panel2.Controls.Add(this.panelCustomFields); this.panel2.Controls.Add(this.panelGeneral); this.panel2.Name = "panel2"; @@ -454,6 +458,19 @@ namespace XenAdmin.TabPages this.pdSectionGeneral.ShowCellToolTips = false; this.pdSectionGeneral.ExpandedChanged += new System.Action(this.pdSection_ExpandedChanged); // + // panelBios + // + resources.ApplyResources(this.panelBios, "panelBios"); + this.panelBios.Controls.Add(this.pdSectionBios); + this.panelBios.Name = "panelBios"; + // + // pdSectionBios + // + this.pdSectionBios.BackColor = System.Drawing.Color.Gainsboro; + resources.ApplyResources(this.pdSectionBios, "pdSectionBios"); + this.pdSectionBios.Name = "pdSectionBios"; + this.pdSectionBios.ShowCellToolTips = false; + // // GeneralTabPage // resources.ApplyResources(this, "$this"); @@ -486,6 +503,7 @@ namespace XenAdmin.TabPages this.panelManagementInterfaces.ResumeLayout(false); this.panelCustomFields.ResumeLayout(false); this.panelGeneral.ResumeLayout(false); + this.panelBios.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -540,5 +558,7 @@ namespace XenAdmin.TabPages private System.Windows.Forms.Button buttonViewConsole; private System.Windows.Forms.Button buttonViewLog; private System.Windows.Forms.FlowLayoutPanel buttonPanel; + private System.Windows.Forms.Panel panelBios; + private Controls.PDSection pdSectionBios; } } diff --git a/XenAdmin/TabPages/GeneralTabPage.cs b/XenAdmin/TabPages/GeneralTabPage.cs index eeb595ee9..b9b3f7278 100644 --- a/XenAdmin/TabPages/GeneralTabPage.cs +++ b/XenAdmin/TabPages/GeneralTabPage.cs @@ -503,6 +503,7 @@ namespace XenAdmin.TabPages { generateGeneralBox(); generateCustomFieldsBox(); + generateBiosBox(); generateInterfaceBox(); generateMemoryBox(); generateVersionBox(); @@ -607,6 +608,23 @@ namespace XenAdmin.TabPages } } + private void generateBiosBox() + { + PDSection s = pdSectionBios; + + Host host = xenObject as Host; + if (host != null) + { + if (host.bios_strings != null) + { + foreach (var entry in host.bios_strings) + { + s.AddEntry(entry.Key, entry.Value); + } + } + } + } + private void generateCustomFieldsBox() { List customFields = CustomFieldsManager.CustomFieldValues(xenObject); diff --git a/XenAdmin/TabPages/GeneralTabPage.resx b/XenAdmin/TabPages/GeneralTabPage.resx index 698625b16..571170d59 100644 --- a/XenAdmin/TabPages/GeneralTabPage.resx +++ b/XenAdmin/TabPages/GeneralTabPage.resx @@ -169,7 +169,7 @@ Top - 0, 792 + 0, 836 0, 5, 0, 5 @@ -235,7 +235,7 @@ Top - 0, 748 + 0, 792 0, 5, 0, 5 @@ -301,7 +301,7 @@ Top - 0, 704 + 0, 748 0, 5, 0, 5 @@ -367,7 +367,7 @@ Top - 0, 660 + 0, 704 0, 5, 0, 5 @@ -433,7 +433,7 @@ Top - 0, 616 + 0, 660 0, 5, 0, 5 @@ -499,7 +499,7 @@ Top - 0, 572 + 0, 616 0, 5, 0, 5 @@ -565,7 +565,7 @@ Top - 0, 528 + 0, 572 0, 5, 0, 5 @@ -631,7 +631,7 @@ Top - 0, 484 + 0, 528 0, 5, 0, 5 @@ -697,7 +697,7 @@ Top - 0, 440 + 0, 484 0, 5, 0, 5 @@ -763,7 +763,7 @@ Top - 0, 396 + 0, 440 0, 5, 0, 5 @@ -829,7 +829,7 @@ Top - 0, 352 + 0, 396 0, 5, 0, 5 @@ -895,7 +895,7 @@ Top - 0, 308 + 0, 352 0, 5, 0, 5 @@ -961,7 +961,7 @@ Top - 0, 264 + 0, 308 0, 5, 0, 5 @@ -1027,7 +1027,7 @@ Top - 0, 220 + 0, 264 0, 5, 0, 5 @@ -1093,7 +1093,7 @@ Top - 0, 176 + 0, 220 0, 5, 0, 5 @@ -1159,7 +1159,7 @@ Top - 0, 132 + 0, 176 0, 5, 0, 5 @@ -1225,7 +1225,7 @@ Top - 0, 88 + 0, 132 0, 5, 0, 5 @@ -1248,6 +1248,72 @@ 16 + + True + + + GrowAndShrink + + + Top + + + 0, 5 + + + 0, 34 + + + 1, 1, 1, 1 + + + BIOS + + + 712, 34 + + + 0 + + + pdSectionBios + + + XenAdmin.Controls.PDSection, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + panelBios + + + 0 + + + Top + + + 0, 88 + + + 0, 5, 0, 5 + + + 712, 44 + + + 1 + + + panelBios + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 17 + True @@ -1312,7 +1378,7 @@ panel2 - 17 + 18 True @@ -1378,7 +1444,7 @@ panel2 - 18 + 19 10, 39