From aebffe9b13711284544f1158767066f979ab98d3 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Sat, 1 Oct 2016 00:23:28 +0100 Subject: [PATCH 1/4] CP-19086: Improvements to the PVS cache UI PVS Tab: - Move the "View PVS sites" button inside the "Configure PVS Cache" dialog (next to Remove button) and make it per-site (showing only the PVS servers from that site) - Remove "Currently attached" column from the VMs section - Rename "Status" column to "Read caching status" Configure PVS Cache" dialog: - Make sure there is a scrollbar to accommodate all hosts in a pool - Add a confirmation dialog when a site is removed. The action is executed when the Remove button is pressed. - When Memory SR is selected, set the maximum value to the dom0-extra-memory.. - Allow empty configuration (but see next point): The OK button should only be disabled if the PVS site name is empty - Add an extra option in the "Cache storage" combobox, with text "Not configured", selected by default on a new site. When this is selected, we will remove the existing entry in pvs_cache_storage and will not create a new one. - When a PVS site is deleted (forgotten), we first delete all the associated PVS_servers, otherwise the site cannot be deleted. --- XenAdmin/Controls/PvsCacheStorageRow.cs | 11 +- .../Dialogs/PvsCacheConfigurationDialog.cs | 33 ++- .../PvsCacheConfigurationPage.Designer.cs | 20 +- .../PvsPages/PvsCacheConfigurationPage.cs | 13 +- .../PvsPages/PvsCacheConfigurationPage.resx | 47 ++- XenAdmin/Dialogs/PvsSiteDialog.Designer.cs | 64 +---- XenAdmin/Dialogs/PvsSiteDialog.cs | 56 ++-- XenAdmin/Dialogs/PvsSiteDialog.resx | 271 ++++++++++++++---- XenAdmin/TabPages/PvsPage.Designer.cs | 117 +++----- XenAdmin/TabPages/PvsPage.cs | 17 +- XenAdmin/TabPages/PvsPage.resx | 104 ++----- .../Actions/PVS/ConfigurePvsSiteAction.cs | 15 +- XenModel/Actions/PVS/DeletePvsSiteAction.cs | 20 +- XenModel/Messages.Designer.cs | 11 +- XenModel/Messages.resx | 5 +- XenModel/XenAPI-Extensions/Failure.cs | 1 + XenModel/XenAPI-Extensions/Host.cs | 9 + XenModel/XenAPI-Extensions/VM.cs | 2 +- 18 files changed, 490 insertions(+), 326 deletions(-) diff --git a/XenAdmin/Controls/PvsCacheStorageRow.cs b/XenAdmin/Controls/PvsCacheStorageRow.cs index a0eac703b..3fa87eb71 100644 --- a/XenAdmin/Controls/PvsCacheStorageRow.cs +++ b/XenAdmin/Controls/PvsCacheStorageRow.cs @@ -77,7 +77,12 @@ namespace XenAdmin.Controls { comboBoxCacheSr.Items.Clear(); - // add Memeory SR first; if no memory SR found, add a placeholder (we will create the memory SR in ConfigurePvsCacheAction) + // add the "Not configured" item first + var notConfiguredItem = new ToStringWrapper(null, Messages.PVS_CACHE_NOT_CONFIGURED); + comboBoxCacheSr.Items.Add(notConfiguredItem); + comboBoxCacheSr.SelectedItem = notConfiguredItem; + + // add Memeory SR; if no memory SR found, add a placeholder (we will create the memory SR in ConfigurePvsCacheAction) var memorySr = Host.Connection.Cache.SRs.FirstOrDefault(s => s.GetSRType(false) == SR.SRTypes.tmpfs && s.CanBeSeenFrom(Host)); if (memorySr == null) { @@ -162,7 +167,7 @@ namespace XenAdmin.Controls { get { - if (OrigPvsCacheStorage == null) + if (OrigPvsCacheStorage == null || CacheSr == null) return true; return OrigPvsCacheStorage.SR.opaque_ref != CacheSr.opaque_ref || origCacheSizeGb != numericUpDownCacheSize.Value; } @@ -179,7 +184,7 @@ namespace XenAdmin.Controls var selectedSr = CacheSr; if (selectedSr != null) { - var maxSize = (decimal)Util.ToGB(selectedSr.GetSRType(false) == SR.SRTypes.tmpfs ? Host.dom0_memory : selectedSr.FreeSpace, 1, RoundingBehaviour.Down); ; + var maxSize = (decimal)Util.ToGB(selectedSr.GetSRType(false) == SR.SRTypes.tmpfs ? Host.dom0_memory_extra : selectedSr.FreeSpace, 1, RoundingBehaviour.Down); ; if (maxSize != numericUpDownCacheSize.Maximum) SetupCacheSizeSpinner(numericUpDownCacheSize.Value, numericUpDownCacheSize.Minimum, maxSize); } diff --git a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs index 45f86716a..a00000595 100644 --- a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs +++ b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; +using System.Runtime.Remoting.Messaging; using System.Windows.Forms; using XenAdmin.Actions; using XenAdmin.Controls; @@ -123,23 +124,41 @@ namespace XenAdmin.Dialogs verticalTabs.Items.Add(editPage); } - - private List deletedSites = new List(); - + void DeletePage(PvsCacheConfigurationPage page) { + if (page.PvsSite != null && !DeleteSite(page.PvsSite)) + return; int selectedIndex = verticalTabs.SelectedIndex; verticalTabs.Items.Remove(page); verticalTabs.SelectedIndex = selectedIndex < verticalTabs.Items.Count - 1 ? selectedIndex : verticalTabs.Items.Count - 1; page.Changed -= SomethingChangedOnPage; page.DeleteButtonClicked -= DeleteButtonClickedOnPage; - if (page.PvsSite != null) - deletedSites.Add(page.PvsSite); ContentPanel.Controls.Remove(page); RefreshButtons(); ResizeVerticalTabs(verticalTabs.Items.Count); } + private bool DeleteSite(PVS_site site) + { + if (site == null) + return false; + + DialogResult dialogResult; + using (var dlg = new ThreeButtonDialog( + new ThreeButtonDialog.Details(SystemIcons.Warning, string.Format(Messages.CONFIRM_DELETE_PVS_SITE, site.Name), Messages.XENCENTER), + ThreeButtonDialog.ButtonOK, + ThreeButtonDialog.ButtonCancel)) + { + dialogResult = dlg.ShowDialog(Parent); + } + if (dialogResult != DialogResult.OK) + return false; + var action = new DeletePvsSiteAction(site); + new ActionProgressDialog(action, ProgressBarStyle.Blocks).ShowDialog(this); + return action.Succeeded; + } + private void ResizeVerticalTabs(int itemCount) { int maxHeight = splitContainer.Panel1.Height - AddButton.Height; @@ -266,9 +285,7 @@ namespace XenAdmin.Dialogs private void okButton_Click(object sender, EventArgs e) { List actions = GetActions(); - - actions.AddRange(deletedSites.Select(site => new DeletePvsSiteAction(site))); - + if (actions.Count == 0) return; diff --git a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.Designer.cs b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.Designer.cs index bd840b529..80a857ef5 100644 --- a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.Designer.cs +++ b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.Designer.cs @@ -34,6 +34,7 @@ namespace XenAdmin.Dialogs this.label1 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.textBox1 = new System.Windows.Forms.TextBox(); + this.viewPvsServersButton = new System.Windows.Forms.Button(); this.hostsPanel = new XenAdmin.Controls.FlickerFreePanel(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); @@ -41,17 +42,17 @@ namespace XenAdmin.Dialogs // tableLayoutPanel1 // resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); - this.tableLayoutPanel1.Controls.Add(this.deleteButton, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.deleteButton, 3, 3); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1); this.tableLayoutPanel1.Controls.Add(this.label7, 0, 0); this.tableLayoutPanel1.Controls.Add(this.textBox1, 1, 0); this.tableLayoutPanel1.Controls.Add(this.hostsPanel, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.viewPvsServersButton, 1, 3); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // // deleteButton // resources.ApplyResources(this.deleteButton, "deleteButton"); - this.tableLayoutPanel1.SetColumnSpan(this.deleteButton, 2); this.deleteButton.Image = global::XenAdmin.Properties.Resources._000_RemoveSite_h32bit_16; this.deleteButton.Name = "deleteButton"; this.deleteButton.UseVisualStyleBackColor = true; @@ -60,7 +61,7 @@ namespace XenAdmin.Dialogs // label1 // resources.ApplyResources(this.label1, "label1"); - this.tableLayoutPanel1.SetColumnSpan(this.label1, 2); + this.tableLayoutPanel1.SetColumnSpan(this.label1, 3); this.label1.Name = "label1"; // // label7 @@ -70,16 +71,24 @@ namespace XenAdmin.Dialogs // // textBox1 // + this.tableLayoutPanel1.SetColumnSpan(this.textBox1, 2); resources.ApplyResources(this.textBox1, "textBox1"); this.textBox1.Name = "textBox1"; this.textBox1.TextChanged += new System.EventHandler(this.SomethingChanged); // + // viewPvsServersButton + // + resources.ApplyResources(this.viewPvsServersButton, "viewPvsServersButton"); + this.viewPvsServersButton.Name = "viewPvsServersButton"; + this.viewPvsServersButton.UseVisualStyleBackColor = true; + this.viewPvsServersButton.Click += new System.EventHandler(this.viewServersButton_Click); + // // hostsPanel // + resources.ApplyResources(this.hostsPanel, "hostsPanel"); this.hostsPanel.BorderColor = System.Drawing.Color.Black; this.hostsPanel.BorderWidth = 1; - this.tableLayoutPanel1.SetColumnSpan(this.hostsPanel, 2); - resources.ApplyResources(this.hostsPanel, "hostsPanel"); + this.tableLayoutPanel1.SetColumnSpan(this.hostsPanel, 3); this.hostsPanel.Name = "hostsPanel"; // // PvsCacheConfigurationPage @@ -103,5 +112,6 @@ namespace XenAdmin.Dialogs private Controls.FlickerFreePanel hostsPanel; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button deleteButton; + public System.Windows.Forms.Button viewPvsServersButton; } } diff --git a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs index 49cb64862..df3f7ce36 100644 --- a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs +++ b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs @@ -82,8 +82,9 @@ namespace XenAdmin.Dialogs // Generate a unique suggested name for the new site textBox1.Text = Helpers.MakeUniqueName(Messages.PVS_SITE_NAME, takenNames); } - + LoadServers(); + viewPvsServersButton.Enabled = PvsSite != null; } public bool ValidToSave @@ -148,7 +149,7 @@ namespace XenAdmin.Dialogs { site = PvsSite != null ? new XenRef(PvsSite) : null, host = new XenRef(row.Host), - SR = new XenRef(row.CacheSr), + SR = row.CacheSr != null ? new XenRef(row.CacheSr) : null, size = row.CacheSize }; @@ -187,5 +188,13 @@ namespace XenAdmin.Dialogs if (DeleteButtonClicked != null) DeleteButtonClicked(this, e); } + + private void viewServersButton_Click(object sender, EventArgs e) + { + if (PvsSite == null) + return; + using (var dialog = new PvsSiteDialog(PvsSite)) + dialog.ShowDialog(this); + } } } diff --git a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.resx b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.resx index ed9fc1a00..4146aa55a 100644 --- a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.resx +++ b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.resx @@ -119,7 +119,7 @@ - 2 + 3 @@ -148,7 +148,7 @@ 128, 23 - 5 + 6 &Remove PVS Site @@ -247,7 +247,7 @@ 69, 13 - 354, 20 + 368, 20 2 @@ -264,6 +264,9 @@ 3 + + True + Fill @@ -288,6 +291,42 @@ 4 + + Bottom, Right + + + True + + + NoControl + + + 175, 330 + + + 5, 0, 5, 0 + + + 128, 23 + + + 5 + + + &View PVS Servers... + + + viewPvsServersButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + Fill @@ -319,7 +358,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="deleteButton" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label7" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBox1" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="hostsPanel" Row="2" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="deleteButton" Row="3" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="label7" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="textBox1" Row="0" RowSpan="1" Column="1" ColumnSpan="2" /><Control Name="hostsPanel" Row="2" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="viewPvsServersButton" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> True diff --git a/XenAdmin/Dialogs/PvsSiteDialog.Designer.cs b/XenAdmin/Dialogs/PvsSiteDialog.Designer.cs index 4fdb278c1..2fca462dd 100644 --- a/XenAdmin/Dialogs/PvsSiteDialog.Designer.cs +++ b/XenAdmin/Dialogs/PvsSiteDialog.Designer.cs @@ -28,21 +28,17 @@ namespace XenAdmin.Dialogs /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PvsSiteDialog)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.closeButton = new System.Windows.Forms.Button(); - this.bottomPanel = new System.Windows.Forms.Panel(); this.mainPanel = new System.Windows.Forms.Panel(); - this.gridView = new XenAdmin.Controls.DataGridViewEx.CollapsingPvsSiteServerDataGridView(this.components); - this.expansionColumn = new System.Windows.Forms.DataGridViewImageColumn(); - this.siteColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.gridView = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); + this.bottomPanel = new System.Windows.Forms.Panel(); this.ipAddressesColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.firstPortColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lastPortColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.bottomPanel.SuspendLayout(); this.mainPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridView)).BeginInit(); + this.bottomPanel.SuspendLayout(); this.SuspendLayout(); // // closeButton @@ -53,12 +49,6 @@ namespace XenAdmin.Dialogs this.closeButton.UseVisualStyleBackColor = true; this.closeButton.Click += new System.EventHandler(this.closeButton_Click); // - // bottomPanel - // - this.bottomPanel.Controls.Add(this.closeButton); - resources.ApplyResources(this.bottomPanel, "bottomPanel"); - this.bottomPanel.Name = "bottomPanel"; - // // mainPanel // this.mainPanel.Controls.Add(this.gridView); @@ -71,64 +61,42 @@ namespace XenAdmin.Dialogs this.gridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; this.gridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.gridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.expansionColumn, - this.siteColumn, this.ipAddressesColumn, this.firstPortColumn, this.lastPortColumn}); resources.ApplyResources(this.gridView, "gridView"); this.gridView.Name = "gridView"; this.gridView.ReadOnly = true; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 9F); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridView.RowHeadersDefaultCellStyle = dataGridViewCellStyle1; - this.gridView.Updating = false; // - // expansionColumn + // bottomPanel // - this.expansionColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - this.expansionColumn.FillWeight = 16.66667F; - resources.ApplyResources(this.expansionColumn, "expansionColumn"); - this.expansionColumn.Name = "expansionColumn"; - this.expansionColumn.ReadOnly = true; - this.expansionColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; - // - // siteColumn - // - this.siteColumn.FillWeight = 108.4123F; - resources.ApplyResources(this.siteColumn, "siteColumn"); - this.siteColumn.Name = "siteColumn"; - this.siteColumn.ReadOnly = true; - this.siteColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.bottomPanel.Controls.Add(this.closeButton); + resources.ApplyResources(this.bottomPanel, "bottomPanel"); + this.bottomPanel.Name = "bottomPanel"; // // ipAddressesColumn // - this.ipAddressesColumn.FillWeight = 172.9413F; + this.ipAddressesColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.ipAddressesColumn.FillWeight = 105.6863F; resources.ApplyResources(this.ipAddressesColumn, "ipAddressesColumn"); this.ipAddressesColumn.Name = "ipAddressesColumn"; this.ipAddressesColumn.ReadOnly = true; - this.ipAddressesColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // firstPortColumn // - this.firstPortColumn.FillWeight = 100.9122F; + this.firstPortColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.firstPortColumn.FillWeight = 173.6275F; resources.ApplyResources(this.firstPortColumn, "firstPortColumn"); this.firstPortColumn.Name = "firstPortColumn"; this.firstPortColumn.ReadOnly = true; - this.firstPortColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // lastPortColumn // - this.lastPortColumn.FillWeight = 101.0676F; + this.lastPortColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.lastPortColumn.FillWeight = 173.6275F; resources.ApplyResources(this.lastPortColumn, "lastPortColumn"); this.lastPortColumn.Name = "lastPortColumn"; this.lastPortColumn.ReadOnly = true; - this.lastPortColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // PvsSiteDialog // @@ -143,9 +111,9 @@ namespace XenAdmin.Dialogs this.MinimizeBox = true; this.Name = "PvsSiteDialog"; this.ShowInTaskbar = true; - this.bottomPanel.ResumeLayout(false); this.mainPanel.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.gridView)).EndInit(); + this.bottomPanel.ResumeLayout(false); this.ResumeLayout(false); } @@ -154,9 +122,7 @@ namespace XenAdmin.Dialogs private System.Windows.Forms.Button closeButton; private System.Windows.Forms.Panel bottomPanel; private System.Windows.Forms.Panel mainPanel; - private Controls.DataGridViewEx.CollapsingPvsSiteServerDataGridView gridView; - private System.Windows.Forms.DataGridViewImageColumn expansionColumn; - private System.Windows.Forms.DataGridViewTextBoxColumn siteColumn; + private Controls.DataGridViewEx.DataGridViewEx gridView; private System.Windows.Forms.DataGridViewTextBoxColumn ipAddressesColumn; private System.Windows.Forms.DataGridViewTextBoxColumn firstPortColumn; private System.Windows.Forms.DataGridViewTextBoxColumn lastPortColumn; diff --git a/XenAdmin/Dialogs/PvsSiteDialog.cs b/XenAdmin/Dialogs/PvsSiteDialog.cs index 53e4de37a..5829200ac 100644 --- a/XenAdmin/Dialogs/PvsSiteDialog.cs +++ b/XenAdmin/Dialogs/PvsSiteDialog.cs @@ -30,27 +30,28 @@ */ using System; -using System.Linq; using System.ComponentModel; -using XenAdmin.Network; -using XenAdmin.Controls.DataGridViewEx; +using System.Windows.Forms; using XenAPI; namespace XenAdmin.Dialogs { public partial class PvsSiteDialog : XenDialogBase { + private readonly PVS_site pvsSite; + /// - /// Creates a dialog for viewing the PVS sites and PVS servers on a particular connection. + /// Creates a dialog for viewing the PVS servers on a particular site. /// - /// May not be null. - public PvsSiteDialog(IXenConnection _connection) + /// May not be null. + public PvsSiteDialog(PVS_site site) { - System.Diagnostics.Trace.Assert(_connection != null); - connection = _connection; + System.Diagnostics.Trace.Assert(site != null); + connection = site.Connection; + pvsSite = site; InitializeComponent(); - Text = string.Format(Messages.PVS_SITE_DIALOG_TITLE, this.connection.Name); + Text = string.Format(Messages.PVS_SITE_DIALOG_TITLE, pvsSite.Name.Ellipsise(50)); System.Diagnostics.Trace.Assert(gridView.Columns.Count > 0); gridView.Columns[0].DefaultCellStyle.NullValue = null; @@ -62,21 +63,14 @@ namespace XenAdmin.Dialogs private void RegisterEventHandlers() { UnregisterEventHandlers(); - connection.Cache.RegisterBatchCollectionChanged(PvsSiteBatchCollectionChanged); connection.Cache.RegisterBatchCollectionChanged(PvsServerBatchCollectionChanged); } private void UnregisterEventHandlers() { - connection.Cache.DeregisterBatchCollectionChanged(PvsSiteBatchCollectionChanged); connection.Cache.DeregisterBatchCollectionChanged(PvsServerBatchCollectionChanged); } - private void PvsSiteBatchCollectionChanged(object sender, EventArgs e) - { - Program.Invoke(this, Rebuild); - } - private void PvsServerBatchCollectionChanged(object sender, EventArgs e) { Program.Invoke(this, Rebuild); @@ -98,19 +92,10 @@ namespace XenAdmin.Dialogs gridView.SuspendLayout(); gridView.Rows.Clear(); - var pvsSites = connection.Cache.PVS_sites.ToList(); - pvsSites.Sort(); - - foreach (var pvsSite in pvsSites) + foreach (var pvsServer in connection.ResolveAll(pvsSite.servers)) { - var siteRow = new CollapsingPvsSiteServerDataGridViewRow(pvsSite); - gridView.Rows.Add(siteRow); - - foreach (var pvsServer in connection.ResolveAll(pvsSite.servers)) - { - var serverRow = new CollapsingPvsSiteServerDataGridViewRow(pvsServer); - gridView.Rows.Add(serverRow); - } + var serverRow = NewPvsServerRow(pvsServer); + gridView.Rows.Add(serverRow); } } finally @@ -119,6 +104,21 @@ namespace XenAdmin.Dialogs } } + private DataGridViewRow NewPvsServerRow(PVS_server pvsServer) + { + var ipAddressesCell = new DataGridViewTextBoxCell(); + var firstPortCell = new DataGridViewTextBoxCell(); + var lastPortCell = new DataGridViewTextBoxCell(); + + ipAddressesCell.Value = string.Join(Messages.LIST_SEPARATOR, pvsServer.addresses); + firstPortCell.Value = pvsServer.first_port; + lastPortCell.Value = pvsServer.last_port; + + var newRow = new DataGridViewRow { Tag = pvsSite }; + newRow.Cells.AddRange(ipAddressesCell, firstPortCell, lastPortCell); + return newRow; + } + private void closeButton_Click(object sender, EventArgs e) { Close(); diff --git a/XenAdmin/Dialogs/PvsSiteDialog.resx b/XenAdmin/Dialogs/PvsSiteDialog.resx index d4ac7a588..b27ddd3e0 100644 --- a/XenAdmin/Dialogs/PvsSiteDialog.resx +++ b/XenAdmin/Dialogs/PvsSiteDialog.resx @@ -153,54 +153,6 @@ 0 - - Bottom - - - Segoe UI, 9pt - - - 8, 325 - - - 602, 29 - - - 5 - - - bottomPanel - - - System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 1 - - - True - - - - - - 20 - - - 20 - - - True - - - PVS Site - - - 65 - True @@ -219,6 +171,9 @@ 60 + + 130 + True @@ -228,6 +183,9 @@ 60 + + 130 + Fill @@ -247,7 +205,7 @@ gridView - XenAdmin.Controls.DataGridViewEx.CollapsingPvsSiteServerDataGridView, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null mainPanel @@ -285,6 +243,33 @@ 0 + + Bottom + + + Segoe UI, 9pt + + + 8, 325 + + + 602, 29 + + + 5 + + + bottomPanel + + + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + True @@ -297,6 +282,182 @@ Tahoma, 8pt + + + AAABAAYAICAQAAAAAADoAgAAZgAAABAQEAAAAAAAKAEAAE4DAAAgIAAAAQAIAKgIAAB2BAAAEBAAAAEA + CABoBQAAHg0AACAgAAABACAAqBAAAIYSAAAQEAAAAQAgAGgEAAAuIwAAKAAAACAAAABAAAAAAQAEAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAACAgACAAAAAgACAAICAAACAgIAAwMDAAAAA + /wAA/wAAAP//AP8A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AP8f1AAAP9QAVT/UAKo/ + 1AD/P9QAAF/UAFVf1ACqX9QA/1/UAAB/1ABVf9QAqn/UAP9/1AAAn9QAVZ/UAKqf1AD/n9QAAL/UAFW/ + 1ACqv9QA/7/UAADf1ABV39QAqt/UAP/f1AAA/9QAVf/UAKr/1AD//9QAVQD/AKoA/wAAH/8AVR//AKof + /wD/H/8AAD//AFU//wCqP/8A/z//AABf/wBVX/8Aql//AP9f/wAAf/8AVX//AKp//wD/f/8AAJ//AFWf + /wCqn/8A/5//AAC//wBVv/8Aqr//AP+//wAA3/8AVd//AKrf/wD/3/8AVf//AKr//wD/zMwA/8z/AP// + MwD//2YA//+ZAP//zAAAfwAAVX8AAKp/AAD/fwAAAJ8AAFWfAACqnwAA/58AAAC/AABVvwAAqr8AAP+/ + AAAA3wAAVd8AAKrfAAD/3wAAVf8AAKr/AAAAACoAVQAqAKoAKgD/ACoAAB8qAFUfKgCqHyoA/x8qAAA/ + KgBVPyoA8Pv/AKSgoACAgIAAAAD/AAD/AAAA//8A/wAAAAAAAAD//wAA////AP39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39qoYIqoYIhqoIqgiqCaoIqgiqhqqGhoYIhoYIqv39/f0I/f39 + /ar9/f39/YY2Ng4yDg4ODgoOCgoKCgqG/f39/Yb9/f39CP39/f39qjY7Ozs3Nzc3NjMSMjIOCqr9/f39 + qv39/f2G/f39/f0IN19fOzs3Nzc3NjcODg4KCP39/f0I/f39/ar9/f39/ao6X19fXzs7Ozc3NzY3NgqG + /f39/Yb9/f39CP39/f39hl9jY19jX187Ozs7Nzc3Dqr9/f39qv39/f2G/f39/f0IOodjh19jX19fXztf + OzcOCP39/f0ICAmqCAiqCKoICapfCYdjh2ODY19fXzs7Ow6q/f39/QhITEwoSCUoKSQoqmMJCYcJCWNj + Y2NfY19fNgj9/f39qkyZmZmYmJRwlCmqX19fXl9fX186WzY3Njc2gv39/f0JcJ2dmZmZlJmUJAmqCaoJ + hggIqggICKoIqggI/f39/YZwnp2dnZmZmJVMqnx8fHx8fFR8VHhUVFRUVKr9/f39CHChoZ2dnZ2ZmUwJ + fKSkxqSkxqSkpKSkpKBUCP39/f2qcKLDoqGdnZ2ZTKp8ysakxqSkxqSkxqSkpFSq/f39/QiUpqbDoqHE + nZ1Mq3ykqMakyqSkxqSkpKSkVAj9/f39hpTIyKbHoqGhoXAIfMrLpMqkxqSkxqTGpKRUqv39/f0IlMym + yKbIpcShcAh8y6jKpMqkxsqkpKSkxlQI/f39/aqUzMzMyKbIpqJwqnzLy8qpxsqkpMakxqSkeAj9/f39 + CJSUlJSUlJSUlJQJgMupy8qpysqkyqSkxqRUqv39/f2GCKoIqgiqCKoIhgigrcvPqcuoy8qkxsqkxnyG + /f39/ar9/f39/f39/f39qnzPz6nLy8uoyqnKpKTKVAj9/f39CP39/f39/f39/f0IfNDPz8+py8upyqjG + yqR8hv39/f2G/f39/f39/f39/Qik0K7P0M+ty8vLy6jKpXyq/f39/ar9/f39/f39/f39CHzQ09Ctz8/P + qcupy6jKeAj9/f39CP39/f39/f39/f2qoNPQ0NPQ0M/Qz8vLy6l8CP39/f2G/f39/f39/f39/QmkfKR8 + oHx8fHx8fHx8fHyG/f39/aoIqgiqCKoIqgiqCKoIqgiqCKoIqgiqCKoIqgj9/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3///////////// + ///AAAAD3vgAA974AAPe+AAD3vgAA974AAPe+AADwAAAA8AAAAPAAAADwAAAA8AAAAPAAAADwAAAA8AA + AAPAAAADwAAAA8AAAAPAAAADwAAAA9/4AAPf+AAD3/gAA9/4AAPf+AAD3/gAA8AAAAP//////////ygA + AAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACAAAAAgIAAgAAAAIAA + gACAg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/CCrI/woowP8LJrf/DSSu/8DAwP8Sjbj/Zdb9/0/Q + /P88y/v/Kcf7/xrC+/8IbZD/wMDA/wAAAAAAAAAAwMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/FpfG/43h + /f962/3/Zdb8/0/Q/P87zPz/CXSZ/8DAwP8AAAAAAAAAAMDAwP8AAAAAAAAAAAAAAAAAAAAAwMDA/xif + z/+u6f7/n+X9/47h/f953P3/ZNb9/w19pP/AwMD/AAAAAAAAAADAwMD/AAAAAAAAAAAAAAAAAAAAAMDA + wP8apNX/uez+/7ns/v+u6f7/oOX9/43h/f8Rh7H/wMDA/wAAAAAAAAAAwMDA/wAAAAAAAAAAAAAAAAAA + AADAwMD/GqTV/xqk1f8apNX/GaHR/xecy/8WmMb/FJK+/8DAwP8AAAAAAAAAAMDAwP/AwMD/wMDA/8DA + wP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/wMDA/8DAwP/AwMD/AAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//wAAgAEAALQF + wf+0BQAAgAUAAIAFAACAAQAAgAHB/4ABAACAAQAAgAEAALwBAAC8AQAAvAHB/4ABbP///5H/ + + + + NoControl + 0, 0, 0, 0 @@ -309,18 +470,6 @@ PVS Sites - - expansionColumn - - - System.Windows.Forms.DataGridViewImageColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - siteColumn - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ipAddressesColumn diff --git a/XenAdmin/TabPages/PvsPage.Designer.cs b/XenAdmin/TabPages/PvsPage.Designer.cs index c32997a60..36308ecae 100644 --- a/XenAdmin/TabPages/PvsPage.Designer.cs +++ b/XenAdmin/TabPages/PvsPage.Designer.cs @@ -29,19 +29,13 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PvsPage)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.dataGridViewVms = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); - this.columnVM = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnCachingEnabled = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.columnCurrentlyCached = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnPvsSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.label2 = new System.Windows.Forms.Label(); this.dataGridViewSites = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); this.ColumnSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -50,10 +44,13 @@ this.label1 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.ConfigureButton = new System.Windows.Forms.Button(); - this.ViewPvsSitesButton = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); this.enableButton = new XenAdmin.Commands.CommandButton(); this.disableButton = new XenAdmin.Commands.CommandButton(); + this.columnVM = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnCachingEnabled = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnPvsSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.pageContainerPanel.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewVms)).BeginInit(); @@ -87,7 +84,6 @@ this.dataGridViewVms.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.columnVM, this.ColumnCachingEnabled, - this.columnCurrentlyCached, this.ColumnPvsSite, this.ColumnStatus}); resources.ApplyResources(this.dataGridViewVms, "dataGridViewVms"); @@ -95,48 +91,6 @@ this.dataGridViewVms.Name = "dataGridViewVms"; this.dataGridViewVms.ReadOnly = true; // - // columnVM - // - this.columnVM.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.columnVM.DefaultCellStyle = dataGridViewCellStyle1; - resources.ApplyResources(this.columnVM, "columnVM"); - this.columnVM.Name = "columnVM"; - this.columnVM.ReadOnly = true; - // - // ColumnCachingEnabled - // - resources.ApplyResources(this.ColumnCachingEnabled, "ColumnCachingEnabled"); - this.ColumnCachingEnabled.Name = "ColumnCachingEnabled"; - this.ColumnCachingEnabled.ReadOnly = true; - // - // columnCurrentlyCached - // - this.columnCurrentlyCached.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - this.columnCurrentlyCached.DefaultCellStyle = dataGridViewCellStyle2; - this.columnCurrentlyCached.FillWeight = 30F; - resources.ApplyResources(this.columnCurrentlyCached, "columnCurrentlyCached"); - this.columnCurrentlyCached.Name = "columnCurrentlyCached"; - this.columnCurrentlyCached.ReadOnly = true; - this.columnCurrentlyCached.Resizable = System.Windows.Forms.DataGridViewTriState.True; - // - // ColumnPvsSite - // - resources.ApplyResources(this.ColumnPvsSite, "ColumnPvsSite"); - this.ColumnPvsSite.Name = "ColumnPvsSite"; - this.ColumnPvsSite.ReadOnly = true; - // - // ColumnStatus - // - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - this.ColumnStatus.DefaultCellStyle = dataGridViewCellStyle3; - this.ColumnStatus.FillWeight = 30F; - resources.ApplyResources(this.ColumnStatus, "ColumnStatus"); - this.ColumnStatus.Name = "ColumnStatus"; - this.ColumnStatus.ReadOnly = true; - // // label2 // resources.ApplyResources(this.label2, "label2"); @@ -160,9 +114,9 @@ // ColumnSite // this.ColumnSite.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.ColumnSite.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.ColumnSite.DefaultCellStyle = dataGridViewCellStyle3; this.ColumnSite.FillWeight = 20F; resources.ApplyResources(this.ColumnSite, "ColumnSite"); this.ColumnSite.Name = "ColumnSite"; @@ -171,8 +125,8 @@ // ColumnConfiguration // this.ColumnConfiguration.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - this.ColumnConfiguration.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; + this.ColumnConfiguration.DefaultCellStyle = dataGridViewCellStyle4; this.ColumnConfiguration.FillWeight = 20F; resources.ApplyResources(this.ColumnConfiguration, "ColumnConfiguration"); this.ColumnConfiguration.Name = "ColumnConfiguration"; @@ -182,8 +136,8 @@ // ColumnSRs // this.ColumnSRs.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - this.ColumnSRs.DefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; + this.ColumnSRs.DefaultCellStyle = dataGridViewCellStyle5; resources.ApplyResources(this.ColumnSRs, "ColumnSRs"); this.ColumnSRs.Name = "ColumnSRs"; this.ColumnSRs.ReadOnly = true; @@ -197,7 +151,6 @@ // resources.ApplyResources(this.panel1, "panel1"); this.panel1.Controls.Add(this.ConfigureButton); - this.panel1.Controls.Add(this.ViewPvsSitesButton); this.panel1.Name = "panel1"; // // ConfigureButton @@ -207,13 +160,6 @@ this.ConfigureButton.UseVisualStyleBackColor = true; this.ConfigureButton.Click += new System.EventHandler(this.ConfigureButton_Click); // - // ViewPvsSitesButton - // - resources.ApplyResources(this.ViewPvsSitesButton, "ViewPvsSitesButton"); - this.ViewPvsSitesButton.Name = "ViewPvsSitesButton"; - this.ViewPvsSitesButton.UseVisualStyleBackColor = true; - this.ViewPvsSitesButton.Click += new System.EventHandler(this.ViewPvsSitesButton_Click); - // // panel2 // resources.ApplyResources(this.panel2, "panel2"); @@ -233,6 +179,39 @@ this.disableButton.Name = "disableButton"; this.disableButton.UseVisualStyleBackColor = true; // + // columnVM + // + this.columnVM.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; + dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.columnVM.DefaultCellStyle = dataGridViewCellStyle1; + resources.ApplyResources(this.columnVM, "columnVM"); + this.columnVM.Name = "columnVM"; + this.columnVM.ReadOnly = true; + // + // ColumnCachingEnabled + // + this.ColumnCachingEnabled.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + resources.ApplyResources(this.ColumnCachingEnabled, "ColumnCachingEnabled"); + this.ColumnCachingEnabled.Name = "ColumnCachingEnabled"; + this.ColumnCachingEnabled.ReadOnly = true; + // + // ColumnPvsSite + // + resources.ApplyResources(this.ColumnPvsSite, "ColumnPvsSite"); + this.ColumnPvsSite.Name = "ColumnPvsSite"; + this.ColumnPvsSite.ReadOnly = true; + // + // ColumnStatus + // + this.ColumnStatus.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; + this.ColumnStatus.DefaultCellStyle = dataGridViewCellStyle2; + this.ColumnStatus.FillWeight = 30F; + resources.ApplyResources(this.ColumnStatus, "ColumnStatus"); + this.ColumnStatus.Name = "ColumnStatus"; + this.ColumnStatus.ReadOnly = true; + // // PvsPage // resources.ApplyResources(this, "$this"); @@ -254,7 +233,6 @@ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; private Controls.DataGridViewEx.DataGridViewEx dataGridViewSites; - public System.Windows.Forms.Button ViewPvsSitesButton; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private Controls.DataGridViewEx.DataGridViewEx dataGridViewVms; @@ -265,11 +243,10 @@ private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; private XenAdmin.Commands.CommandButton enableButton; + public System.Windows.Forms.Button ConfigureButton; private System.Windows.Forms.DataGridViewTextBoxColumn columnVM; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnCachingEnabled; - private System.Windows.Forms.DataGridViewTextBoxColumn columnCurrentlyCached; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnPvsSite; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnStatus; - public System.Windows.Forms.Button ConfigureButton; } } diff --git a/XenAdmin/TabPages/PvsPage.cs b/XenAdmin/TabPages/PvsPage.cs index a9279517d..c3d2bdc41 100644 --- a/XenAdmin/TabPages/PvsPage.cs +++ b/XenAdmin/TabPages/PvsPage.cs @@ -121,8 +121,6 @@ namespace XenAdmin.TabPages { dataGridViewSites.ResumeLayout(); } - - ViewPvsSitesButton.Enabled = Connection.Cache.PVS_sites.Length > 0; } private DataGridViewRow NewPvsSiteRow(PVS_site pvsSite) @@ -267,12 +265,11 @@ namespace XenAdmin.TabPages { var vmCell = new DataGridViewTextBoxCell { Value = vm.Name }; var cacheEnabledCell = new DataGridViewTextBoxCell { Value = Messages.NO }; - var cachedCell = new DataGridViewTextBoxCell { Value = Messages.NO_VALUE }; var pvsSiteCell = new DataGridViewTextBoxCell { Value = Messages.NO_VALUE }; var statusCell = new DataGridViewTextBoxCell { Value = Messages.NO_VALUE }; var newRow = new DataGridViewRow { Tag = vm }; - newRow.Cells.AddRange(vmCell, cacheEnabledCell, cachedCell, pvsSiteCell, statusCell); + newRow.Cells.AddRange(vmCell, cacheEnabledCell, pvsSiteCell, statusCell); vm.PropertyChanged += VmPropertyChanged; return newRow; @@ -285,11 +282,6 @@ namespace XenAdmin.TabPages var vmCell = new DataGridViewTextBoxCell { Value = vm.Name }; var cacheEnabledCell = new DataGridViewTextBoxCell { Value = Messages.YES }; - var cachedCell = new DataGridViewTextBoxCell - { - Value = pvsProxy.currently_attached ? Messages.YES : Messages.NO - }; - var pvsSiteCell = new DataGridViewTextBoxCell { Value = Connection.Resolve(pvsProxy.site) }; var statusCell = new DataGridViewTextBoxCell @@ -298,7 +290,7 @@ namespace XenAdmin.TabPages }; var newRow = new DataGridViewRow { Tag = vm }; - newRow.Cells.AddRange(vmCell, cacheEnabledCell, cachedCell, pvsSiteCell, statusCell); + newRow.Cells.AddRange(vmCell, cacheEnabledCell, pvsSiteCell, statusCell); vm.PropertyChanged += VmPropertyChanged; return newRow; @@ -372,11 +364,6 @@ namespace XenAdmin.TabPages } } - private void ViewPvsSitesButton_Click(object sender, EventArgs e) - { - Program.MainWindow.ShowPerConnectionWizard(connection, new PvsSiteDialog(connection)); - } - private void ConfigureButton_Click(object sender, EventArgs e) { using (var dialog = new PvsCacheConfigurationDialog(connection)) diff --git a/XenAdmin/TabPages/PvsPage.resx b/XenAdmin/TabPages/PvsPage.resx index 830324999..59648ed06 100644 --- a/XenAdmin/TabPages/PvsPage.resx +++ b/XenAdmin/TabPages/PvsPage.resx @@ -140,17 +140,8 @@ Read caching enabled - - True - - - Currently cached - - - 120 - - - 122 + + 148 True @@ -162,11 +153,14 @@ True - Status + Read caching status 120 + + 137 + Fill @@ -366,41 +360,11 @@ 0 - - NoControl - - - 156, 3 - - - 5, 0, 5, 0 - - - 150, 23 - - - 7 - - - View PVS &Sites... - - - ViewPvsSitesButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel1 - - - 1 - 3, 259 - 309, 29 + 153, 29 13 @@ -561,36 +525,6 @@ 1129, 699 - - columnVM - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnCachingEnabled - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - columnCurrentlyCached - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnPvsSite - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnStatus - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - ColumnSite @@ -609,6 +543,30 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + columnVM + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ColumnCachingEnabled + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ColumnPvsSite + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ColumnStatus + + + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + PvsPage diff --git a/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs b/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs index aa0f1d09a..689d10adc 100644 --- a/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs +++ b/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs @@ -82,7 +82,7 @@ namespace XenAdmin.Actions foreach (var pvsCacheStorage in pvsCacheStorages) { // create Memory SR, if needed - if (Helper.IsNullOrEmptyOpaqueRef(pvsCacheStorage.SR.opaque_ref)) + if (pvsCacheStorage.SR != null && Helper.IsNullOrEmptyOpaqueRef(pvsCacheStorage.SR.opaque_ref)) { RelatedTask = SR.async_create(Session, pvsCacheStorage.host, new Dictionary { { URI, "" } }, 0, Messages.PVS_CACHE_MEMORY_SR_NAME, "", SR.SRTypes.tmpfs.ToString(), "", false, new Dictionary()); @@ -107,9 +107,16 @@ namespace XenAdmin.Actions } // create new PVS_cache_storage - pvsCacheStorage.site = new XenRef(pvsSite); //asign the new site - RelatedTask = PVS_cache_storage.async_create(Session, pvsCacheStorage); - PollToCompletion(PercentComplete, PercentComplete + inc); + if (pvsCacheStorage.SR != null) + { + pvsCacheStorage.site = new XenRef(pvsSite); //asign the new site + RelatedTask = PVS_cache_storage.async_create(Session, pvsCacheStorage); + PollToCompletion(PercentComplete, PercentComplete + inc); + } + else + { + PercentComplete += inc; + } } PercentComplete = 100; Description = Messages.ACTION_CONFUGURE_PVS_SITE_DONE; diff --git a/XenModel/Actions/PVS/DeletePvsSiteAction.cs b/XenModel/Actions/PVS/DeletePvsSiteAction.cs index a65b8253d..71b0a6e8d 100644 --- a/XenModel/Actions/PVS/DeletePvsSiteAction.cs +++ b/XenModel/Actions/PVS/DeletePvsSiteAction.cs @@ -1,4 +1,6 @@ -using XenAPI; +using System; +using System.Linq; +using XenAPI; namespace XenAdmin.Actions { @@ -16,6 +18,22 @@ namespace XenAdmin.Actions protected override void Run() { + // check if there are any running proxies + var pvsProxies = Connection.Cache.PVS_proxies.Where(s => s.site.opaque_ref == pvsSite.opaque_ref).ToList(); + if (pvsProxies.Count > 0) + { + throw new Failure(Failure.PVS_SITE_CONTAINS_RUNNING_PROXIES); + } + + // delete PVS_servers + var pvsServers = Connection.Cache.PVS_servers.Where(s => s.site.opaque_ref == pvsSite.opaque_ref).ToList(); + int inc = pvsServers.Count > 0 ? 50 / pvsServers.Count : 50; + foreach (var pvsServer in pvsServers) + { + RelatedTask = PVS_server.async_forget(Session, pvsServer.opaque_ref); + PollToCompletion(PercentComplete, PercentComplete + inc); + } + RelatedTask = PVS_site.async_forget(Session, pvsSite.opaque_ref); PollToCompletion(); Description = Messages.ACTION_DELETE_PVS_SITE_DONE; diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 028edef48..c48c39783 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -7245,6 +7245,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Are you sure you want to delete '{0}'?. + /// + public static string CONFIRM_DELETE_PVS_SITE { + get { + return ResourceManager.GetString("CONFIRM_DELETE_PVS_SITE", resourceCulture); + } + } + /// /// Looks up a localized string similar to Are you sure you want to delete the tag '{0}' from all managed resources?. /// @@ -27877,7 +27886,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to PVS Sites - '{0}'. + /// Looks up a localized string similar to PVS Servers on site {0}'. /// public static string PVS_SITE_DIALOG_TITLE { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 6a29b40c1..e05e21ff3 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -9695,7 +9695,7 @@ Press OK to continue the wizard and return to the server and follow the instruct Not configured - PVS Sites - '{0}' + PVS Servers on site {0}' PVS Site @@ -13246,4 +13246,7 @@ You will need to navigate to the Console on each of the selected VMs to complete You are here + + Are you sure you want to delete '{0}'? + \ No newline at end of file diff --git a/XenModel/XenAPI-Extensions/Failure.cs b/XenModel/XenAPI-Extensions/Failure.cs index 289830200..982bc4954 100644 --- a/XenModel/XenAPI-Extensions/Failure.cs +++ b/XenModel/XenAPI-Extensions/Failure.cs @@ -83,6 +83,7 @@ namespace XenAPI public const string HOST_UNKNOWN_TO_MASTER = "HOST_UNKNOWN_TO_MASTER"; public const string VM_HAS_VGPU = "VM_HAS_VGPU"; public const string OUT_OF_SPACE = "OUT_OF_SPACE"; + public const string PVS_SITE_CONTAINS_RUNNING_PROXIES = "PVS_SITE_CONTAINS_RUNNING_PROXIES"; private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index c84dc9d34..a55768212 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -1284,6 +1284,15 @@ namespace XenAPI } } + public long dom0_memory_extra + { + get + { + VM vm = ControlDomainZero; + return vm != null ? vm.memory_static_max - vm.memory_static_min : 0; + } + } + /// /// Friendly string showing memory usage on the host diff --git a/XenModel/XenAPI-Extensions/VM.cs b/XenModel/XenAPI-Extensions/VM.cs index 13f7ea60c..3c97771a4 100644 --- a/XenModel/XenAPI-Extensions/VM.cs +++ b/XenModel/XenAPI-Extensions/VM.cs @@ -2078,7 +2078,7 @@ namespace XenAPI { get { - return Connection.Cache.PVS_proxies.FirstOrDefault(p => p.VM.Equals(this)); // null if none + return Connection.Cache.PVS_proxies.FirstOrDefault(p => p.VM != null && p.VM.Equals(this)); // null if none } } } From be66919627b7021d60d0f7853c2be52577befe48 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Mon, 3 Oct 2016 10:51:56 +0100 Subject: [PATCH 2/4] CP-19086: Improvements to the PVS cache UI - If the PVS site cannot be removed (it has running proxies) then popup a dialog stating the reason, instead of starting the action and failing there. We still have the same check in the action, just in case the situation changed in the meantime. - Removed unused controls Signed-off-by: Mihaela Stoica --- ...psingPvsSiteServerDataGridView.Designer.cs | 36 ----- .../CollapsingPvsSiteServerDataGridView.cs | 99 ------------- .../CollapsingPvsSiteServerDataGridViewRow.cs | 140 ------------------ .../Dialogs/PvsCacheConfigurationDialog.cs | 11 ++ XenAdmin/XenAdmin.csproj | 7 - XenModel/Messages.Designer.cs | 9 ++ XenModel/Messages.resx | 3 + 7 files changed, 23 insertions(+), 282 deletions(-) delete mode 100644 XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.Designer.cs delete mode 100644 XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.cs delete mode 100644 XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridViewRow.cs diff --git a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.Designer.cs b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.Designer.cs deleted file mode 100644 index 053812638..000000000 --- a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.Designer.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace XenAdmin.Controls.DataGridViewEx -{ - partial class CollapsingPvsSiteServerDataGridView - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Component Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - components = new System.ComponentModel.Container(); - } - - #endregion - } -} diff --git a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.cs b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.cs deleted file mode 100644 index 115d35190..000000000 --- a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright (c) Citrix Systems Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System.ComponentModel; -using System.Windows.Forms; - -namespace XenAdmin.Controls.DataGridViewEx -{ - public partial class CollapsingPvsSiteServerDataGridView : DataGridViewEx - { - public CollapsingPvsSiteServerDataGridView() - { - InitializeComponent(); - } - - public CollapsingPvsSiteServerDataGridView(IContainer container) - { - container.Add(this); - - InitializeComponent(); - } - - public bool Updating { get; set; } - - private const int expansionColumnIndex = 0; - - protected override void OnCellContentClick(DataGridViewCellEventArgs e) - { - base.OnCellContentClick(e); - - if (e.ColumnIndex == expansionColumnIndex) - ExpandCollapseClicked(e.RowIndex); - } - - public void ExpandCollapseClicked(int rowIndex) - { - var siteRow = (CollapsingPvsSiteServerDataGridViewRow)Rows[rowIndex]; - - if (siteRow.UnderlyingSite != null) - { - for (int i = rowIndex + 1; i < Rows.Count; i++) - { - var row = (CollapsingPvsSiteServerDataGridViewRow)Rows[i]; - - if (row.IsSiteRow) - break; - - row.Visible = !row.Visible; - - if (row.Visible) - siteRow.SetCollapseIcon(); - else - siteRow.SetExpandIcon(); - } - } - } - - protected override void OnKeyDown(KeyEventArgs e) - { - if (CurrentCell != null && CurrentCell.ColumnIndex == expansionColumnIndex) - { - if (e.KeyCode == Keys.Space) - { - ExpandCollapseClicked(CurrentCell.RowIndex); - e.Handled = true; - } - } - base.OnKeyDown(e); - } - } -} diff --git a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridViewRow.cs b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridViewRow.cs deleted file mode 100644 index d32e07ac0..000000000 --- a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridViewRow.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* Copyright (c) Citrix Systems Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, - * with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the - * following disclaimer in the documentation and/or other - * materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND - * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -using System.Windows.Forms; -using XenAdmin.Properties; -using XenAPI; - -namespace XenAdmin.Controls.DataGridViewEx -{ - public class CollapsingPvsSiteServerDataGridViewRow : DataGridViewExRow - { - protected DataGridViewImageCell expansionCell; - protected DataGridViewTextBoxCell siteCell; - protected DataGridViewTextBoxCell ipAddressesCell; - protected DataGridViewTextBoxCell firstPortCell; - protected DataGridViewTextBoxCell lastPortCell; - protected bool isPvsSiteRow; - - public CollapsingPvsSiteServerDataGridViewRow(PVS_site site) - { - Tag = site; - isPvsSiteRow = true; - - SetupCells(); - } - - public CollapsingPvsSiteServerDataGridViewRow(PVS_server server) - { - Tag = server; - isPvsSiteRow = false; - - SetupCells(); - } - - private void SetupCells() - { - expansionCell = new DataGridViewImageCell(); - siteCell = new DataGridViewTextBoxCell(); - ipAddressesCell = new DataGridViewTextBoxCell(); - firstPortCell = new DataGridViewTextBoxCell(); - lastPortCell = new DataGridViewTextBoxCell(); - - Cells.Add(expansionCell); - Cells.Add(siteCell); - Cells.Add(ipAddressesCell); - Cells.Add(firstPortCell); - Cells.Add(lastPortCell); - - UpdateDetails(); - } - - protected void UpdateDetails() - { - if (isPvsSiteRow) - { - PVS_site site = (PVS_site)Tag; - - if (site.servers.Count == 0) - SetNoIcon(); - else - SetCollapseIcon(); - - siteCell.Value = site.Name; - } - else - { - PVS_server server = (PVS_server)Tag; - - SetNoIcon(); - - ipAddressesCell.Value = string.Join(", ", server.addresses); - firstPortCell.Value = server.first_port; - lastPortCell.Value = server.last_port; - } - } - - public bool IsSiteRow - { - get { return isPvsSiteRow; } - } - - public bool IsServerRow - { - get { return !isPvsSiteRow; } - } - - public PVS_site UnderlyingSite - { - get { return Tag as PVS_site; } - } - - public PVS_server UnderlyingServer - { - get { return Tag as PVS_server; } - } - - public void SetCollapseIcon() - { - expansionCell.Value = Resources.tree_minus; - } - - public void SetExpandIcon() - { - expansionCell.Value = Resources.tree_plus; - } - - public void SetNoIcon() - { - expansionCell.Value = null; - } - } -} diff --git a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs index a00000595..0291ad9e9 100644 --- a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs +++ b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs @@ -144,6 +144,17 @@ namespace XenAdmin.Dialogs if (site == null) return false; + // We cannot delete the site if there are running proxies + var pvsProxies = connection.Cache.PVS_proxies.Where(s => s.site.opaque_ref == site.opaque_ref).ToList(); + if (pvsProxies.Count > 0) + { + using (var dlg = new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.PVS_SITE_CANNOT_BE_REMOVED, Messages.XENCENTER))) + { + dlg.ShowDialog(Parent); + } + return false; + } + DialogResult dialogResult; using (var dlg = new ThreeButtonDialog( new ThreeButtonDialog.Details(SystemIcons.Warning, string.Format(Messages.CONFIRM_DELETE_PVS_SITE, site.Name), Messages.XENCENTER), diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index 2bba088f3..3a4af2472 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -161,13 +161,6 @@ ConsolePanel.cs - - - Component - - - CollapsingPvsSiteServerDataGridView.cs - Component diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index c48c39783..827fbc1fd 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -27885,6 +27885,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to This PVS site cannot be removed because it contains running proxies.. + /// + public static string PVS_SITE_CANNOT_BE_REMOVED { + get { + return ResourceManager.GetString("PVS_SITE_CANNOT_BE_REMOVED", resourceCulture); + } + } + /// /// Looks up a localized string similar to PVS Servers on site {0}'. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index e05e21ff3..211886dc4 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -13249,4 +13249,7 @@ You will need to navigate to the Console on each of the selected VMs to complete Are you sure you want to delete '{0}'? + + This PVS site cannot be removed because it contains running proxies. + \ No newline at end of file From d827361acc9fb6bd7ba7c590a53279856d3723e5 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Wed, 5 Oct 2016 09:51:23 +0100 Subject: [PATCH 3/4] CP-19086: Improvements to the PVS cache UI - Removed the cache configuration gridview from the PVS tab. This tab now contains the button to configure PVS cache and the VMs grid - Show the confirmation dialog even when deleting a new site - Enabled the "View PVS servers" button only if the site has servers Signed-off-by: Mihaela Stoica --- .../Dialogs/PvsCacheConfigurationDialog.cs | 34 ++-- .../PvsPages/PvsCacheConfigurationPage.cs | 2 +- XenAdmin/TabPages/PvsPage.Designer.cs | 158 +++++------------- XenAdmin/TabPages/PvsPage.cs | 67 +------- XenAdmin/TabPages/PvsPage.resx | 157 +++-------------- 5 files changed, 94 insertions(+), 324 deletions(-) diff --git a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs index 0291ad9e9..c81800cc7 100644 --- a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs +++ b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs @@ -33,7 +33,6 @@ using System; using System.Collections.Generic; using System.Drawing; using System.Linq; -using System.Runtime.Remoting.Messaging; using System.Windows.Forms; using XenAdmin.Actions; using XenAdmin.Controls; @@ -127,7 +126,8 @@ namespace XenAdmin.Dialogs void DeletePage(PvsCacheConfigurationPage page) { - if (page.PvsSite != null && !DeleteSite(page.PvsSite)) + // try to delete the site (asks user for confirmation), also passing the site name, in case it has changed + if (!DeleteSite(page.PvsSite, page.Text)) return; int selectedIndex = verticalTabs.SelectedIndex; verticalTabs.Items.Remove(page); @@ -139,25 +139,27 @@ namespace XenAdmin.Dialogs ResizeVerticalTabs(verticalTabs.Items.Count); } - private bool DeleteSite(PVS_site site) + private bool DeleteSite(PVS_site site, string siteName) { - if (site == null) - return false; - // We cannot delete the site if there are running proxies - var pvsProxies = connection.Cache.PVS_proxies.Where(s => s.site.opaque_ref == site.opaque_ref).ToList(); - if (pvsProxies.Count > 0) - { - using (var dlg = new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.PVS_SITE_CANNOT_BE_REMOVED, Messages.XENCENTER))) + if (site != null) + { + var pvsProxies = connection.Cache.PVS_proxies.Where(s => s.site.opaque_ref == site.opaque_ref).ToList(); + if (pvsProxies.Count > 0) { - dlg.ShowDialog(Parent); + using (var dlg = + new ThreeButtonDialog(new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.PVS_SITE_CANNOT_BE_REMOVED, Messages.XENCENTER))) + { + dlg.ShowDialog(Parent); + } + return false; } - return false; } + // show confirmation dialog DialogResult dialogResult; using (var dlg = new ThreeButtonDialog( - new ThreeButtonDialog.Details(SystemIcons.Warning, string.Format(Messages.CONFIRM_DELETE_PVS_SITE, site.Name), Messages.XENCENTER), + new ThreeButtonDialog.Details(SystemIcons.Warning, string.Format(Messages.CONFIRM_DELETE_PVS_SITE, siteName), Messages.XENCENTER), ThreeButtonDialog.ButtonOK, ThreeButtonDialog.ButtonCancel)) { @@ -165,6 +167,12 @@ namespace XenAdmin.Dialogs } if (dialogResult != DialogResult.OK) return false; + + // if it is a newly added site, then there's noting we need to do here (it does not exist on the server yet) + if (site == null) + return true; + + // delete existing site var action = new DeletePvsSiteAction(site); new ActionProgressDialog(action, ProgressBarStyle.Blocks).ShowDialog(this); return action.Succeeded; diff --git a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs index df3f7ce36..5097c8894 100644 --- a/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs +++ b/XenAdmin/Dialogs/PvsPages/PvsCacheConfigurationPage.cs @@ -84,7 +84,7 @@ namespace XenAdmin.Dialogs } LoadServers(); - viewPvsServersButton.Enabled = PvsSite != null; + viewPvsServersButton.Enabled = PvsSite != null && PvsSite.servers.Count > 0; } public bool ValidToSave diff --git a/XenAdmin/TabPages/PvsPage.Designer.cs b/XenAdmin/TabPages/PvsPage.Designer.cs index 36308ecae..6624cb73d 100644 --- a/XenAdmin/TabPages/PvsPage.Designer.cs +++ b/XenAdmin/TabPages/PvsPage.Designer.cs @@ -29,32 +29,23 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PvsPage)); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.dataGridViewVms = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); + this.columnVM = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnCachingEnabled = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnPvsSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ColumnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.label2 = new System.Windows.Forms.Label(); - this.dataGridViewSites = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); - this.ColumnSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnConfiguration = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnSRs = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.label1 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.ConfigureButton = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); this.enableButton = new XenAdmin.Commands.CommandButton(); this.disableButton = new XenAdmin.Commands.CommandButton(); - this.columnVM = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnCachingEnabled = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnPvsSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ColumnStatus = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.pageContainerPanel.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewVms)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSites)).BeginInit(); this.panel1.SuspendLayout(); this.panel2.SuspendLayout(); this.SuspendLayout(); @@ -67,12 +58,10 @@ // tableLayoutPanel1 // resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); - this.tableLayoutPanel1.Controls.Add(this.dataGridViewVms, 0, 4); - this.tableLayoutPanel1.Controls.Add(this.label2, 0, 3); - this.tableLayoutPanel1.Controls.Add(this.dataGridViewSites, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.dataGridViewVms, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.label2, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.panel2, 0, 3); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // // dataGridViewVms @@ -91,94 +80,6 @@ this.dataGridViewVms.Name = "dataGridViewVms"; this.dataGridViewVms.ReadOnly = true; // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // dataGridViewSites - // - resources.ApplyResources(this.dataGridViewSites, "dataGridViewSites"); - this.dataGridViewSites.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; - this.dataGridViewSites.BackgroundColor = System.Drawing.SystemColors.Window; - this.dataGridViewSites.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.dataGridViewSites.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.dataGridViewSites.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ColumnSite, - this.ColumnConfiguration, - this.ColumnSRs}); - this.dataGridViewSites.MultiSelect = true; - this.dataGridViewSites.Name = "dataGridViewSites"; - this.dataGridViewSites.ReadOnly = true; - // - // ColumnSite - // - this.ColumnSite.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.ColumnSite.DefaultCellStyle = dataGridViewCellStyle3; - this.ColumnSite.FillWeight = 20F; - resources.ApplyResources(this.ColumnSite, "ColumnSite"); - this.ColumnSite.Name = "ColumnSite"; - this.ColumnSite.ReadOnly = true; - // - // ColumnConfiguration - // - this.ColumnConfiguration.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - this.ColumnConfiguration.DefaultCellStyle = dataGridViewCellStyle4; - this.ColumnConfiguration.FillWeight = 20F; - resources.ApplyResources(this.ColumnConfiguration, "ColumnConfiguration"); - this.ColumnConfiguration.Name = "ColumnConfiguration"; - this.ColumnConfiguration.ReadOnly = true; - this.ColumnConfiguration.Resizable = System.Windows.Forms.DataGridViewTriState.True; - // - // ColumnSRs - // - this.ColumnSRs.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; - this.ColumnSRs.DefaultCellStyle = dataGridViewCellStyle5; - resources.ApplyResources(this.ColumnSRs, "ColumnSRs"); - this.ColumnSRs.Name = "ColumnSRs"; - this.ColumnSRs.ReadOnly = true; - // - // label1 - // - resources.ApplyResources(this.label1, "label1"); - this.label1.Name = "label1"; - // - // panel1 - // - resources.ApplyResources(this.panel1, "panel1"); - this.panel1.Controls.Add(this.ConfigureButton); - this.panel1.Name = "panel1"; - // - // ConfigureButton - // - resources.ApplyResources(this.ConfigureButton, "ConfigureButton"); - this.ConfigureButton.Name = "ConfigureButton"; - this.ConfigureButton.UseVisualStyleBackColor = true; - this.ConfigureButton.Click += new System.EventHandler(this.ConfigureButton_Click); - // - // panel2 - // - resources.ApplyResources(this.panel2, "panel2"); - this.panel2.Controls.Add(this.enableButton); - this.panel2.Controls.Add(this.disableButton); - this.panel2.Name = "panel2"; - // - // enableButton - // - resources.ApplyResources(this.enableButton, "enableButton"); - this.enableButton.Name = "enableButton"; - this.enableButton.UseVisualStyleBackColor = true; - // - // disableButton - // - resources.ApplyResources(this.disableButton, "disableButton"); - this.disableButton.Name = "disableButton"; - this.disableButton.UseVisualStyleBackColor = true; - // // columnVM // this.columnVM.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; @@ -212,6 +113,43 @@ this.ColumnStatus.Name = "ColumnStatus"; this.ColumnStatus.ReadOnly = true; // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // panel1 + // + resources.ApplyResources(this.panel1, "panel1"); + this.panel1.Controls.Add(this.ConfigureButton); + this.panel1.Name = "panel1"; + // + // ConfigureButton + // + resources.ApplyResources(this.ConfigureButton, "ConfigureButton"); + this.ConfigureButton.Name = "ConfigureButton"; + this.ConfigureButton.UseVisualStyleBackColor = true; + this.ConfigureButton.Click += new System.EventHandler(this.ConfigureButton_Click); + // + // panel2 + // + resources.ApplyResources(this.panel2, "panel2"); + this.panel2.Controls.Add(this.enableButton); + this.panel2.Controls.Add(this.disableButton); + this.panel2.Name = "panel2"; + // + // enableButton + // + resources.ApplyResources(this.enableButton, "enableButton"); + this.enableButton.Name = "enableButton"; + this.enableButton.UseVisualStyleBackColor = true; + // + // disableButton + // + resources.ApplyResources(this.disableButton, "disableButton"); + this.disableButton.Name = "disableButton"; + this.disableButton.UseVisualStyleBackColor = true; + // // PvsPage // resources.ApplyResources(this, "$this"); @@ -221,7 +159,6 @@ this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewVms)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSites)).EndInit(); this.panel1.ResumeLayout(false); this.panel2.ResumeLayout(false); this.ResumeLayout(false); @@ -232,13 +169,8 @@ #endregion private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private Controls.DataGridViewEx.DataGridViewEx dataGridViewSites; - private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private Controls.DataGridViewEx.DataGridViewEx dataGridViewVms; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnSite; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnConfiguration; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnSRs; private XenAdmin.Commands.CommandButton disableButton; private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Panel panel2; diff --git a/XenAdmin/TabPages/PvsPage.cs b/XenAdmin/TabPages/PvsPage.cs index c3d2bdc41..26765327c 100644 --- a/XenAdmin/TabPages/PvsPage.cs +++ b/XenAdmin/TabPages/PvsPage.cs @@ -89,72 +89,10 @@ namespace XenAdmin.TabPages connection.Cache.RegisterBatchCollectionChanged(PvsProxyBatchCollectionChanged); } - LoadSites(); LoadVMs(); } } - #region PVS cache configuration - - private void LoadSites() - { - Program.AssertOnEventThread(); - - if (!Visible) - return; - - try - { - dataGridViewSites.SuspendLayout(); - dataGridViewSites.Rows.Clear(); - - var pvsSites = Connection.Cache.PVS_sites.ToList(); - pvsSites.Sort(); - - foreach (var pvsSite in pvsSites) - dataGridViewSites.Rows.Add(NewPvsSiteRow(pvsSite)); - - if (dataGridViewSites.SelectedRows.Count == 0 && dataGridViewSites.Rows.Count > 0) - dataGridViewSites.Rows[0].Selected = true; - } - finally - { - dataGridViewSites.ResumeLayout(); - } - } - - private DataGridViewRow NewPvsSiteRow(PVS_site pvsSite) - { - var siteCell = new DataGridViewTextBoxCell { Value = pvsSite.Name }; - - var cacheSrs = new List(); - foreach (var cacheStorage in Connection.ResolveAll(pvsSite.cache_storage)) - { - var sr = Connection.Resolve(cacheStorage.SR); - if (sr != null && sr.GetSRType(false) != SR.SRTypes.tmpfs) //not memory SR - { - cacheSrs.Add(sr); - } - } - - var configurationCell = new DataGridViewTextBoxCell - { - Value = cacheSrs.Count > 0 - ? Messages.PVS_CACHE_MEMORY_AND_DISK - : pvsSite.cache_storage.Count > 0 ? Messages.PVS_CACHE_MEMORY_ONLY : Messages.PVS_CACHE_NOT_CONFIGURED - }; - var cacheSrsCell = new DataGridViewTextBoxCell - { - Value = cacheSrs.Count > 0 ? string.Join(Messages.LIST_SEPARATOR, cacheSrs) : Messages.NO_VALUE - }; - - var newRow = new DataGridViewRow { Tag = pvsSite }; - newRow.Cells.AddRange(siteCell, configurationCell, cacheSrsCell); - - return newRow; - } - #endregion - #region VMs private void LoadVMs() @@ -340,7 +278,7 @@ namespace XenAdmin.TabPages private void PvsSiteBatchCollectionChanged(object sender, EventArgs e) { - Program.Invoke(this, LoadSites); + Program.Invoke(this, LoadVMs); } private void PvsProxyBatchCollectionChanged(object sender, EventArgs e) @@ -379,9 +317,6 @@ namespace XenAdmin.TabPages DataGridViewRow row1 = (DataGridViewRow)first; DataGridViewRow row2 = (DataGridViewRow)second; - string ce1 = row1.Cells[1].Value.ToString(); - string ce2 = row2.Cells[1].Value.ToString(); - int cachingEnabled1 = row1.Cells[1].Value.ToString().Equals(Messages.YES) ? 0 : 1; int cachingEnabled2 = row2.Cells[1].Value.ToString().Equals(Messages.YES) ? 0 : 1; diff --git a/XenAdmin/TabPages/PvsPage.resx b/XenAdmin/TabPages/PvsPage.resx index 59648ed06..e86808040 100644 --- a/XenAdmin/TabPages/PvsPage.resx +++ b/XenAdmin/TabPages/PvsPage.resx @@ -169,13 +169,16 @@ Segoe UI, 9pt - 0, 324 + 0, 62 0, 0, 1, 5 + + 900, 500 + - 1108, 237 + 854, 279 10 @@ -199,7 +202,7 @@ Segoe UI, 11.25pt - 0, 301 + 0, 39 0, 10, 0, 0 @@ -228,105 +231,6 @@ 1 - - Top, Left, Right - - - True - - - PVS Site - - - 80 - - - 80 - - - True - - - Cache configuration - - - 140 - - - 140 - - - True - - - Cache SRs - - - 80 - - - Segoe UI, 9pt - - - 0, 23 - - - 0, 0, 1, 5 - - - 1108, 228 - - - 5 - - - dataGridViewSites - - - XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - - - tableLayoutPanel1 - - - 2 - - - True - - - Segoe UI, 11.25pt - - - 0, 0 - - - 0, 0, 0, 0 - - - 0, 0, 0, 3 - - - 171, 23 - - - 8 - - - PVS Cache configuration - - - label1 - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - tableLayoutPanel1 - - - 3 - True @@ -340,7 +244,7 @@ 5, 0, 5, 0 - 150, 23 + 170, 23 6 @@ -361,10 +265,13 @@ 0 - 3, 259 + 0, 0 + + + 0, 0, 0, 0 - 153, 29 + 173, 29 13 @@ -379,7 +286,7 @@ tableLayoutPanel1 - 4 + 2 True @@ -445,7 +352,10 @@ 1 - 3, 569 + 0, 349 + + + 0, 3, 0, 3 349, 29 @@ -463,7 +373,7 @@ tableLayoutPanel1 - 5 + 3 Fill @@ -471,11 +381,14 @@ 10, 10 + + 905, 602 + - 6 + 4 - 1109, 601 + 855, 381 0 @@ -493,13 +406,13 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="dataGridViewSites" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="panel1" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="panel2" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="dataGridViewVms" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label2" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="panel1" Row="0" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="panel2" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="Percent,100" /><Rows Styles="AutoSize,20,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> 0, 78 - 1129, 621 + 875, 401 pageContainerPanel @@ -523,25 +436,7 @@ 8, 8, 8, 8 - 1129, 699 - - - ColumnSite - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnConfiguration - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColumnSRs - - - System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + 875, 479 columnVM From c8d86baeeeb84f4c49e494a3faf4eff438b3a1a5 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Wed, 5 Oct 2016 14:12:24 +0100 Subject: [PATCH 4/4] CP-19086: More improvements to the PVS cache UI - in the ConfigurePvsSiteAction, we now check if a site still exists, before trying to configure it - added a CollectionChanged event handler in the Cache configuration dialog, and if we observe that a site has been added, we add it to the dialog as a new page Signed-off-by: Mihaela Stoica --- .../PvsCacheConfigurationDialog.Designer.cs | 1 + .../Dialogs/PvsCacheConfigurationDialog.cs | 22 +++++++++++++++++++ .../Actions/PVS/ConfigurePvsSiteAction.cs | 21 +++++++++++++++--- 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.Designer.cs b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.Designer.cs index c699b92d4..46b043329 100644 --- a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.Designer.cs +++ b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.Designer.cs @@ -116,6 +116,7 @@ namespace XenAdmin.Dialogs resources.ApplyResources(this, "$this"); this.Controls.Add(this.BlurbLabel); this.Name = "PvsCacheConfigurationDialog"; + this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.PvsCacheConfigurationDialog_FormClosed); this.Controls.SetChildIndex(this.okButton, 0); this.Controls.SetChildIndex(this.cancelButton, 0); this.Controls.SetChildIndex(this.splitContainer, 0); diff --git a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs index c81800cc7..02d0bf19f 100644 --- a/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs +++ b/XenAdmin/Dialogs/PvsCacheConfigurationDialog.cs @@ -31,6 +31,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Drawing; using System.Linq; using System.Windows.Forms; @@ -55,6 +56,7 @@ namespace XenAdmin.Dialogs Text = string.Format(Messages.PVS_CACHE_CONFIG_DIALOG_TITLE, connection.Name); Rebuild(); + this.connection.Cache.RegisterCollectionChanged(PvsSiteCollectionChanged); } protected override string GetTabTitle(VerticalTabs.VerticalTab verticalTab) @@ -334,5 +336,25 @@ namespace XenAdmin.Dialogs return actions; } + + private void PvsSiteCollectionChanged(object sender, CollectionChangeEventArgs e) + { + if (e.Action == CollectionChangeAction.Add) + { + PVS_site addedSite = e.Element as PVS_site; + + Program.Invoke(this, () => + { + ResizeVerticalTabs(verticalTabs.Items.Count + 1); + NewPage(addedSite); + }); + } + + } + + private void PvsCacheConfigurationDialog_FormClosed(object sender, FormClosedEventArgs e) + { + this.connection.Cache.DeregisterCollectionChanged(PvsSiteCollectionChanged); + } } } diff --git a/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs b/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs index 689d10adc..0480e00de 100644 --- a/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs +++ b/XenModel/Actions/PVS/ConfigurePvsSiteAction.cs @@ -38,6 +38,8 @@ namespace XenAdmin.Actions { public class ConfigurePvsSiteAction : AsyncAction { + private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private PVS_site pvsSite; private readonly List pvsCacheStorages; private readonly string siteName; @@ -71,10 +73,23 @@ namespace XenAdmin.Actions PollToCompletion(0,10); pvsSite = Connection.WaitForCache(new XenRef(Result)); } - else if (pvsSite.name_label != siteName) + else { - // set name_label - PVS_site.set_name_label(Session, pvsSite.opaque_ref, siteName); + // get the site again from cache, just in case it changed (or dissapeared) in the meantime + pvsSite = Connection.Cache.Resolve(new XenRef(pvsSite.opaque_ref)); + if (pvsSite == null) + { + log.InfoFormat("PVS Site '{0}' cannot be configured, because it cannot be found.", siteName); + PercentComplete = 100; + Description = Messages.COMPLETED; + return; + } + + if (pvsSite.name_label != siteName) + { + // set name_label + PVS_site.set_name_label(Session, pvsSite.opaque_ref, siteName); + } } PercentComplete = 10;