show bios strings as a new panel in the hosts general tab

https://github.com/xcp-ng/xenadmin/issues/147
This commit is contained in:
Alexander Schulz 2019-05-11 23:05:20 +02:00
parent 4cd256f33c
commit c60ab4d2b8
3 changed files with 123 additions and 19 deletions

View File

@ -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<XenAdmin.Controls.PDSection>(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;
}
}

View File

@ -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<CustomField> customFields = CustomFieldsManager.CustomFieldValues(xenObject);

View File

@ -169,7 +169,7 @@
<value>Top</value>
</data>
<data name="panelReadCaching.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 792</value>
<value>0, 836</value>
</data>
<data name="panelReadCaching.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -235,7 +235,7 @@
<value>Top</value>
</data>
<data name="panelDockerInfo.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 748</value>
<value>0, 792</value>
</data>
<data name="panelDockerInfo.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -301,7 +301,7 @@
<value>Top</value>
</data>
<data name="panelDockerVersion.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 704</value>
<value>0, 748</value>
</data>
<data name="panelDockerVersion.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -367,7 +367,7 @@
<value>Top</value>
</data>
<data name="panelStorageLinkSystemCapabilities.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 660</value>
<value>0, 704</value>
</data>
<data name="panelStorageLinkSystemCapabilities.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -433,7 +433,7 @@
<value>Top</value>
</data>
<data name="panelMultipathBoot.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 616</value>
<value>0, 660</value>
</data>
<data name="panelMultipathBoot.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -499,7 +499,7 @@
<value>Top</value>
</data>
<data name="panelStorageLink.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 572</value>
<value>0, 616</value>
</data>
<data name="panelStorageLink.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -565,7 +565,7 @@
<value>Top</value>
</data>
<data name="panelUpdates.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 528</value>
<value>0, 572</value>
</data>
<data name="panelUpdates.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -631,7 +631,7 @@
<value>Top</value>
</data>
<data name="panelMemoryAndVCPUs.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 484</value>
<value>0, 528</value>
</data>
<data name="panelMemoryAndVCPUs.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -697,7 +697,7 @@
<value>Top</value>
</data>
<data name="panelMultipathing.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 440</value>
<value>0, 484</value>
</data>
<data name="panelMultipathing.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -763,7 +763,7 @@
<value>Top</value>
</data>
<data name="panelStatus.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 396</value>
<value>0, 440</value>
</data>
<data name="panelStatus.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -829,7 +829,7 @@
<value>Top</value>
</data>
<data name="panelHighAvailability.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 352</value>
<value>0, 396</value>
</data>
<data name="panelHighAvailability.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -895,7 +895,7 @@
<value>Top</value>
</data>
<data name="panelBootOptions.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 308</value>
<value>0, 352</value>
</data>
<data name="panelBootOptions.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -961,7 +961,7 @@
<value>Top</value>
</data>
<data name="panelCPU.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 264</value>
<value>0, 308</value>
</data>
<data name="panelCPU.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -1027,7 +1027,7 @@
<value>Top</value>
</data>
<data name="panelLicense.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 220</value>
<value>0, 264</value>
</data>
<data name="panelLicense.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -1093,7 +1093,7 @@
<value>Top</value>
</data>
<data name="panelVersion.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 176</value>
<value>0, 220</value>
</data>
<data name="panelVersion.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -1159,7 +1159,7 @@
<value>Top</value>
</data>
<data name="panelMemory.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 132</value>
<value>0, 176</value>
</data>
<data name="panelMemory.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -1225,7 +1225,7 @@
<value>Top</value>
</data>
<data name="panelManagementInterfaces.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 88</value>
<value>0, 132</value>
</data>
<data name="panelManagementInterfaces.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
@ -1248,6 +1248,72 @@
<data name="&gt;&gt;panelManagementInterfaces.ZOrder" xml:space="preserve">
<value>16</value>
</data>
<data name="panelBios.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="panelBios.AutoSizeMode" type="System.Windows.Forms.AutoSizeMode, System.Windows.Forms">
<value>GrowAndShrink</value>
</data>
<data name="pdSectionBios.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="pdSectionBios.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 5</value>
</data>
<data name="pdSectionBios.MinimumSize" type="System.Drawing.Size, System.Drawing">
<value>0, 34</value>
</data>
<data name="pdSectionBios.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>1, 1, 1, 1</value>
</data>
<data name="pdSectionBios.SectionTitle" xml:space="preserve">
<value>BIOS</value>
</data>
<data name="pdSectionBios.Size" type="System.Drawing.Size, System.Drawing">
<value>712, 34</value>
</data>
<data name="pdSectionBios.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="&gt;&gt;pdSectionBios.Name" xml:space="preserve">
<value>pdSectionBios</value>
</data>
<data name="&gt;&gt;pdSectionBios.Type" xml:space="preserve">
<value>XenAdmin.Controls.PDSection, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
</data>
<data name="&gt;&gt;pdSectionBios.Parent" xml:space="preserve">
<value>panelBios</value>
</data>
<data name="&gt;&gt;pdSectionBios.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="panelBios.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Top</value>
</data>
<data name="panelBios.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 88</value>
</data>
<data name="panelBios.Padding" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>0, 5, 0, 5</value>
</data>
<data name="panelBios.Size" type="System.Drawing.Size, System.Drawing">
<value>712, 44</value>
</data>
<data name="panelBios.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;panelBios.Name" xml:space="preserve">
<value>panelBios</value>
</data>
<data name="&gt;&gt;panelBios.Type" xml:space="preserve">
<value>System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;panelBios.Parent" xml:space="preserve">
<value>panel2</value>
</data>
<data name="&gt;&gt;panelBios.ZOrder" xml:space="preserve">
<value>17</value>
</data>
<data name="panelCustomFields.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
@ -1312,7 +1378,7 @@
<value>panel2</value>
</data>
<data name="&gt;&gt;panelCustomFields.ZOrder" xml:space="preserve">
<value>17</value>
<value>18</value>
</data>
<data name="panelGeneral.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
@ -1378,7 +1444,7 @@
<value>panel2</value>
</data>
<data name="&gt;&gt;panelGeneral.ZOrder" xml:space="preserve">
<value>18</value>
<value>19</value>
</data>
<data name="panel2.Location" type="System.Drawing.Point, System.Drawing">
<value>10, 39</value>