Merge branch 'develop' into Giancarlo

This commit is contained in:
Samuele E. Locatelli
2020-12-14 15:46:30 +01:00
10 changed files with 590 additions and 590 deletions
Vendored
+1 -1
View File
@@ -12,7 +12,7 @@ pipeline {
steps {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=1345']) {
withEnv(['NEXT_BUILD_NUMBER=1346']) {
// env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '6.12.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO'
+1 -1
View File
@@ -10,7 +10,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Controller_SelectedScaffolderID>MvcControllerEmptyScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Common/MVC/Controller</Controller_SelectedScaffolderCategoryPath>
<WebStackScaffolding_ControllerDialogWidth>600</WebStackScaffolding_ControllerDialogWidth>
+375 -359
View File
@@ -13,381 +13,397 @@ using ZXing.QrCode;
namespace MP.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
public class HomeController : Controller
{
ViewBag.Title = "MAPO";
// x sicurezza leggo da web.config
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
{
try
{
// esegue stored procedure come function, recuperando chiave desiderata...
ViewBag.Environment = ctx.stp_AKV_getByKey("Environment").ToList<AnagKeyValue>()[0].valString;
// imposto URL dei vari siti
ViewBag.UrlMpSite = ctx.stp_AKV_getByKey("UrlMpSite").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpAdmin = ctx.stp_AKV_getByKey("UrlMpAdmin").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpIO = ctx.stp_AKV_getByKey("UrlMpIO").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpCTrack = ctx.stp_AKV_getByKey("UrlMpCTrack").ToList<AnagKeyValue>()[0].valString;
// importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth!
ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList<AnagKeyValue>()[0].valString != "");
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in composizione HOME page LAND:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
// Default: NO CTrack
ViewBag.CTrack_Enb = false;
}
}
return View();
}
/// <summary>
/// info steamware
/// </summary>
/// <returns></returns>
public ActionResult About()
{
ViewBag.Title = "MES | SCADA | IOT";
ViewBag.Message = "Soluzione integrata per la gestione della produzione";
#region Protected Methods
return View();
}
/// <summary>
/// contatti
/// </summary>
/// <returns></returns>
public ActionResult Contact()
{
ViewBag.Title = "MAPO";
ViewBag.Message = "Per contattarci";
return View();
}
/// <summary>
/// System INFO
/// </summary>
/// <returns></returns>
public ActionResult System()
{
ViewBag.Title = "MAPO System Info";
ViewBag.Message = "HW & SW details";
return View();
}
/// <summary>
/// Gestione download aggiornamenti
/// </summary>
/// <param name="results"></param>
/// <returns></returns>
public ActionResult Packages(string results)
{
ViewBag.Title = "Steamware's MAPO Suite";
ViewBag.Message = "Ultime release applicazioni";
UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs();
// Recupero info ADM...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("ADM"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpAdmin = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpAdmin = "ND";
ViewBag.AdmDisabled = "disabled";
}
// Recupero info IO...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("IO"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpIO = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpIO = "ND";
ViewBag.IODisabled = "disabled";
}
// Recupero info LAND...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("LAND"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpLand = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpLand = "ND";
ViewBag.LandDisabled = "disabled";
}
// Recupero info MON...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("MON"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpMon = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpMon = "ND";
ViewBag.MonDisabled = "disabled";
}
// Recupero info SITE...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("SITE"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpSite = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpSite = "ND";
ViewBag.SiteDisabled = "disabled";
}
// Recupero info TAB...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("TAB"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpTab = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpTab = "ND";
ViewBag.TabDisabled = "disabled";
}
// Recupero info CTRACK...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("CTRACK"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpCTrack = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpCTrack = "ND";
ViewBag.TabDisabled = "disabled";
}
// salvo risultati...
ViewBag.Results = results;
// fix visibilità CTrack
using (var ctx = new MoonProEntities())
{
try
/// <summary>
/// Path locale dove scaricare gli installer
/// </summary>
protected string localDownloadPath(string package)
{
// importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth!
ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList<AnagKeyValue>()[0].valString != "");
return string.Format(@"{0}{1}\{2}", memLayer.ML.CRS("downloadPath"), package, memLayer.ML.CRS("appVers"));
}
catch
/// <summary>
/// URLK stringa di UPDATE...
/// </summary>
protected string updateUrl(string package)
{
ViewBag.CTrack_Enb = false;
return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/{0}/{1}/manifest.xml", package, memLayer.ML.CRS("appVers"));
}
}
// VIEW!
return View();
}
/// <summary>
/// Gestione configurazioni applicativi (DB)
/// </summary>
/// <param name="results"></param>
/// <returns></returns>
public ActionResult ConfigMan(string sorgente)
{
ViewBag.Title = "Steamware's MAPO Suite - Configurations";
// cerco file se disponibile...
string filePath = Path.Combine(Server.MapPath("~/FileUpload"), "web.config");
bool fileExist = (fileMover.obj.fileExist(Server.MapPath("~/FileUpload"), "web.config"));
if (fileExist)
{
ViewBag.Message = "File web.config presente";
// leggo il file di conf caricato...
System.Configuration.Configuration rootWebConfig = WebConfigurationManager.OpenWebConfiguration("~/FileUpload/web.config");
#endregion Protected Methods
if (sorgente != "" && sorgente != null)
#region Public Methods
/// <summary>
/// info steamware
/// </summary>
/// <returns></returns>
public ActionResult About()
{
// resetto tab import
memLayer.ML.taConfigTmp.reset(sorgente);
// carico dati!
var settings = rootWebConfig.AppSettings.Settings;
foreach (var item in settings.AllKeys)
{
memLayer.ML.taConfigTmp.insertQuery(sorgente, item, settings[item].Value, string.Format("{0}|{1}", sorgente, item));
}
// salvo in viewbag gli elenchi 0/1/2 (tutte, nuove, modificate)
ViewBag.Title = "MES | SCADA | IOT";
ViewBag.Message = "Soluzione integrata per la gestione della produzione";
using (var ctx = new MoonProEntities())
{
try
return View();
}
/// <summary>
/// Gestione configurazioni applicativi (DB)
/// </summary>
/// <param name="results"></param>
/// <returns></returns>
public ActionResult ConfigMan(string sorgente)
{
ViewBag.Title = "Steamware's MAPO Suite - Configurations";
// cerco file se disponibile...
string filePath = Path.Combine(Server.MapPath("~/FileUpload"), "web.config");
bool fileExist = (fileMover.obj.fileExist(Server.MapPath("~/FileUpload"), "web.config"));
if (fileExist)
{
// esegue stored procedure come function, recuperando chiave desiderata...
var elConfig = ctx.ConfigTmp.ToList<ConfigTmp>();
ViewBag.elConfig = elConfig;
ViewBag.Message = "File web.config presente";
// leggo il file di conf caricato...
System.Configuration.Configuration rootWebConfig = WebConfigurationManager.OpenWebConfiguration("~/FileUpload/web.config");
if (sorgente != "" && sorgente != null)
{
// resetto tab import
memLayer.ML.taConfigTmp.reset(sorgente);
// carico dati!
var settings = rootWebConfig.AppSettings.Settings;
foreach (var item in settings.AllKeys)
{
memLayer.ML.taConfigTmp.insertQuery(sorgente, item, settings[item].Value, string.Format("{0}|{1}", sorgente, item));
}
// salvo in viewbag gli elenchi 0/1/2 (tutte, nuove, modificate)
using (var ctx = new MoonProEntities())
{
try
{
// esegue stored procedure come function, recuperando chiave desiderata...
var elConfig = ctx.ConfigTmp.ToList<ConfigTmp>();
ViewBag.elConfig = elConfig;
}
catch
{ }
}
ViewBag.keyList = "CARICATO!";
}
}
catch
{ }
}
ViewBag.keyList = "CARICATO!";
}
}
else
{
ViewBag.Message = "Attenzione: nessun file presente!";
}
// VIEW!
return View((object)ViewBag.elConfig);
}
[HttpPost]
public ActionResult UploadFile(HttpPostedFileBase file, string sorgente)
{
if (file != null && file.ContentLength > 0 && sorgente != "")
{
try
{
// forzo nome SEMPRE a web.config
//string path = Path.Combine(Server.MapPath("~/FileUpload"), Path.GetFileName(file.FileName).ToLower());
string path = Path.Combine(Server.MapPath("~/FileUpload"), "web.config");
file.SaveAs(path);
ViewBag.Message = "File Caricato!";
// ora processo import del sorgente selezionato...
}
catch (Exception ex)
{
ViewBag.Message = "ERROR:" + ex.Message.ToString();
}
}
else
{
ViewBag.Message = "Non è stato selezionato alcun file.";
}
return RedirectToAction("ConfigMan", "Home", new { sorgente });
}
// GET: Home/Download/Caller (ALL|ADM|IO|LAND|MON|SITE|TAB|CTRACK)
public ActionResult Download(string caller)
{
string resultsMsg = "";
// in base al caller scarico il file installazione richiesto...
if (caller == null)
{
caller = "ALL";
}
// ora verifico COSA devo scaricare...
if (updateUrl(caller) != "")
{
// se è ALL scarico tuttoi...
if (caller == "ALL")
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
int done = 0;
// scarico TUTTI...
done += UpdateMan.obj.downloadLatest(updateUrl("ADM"), localDownloadPath("ADM"), "ADM");
done += UpdateMan.obj.downloadLatest(updateUrl("IO"), localDownloadPath("IO"), "IO");
done += UpdateMan.obj.downloadLatest(updateUrl("LAND"), localDownloadPath("LAND"), "LAND");
done += UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON"), "MON");
done += UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE"), "SITE");
done += UpdateMan.obj.downloadLatest(updateUrl("TAB"), localDownloadPath("TAB"), "TAB");
done += UpdateMan.obj.downloadLatest(updateUrl("CTRACK"), localDownloadPath("CTRACK"), "CTRACK");
stopWatch.Stop();
// calcolo elapsed time come TimeSpan value.
TimeSpan ts = stopWatch.Elapsed;
resultsMsg = string.Format("OK: {0} Package downloaded, {1:0.000} sec", done, ts.TotalSeconds);
}
else
{
// scarico singolo target...
UpdateMan.obj.downloadLatest(updateUrl(caller), localDownloadPath(caller), caller);
resultsMsg = string.Format("OK: {0} DOWNLOADED | {1} --> {2}", caller, updateUrl(caller), localDownloadPath(caller));
}
}
// ...chiamo action
return RedirectToAction("Packages", "Home", new { results = resultsMsg });
}
/// <summary>
/// Gestione QRCode utenti TAB
/// </summary>
/// <returns></returns>
public ActionResult UserListQR(string id, string From, string Lenght)
{
int lenght = 0;
int from = 0;
int.TryParse(Lenght, out lenght);
int.TryParse(From, out from);
ViewBag.Title = "QR link";
ViewBag.Message = WebConfigurationManager.AppSettings["Cliente"];
ViewBag.BaseUrl = WebConfigurationManager.AppSettings["baseAuthUrl"];
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
{
try
{
// esegue stored procedure come function, recuperando chiave desiderata...
var elOperatori = ctx.AnagraficaOperatori.ToList<AnagraficaOperatori>();
if (from + lenght > 0)
{
// seleziono sottoelenco SE ammissibile...
int numRec = elOperatori.Count;
lenght = lenght == 0 ? numRec : lenght;
from = from > numRec ? 0 : from;
if (from < numRec)
else
{
lenght = from + lenght < numRec ? lenght : numRec - from;
elOperatori = elOperatori.GetRange(from, lenght);
ViewBag.Message = "Attenzione: nessun file presente!";
}
}
ViewBag.elOperatori = elOperatori;
// VIEW!
return View((object)ViewBag.elConfig);
}
catch
{ }
}
return View((object)ViewBag.elOperatori);
}
/// <summary>
/// Restituisce un QR code dato valore
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
public ActionResult QR(string valore)
{
QrCodeEncodingOptions options = new QrCodeEncodingOptions
{
DisableECI = true,
CharacterSet = "UTF-8",
Width = 600,
Height = 600,
Margin = 0
};
var writer = new BarcodeWriter();
writer.Format = BarcodeFormat.QR_CODE;
writer.Options = options;
// scrivo bitmap
var pixelData = writer.Write(valore);
// Return Image
MemoryStream ms = new MemoryStream();
pixelData.Save(ms, ImageFormat.Png);
ms.Position = 0;
return new FileStreamResult(ms, "image/png");
}
/// <summary>
/// contatti
/// </summary>
/// <returns></returns>
public ActionResult Contact()
{
ViewBag.Title = "MAPO";
ViewBag.Message = "Per contattarci";
return View();
}
/// <summary>
/// Path locale dove scaricare gli installer
/// </summary>
protected string localDownloadPath(string package)
{
return string.Format(@"{0}{1}\{2}", memLayer.ML.CRS("downloadPath"), package, memLayer.ML.CRS("appVers"));
// GET: Home/Download/Caller (ALL|ADM|IO|LAND|MON|SITE|TAB|CTRACK)
public ActionResult Download(string caller)
{
string resultsMsg = "";
// in base al caller scarico il file installazione richiesto...
if (caller == null)
{
caller = "ALL";
}
// ora verifico COSA devo scaricare...
if (updateUrl(caller) != "")
{
// se è ALL scarico tuttoi...
if (caller == "ALL")
{
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
int done = 0;
// scarico TUTTI...
done += UpdateMan.obj.downloadLatest(updateUrl("ADM"), localDownloadPath("ADM"), "ADM");
done += UpdateMan.obj.downloadLatest(updateUrl("IO"), localDownloadPath("IO"), "IO");
done += UpdateMan.obj.downloadLatest(updateUrl("LAND"), localDownloadPath("LAND"), "LAND");
done += UpdateMan.obj.downloadLatest(updateUrl("MON"), localDownloadPath("MON"), "MON");
done += UpdateMan.obj.downloadLatest(updateUrl("SITE"), localDownloadPath("SITE"), "SITE");
done += UpdateMan.obj.downloadLatest(updateUrl("TAB"), localDownloadPath("TAB"), "TAB");
done += UpdateMan.obj.downloadLatest(updateUrl("CTRACK"), localDownloadPath("CTRACK"), "CTRACK");
stopWatch.Stop();
// calcolo elapsed time come TimeSpan value.
TimeSpan ts = stopWatch.Elapsed;
resultsMsg = string.Format("OK: {0} Package downloaded, {1:0.000} sec", done, ts.TotalSeconds);
}
else
{
// scarico singolo target...
UpdateMan.obj.downloadLatest(updateUrl(caller), localDownloadPath(caller), caller);
resultsMsg = string.Format("OK: {0} DOWNLOADED | {1} --> {2}", caller, updateUrl(caller), localDownloadPath(caller));
}
}
// ...chiamo action
return RedirectToAction("Packages", "Home", new { results = resultsMsg });
}
public ActionResult Index()
{
ViewBag.Title = "MAPO";
// x sicurezza leggo da web.config
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
{
try
{
// esegue stored procedure come function, recuperando chiave desiderata...
ViewBag.Environment = ctx.stp_AKV_getByKey("Environment").ToList<AnagKeyValue>()[0].valString;
// imposto URL dei vari siti
ViewBag.UrlMpSite = ctx.stp_AKV_getByKey("UrlMpSite").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpAdmin = ctx.stp_AKV_getByKey("UrlMpAdmin").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpIO = ctx.stp_AKV_getByKey("UrlMpIO").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpMON = ctx.stp_AKV_getByKey("UrlMpMON").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpTAB = ctx.stp_AKV_getByKey("UrlMpTAB").ToList<AnagKeyValue>()[0].valString;
ViewBag.UrlMpCTrack = ctx.stp_AKV_getByKey("UrlMpCTrack").ToList<AnagKeyValue>()[0].valString;
// importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth!
ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList<AnagKeyValue>()[0].valString != "");
}
catch (Exception exc)
{
logger.lg.scriviLog(string.Format("Eccezione in composizione HOME page LAND:{0}{1}", Environment.NewLine, exc), tipoLog.EXCEPTION);
// Default: NO CTrack
ViewBag.CTrack_Enb = false;
}
}
return View();
}
/// <summary>
/// Gestione download aggiornamenti
/// </summary>
/// <param name="results"></param>
/// <returns></returns>
public ActionResult Packages(string results)
{
ViewBag.Title = "Steamware's MAPO Suite";
ViewBag.Message = "Ultime release applicazioni";
UpdateInfoEventArgs updArgs = new UpdateInfoEventArgs();
// Recupero info ADM...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("ADM"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpAdmin = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpAdmin = "ND";
ViewBag.AdmDisabled = "disabled";
}
// Recupero info IO...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("IO"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpIO = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpIO = "ND";
ViewBag.IODisabled = "disabled";
}
// Recupero info LAND...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("LAND"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpLand = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpLand = "ND";
ViewBag.LandDisabled = "disabled";
}
// Recupero info MON...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("MON"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpMon = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpMon = "ND";
ViewBag.MonDisabled = "disabled";
}
// Recupero info SITE...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("SITE"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpSite = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpSite = "ND";
ViewBag.SiteDisabled = "disabled";
}
// Recupero info TAB...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("TAB"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpTab = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpTab = "ND";
ViewBag.TabDisabled = "disabled";
}
// Recupero info CTRACK...
updArgs = UpdateMan.obj.getUpdateInfo(updateUrl("CTRACK"));
if (updArgs.IsUpdateAvailable)
{
ViewBag.VersMpCTrack = updArgs.CurrentVersion;
}
else
{
ViewBag.VersMpCTrack = "ND";
ViewBag.TabDisabled = "disabled";
}
// salvo risultati...
ViewBag.Results = results;
// fix visibilità CTrack
using (var ctx = new MoonProEntities())
{
try
{
// importo verifica abilitazione CTrack - !!!FARE!!! vero check key auth!
ViewBag.CTrack_Enb = (ctx.stp_AKV_getByKey("CTRACK").ToList<AnagKeyValue>()[0].valString != "");
}
catch
{
ViewBag.CTrack_Enb = false;
}
}
// VIEW!
return View();
}
/// <summary>
/// Restituisce un QR code dato valore
/// </summary>
/// <param name="valore"></param>
/// <returns></returns>
public ActionResult QR(string valore)
{
QrCodeEncodingOptions options = new QrCodeEncodingOptions
{
DisableECI = true,
CharacterSet = "UTF-8",
Width = 600,
Height = 600,
Margin = 0
};
var writer = new BarcodeWriter();
writer.Format = BarcodeFormat.QR_CODE;
writer.Options = options;
// scrivo bitmap
var pixelData = writer.Write(valore);
// Return Image
MemoryStream ms = new MemoryStream();
pixelData.Save(ms, ImageFormat.Png);
ms.Position = 0;
return new FileStreamResult(ms, "image/png");
}
/// <summary>
/// System INFO
/// </summary>
/// <returns></returns>
public ActionResult SystemInfo()
{
ViewBag.Title = "MAPO System Info";
ViewBag.Message = "HW & SW details";
// imposto i vari dati da mostrare a video senza indicare come bypassare...
string connStr = memLayer.ML.confReadString("DbConfConnectionString");
var currHwSwInfo = HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly());
ViewBag.DbNameExample = connStr.Substring(0, connStr.IndexOf(";Persist Security"));
ViewBag.CodModulo = memLayer.ML.confReadString("CodModulo");
ViewBag.HwSwInfo = currHwSwInfo;
return View();
}
[HttpPost]
public ActionResult UploadFile(HttpPostedFileBase file, string sorgente)
{
if (file != null && file.ContentLength > 0 && sorgente != "")
{
try
{
// forzo nome SEMPRE a web.config
//string path = Path.Combine(Server.MapPath("~/FileUpload"), Path.GetFileName(file.FileName).ToLower());
string path = Path.Combine(Server.MapPath("~/FileUpload"), "web.config");
file.SaveAs(path);
ViewBag.Message = "File Caricato!";
// ora processo import del sorgente selezionato...
}
catch (Exception ex)
{
ViewBag.Message = "ERROR:" + ex.Message.ToString();
}
}
else
{
ViewBag.Message = "Non è stato selezionato alcun file.";
}
return RedirectToAction("ConfigMan", "Home", new { sorgente });
}
/// <summary>
/// Gestione QRCode utenti TAB
/// </summary>
/// <returns></returns>
public ActionResult UserListQR(string id, string From, string Lenght)
{
int lenght = 0;
int from = 0;
int.TryParse(Lenght, out lenght);
int.TryParse(From, out from);
ViewBag.Title = "QR link";
ViewBag.Message = WebConfigurationManager.AppSettings["Cliente"];
ViewBag.BaseUrl = WebConfigurationManager.AppSettings["baseAuthUrl"];
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
{
try
{
// esegue stored procedure come function, recuperando chiave desiderata...
var elOperatori = ctx.AnagraficaOperatori.ToList<AnagraficaOperatori>();
if (from + lenght > 0)
{
// seleziono sottoelenco SE ammissibile...
int numRec = elOperatori.Count;
lenght = lenght == 0 ? numRec : lenght;
from = from > numRec ? 0 : from;
if (from < numRec)
{
lenght = from + lenght < numRec ? lenght : numRec - from;
elOperatori = elOperatori.GetRange(from, lenght);
}
}
ViewBag.elOperatori = elOperatori;
}
catch
{ }
}
return View((object)ViewBag.elOperatori);
}
#endregion Public Methods
}
/// <summary>
/// URLK stringa di UPDATE...
/// </summary>
protected string updateUrl(string package)
{
return string.Format("http://seriate.steamware.net:8083/SWS/MAPO/{0}/{1}/manifest.xml", package, memLayer.ML.CRS("appVers"));
}
}
}
+1 -1
View File
@@ -496,7 +496,7 @@
<Content Include="Views\Home\Packages.cshtml" />
<Content Include="Views\Home\UserListQR.cshtml" />
<Content Include="Views\Home\ConfigMan.cshtml" />
<Content Include="Views\Home\System.cshtml" />
<Content Include="Views\Home\SystemInfo.cshtml" />
<Content Include="Scripts\umd\popper.min.js.map" />
<Content Include="Scripts\umd\popper.js.map" />
<Content Include="Scripts\umd\popper.js.flow" />
-174
View File
@@ -1,174 +0,0 @@
<div class="container mt-4">
<div class="row">
<div class="col-10 offset-1">
<div class="card">
<div class="card-header text-center">
<h2>@ViewBag.Title</h2>
</div>
<div class="card-body px-3">
<h4 class="card-title">@ViewBag.Message</h4>
<div class="row">
<div class="col">
<div id="accordion">
<div class="card">
<div class="card-header text-uppercase" id="heading04">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="lbtGrp01" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapse04" aria-expanded="true" aria-controls="collapse04">
Global data
</asp:LinkButton>
</h5>
</div>
<div id="collapse04" class="collapse" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Module</h5>
</div>
<p class="mb-1">@SteamWare.memLayer.ML.confReadString("CodModulo")</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">.net framework</h5>
</div>
<p class="mb-1">@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).runtimeImg</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Main Assembly</h5>
</div>
<p class="mb-1">@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).mainAssembly</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase" id="heading01">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="LinkButton1" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapse01" aria-expanded="true" aria-controls="collapse01">
Stats (Server, IIS, APP)
</asp:LinkButton>
</h5>
</div>
<div id="collapse01" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Server Stats</h5>
</div>
<p class="mb-1">
<pre>@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).ServerStats</pre>
</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">IIS Stats</h5>
</div>
<p class="mb-1">
<pre>@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).IISStats</pre>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase" id="heading02">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="LinkButton2" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapse02" aria-expanded="true" aria-controls="collapse02">
Redis Server data
</asp:LinkButton>
</h5>
</div>
<div id="collapse02" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Redis Servers Data</h5>
</div>
<p class="mb-1">
<pre>@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).redisServersData</pre>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase" id="heading03">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="LinkButton3" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapse03" aria-expanded="true" aria-controls="collapse03">
Browser data
</asp:LinkButton>
</h5>
</div>
<div id="collapse03" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Browser size data</h5>
</div>
<p class="mb-1">
<pre>@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).paretoBrowserSize</pre>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase" id="heading05">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="lbtGrp02" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapse05" aria-expanded="false" aria-controls="collapse05">
Other Libraries
</asp:LinkButton>
</h5>
</div>
<div id="collapse05" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Elenco librerie</h5>
<span>@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).numLibraries</span>
</div>
<p class="mb-1">
<pre style="width: 100%; white-space: pre-wrap;">@SteamWare.HwSwInfo.man(System.Reflection.Assembly.GetExecutingAssembly()).librariesVers</pre>
</p>
</div>
</div>
</div>
</div>
</div>
@*<div class="card">
<div class="card-header text-uppercase" id="heading06">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="lbtGrp03" class="btn btn-link collapsed" data-toggle="collapse" data-target="#collapse06" aria-expanded="false" aria-controls="collapse06">
Reset Results
</asp:LinkButton>
</h5>
</div>
<div id="collapse06" class="collapse" aria-labelledby="headingThree" data-parent="#accordion">
<div class="card-body">
<p class="mb-1">
<pre style="width: 100%; white-space: pre-wrap;"><asp:Label ID="lblOut" runat="server" /></pre>
</p>
</div>
</div>
</div>*@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+160
View File
@@ -0,0 +1,160 @@
<div class="container mt-4">
<div class="row">
<div class="col-10 offset-1">
<div class="card">
<div class="card-header text-center">
<h2>@ViewBag.Title</h2>
</div>
<div class="card-body px-3">
<h4 class="card-title">@ViewBag.Message</h4>
<div class="row">
<div class="col">
<div id="accordion">
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading04">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="lbtGrp01" class="collapsed" data-toggle="collapse" data-target="#collapse04" aria-expanded="true" aria-controls="collapse04">
Global data
</asp:LinkButton>
</h5>
</div>
<div id="collapse04" class="collapse" aria-labelledby="headingOne" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Module</h5>
</div>
<p class="mb-1">@ViewBag.CodModulo</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Main DB Conf</h5>
</div>
<p class="mb-1">@ViewBag.DbNameExample</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">.net framework</h5>
</div>
<p class="mb-1">@ViewBag.HwSwInfo.runtimeImg</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Main Assembly</h5>
</div>
<p class="mb-1">@ViewBag.HwSwInfo.mainAssembly</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading01">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="LinkButton1" class="collapsed" data-toggle="collapse" data-target="#collapse01" aria-expanded="true" aria-controls="collapse01">
Stats (Server, IIS, APP)
</asp:LinkButton>
</h5>
</div>
<div id="collapse01" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Server Stats</h5>
</div>
<p class="mb-1">
<pre>@ViewBag.HwSwInfo.ServerStats</pre>
</p>
</div>
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">IIS Stats</h5>
</div>
<p class="mb-1">
<pre>@ViewBag.HwSwInfo.IISStats</pre>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading02">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="LinkButton2" class="collapsed" data-toggle="collapse" data-target="#collapse02" aria-expanded="true" aria-controls="collapse02">
Redis Server data
</asp:LinkButton>
</h5>
</div>
<div id="collapse02" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Redis Servers Data</h5>
</div>
<p class="mb-1">
<pre>@ViewBag.HwSwInfo.redisServersData</pre>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading03">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="LinkButton3" class="collapsed" data-toggle="collapse" data-target="#collapse03" aria-expanded="true" aria-controls="collapse03">
Browser data
</asp:LinkButton>
</h5>
</div>
<div id="collapse03" class="collapse" aria-labelledby="heading01" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Browser size data</h5>
</div>
<p class="mb-1">
<pre>@ViewBag.HwSwInfo.paretoBrowserSize</pre>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div class="card-header text-uppercase btn btn-block" id="heading05">
<h5 class="mb-0">
<asp:LinkButton runat="server" ID="lbtGrp02" class="collapsed" data-toggle="collapse" data-target="#collapse05" aria-expanded="false" aria-controls="collapse05">
Other Libraries
</asp:LinkButton>
</h5>
</div>
<div id="collapse05" class="collapse" aria-labelledby="headingTwo" data-parent="#accordion">
<div class="card-body">
<div class="list-group">
<div class="list-group-item">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">Elenco librerie</h5>
<span>@ViewBag.HwSwInfo.numLibraries</span>
</div>
<p class="mb-1">
<pre style="width: 100%; white-space: pre-wrap;">@ViewBag.HwSwInfo.librariesVers</pre>
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+50 -50
View File
@@ -1,58 +1,58 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - MP LAND</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - MP LAND</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
<div class="container">
<img class="img-fluid" style="height: 40px;" src="~/images/SteamwareLogoOnly.png" />
@Html.ActionLink("MAPO suite", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarContent">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbarContent" class="navbar-collapse collapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item btn btn-outline-info btn-sm mx-1">@Html.ActionLink("TAB User login QR", "UserListQR", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-info btn-sm mx-1">@Html.ActionLink("Package Versions", "Packages", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-info btn-sm mx-1">@Html.ActionLink("web.config import", "ConfigMan", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-secondary btn-sm mx-1">@Html.ActionLink("About", "About", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-secondary btn-sm mx-1">@Html.ActionLink("Contact", "Contact", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-warning btn-sm mx-1">@Html.ActionLink("System Data", "System", new { controller = "Home" }, new { @class = "nav-link" })</li>
</ul>
</div>
<div class="navbar navbar-expand-sm navbar-dark bg-dark fixed-top">
<div class="container">
<img class="img-fluid" style="height: 40px;" src="~/images/SteamwareLogoOnly.png" />
@Html.ActionLink("MAPO suite", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarContent">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbarContent" class="navbar-collapse collapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item btn btn-outline-info btn-sm mx-1">@Html.ActionLink("TAB User login QR", "UserListQR", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-info btn-sm mx-1">@Html.ActionLink("Package Versions", "Packages", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-info btn-sm mx-1">@Html.ActionLink("web.config import", "ConfigMan", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-secondary btn-sm mx-1">@Html.ActionLink("About", "About", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-secondary btn-sm mx-1">@Html.ActionLink("Contact", "Contact", new { controller = "Home" }, new { @class = "nav-link" })</li>
<li class="nav-item btn btn-outline-warning btn-sm mx-1">@Html.ActionLink("System Data", "SystemInfo", new { controller = "Home" }, new { @class = "nav-link" })</li>
</ul>
</div>
</div>
</div>
<div class="container-fluid body-content">
@RenderBody()
<hr />
@{
// recupero variabile ambiente...
ViewBag.envir = System.Web.Configuration.WebConfigurationManager.AppSettings["Environment"];
string cssFixFooter = "";
}
@if (ViewBag.envir != "Dev")
{
cssFixFooter = "fixed-bottom";
}
<footer class="navbar navbar-dark bg-dark @cssFixFooter text-gray small p-0">
<div class="container-fluid row">
<div class="col-6 fontSmall text-left">
<span class="text-white">MAPO</span> | IP: @Request.UserHostAddress
</div>
<div class="col-6 fontSmall text-right">
v: @typeof(MP.MvcApplication).Assembly.GetName().Version | 2007 - @DateTime.Now.Year <span class="text-white">&copy; Steamware s.r.l.</span>
</div>
</div>
</footer>
</div>
</div>
<div class="container-fluid body-content">
@RenderBody()
<hr />
@{
// recupero variabile ambiente...
ViewBag.envir = System.Web.Configuration.WebConfigurationManager.AppSettings["Environment"];
string cssFixFooter = "";
}
@if (ViewBag.envir != "Dev")
{
cssFixFooter = "fixed-bottom";
}
<footer class="navbar navbar-dark bg-dark @cssFixFooter text-gray small p-0">
<div class="container-fluid row">
<div class="col-6 fontSmall text-left">
<span class="text-white">MAPO</span> | IP: @Request.UserHostAddress
</div>
<div class="col-6 fontSmall text-right">
v: @typeof(MP.MvcApplication).Assembly.GetName().Version | 2007 - @DateTime.Now.Year <span class="text-white">&copy; Steamware s.r.l.</span>
</div>
</div>
</footer>
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>
</html>
+1 -1
View File
@@ -19,7 +19,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<Controller_SelectedScaffolderID>ApiControllerWithActionsScaffolder</Controller_SelectedScaffolderID>
<Controller_SelectedScaffolderCategoryPath>root/Controller</Controller_SelectedScaffolderCategoryPath>
</PropertyGroup>
+1 -1
View File
@@ -8,7 +8,7 @@
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<ProjectView>ShowAllFiles</ProjectView>
<NameOfLastUsedPublishProfile>IIS02</NameOfLastUsedPublishProfile>
</PropertyGroup>
-2
View File
@@ -106,8 +106,6 @@ namespace WebConfigSetter
processRequest();
Console.WriteLine(separatore);
Console.Write("Premere un tasto x uscire");
Console.ReadLine();
}
/// <summary>