diff --git a/Console/TeslaConsole/SiteManagement.cs b/Console/TeslaConsole/SiteManagement.cs index c7bea51..d1cf2b7 100644 --- a/Console/TeslaConsole/SiteManagement.cs +++ b/Console/TeslaConsole/SiteManagement.cs @@ -1023,56 +1023,21 @@ public class SiteManagement : Form AppRegistry.AddProduct(dialog.Product); BuildInstallProductMenu(); - if (!dialog.PushNow) + // A package means "deploy now" — install it (file transfer + entry registration on + // completion) to the selected pods. No package → the product is only added to the catalog. + if (dialog.PackagePath == null) { return; } - if (dialog.PackagePath != null) - { - // Package supplied → full install (file transfer + entry registration on completion). - foreach (int podIndex in SelectedInstallablePodIndices()) - { - mPods[podIndex].Install_CustomResolution = null; - mPods[podIndex].Install_HostTypes = new List(); - InstallProduct(podIndex, dialog.Product.Id, dialog.PackagePath); - } - } - else - { - RegisterProductOnSelectedPods(dialog.Product); - } - } - - /// Pushes a catalog product's launch entries to selected connected pods without installing files. - private void RegisterProductOnSelectedPods(ProductDefinition product) - { - int pushed = 0; - int skipped = 0; foreach (int podIndex in SelectedInstallablePodIndices()) { - PodData pod = mPods[podIndex]; - if (!pod.Conn.IsConnected) - { - skipped++; - continue; - } - foreach (LaunchEntryDefinition entry in product.Entries) - { - pod.Conn.AddApp(entry.ToLaunchData(null)); - } - pod.Status = "Registered " + product.Name; - dgvPods.InvalidateCell(colOperationProgress.Index, podIndex); - pushed++; - } - if (skipped > 0) - { - MessageBox.Show(this, - $"Registered \"{product.Name}\" on {pushed} pod(s). {skipped} selected pod(s) were skipped because they are not connected.", - "Register Product", MessageBoxButtons.OK, MessageBoxIcon.Information); + mPods[podIndex].Install_CustomResolution = null; + mPods[podIndex].Install_HostTypes = new List(); + InstallProduct(podIndex, dialog.Product.Id, dialog.PackagePath); } } - /// Indices of selected rows that are local, idle pods eligible for install/registration. + /// Indices of selected rows that are local, idle pods eligible for install. private IEnumerable SelectedInstallablePodIndices() { foreach (DataGridViewRow selectedRow in dgvPods.SelectedRows) diff --git a/Console/TeslaConsole/dlgAddProduct.cs b/Console/TeslaConsole/dlgAddProduct.cs index b602143..0ac66b3 100644 --- a/Console/TeslaConsole/dlgAddProduct.cs +++ b/Console/TeslaConsole/dlgAddProduct.cs @@ -24,8 +24,6 @@ internal class dlgAddProduct : Form private CheckBox chkAutoRestart; - private CheckBox chkPushNow; - private Button cmdOK; private Button cmdCancel; @@ -33,12 +31,10 @@ internal class dlgAddProduct : Form /// The product the operator defined. Valid only after the dialog returns . public ProductDefinition Product { get; private set; } - /// Optional install package (zip) to deploy with the entry; null/empty for entry-only. + /// Optional install package (zip). If set, the product is deployed to the + /// selected pods after it is added; if null/empty, it is only added to the catalog. public string PackagePath => string.IsNullOrWhiteSpace(txtPackage.Text) ? null : txtPackage.Text.Trim(); - /// Whether to push the new product to the currently selected pods after adding it. - public bool PushNow => chkPushNow.Checked; - public dlgAddProduct() { InitializeComponent(); @@ -52,7 +48,6 @@ internal class dlgAddProduct : Form this.txtArgs = new TextBox(); this.txtPackage = new TextBox(); this.chkAutoRestart = new CheckBox(); - this.chkPushNow = new CheckBox(); this.cmdOK = new Button(); this.cmdCancel = new Button(); base.SuspendLayout(); @@ -90,11 +85,6 @@ internal class dlgAddProduct : Form this.chkAutoRestart.SetBounds(fieldX, y, 200, 20); this.chkAutoRestart.Text = "Auto-restart if it exits"; this.chkAutoRestart.Checked = true; - y += 24; - - this.chkPushNow.SetBounds(fieldX, y, 280, 20); - this.chkPushNow.Text = "Push to selected pods now"; - this.chkPushNow.Checked = true; y += 36; this.cmdOK.SetBounds(browseX - 169, y, 80, 24); @@ -118,7 +108,6 @@ internal class dlgAddProduct : Form base.Controls.Add(this.txtArgs); base.Controls.Add(this.txtPackage); base.Controls.Add(this.chkAutoRestart); - base.Controls.Add(this.chkPushNow); base.Controls.Add(this.cmdOK); base.Controls.Add(this.cmdCancel); base.Name = "dlgAddProduct";