Aggiunta chiamate in startup + fix hide cli reboot
This commit is contained in:
+2
-2
@@ -42,7 +42,7 @@
|
||||
blazorWebView1.Dock = DockStyle.Fill;
|
||||
blazorWebView1.Location = new Point(0, 0);
|
||||
blazorWebView1.Name = "blazorWebView1";
|
||||
blazorWebView1.Size = new Size(620, 370);
|
||||
blazorWebView1.Size = new Size(644, 441);
|
||||
blazorWebView1.StartPath = "/";
|
||||
blazorWebView1.TabIndex = 0;
|
||||
//
|
||||
@@ -76,7 +76,7 @@
|
||||
//
|
||||
AutoScaleDimensions = new SizeF(7F, 15F);
|
||||
AutoScaleMode = AutoScaleMode.Font;
|
||||
ClientSize = new Size(620, 370);
|
||||
ClientSize = new Size(644, 441);
|
||||
Controls.Add(blazorWebView1);
|
||||
Icon = (Icon)resources.GetObject("$this.Icon");
|
||||
MaximizeBox = false;
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace EgwControlCenter.App
|
||||
/// </summary>
|
||||
private DateTime lastMsqShown { get; set; } = DateTime.MinValue;
|
||||
|
||||
private Size lastSize { get; set; } = new Size(636, 409);
|
||||
private Size lastSize { get; set; } = new Size(660, 480);
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
@@ -73,7 +73,12 @@ namespace EgwControlCenter.App
|
||||
Assembly assembly = Assembly.GetExecutingAssembly();
|
||||
string startDir = Path.GetDirectoryName(assembly.Location)!;
|
||||
string extPath = Path.Combine(startDir, "libs", "EgwAccRestarter.exe");
|
||||
Process.Start(extPath);
|
||||
// uso processstartInfo x nascondere finestra
|
||||
ProcessStartInfo startInfo = new ProcessStartInfo();
|
||||
startInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
startInfo.CreateNoWindow = true;
|
||||
startInfo.FileName = extPath;
|
||||
Process.Start(startInfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -164,6 +169,18 @@ namespace EgwControlCenter.App
|
||||
// aspetto e poi mando a tray...
|
||||
await Task.Delay(500);
|
||||
SendToTray();
|
||||
// eseguo task preliminari tipo invio reset effettuato + elenco conf...
|
||||
await Task.Delay(1000);
|
||||
await ACService.SendRebooted();
|
||||
// ora invio info licenza (SE disponibili)
|
||||
await Task.Delay(1000);
|
||||
await ACService.SendLicInfo();
|
||||
// infine invio info conf (x editing successivo)
|
||||
await Task.Delay(1000);
|
||||
await ACService.SendConfTarget();
|
||||
// invio stats avvio
|
||||
await Task.Delay(1000);
|
||||
await ACService.SendStats();
|
||||
}
|
||||
|
||||
private void BlazorForm_Resize(object sender, EventArgs e)
|
||||
@@ -339,7 +356,7 @@ namespace EgwControlCenter.App
|
||||
notifyIcon1.BalloonTipClicked += NotifyIcon1_BalloonTipClicked;
|
||||
notifyIcon1.Visible = true;
|
||||
// mostro notifica... SE abilitata
|
||||
if (ACService.EnableNotify)
|
||||
if (ACService != null && ACService.EnableNotify)
|
||||
{
|
||||
notifyIcon1.ShowBalloonTip(100);
|
||||
}
|
||||
|
||||
@@ -11,32 +11,36 @@
|
||||
"BasePath": "C:\\Steamware",
|
||||
"SearchPattern": "IOB-*.exe",
|
||||
"IsEnabled": true,
|
||||
"UpdateEnabled": true
|
||||
"UpdateEnabled": true,
|
||||
},
|
||||
{
|
||||
"Idx": 2,
|
||||
"ApplicationType": "Machine",
|
||||
"BasePath": "C:\\EgtData\\Machines",
|
||||
"IsEnabled": true
|
||||
"IsEnabled": true,
|
||||
"UpdateEnabled": false
|
||||
},
|
||||
{
|
||||
"Idx": 3,
|
||||
"ApplicationType": "Machine",
|
||||
"BasePath": "C:\\TechnoEssetre7\\EgalTech\\EgtCAM5\\Machines",
|
||||
"IsEnabled": true
|
||||
"IsEnabled": true,
|
||||
"UpdateEnabled": false
|
||||
},
|
||||
{
|
||||
"Idx": 4,
|
||||
"ApplicationType": "Machine",
|
||||
"BasePath": "C:\\Testing\\Machines",
|
||||
"IsEnabled": true
|
||||
"IsEnabled": true,
|
||||
"UpdateEnabled": false
|
||||
},
|
||||
{
|
||||
"Idx": 5,
|
||||
"ApplicationType": "LicenceApp",
|
||||
"BasePath": "C:\\EgtData",
|
||||
"SearchPattern": "*.ini",
|
||||
"IsEnabled": true
|
||||
"IsEnabled": true,
|
||||
"UpdateEnabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>1.2.2501.2016</Version>
|
||||
<Version>1.2.2501.2019</Version>
|
||||
<Configurations>Debug;Release;DEBUG_Local</Configurations>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,8 +4,8 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ApplicationRevision>2016</ApplicationRevision>
|
||||
<ApplicationVersion>1.2.2501.2016</ApplicationVersion>
|
||||
<ApplicationRevision>2019</ApplicationRevision>
|
||||
<ApplicationVersion>1.2.2501.2019</ApplicationVersion>
|
||||
<BootstrapperEnabled>True</BootstrapperEnabled>
|
||||
<Configuration>Release</Configuration>
|
||||
<CreateWebPageOnPublish>True</CreateWebPageOnPublish>
|
||||
|
||||
@@ -449,6 +449,61 @@ namespace EgwControlCenter.Core
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invia info di reboot effettuato (spostando da req/run a done...)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task SendRebooted()
|
||||
{
|
||||
// preparo un task di reboot da inviare
|
||||
var task2send = new Dictionary<string, string>();
|
||||
task2send.Add("ExecStart", $"{DateTime.Now:yyyy-MM-dd HH:mm:ss}");
|
||||
await CurrCheck.TaskSetRunning(DeviceName, task2send);
|
||||
await Task.Delay(500);
|
||||
await CurrCheck.TaskSetDone(DeviceName, task2send);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invia info licenza (se disponibili)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task SendLicInfo()
|
||||
{
|
||||
if (CurrCheck.LicenceFilesDict.Count > 0)
|
||||
{
|
||||
// serializzo risultato
|
||||
string rawData = JsonConvert.SerializeObject(CurrCheck.LicenceFilesDict);
|
||||
Dictionary<string, string> licInfo = new Dictionary<string, string>();
|
||||
// chiave: LicInfo
|
||||
licInfo.Add("LicInfo", rawData);
|
||||
// invio!
|
||||
await CurrCheck.TaskSetDone(DeviceName, licInfo);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Invia info configurazione (directory)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task SendConfTarget()
|
||||
{
|
||||
// preparo un task di conf da inviare
|
||||
var task2send = new Dictionary<string, string>();
|
||||
string rawConf = JsonConvert.SerializeObject(CurrCheck.CurrPatrolCont.TargetList);
|
||||
task2send.Add("TargetList", rawConf);
|
||||
await Task.Delay(500);
|
||||
await CurrCheck.TaskSetDone(DeviceName, task2send);
|
||||
}
|
||||
/// <summary>
|
||||
/// Invia info satats preliminari
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task SendStats()
|
||||
{
|
||||
// invio statistiche esecuzione...
|
||||
await DoSendRunStats();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restituisce un codice di auth temporaneo INT da impiegare x autorizzare
|
||||
/// </summary>
|
||||
|
||||
@@ -826,40 +826,46 @@ namespace EgwControlCenter.Core
|
||||
{
|
||||
// recupero elenco sottodirectory = possibili conf applicativi
|
||||
var dirList = Directory.GetDirectories(item.BasePath);
|
||||
// ciclo e cerco i file mlde...
|
||||
// ciclo x cercare i files...
|
||||
foreach (var currDir in dirList)
|
||||
{
|
||||
string prgName = Path.GetFileName(currDir);
|
||||
// compongo ricerca della cartella Config dentro la folder target
|
||||
string confPath = Path.Combine(currDir, "Config");
|
||||
// verifico se esiste directory...
|
||||
if (Directory.Exists(confPath))
|
||||
{
|
||||
// cerco se ci sia un file mlde...
|
||||
// cerco se ci sia un file di quelli richiesti...
|
||||
var fileFound = Directory.GetFiles(confPath, item.SearchPattern);
|
||||
if (fileFound != null && fileFound.Count() > 0)
|
||||
{
|
||||
// ciclo su tutti i file candidati...
|
||||
foreach (var file in fileFound)
|
||||
{
|
||||
string licName = LicSearchFileName(file);
|
||||
if (!string.IsNullOrEmpty(licName))
|
||||
// vincolo dei soli file con nome uguale alla folder ancestor...
|
||||
string iniName = Path.GetFileName(file);
|
||||
if (iniName.StartsWith($"{prgName}."))
|
||||
{
|
||||
var contDir = Path.GetDirectoryName(file);
|
||||
if (!string.IsNullOrEmpty(contDir))
|
||||
string licName = LicSearchFileName(file);
|
||||
if (!string.IsNullOrEmpty(licName))
|
||||
{
|
||||
string licPath = Path.Combine(contDir, licName);
|
||||
if (File.Exists(licPath))
|
||||
var contDir = Path.GetDirectoryName(file);
|
||||
if (!string.IsNullOrEmpty(contDir))
|
||||
{
|
||||
// leggo il contenuto e salvo...
|
||||
var licContent = File.ReadAllText(licPath);
|
||||
if (!newLicDict.ContainsKey(licPath))
|
||||
string licPath = Path.Combine(contDir, licName);
|
||||
if (File.Exists(licPath))
|
||||
{
|
||||
newLicDict.Add(licPath, licContent);
|
||||
numFound++;
|
||||
}
|
||||
else
|
||||
{
|
||||
newLicDict[licPath] = licContent;
|
||||
// leggo il contenuto e salvo...
|
||||
var licContent = File.ReadAllText(licPath);
|
||||
if (!newLicDict.ContainsKey(licPath))
|
||||
{
|
||||
newLicDict.Add(licPath, licContent);
|
||||
numFound++;
|
||||
}
|
||||
else
|
||||
{
|
||||
newLicDict[licPath] = licContent;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1403,6 +1409,15 @@ namespace EgwControlCenter.Core
|
||||
ListStatus = JsonConvert.DeserializeObject<List<TargetStatus>>(rawData) ?? new List<TargetStatus>();
|
||||
}
|
||||
}
|
||||
// cerco se presente file licInfo e lo ricarico...
|
||||
if (File.Exists(LicInfoPath))
|
||||
{
|
||||
var rawData = File.ReadAllText(LicInfoPath);
|
||||
if (!string.IsNullOrEmpty(rawData))
|
||||
{
|
||||
LicenceFilesDict = JsonConvert.DeserializeObject<Dictionary<string,string>>(rawData) ?? new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user