Aggiunta download x CTRACK

This commit is contained in:
Samuele E. Locatelli
2018-12-15 17:01:57 +01:00
parent 58861ad098
commit 5f3240402c
3 changed files with 50 additions and 11 deletions
+27 -2
View File
@@ -17,7 +17,7 @@ namespace MP.Controllers
{
public ActionResult Index()
{
ViewBag.Title = "MoonPro";
ViewBag.Title = "MAPO";
// x sicurezza leggo da web.config
ViewBag.Environment = WebConfigurationManager.AppSettings["Environment"];
using (var ctx = new MoonProEntities())
@@ -150,8 +150,32 @@ namespace MP.Controllers
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();
}
@@ -240,7 +264,7 @@ namespace MP.Controllers
}
// GET: Home/Download/Caller (ALL|ADM|IO|LAND|MON|SITE|TAB)
// GET: Home/Download/Caller (ALL|ADM|IO|LAND|MON|SITE|TAB|CTRACK)
public ActionResult Download(string caller)
{
string resultsMsg = "";
@@ -265,6 +289,7 @@ namespace MP.Controllers
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;
+21 -7
View File
@@ -20,13 +20,13 @@
<h2 class="text-center text-success">
ALL PACKAGES <i class="fa fa-download"></i>
</h2>
<a href="@Url.Action("Download", "Home", new { caller="ALL" })" class="btn btn-outline-success btn-lg fullWidth" onClick="return confirm('Sicuro di voler scaricare tutti i pacchetti?')">
<a href="@Url.Action("Download", "Home", new { caller = "ALL" })" class="btn btn-outline-success btn-lg fullWidth" onClick="return confirm('Sicuro di voler scaricare tutti i pacchetti?')">
<strong>DOWNLOAD ALL LATEST</strong>
</a>
</div>
<div class="col-sm-6 col-md-4">
<h2 class="text-center">MP-ADMIN <i class="fa fa-download"></i></h2>
<a href="@Url.Action("Download", "Home", new { caller="ADM" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.AdmDisabled">
<a href="@Url.Action("Download", "Home", new { caller = "ADM" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.AdmDisabled">
<strong>@ViewBag.VersMpAdmin</strong>
</a>
</div>
@@ -35,7 +35,7 @@
MP-IO
<i class="fa fa-download"></i>
</h2>
<a href="@Url.Action("Download", "Home", new { caller="IO" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.IODisabled">
<a href="@Url.Action("Download", "Home", new { caller = "IO" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.IODisabled">
<strong>@ViewBag.VersMpIO</strong>
</a>
</div>
@@ -44,7 +44,7 @@
MP-LAND
<i class="fa fa-download"></i>
</h2>
<a href="@Url.Action("Download", "Home", new { caller="LAND" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.LandDisabled">
<a href="@Url.Action("Download", "Home", new { caller = "LAND" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.LandDisabled">
<strong>@ViewBag.VersMpLand</strong>
</a>
</div>
@@ -53,7 +53,7 @@
MP-MON
<i class="fa fa-download"></i>
</h2>
<a href="@Url.Action("Download", "Home", new { caller="MON" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.MonDisabled">
<a href="@Url.Action("Download", "Home", new { caller = "MON" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.MonDisabled">
<strong>@ViewBag.VersMpMon</strong>
</a>
</div>
@@ -62,7 +62,7 @@
MP-SITE
<i class="fa fa-download"></i>
</h2>
<a href="@Url.Action("Download", "Home", new { caller="SITE" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.SiteDisabled">
<a href="@Url.Action("Download", "Home", new { caller = "SITE" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.SiteDisabled">
<strong>@ViewBag.VersMpSite</strong>
</a>
</div>
@@ -71,10 +71,24 @@
MP-TAB
<i class="fa fa-download"></i>
</h2>
<a href="@Url.Action("Download", "Home", new { caller="TAB" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.TabDisabled">
<a href="@Url.Action("Download", "Home", new { caller = "TAB" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.TabDisabled">
<strong>@ViewBag.VersMpTab</strong>
</a>
</div>
@{
if (ViewBag.CTrack_Enb)
{
<div class="col-sm-6 col-md-4">
<h2 class="text-center">
MP-CTRACK
<i class="fa fa-download"></i>
</h2>
<a href="@Url.Action("Download", "Home", new { caller = "CTRACK" })" class="btn btn-outline-secondary btn-lg fullWidth @ViewBag.TabDisabled">
<strong>@ViewBag.VersMpCTrack</strong>
</a>
</div>
}
}
</div>
</div>
</div>
+2 -2
View File
@@ -17,7 +17,7 @@
</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("User List", "UserListQR", new { controller = "Home" }, new { @class = "nav-link" })</li>
<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>
@@ -41,7 +41,7 @@
<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">MoonPro</span> | IP: @Request.UserHostAddress
<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>