diff --git a/XenAdmin/Wizards/NewSRWizard.cs b/XenAdmin/Wizards/NewSRWizard.cs index f3c607dd7..bd013f65f 100644 --- a/XenAdmin/Wizards/NewSRWizard.cs +++ b/XenAdmin/Wizards/NewSRWizard.cs @@ -52,6 +52,7 @@ namespace XenAdmin.Wizards #region Wizard pages private readonly NewSrWizardNamePage xenTabPageSrName; private readonly CIFS_ISO xenTabPageCifsIso; + private readonly CifsFrontend xenTabPageCifs; private readonly CSLG xenTabPageCslg; private readonly VHDoNFS xenTabPageVhdoNFS; private readonly NFS_ISO xenTabPageNfsIso; @@ -103,6 +104,7 @@ namespace XenAdmin.Wizards xenTabPageSrName = new NewSrWizardNamePage(); xenTabPageCifsIso = new CIFS_ISO(); + xenTabPageCifs = new CifsFrontend(); xenTabPageCslg = new CSLG(); xenTabPageVhdoNFS = new VHDoNFS(); xenTabPageNfsIso = new NFS_ISO(); @@ -305,6 +307,8 @@ namespace XenAdmin.Wizards } else if (m_srWizardType is SrWizardType_CifsIso) AddPage(xenTabPageCifsIso); + else if (m_srWizardType is SrWizardType_Cifs) + AddPage(xenTabPageCifs); else if (m_srWizardType is SrWizardType_NfsIso) AddPage(xenTabPageNfsIso); @@ -333,6 +337,8 @@ namespace XenAdmin.Wizards xenTabPageCifsIso.SrWizardType = m_srWizardType; else if (m_srWizardType is SrWizardType_NfsIso) xenTabPageNfsIso.SrWizardType = m_srWizardType; + else if (m_srWizardType is SrWizardType_Cifs) + xenTabPageCifs.SrWizardType = m_srWizardType; #endregion } else if (senderPagetype == typeof(CIFS_ISO)) @@ -340,6 +346,11 @@ namespace XenAdmin.Wizards m_srWizardType.DeviceConfig = xenTabPageCifsIso.DeviceConfig; SetCustomDescription(m_srWizardType, xenTabPageCifsIso.SrDescription); } + else if (senderPagetype == typeof(CifsFrontend)) + { + m_srWizardType.DeviceConfig = xenTabPageCifs.DeviceConfig; + SetCustomDescription(m_srWizardType, xenTabPageCifs.SrDescription); + } else if (senderPagetype == typeof(LVMoISCSI)) { m_srWizardType.UUID = xenTabPageLvmoIscsi.UUID; diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.Designer.cs b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.Designer.cs index f849ac323..92aa3365c 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.Designer.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.Designer.cs @@ -40,6 +40,7 @@ this.upsellPage1 = new XenAdmin.Controls.UpsellPage(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel1 = new System.Windows.Forms.Panel(); + this.radioButtonCifs = new System.Windows.Forms.RadioButton(); this.verticalDividerLine = new System.Windows.Forms.Label(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.SRBlurb = new XenAdmin.Controls.Common.AutoHeightLabel(); @@ -131,6 +132,7 @@ // // panel1 // + this.panel1.Controls.Add(this.radioButtonCifs); this.panel1.Controls.Add(this.verticalDividerLine); this.panel1.Controls.Add(this.labelVirtualDiskStorage); this.panel1.Controls.Add(this.labelISOlibrary); @@ -143,6 +145,15 @@ resources.ApplyResources(this.panel1, "panel1"); this.panel1.Name = "panel1"; // + // radioButtonCifs + // + resources.ApplyResources(this.radioButtonCifs, "radioButtonCifs"); + this.radioButtonCifs.BackColor = System.Drawing.Color.Transparent; + this.radioButtonCifs.ForeColor = System.Drawing.SystemColors.WindowText; + this.radioButtonCifs.Name = "radioButtonCifs"; + this.radioButtonCifs.UseVisualStyleBackColor = false; + this.radioButtonCifs.CheckedChanged += new System.EventHandler(this.RadioButton_CheckedChanged); + // // verticalDividerLine // this.verticalDividerLine.BackColor = System.Drawing.SystemColors.ControlDark; @@ -208,5 +219,6 @@ private XenAdmin.Controls.DeprecationBanner deprecationBanner; private System.Windows.Forms.Label verticalDividerLine; private System.Windows.Forms.Label selectedStoreTypeLabel; + private System.Windows.Forms.RadioButton radioButtonCifs; } } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs index 34ff21919..c4fcc5ff6 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.cs @@ -61,6 +61,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages radioButtonNfsIso.Tag = new SrWizardType_NfsIso(); radioButtonCifsIso.Tag = new SrWizardType_CifsIso(); radioButtonCslg.Tag = new SrWizardType_Cslg(); + radioButtonCifs.Tag = new SrWizardType_Cifs(); } private void SetupDeprecationBanner(bool visible) @@ -89,6 +90,8 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages { radioButtonCslg.Visible = !Helpers.CreedenceOrGreater(Connection); //Hide iSL radio button for Creedence or higher (StorageLink is not supported) + radioButtonCifs.Enabled = !Helpers.FeatureForbidden(Connection, Host.RestrictCifs); + foreach (var radioButton in RadioButtons) { var frontend = (SrWizardType)radioButton.Tag; @@ -214,7 +217,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages private RadioButton[] RadioButtons { - get { return new[] { radioButtonNfs, radioButtonIscsi, radioButtonFibreChannel, radioButtonCslg, radioButtonNfsIso, radioButtonCifsIso }; } + get { return new[] { radioButtonNfs, radioButtonIscsi, radioButtonFibreChannel, radioButtonCslg, radioButtonNfsIso, radioButtonCifsIso, radioButtonCifs }; } } public void PreselectNewSrWizardType(Type type) diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.resx b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.resx index 84804c0a8..a489d5bb3 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.resx +++ b/XenAdmin/Wizards/NewSRWizard_Pages/ChooseSrTypePage.resx @@ -112,20 +112,20 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + True - + Segoe UI, 9pt - + NoControl @@ -145,13 +145,13 @@ radioButtonNfs - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 3 + 4 True @@ -178,13 +178,13 @@ radioButtonIscsi - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 4 + 5 True @@ -196,7 +196,7 @@ NoControl - 6, 183 + 6, 208 67, 19 @@ -211,13 +211,13 @@ radioButtonNfsIso - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 8 + 9 True @@ -229,7 +229,7 @@ NoControl - 6, 159 + 6, 184 172, 19 @@ -244,13 +244,13 @@ radioButtonCifsIso - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 7 + 8 True @@ -277,13 +277,13 @@ radioButtonFibreChannel - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 5 + 6 True @@ -295,7 +295,7 @@ NoControl - 6, 103 + 6, 128 150, 19 @@ -310,13 +310,13 @@ radioButtonCslg - System.Windows.Forms.RadioButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 6 + 7 True @@ -328,7 +328,7 @@ NoControl - 3, 133 + 3, 158 3, 10, 3, 10 @@ -346,13 +346,13 @@ labelISOlibrary - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 2 + 3 True @@ -382,13 +382,13 @@ labelVirtualDiskStorage - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 1 + 2 True @@ -420,7 +420,7 @@ 3, 51 - 243, 67 + 297, 67 0 @@ -440,6 +440,39 @@ 2 + + True + + + Segoe UI, 9pt + + + NoControl + + + 6, 103 + + + 48, 19 + + + 19 + + + CIFS + + + radioButtonCifs + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + 222, 0 @@ -456,19 +489,19 @@ verticalDividerLine - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 panel1 - 0 + 1 3, 3 - 225, 224 + 225, 271 35 @@ -477,7 +510,7 @@ panel1 - System.Windows.Forms.Panel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -516,7 +549,7 @@ selectedStoreTypeLabel - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel2 @@ -543,7 +576,7 @@ tableLayoutPanel2 - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel1 @@ -573,7 +606,7 @@ tableLayoutPanel1 - System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 $this @@ -681,7 +714,7 @@ selectedStoreTypeLabel - System.Windows.Forms.Label, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 tableLayoutPanel2 @@ -689,7 +722,7 @@ 3 - + True diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.Designer.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.Designer.cs new file mode 100644 index 000000000..ebd74f3b5 --- /dev/null +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.Designer.cs @@ -0,0 +1,176 @@ +namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends +{ + partial class CifsFrontend + { + /// + /// 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() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CifsFrontend)); + this.CifsScanButton = new System.Windows.Forms.Button(); + this.listBoxCifsSRs = new XenAdmin.Controls.SRListBox(); + this.radioButtonCifsReattach = new System.Windows.Forms.RadioButton(); + this.radioButtonCifsNew = new System.Windows.Forms.RadioButton(); + this.label2 = new System.Windows.Forms.Label(); + this.labelAdvancedOptions = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.CifsServerPathTextBox = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.passwordTextBox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.userNameTextBox = new System.Windows.Forms.TextBox(); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // CifsScanButton + // + resources.ApplyResources(this.CifsScanButton, "CifsScanButton"); + this.CifsScanButton.Name = "CifsScanButton"; + this.CifsScanButton.UseVisualStyleBackColor = true; + this.CifsScanButton.Click += new System.EventHandler(this.buttonCifsScan_Click); + // + // listBoxCifsSRs + // + this.tableLayoutPanel1.SetColumnSpan(this.listBoxCifsSRs, 3); + resources.ApplyResources(this.listBoxCifsSRs, "listBoxCifsSRs"); + this.listBoxCifsSRs.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed; + this.listBoxCifsSRs.Name = "listBoxCifsSRs"; + this.listBoxCifsSRs.Sorted = true; + this.listBoxCifsSRs.SelectedIndexChanged += new System.EventHandler(this.listBoxCifsSRs_SelectedIndexChanged); + // + // radioButtonCifsReattach + // + resources.ApplyResources(this.radioButtonCifsReattach, "radioButtonCifsReattach"); + this.tableLayoutPanel1.SetColumnSpan(this.radioButtonCifsReattach, 3); + this.radioButtonCifsReattach.Name = "radioButtonCifsReattach"; + this.radioButtonCifsReattach.UseVisualStyleBackColor = true; + this.radioButtonCifsReattach.CheckedChanged += new System.EventHandler(this.radioButtonCifsReattach_CheckedChanged); + // + // radioButtonCifsNew + // + resources.ApplyResources(this.radioButtonCifsNew, "radioButtonCifsNew"); + this.radioButtonCifsNew.Checked = true; + this.tableLayoutPanel1.SetColumnSpan(this.radioButtonCifsNew, 3); + this.radioButtonCifsNew.Name = "radioButtonCifsNew"; + this.radioButtonCifsNew.TabStop = true; + this.radioButtonCifsNew.UseVisualStyleBackColor = true; + this.radioButtonCifsNew.CheckedChanged += new System.EventHandler(this.radioButtonCifsNew_CheckedChanged); + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.ForeColor = System.Drawing.SystemColors.WindowText; + this.label2.Name = "label2"; + // + // labelAdvancedOptions + // + resources.ApplyResources(this.labelAdvancedOptions, "labelAdvancedOptions"); + this.labelAdvancedOptions.ForeColor = System.Drawing.SystemColors.WindowText; + this.labelAdvancedOptions.Name = "labelAdvancedOptions"; + // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.ForeColor = System.Drawing.SystemColors.WindowText; + this.label3.Name = "label3"; + // + // CifsServerPathTextBox + // + resources.ApplyResources(this.CifsServerPathTextBox, "CifsServerPathTextBox"); + this.CifsServerPathTextBox.Name = "CifsServerPathTextBox"; + this.CifsServerPathTextBox.TextChanged += new System.EventHandler(this.AnyCifsParameters_TextChanged); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.passwordTextBox, 1, 4); + this.tableLayoutPanel1.Controls.Add(this.label4, 0, 4); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.label3, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.CifsServerPathTextBox, 1, 1); + this.tableLayoutPanel1.Controls.Add(this.CifsScanButton, 2, 1); + this.tableLayoutPanel1.Controls.Add(this.labelAdvancedOptions, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.userNameTextBox, 1, 3); + this.tableLayoutPanel1.Controls.Add(this.radioButtonCifsNew, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.radioButtonCifsReattach, 0, 7); + this.tableLayoutPanel1.Controls.Add(this.listBoxCifsSRs, 0, 8); + this.tableLayoutPanel1.Controls.Add(this.label2, 1, 2); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // passwordTextBox + // + resources.ApplyResources(this.passwordTextBox, "passwordTextBox"); + this.passwordTextBox.Name = "passwordTextBox"; + this.passwordTextBox.UseSystemPasswordChar = true; + this.passwordTextBox.TextChanged += new System.EventHandler(this.AnyCifsParameters_TextChanged); + // + // label4 + // + resources.ApplyResources(this.label4, "label4"); + this.label4.ForeColor = System.Drawing.SystemColors.WindowText; + this.label4.Name = "label4"; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.tableLayoutPanel1.SetColumnSpan(this.label1, 3); + this.label1.Name = "label1"; + // + // userNameTextBox + // + resources.ApplyResources(this.userNameTextBox, "userNameTextBox"); + this.userNameTextBox.Name = "userNameTextBox"; + this.userNameTextBox.TextChanged += new System.EventHandler(this.AnyCifsParameters_TextChanged); + // + // CifsFrontend + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "CifsFrontend"; + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Button CifsScanButton; + private System.Windows.Forms.RadioButton radioButtonCifsReattach; + private XenAdmin.Controls.SRListBox listBoxCifsSRs; + private System.Windows.Forms.RadioButton radioButtonCifsNew; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label labelAdvancedOptions; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox CifsServerPathTextBox; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox passwordTextBox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox userNameTextBox; + } +} diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.cs new file mode 100644 index 000000000..41797885d --- /dev/null +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.cs @@ -0,0 +1,265 @@ +/* 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; +using System.Collections.Generic; +using System.Windows.Forms; +using XenAdmin.Actions; +using XenAPI; +using XenAdmin.Controls; +using XenAdmin.Core; +using XenAdmin.Dialogs; + + +namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends +{ + public partial class CifsFrontend : XenTabPage + { + private const string SERVER = "server"; + private const string SERVERPATH = "serverpath"; + private const string OPTIONS = "options"; + + public CifsFrontend() + { + InitializeComponent(); + ToggleReattachControlsEnabledState(false); + } + + #region XenTabPage overrides + + public override string Text { get { return Messages.NEWSR_LOCATION; } } + + public override string PageTitle { get { return Messages.NEWSR_PATH_CIFS; } } + + public override string HelpID { get { return "Location_CIFS"; } } + + public override bool EnableNext() + { + return SrWizardHelpers.ValidateCifsSharename(CifsServerPathTextBox.Text) + && (radioButtonCifsNew.Checked || listBoxCifsSRs.SelectedIndex > -1); + } + + public override bool EnablePrevious() + { + if (SrWizardType.DisasterRecoveryTask && SrWizardType.SrToReattach == null) + return false; + + return true; + } + + public override void PopulatePage() + { + if (!SrWizardType.AllowToCreateNewSr) + HideCreateControls(); + + if (SrWizardType.UUID != null) + listBoxCifsSRs.SetMustSelectUUID(SrWizardType.UUID); + } + + #endregion + + private void UpdateButtons() + { + CifsScanButton.Enabled = SrWizardHelpers.ValidateCifsSharename(CifsServerPathTextBox.Text); + OnPageUpdated(); + } + + private void AnyCifsParameters_TextChanged(object sender, EventArgs e) + { + CifsScanButton.Enabled = SrWizardHelpers.ValidateCifsSharename(CifsServerPathTextBox.Text); + + listBoxCifsSRs.Items.Clear(); + ToggleReattachControlsEnabledState(false); + + if(radioButtonCifsNew.Enabled) + radioButtonCifsNew.Checked = true; + + UpdateButtons(); + } + + private void radioButtonCifsReattach_CheckedChanged(object sender, EventArgs e) + { + radioButtonCifsNew.Checked = !radioButtonCifsReattach.Checked; + UpdateButtons(); + } + + private void radioButtonCifsNew_CheckedChanged(object sender, EventArgs e) + { + if (radioButtonCifsNew.Checked) + listBoxCifsSRs.SelectedIndex = -1; + + radioButtonCifsReattach.Checked = !radioButtonCifsNew.Checked; + UpdateButtons(); + } + + private void buttonCifsScan_Click(object sender, EventArgs e) + { + try + { + CifsScanButton.Enabled = false; + + // Perform an SR.probe to see if there is already an SR present + Dictionary dconf = new Dictionary(); + string[] fullpath = CifsServerPathTextBox.Text.Split(new char[] { ':' }); + dconf[SERVER] = fullpath[0]; + if (fullpath.Length > 1) + { + dconf[SERVERPATH] = fullpath[1]; + } + + if (userNameTextBox.Text.Trim().Length > 0 || passwordTextBox.Text.Trim().Length > 0) + { + dconf["username"] = userNameTextBox.Text; + dconf["password"] = passwordTextBox.Text; + } + + Host master = Helpers.GetMaster(Connection); + if (master == null) + return; + + // Start probe + SrProbeAction action = new SrProbeAction(Connection, master, SR.SRTypes.cifs, dconf); + ActionProgressDialog dialog = new ActionProgressDialog(action, ProgressBarStyle.Marquee); + dialog.ShowCancel = true; + dialog.ShowDialog(this); + + if (radioButtonCifsNew.Enabled) + radioButtonCifsNew.Checked = true; + + listBoxCifsSRs.Items.Clear(); + + if (!action.Succeeded) + return; + + List SRs = SR.ParseSRListXML(action.Result); + if (SRs.Count == 0) + { + // Disable box + ToggleReattachControlsEnabledState(false); + listBoxCifsSRs.Items.Add(Messages.NEWSR_NO_SRS_FOUND); + return; + } + + // Fill box + foreach(SR.SRInfo info in SRs) + listBoxCifsSRs.Items.Add(info); + + listBoxCifsSRs.TryAndSelectUUID(); + + ToggleReattachControlsEnabledState(true); + } + finally + { + UpdateButtons(); + } + } + + private void listBoxCifsSRs_SelectedIndexChanged(object sender, EventArgs e) + { + if (listBoxCifsSRs.SelectedIndex == -1) + return; + + radioButtonCifsReattach.Checked = true; + UpdateButtons(); + } + + #region Accessors + + public SrWizardType SrWizardType { private get; set; } + + public string UUID + { + get + { + if (radioButtonCifsNew.Checked) + return null; + + SR.SRInfo srInfo = listBoxCifsSRs.SelectedItem as SR.SRInfo; + if (srInfo == null) + return null; + + return srInfo.UUID; + } + } + + public Dictionary DeviceConfig + { + get + { + var dconf = new Dictionary(); + + string[] fullpath = CifsServerPathTextBox.Text.Split(new char[] { ':' }); + + dconf[SERVER] = fullpath[0]; + + if (fullpath.Length > 1) + { + dconf[SERVERPATH] = fullpath[1]; + } + + if (userNameTextBox.Text.Trim().Length > 0 || passwordTextBox.Text.Trim().Length > 0) + { + dconf["username"] = userNameTextBox.Text; + dconf["password"] = passwordTextBox.Text; + } + + return dconf; + } + } + + public string SrDescription + { + get + { + return string.IsNullOrEmpty(CifsServerPathTextBox.Text) + ? null + : string.Format(Messages.NEWSR_ACTION, CifsServerPathTextBox.Text); + } + } + + #endregion + + private void HideCreateControls() + { + radioButtonCifsNew.Checked = false; + radioButtonCifsReattach.Checked = true; + + radioButtonCifsNew.Enabled = false; + radioButtonCifsReattach.Enabled = true; + } + + private void ToggleReattachControlsEnabledState(bool enable) + { + radioButtonCifsReattach.Enabled = enable; + listBoxCifsSRs.Enabled = enable; + } + } +} diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.ja.resx b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.ja.resx new file mode 100644 index 000000000..95a5a780c --- /dev/null +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.ja.resx @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Left + + + + False + + + NoControl + + + + 427, 49 + + + 70, 23 + + + 3 + + + &Scan + + + CifsScanButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 3 + + + Left, Right + + + 78, 132 + + + 343, 20 + + + 11 + + + passwordTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Left + + + True + + + NoControl + + + 3, 135 + + + 56, 13 + + + 10 + + + Password: + + + MiddleLeft + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + Fill + + + 3, 0 + + + 3, 0, 3, 20 + + + 494, 26 + + + 0 + + + Provide the name of the share where your SR is located, optionally specifying advanced options. Indicate whether you wish to create a new SR or reattach an existing SR before proceeding. + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Left + + + True + + + NoControl + + + 3, 54 + + + 69, 13 + + + 1 + + + S&hare Name: + + + MiddleLeft + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Left, Right + + + 78, 50 + + + 343, 20 + + + 2 + + + CifsServerPathTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Left + + + True + + + NoControl + + + 3, 109 + + + 61, 13 + + + 5 + + + &User name: + + + MiddleLeft + + + labelAdvancedOptions + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Left, Right + + + 78, 106 + + + 343, 20 + + + 6 + + + userNameTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + True + + + NoControl + + + 3, 180 + + + 3, 25, 3, 3 + + + 106, 17 + + + 7 + + + &Create a new SR + + + radioButtonCifsNew + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + True + + + NoControl + + + 3, 203 + + + 143, 17 + + + 8 + + + &Reattach an existing SR: + + + radioButtonCifsReattach + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 78, 75 + + + 3, 0, 3, 15 + + + 111, 13 + + + 4 + + + Example: \\server\path + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Fill + + + 0, 0 + + + 9 + + + 500, 461 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="passwordTextBox" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="CifsServerPathTextBox" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="CifsScanButton" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="labelAdvancedOptions" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="userNameTextBox" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="radioButtonCifsNew" Row="6" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="radioButtonCifsReattach" Row="7" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="listBoxCifsSRs" Row="8" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="label2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,Absolute,20" /></TableLayoutSettings> + + + Fill + + + False + + + 14 + + + 3, 226 + + + 494, 232 + + + 9 + + + listBoxCifsSRs + + + XenAdmin.Controls.SRListBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tableLayoutPanel1 + + + 10 + + + True + + + 96, 96 + + + 500, 461 + + + CifsFrontend + + + XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.resx b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.resx new file mode 100644 index 000000000..95a5a780c --- /dev/null +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.resx @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Left + + + + False + + + NoControl + + + + 427, 49 + + + 70, 23 + + + 3 + + + &Scan + + + CifsScanButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 3 + + + Left, Right + + + 78, 132 + + + 343, 20 + + + 11 + + + passwordTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Left + + + True + + + NoControl + + + 3, 135 + + + 56, 13 + + + 10 + + + Password: + + + MiddleLeft + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + Fill + + + 3, 0 + + + 3, 0, 3, 20 + + + 494, 26 + + + 0 + + + Provide the name of the share where your SR is located, optionally specifying advanced options. Indicate whether you wish to create a new SR or reattach an existing SR before proceeding. + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Left + + + True + + + NoControl + + + 3, 54 + + + 69, 13 + + + 1 + + + S&hare Name: + + + MiddleLeft + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Left, Right + + + 78, 50 + + + 343, 20 + + + 2 + + + CifsServerPathTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Left + + + True + + + NoControl + + + 3, 109 + + + 61, 13 + + + 5 + + + &User name: + + + MiddleLeft + + + labelAdvancedOptions + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Left, Right + + + 78, 106 + + + 343, 20 + + + 6 + + + userNameTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + True + + + NoControl + + + 3, 180 + + + 3, 25, 3, 3 + + + 106, 17 + + + 7 + + + &Create a new SR + + + radioButtonCifsNew + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + True + + + NoControl + + + 3, 203 + + + 143, 17 + + + 8 + + + &Reattach an existing SR: + + + radioButtonCifsReattach + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 78, 75 + + + 3, 0, 3, 15 + + + 111, 13 + + + 4 + + + Example: \\server\path + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Fill + + + 0, 0 + + + 9 + + + 500, 461 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="passwordTextBox" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="CifsServerPathTextBox" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="CifsScanButton" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="labelAdvancedOptions" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="userNameTextBox" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="radioButtonCifsNew" Row="6" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="radioButtonCifsReattach" Row="7" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="listBoxCifsSRs" Row="8" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="label2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,Absolute,20" /></TableLayoutSettings> + + + Fill + + + False + + + 14 + + + 3, 226 + + + 494, 232 + + + 9 + + + listBoxCifsSRs + + + XenAdmin.Controls.SRListBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tableLayoutPanel1 + + + 10 + + + True + + + 96, 96 + + + 500, 461 + + + CifsFrontend + + + XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.zh-CN.resx b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.zh-CN.resx new file mode 100644 index 000000000..95a5a780c --- /dev/null +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/CIFSFrontend.zh-CN.resx @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + Left + + + + False + + + NoControl + + + + 427, 49 + + + 70, 23 + + + 3 + + + &Scan + + + CifsScanButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + 3 + + + Left, Right + + + 78, 132 + + + 343, 20 + + + 11 + + + passwordTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + Left + + + True + + + NoControl + + + 3, 135 + + + 56, 13 + + + 10 + + + Password: + + + MiddleLeft + + + label4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + True + + + Fill + + + 3, 0 + + + 3, 0, 3, 20 + + + 494, 26 + + + 0 + + + Provide the name of the share where your SR is located, optionally specifying advanced options. Indicate whether you wish to create a new SR or reattach an existing SR before proceeding. + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + Left + + + True + + + NoControl + + + 3, 54 + + + 69, 13 + + + 1 + + + S&hare Name: + + + MiddleLeft + + + label3 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Left, Right + + + 78, 50 + + + 343, 20 + + + 2 + + + CifsServerPathTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + Left + + + True + + + NoControl + + + 3, 109 + + + 61, 13 + + + 5 + + + &User name: + + + MiddleLeft + + + labelAdvancedOptions + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 6 + + + Left, Right + + + 78, 106 + + + 343, 20 + + + 6 + + + userNameTextBox + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + True + + + NoControl + + + 3, 180 + + + 3, 25, 3, 3 + + + 106, 17 + + + 7 + + + &Create a new SR + + + radioButtonCifsNew + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 8 + + + True + + + NoControl + + + 3, 203 + + + 143, 17 + + + 8 + + + &Reattach an existing SR: + + + radioButtonCifsReattach + + + System.Windows.Forms.RadioButton, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 9 + + + True + + + Microsoft Sans Serif, 8.25pt + + + NoControl + + + 78, 75 + + + 3, 0, 3, 15 + + + 111, 13 + + + 4 + + + Example: \\server\path + + + label2 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 11 + + + Fill + + + 0, 0 + + + 9 + + + 500, 461 + + + 0 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="passwordTextBox" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label4" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="label3" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="CifsServerPathTextBox" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="CifsScanButton" Row="1" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="labelAdvancedOptions" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="userNameTextBox" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="radioButtonCifsNew" Row="6" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="radioButtonCifsReattach" Row="7" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="listBoxCifsSRs" Row="8" RowSpan="1" Column="0" ColumnSpan="3" /><Control Name="label2" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,Absolute,20" /></TableLayoutSettings> + + + Fill + + + False + + + 14 + + + 3, 226 + + + 494, 232 + + + 9 + + + listBoxCifsSRs + + + XenAdmin.Controls.SRListBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tableLayoutPanel1 + + + 10 + + + True + + + 96, 96 + + + 500, 461 + + + CifsFrontend + + + XenAdmin.Controls.XenTabPage, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs index be33cf5e3..8302f34cd 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/Frontends/VHDoNFS.cs @@ -160,7 +160,7 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages.Frontends { // Disable box ToggleReattachControlsEnabledState(false); - listBoxNfsSRs.Items.Add(Messages.NEWSR_NFS_NO_SRS_FOUND); + listBoxNfsSRs.Items.Add(Messages.NEWSR_NO_SRS_FOUND); return; } diff --git a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs index a47880814..e54f50fdf 100644 --- a/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs +++ b/XenAdmin/Wizards/NewSRWizard_Pages/SrWizardType.cs @@ -265,6 +265,27 @@ namespace XenAdmin.Wizards.NewSRWizard_Pages } } + public class SrWizardType_Cifs : SrWizardType + { + public override IEnumerable Errors + { + get { return new string[] { /* Failure.SR_BACKEND_FAILURE_111, Failure.SR_BACKEND_FAILURE_112, Failure.SR_BACKEND_FAILURE_113, Failure.SR_BACKEND_FAILURE_114, Failure.SR_BACKEND_FAILURE_454 */ }; } + } + + public override bool IsEnhancedSR { get { return false; } } + public override string FrontendBlurb { get { return Messages.NEWSR_CIFS_BLURB; } } + public override SR.SRTypes Type { get { return SR.SRTypes.cifs; } } + public override string ContentType { get { return ""; } } + public override bool ShowIntroducePrompt { get { return false; } } + public override bool ShowReattachWarning { get { return false; } } + public override bool AllowToCreateNewSr { get { return true; } set { } } + + public override void ResetSrName(IXenConnection connection) + { + SrName = SrWizardHelpers.DefaultSRName(Messages.SRWIZARD_CIFS_STORAGE, connection); + } + } + public class SrWizardType_Cslg : SrWizardType { public override bool IsEnhancedSR { get { return true; } } diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index a9a04faf6..530fa5657 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -559,6 +559,12 @@ MemorySettings.cs + + UserControl + + + CIFSFrontend.cs + UserControl @@ -1704,6 +1710,16 @@ Designer RBACWarningPage.cs + + CIFSFrontend.cs + + + CIFSFrontend.cs + Designer + + + CIFSFrontend.cs + Page_CloudConfigParameters.cs diff --git a/XenModel/Actions/StorageLink/SrCreateAction.cs b/XenModel/Actions/StorageLink/SrCreateAction.cs index 32656d943..57ce7578b 100644 --- a/XenModel/Actions/StorageLink/SrCreateAction.cs +++ b/XenModel/Actions/StorageLink/SrCreateAction.cs @@ -113,7 +113,7 @@ namespace XenAdmin.Actions log.DebugFormat("is shared='{0}'", _srIsShared); string secretuuid = null; - if (Helpers.MidnightRideOrGreater(Connection)) + if (Helpers.MidnightRideOrGreater(Connection) && _srType != XenAPI.SR.SRTypes.cifs) //TEMPORARY: cifs SRs will not use XAPI Secret until development work has been finished. For CP-11364 revert this line. { string value; if (_dconf.TryGetValue("cifspassword", out value)) @@ -130,6 +130,14 @@ namespace XenAdmin.Actions } } + if (Helpers.MidnightRideOrGreater(Connection)) + { + string tempvalue; + System.Diagnostics.Debug.Assert(!_dconf.TryGetValue("password", out tempvalue), "The device config contains 'password', but it should have already been removed!"); + System.Diagnostics.Debug.Assert(!_dconf.TryGetValue("cifspassword", out tempvalue), "The device config contains 'cifspassword', but it should have already been removed!"); + System.Diagnostics.Debug.Assert(!_dconf.TryGetValue("chappassword", out tempvalue), "The device config contains 'chappassword', but it should have already been removed!"); + } + if (_srType == SR.SRTypes.cslg && !Helpers.BostonOrGreater(Connection)) { // make sure this connection is added to the storagelink service. diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 74486b4d1..e082fa499 100644 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -22292,6 +22292,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Select this option if you have a Windows (CIFS) share that you wish to attach to your host or pool.. + /// + public static string NEWSR_CIFS_BLURB { + get { + return ResourceManager.GetString("NEWSR_CIFS_BLURB", resourceCulture); + } + } + /// /// Looks up a localized string similar to Select this option if you have a library of VM installation ISO images available as a Windows (CIFS) share that you wish to attach to your host or pool.. /// @@ -22749,15 +22758,6 @@ namespace XenAdmin { } } - /// - /// Looks up a localized string similar to <No SRs were found>. - /// - public static string NEWSR_NFS_NO_SRS_FOUND { - get { - return ResourceManager.GetString("NEWSR_NFS_NO_SRS_FOUND", resourceCulture); - } - } - /// /// Looks up a localized string similar to No IQNs were found on {0}.. /// @@ -22776,6 +22776,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to <No SRs were found>. + /// + public static string NEWSR_NO_SRS_FOUND { + get { + return ResourceManager.GetString("NEWSR_NO_SRS_FOUND", resourceCulture); + } + } + /// /// Looks up a localized string similar to The given filer has no existing SRs and nowhere to create a new SR.. /// @@ -22785,6 +22794,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Enter a path for your CIFS storage. + /// + public static string NEWSR_PATH_CIFS { + get { + return ResourceManager.GetString("NEWSR_PATH_CIFS", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enter a path for your iSCSI storage. /// @@ -29558,6 +29576,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to CIFS virtual storage. + /// + public static string SRWIZARD_CIFS_STORAGE { + get { + return ResourceManager.GetString("SRWIZARD_CIFS_STORAGE", resourceCulture); + } + } + /// /// Looks up a localized string similar to iSCSI virtual disk storage. /// diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 36883fc97..ede2a15cd 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -7615,6 +7615,9 @@ You should only proceed if you have verified that these settings are correct. NFS SR [{0}] + + Select this option if you have a Windows (CIFS) share that you wish to attach to your host or pool. + Select this option if you have a library of VM installation ISO images available as a Windows (CIFS) share that you wish to attach to your host or pool. @@ -7781,7 +7784,7 @@ VM cloning uses the snapshot and clone capabilities of the filer to provide high Select this option if you have a library of VM installation ISO images available as a NFS share that you wish to attach to your host or pool. - + <No SRs were found> @@ -7793,6 +7796,9 @@ VM cloning uses the snapshot and clone capabilities of the filer to provide high No LUNs were found on {0}. + + Enter a path for your CIFS storage + Enter a path for your iSCSI storage @@ -10185,6 +10191,9 @@ Do you want to connect to the pool master '{1}'? CIFS ISO library + + CIFS virtual storage + iSCSI virtual disk storage diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index c421fc15c..c8a3d83ec 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -243,6 +243,16 @@ namespace XenAPI return h._RestrictCheckpoint; } + public static bool RestrictCifs(Host h) + { + return h._RestrictCifs; + } + + private bool _RestrictCifs + { + get { return BoolKeyPreferTrue(license_params, "restrict_cifs"); } + } + private bool _RestrictWLB { get { return BoolKeyPreferTrue(license_params, "restrict_wlb"); } diff --git a/XenModel/XenAPI-Extensions/SR.cs b/XenModel/XenAPI-Extensions/SR.cs index ff94ad6bf..a80c663c3 100644 --- a/XenModel/XenAPI-Extensions/SR.cs +++ b/XenModel/XenAPI-Extensions/SR.cs @@ -54,7 +54,8 @@ namespace XenAPI local, ext, lvmoiscsi, iso, nfs, lvm, netapp, udev, lvmofc, lvmohba, egenera, egeneracd, dummy, unknown, equal, cslg, shm, iscsi, - ebs, rawhba + ebs, rawhba, + cifs } public const string Content_Type_ISO = "iso"; @@ -247,7 +248,8 @@ namespace XenAPI || type == SRTypes.equal || type == SRTypes.netapp || type == SRTypes.lvmohba - || type == SRTypes.cslg; + || type == SRTypes.cslg + || type == SRTypes.cifs; } }