From 4b737c824ee1b1a347ea63aabe3273f2c16f3ac3 Mon Sep 17 00:00:00 2001 From: Roy Ben Shabat Date: Sun, 20 Jul 2025 01:16:18 +0300 Subject: Published Portal. --- .../Web/Bootstrap Studio/Build/404.html | 1 + .../Bootstrap Studio/Build/assets/img/favicon.png | Bin 0 -> 281 bytes ...2dff81b4d94d97a9ee7dbb180fdbd0d786dc101_640.png | Bin 0 -> 532424 bytes ...e68e9d7d1fbca9b6f059cad6d603c065902cb83_640.png | Bin 0 -> 440465 bytes .../Web/Bootstrap Studio/Build/docs.html | 3 +- .../Web/Bootstrap Studio/Build/firmware.html | 1 + .../Bootstrap Studio/Build/forgotten-password.html | 1 + .../Web/Bootstrap Studio/Build/index.html | 7 +- .../Web/Bootstrap Studio/Build/logged-in.html | 311 +++++++++++++++++++++ .../Web/Bootstrap Studio/Build/login-1.html | 1 + .../Web/Bootstrap Studio/Build/login.html | 1 + .../Web/Bootstrap Studio/Build/product.html | 1 + .../Web/Bootstrap Studio/Build/utilities.html | 3 +- .../Web/Bootstrap Studio/Twine Solutions.bsdesign | Bin 5544162 -> 6757648 bytes .../Tango.Portal/Controllers/AccountController.cs | 44 --- .../Web/Tango.Portal/Controllers/HomeController.cs | 15 +- .../Web/Tango.Portal/Models/Statistics.cs | 14 + ...ervice-gateway-twine-portal - Web Deploy.pubxml | 30 ++ .../profile.arm.json | 113 ++++++++ .../Web/Tango.Portal/Tango.Portal.csproj | 9 +- .../Web/Tango.Portal/Utils/StatisticsUtils.cs | 70 +++++ .../Web/Tango.Portal/ViewModels/IndexVM.cs | 18 ++ .../Web/Tango.Portal/Views/Home/Docs.cshtml | 4 +- .../Web/Tango.Portal/Views/Home/Index.cshtml | 8 +- .../Web/Tango.Portal/Views/Home/Utilities.cshtml | 4 +- .../Views/Shared/NavigationPartial.cshtml | 2 +- ...2dff81b4d94d97a9ee7dbb180fdbd0d786dc101_640.png | Bin 0 -> 120295 bytes ...e68e9d7d1fbca9b6f059cad6d603c065902cb83_640.png | Bin 0 -> 132465 bytes 28 files changed, 594 insertions(+), 67 deletions(-) create mode 100644 Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/favicon.png create mode 100644 Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/g65f952e1b2e0f109a3571a03f13f6724105af4a300162e6ed887109c32dff81b4d94d97a9ee7dbb180fdbd0d786dc101_640.png create mode 100644 Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/gf5bb90117e2f7cbfd9b66ed78a2ba37c32a6a124c5f4f3246dfe63f7ee68e9d7d1fbca9b6f059cad6d603c065902cb83_640.png create mode 100644 Software/Visual_Studio/Web/Bootstrap Studio/Build/logged-in.html delete mode 100644 Software/Visual_Studio/Web/Tango.Portal/Controllers/AccountController.cs create mode 100644 Software/Visual_Studio/Web/Tango.Portal/Models/Statistics.cs create mode 100644 Software/Visual_Studio/Web/Tango.Portal/Properties/PublishProfiles/machineservice-gateway-twine-portal - Web Deploy.pubxml create mode 100644 Software/Visual_Studio/Web/Tango.Portal/Properties/ServiceDependencies/machineservice-gateway-twine-portal - Web Deploy/profile.arm.json create mode 100644 Software/Visual_Studio/Web/Tango.Portal/Utils/StatisticsUtils.cs create mode 100644 Software/Visual_Studio/Web/Tango.Portal/ViewModels/IndexVM.cs create mode 100644 Software/Visual_Studio/Web/Tango.Portal/assets/img/g65f952e1b2e0f109a3571a03f13f6724105af4a300162e6ed887109c32dff81b4d94d97a9ee7dbb180fdbd0d786dc101_640.png create mode 100644 Software/Visual_Studio/Web/Tango.Portal/assets/img/gf5bb90117e2f7cbfd9b66ed78a2ba37c32a6a124c5f4f3246dfe63f7ee68e9d7d1fbca9b6f059cad6d603c065902cb83_640.png (limited to 'Software/Visual_Studio/Web') diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/404.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/404.html index 12add999b..014de5bfa 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/404.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/404.html @@ -5,6 +5,7 @@ Page Not Found - Twine Solutions + diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/favicon.png b/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/favicon.png new file mode 100644 index 000000000..cd18a8beb Binary files /dev/null and b/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/favicon.png differ diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/g65f952e1b2e0f109a3571a03f13f6724105af4a300162e6ed887109c32dff81b4d94d97a9ee7dbb180fdbd0d786dc101_640.png b/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/g65f952e1b2e0f109a3571a03f13f6724105af4a300162e6ed887109c32dff81b4d94d97a9ee7dbb180fdbd0d786dc101_640.png new file mode 100644 index 000000000..74a30c597 Binary files /dev/null and b/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/g65f952e1b2e0f109a3571a03f13f6724105af4a300162e6ed887109c32dff81b4d94d97a9ee7dbb180fdbd0d786dc101_640.png differ diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/gf5bb90117e2f7cbfd9b66ed78a2ba37c32a6a124c5f4f3246dfe63f7ee68e9d7d1fbca9b6f059cad6d603c065902cb83_640.png b/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/gf5bb90117e2f7cbfd9b66ed78a2ba37c32a6a124c5f4f3246dfe63f7ee68e9d7d1fbca9b6f059cad6d603c065902cb83_640.png new file mode 100644 index 000000000..2fefca25a Binary files /dev/null and b/Software/Visual_Studio/Web/Bootstrap Studio/Build/assets/img/gf5bb90117e2f7cbfd9b66ed78a2ba37c32a6a124c5f4f3246dfe63f7ee68e9d7d1fbca9b6f059cad6d603c065902cb83_640.png differ diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/docs.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/docs.html index 99aa74597..131432f0d 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/docs.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/docs.html @@ -5,6 +5,7 @@ Home - Twine Solutions + @@ -48,7 +49,7 @@ document.addEventListener('DOMContentLoaded', function() {

Explore official guides, technical manuals, and support documents to get the most from your Twine system.

-
portfolio, folder, arrow, down, download, record, documentation, icon, portfolio, portfolio, portfolio, portfolio, portfolio, documentation
+
documents, folder, office, text, file, blue, blue office, blue document, folder, folder, folder, office, file, file, file, file, file
diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/firmware.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/firmware.html index 6642bd064..d888b6175 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/firmware.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/firmware.html @@ -5,6 +5,7 @@ Home - Twine Solutions + diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/forgotten-password.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/forgotten-password.html index 678df7240..f5fe6093e 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/forgotten-password.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/forgotten-password.html @@ -5,6 +5,7 @@ Forgotten Password - Twine Solutions + diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/index.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/index.html index 0c0cc0892..582ba0a34 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/index.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/index.html @@ -5,6 +5,7 @@ Home - Twine Solutions + @@ -240,7 +241,7 @@ document.addEventListener('DOMContentLoaded', function() {

TS-1800

-

Robust control software powering the original TS-1800—reliable, efficient, and production-proven dyeing performance.

Download +

Robust control software powering the original TS-1800—reliable, efficient, and production-proven dyeing performance.

Download
@@ -248,7 +249,7 @@ document.addEventListener('DOMContentLoaded', function() {

Twine X4

-

High-throughput controller for four-spool machines—maximize productivity with synchronized multi-thread dyeing.

Download +

High-throughput controller for four-spool machines—maximize productivity with synchronized multi-thread dyeing.

Download
@@ -256,7 +257,7 @@ document.addEventListener('DOMContentLoaded', function() {

Twine X1

-

Next-gen application delivering fast, intelligent control of advanced single-spool thread dyeing operations.

Download +

Next-gen application delivering fast, intelligent control of advanced single-spool thread dyeing operations.

Download
diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/logged-in.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/logged-in.html new file mode 100644 index 000000000..f268c1d05 --- /dev/null +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/logged-in.html @@ -0,0 +1,311 @@ + + + + + + + Home - Twine Solutions + + + + + + + + + + + + +
+
+
+
+
+
+

Official Twine Downloads & Support Portal

+

Find everything you need to install, operate, and optimize your Twine systems—all in one place.

+
+
+
+
+
+
+
+
+
+
+
+
+
+

Twine Studio

+

Powerful end-user tool for remote diagnostics, machine insights and statistics. intuitive, secure, and fast.

Download +
+
+
+
+
+
+
+

FSE

+

Comprehensive tool for Field Service Engineers to diagnose, control, and upgrade machines locally or remotely.

Download +
+
+
+
+
+
+
+

Machine Studio

+

Advanced platform for researchers and engineers to design, analyze, and control thread dyeing machines in detail.

Download +
+
+
+
+
+
+
+
+
+
+
+

Power Your Twine Experience

+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
Seamless Remote Connectivity
+

Access, monitor, and control machines from anywhere with lightning-fast connections and secure real-time data sync.

+
+
+
+
+
+
+
+
+
+ + +
+
+
+
Intelligent Diagnostics Engine
+

Pinpoint issues instantly with smart analytics, live telemetry, and guided troubleshooting for optimal machine performance.

+
+
+
+
+
+
+
+
+
+ + + +
+
+
+
Effortless Version Management
+

Upgrade firmware, databases, and applications with just a few clicks—reliable, consistent, and traceable.

+
+
+
+
+
+
+
+
+
+ +
+
+
+
System Insights & Statistics
+

Gain full visibility across the entire ecosystem with interactive dashboards, logs, and real-time health indicators.

+
+
+
+
+
+
+
+
+
+
+
+
+
+

Stats

+
+
+
+
+
+
+
+
+
+
+ + +
+
+
+
Thread Dyed
+

100,000 meters

+
+
+
+
+
+
+
+
+
+ +
+
+
+
Jobs Completed
+

5,000 Jobs

+
+
+
+
+
+
+
+
+
+ + +
+
+
+
Software Upgrades
+

1,000 Successful Upgrades 

+
+
+
+
+
+
+
+
+
+
+
+
+
+

Machine Application Interfaces

+
+
+
+
+
+
+

TS-1800

+

Robust control software powering the original TS-1800—reliable, efficient, and production-proven dyeing performance.

Download +
+
+
+
+
+
+

Twine X4

+

High-throughput controller for four-spool machines—maximize productivity with synchronized multi-thread dyeing.

Download +
+
+
+
+
+
+

Twine X1

+

Next-gen application delivering fast, intelligent control of advanced single-spool thread dyeing operations.

Download +
+
+
+
+
+
+
+
+
+
+
+
+
+
book, read, reading, notebook, pages, open book, icon, book icon, read icon, education, knowledge, book, open book, open book, open book, open book, open book, book icon, book icon +
+

Documentation & Manuals

+
+
+

Download official guides, technical manuals, and support documents to get the most from your Twine system.

Learn More +
+
+
+
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/login-1.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/login-1.html index 43bbc6c31..539d6b4d5 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/login-1.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/login-1.html @@ -5,6 +5,7 @@ Login - Twine Solutions + diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/login.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/login.html index c62c0dcb1..fb5da155b 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/login.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/login.html @@ -5,6 +5,7 @@ Login - Twine Solutions + diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/product.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/product.html index 7c9ab810c..60b98c2d5 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/product.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/product.html @@ -5,6 +5,7 @@ Home - Twine Solutions + diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Build/utilities.html b/Software/Visual_Studio/Web/Bootstrap Studio/Build/utilities.html index dd637d164..398557416 100644 --- a/Software/Visual_Studio/Web/Bootstrap Studio/Build/utilities.html +++ b/Software/Visual_Studio/Web/Bootstrap Studio/Build/utilities.html @@ -5,6 +5,7 @@ Home - Twine Solutions + @@ -48,7 +49,7 @@ document.addEventListener('DOMContentLoaded', function() {

Explore utilities designed for specific tasks

-
database, backup, update, management, reset to default, database, database, database, backup, backup, backup, backup, backup, update
+
cogwheel, gear, gearwheel, cog, options, settings, machine, tools, preferences, gear, gear, gear, gear, gear, cog, settings, settings, settings, machine, machine, tools, tools, tools
diff --git a/Software/Visual_Studio/Web/Bootstrap Studio/Twine Solutions.bsdesign b/Software/Visual_Studio/Web/Bootstrap Studio/Twine Solutions.bsdesign index 4791a43ac..927a974c3 100644 Binary files a/Software/Visual_Studio/Web/Bootstrap Studio/Twine Solutions.bsdesign and b/Software/Visual_Studio/Web/Bootstrap Studio/Twine Solutions.bsdesign differ diff --git a/Software/Visual_Studio/Web/Tango.Portal/Controllers/AccountController.cs b/Software/Visual_Studio/Web/Tango.Portal/Controllers/AccountController.cs deleted file mode 100644 index 5475966d8..000000000 --- a/Software/Visual_Studio/Web/Tango.Portal/Controllers/AccountController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using Microsoft.Owin.Security.Cookies; -using Microsoft.Owin.Security.OpenIdConnect; -using Microsoft.Owin.Security; - -namespace Tango.Portal.Controllers -{ - public class AccountController : Controller - { - public void SignIn() - { - // Send an OpenID Connect sign-in request. - if (!Request.IsAuthenticated) - { - HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = "/" }, - OpenIdConnectAuthenticationDefaults.AuthenticationType); - } - } - - public void SignOut() - { - string callbackUrl = Url.Action("SignOutCallback", "Account", routeValues: null, protocol: Request.Url.Scheme); - - HttpContext.GetOwinContext().Authentication.SignOut( - new AuthenticationProperties { RedirectUri = callbackUrl }, - OpenIdConnectAuthenticationDefaults.AuthenticationType, CookieAuthenticationDefaults.AuthenticationType); - } - - public ActionResult SignOutCallback() - { - if (Request.IsAuthenticated) - { - // Redirect to home page if the user is authenticated. - return RedirectToAction("Index", "Home"); - } - - return View(); - } - } -} diff --git a/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs b/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs index 58625d768..b913ec6d8 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs +++ b/Software/Visual_Studio/Web/Tango.Portal/Controllers/HomeController.cs @@ -48,7 +48,9 @@ namespace Tango.Portal.Controllers public ActionResult Index() { - return View(new ViewModel(SessionUser)); + var vm = new IndexVM(SessionUser); + vm.Stats = StatisticsUtils.Default.GetStats(); + return View(vm); } public ActionResult Product(String key, PortalEnvironment environment = PortalEnvironment.Production) @@ -242,10 +244,12 @@ namespace Tango.Portal.Controllers public void SignInMicrosoft() { + string callbackUrl = Url.Action("Index", "Home", routeValues: null, protocol: Request.Url.Scheme); + // Send an OpenID Connect sign-in request. if (!Request.IsAuthenticated) { - HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = "/" }, + HttpContext.GetOwinContext().Authentication.Challenge(new AuthenticationProperties { RedirectUri = callbackUrl }, OpenIdConnectAuthenticationDefaults.AuthenticationType); } } @@ -254,16 +258,11 @@ namespace Tango.Portal.Controllers { SessionUser = null; - string callbackUrl = Url.Action("SignOutCallback", "Home", routeValues: null, protocol: Request.Url.Scheme); + string callbackUrl = Url.Action("Index", "Home", routeValues: null, protocol: Request.Url.Scheme); HttpContext.GetOwinContext().Authentication.SignOut( new AuthenticationProperties { RedirectUri = callbackUrl }, OpenIdConnectAuthenticationDefaults.AuthenticationType, CookieAuthenticationDefaults.AuthenticationType); } - - public ActionResult SignOutCallback() - { - return RedirectToAction("Index", "Home"); - } } } \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.Portal/Models/Statistics.cs b/Software/Visual_Studio/Web/Tango.Portal/Models/Statistics.cs new file mode 100644 index 000000000..54e2de9e1 --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.Portal/Models/Statistics.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace Tango.Portal.Models +{ + public class Statistics + { + public int TotalDyedThread { get; set; } + public int JobsCompleted { get; set; } + public int SoftwareUpgrades { get; set; } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.Portal/Properties/PublishProfiles/machineservice-gateway-twine-portal - Web Deploy.pubxml b/Software/Visual_Studio/Web/Tango.Portal/Properties/PublishProfiles/machineservice-gateway-twine-portal - Web Deploy.pubxml new file mode 100644 index 000000000..d85b1631b --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.Portal/Properties/PublishProfiles/machineservice-gateway-twine-portal - Web Deploy.pubxml @@ -0,0 +1,30 @@ + + + + + MSDeploy + /subscriptions/10c8aa60-3b15-4e0d-b412-6aeef90e5e91/resourceGroups/Tango/providers/Microsoft.Web/sites/machineservice-gateway/slots/twine-portal + Tango + + AzureWebSite + Release + Any CPU + http://machineservice-gateway-twine-portal.azurewebsites.net + True + False + machineservice-gateway-twine-portal.scm.azurewebsites.net:443 + machineservice-gateway__twine-portal + + True + False + WMSVC + True + false + $machineservice-gateway__twine-portal + <_SavePWD>True + <_DestinationType>AzureWebSite + + \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.Portal/Properties/ServiceDependencies/machineservice-gateway-twine-portal - Web Deploy/profile.arm.json b/Software/Visual_Studio/Web/Tango.Portal/Properties/ServiceDependencies/machineservice-gateway-twine-portal - Web Deploy/profile.arm.json new file mode 100644 index 000000000..a4b7a71c2 --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.Portal/Properties/ServiceDependencies/machineservice-gateway-twine-portal - Web Deploy/profile.arm.json @@ -0,0 +1,113 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_dependencyType": "compute.appService.windows" + }, + "parameters": { + "resourceGroupName": { + "type": "string", + "defaultValue": "Tango", + "metadata": { + "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking." + } + }, + "resourceGroupLocation": { + "type": "string", + "defaultValue": "westeurope", + "metadata": { + "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support." + } + }, + "resourceName": { + "type": "string", + "defaultValue": "twine-portal", + "metadata": { + "description": "Name of the main resource to be created by this template." + } + }, + "resourceLocation": { + "type": "string", + "defaultValue": "[parameters('resourceGroupLocation')]", + "metadata": { + "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there." + } + } + }, + "variables": { + "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]", + "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]" + }, + "resources": [ + { + "type": "Microsoft.Resources/resourceGroups", + "name": "[parameters('resourceGroupName')]", + "location": "[parameters('resourceGroupLocation')]", + "apiVersion": "2019-10-01" + }, + { + "type": "Microsoft.Resources/deployments", + "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]", + "resourceGroup": "[parameters('resourceGroupName')]", + "apiVersion": "2019-10-01", + "dependsOn": [ + "[parameters('resourceGroupName')]" + ], + "properties": { + "mode": "Incremental", + "template": { + "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "resources": [ + { + "location": "[parameters('resourceLocation')]", + "name": "[parameters('resourceName')]", + "type": "Microsoft.Web/sites", + "apiVersion": "2015-08-01", + "tags": { + "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty" + }, + "dependsOn": [ + "[variables('appServicePlan_ResourceId')]" + ], + "kind": "app", + "properties": { + "name": "[parameters('resourceName')]", + "kind": "app", + "httpsOnly": true, + "reserved": false, + "serverFarmId": "[variables('appServicePlan_ResourceId')]", + "siteConfig": { + "metadata": [ + { + "name": "CURRENT_STACK", + "value": "dotnetcore" + } + ] + } + }, + "identity": { + "type": "SystemAssigned" + } + }, + { + "location": "[parameters('resourceLocation')]", + "name": "[variables('appServicePlan_name')]", + "type": "Microsoft.Web/serverFarms", + "apiVersion": "2015-08-01", + "sku": { + "name": "S1", + "tier": "Standard", + "family": "S", + "size": "S1" + }, + "properties": { + "name": "[variables('appServicePlan_name')]" + } + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.Portal/Tango.Portal.csproj b/Software/Visual_Studio/Web/Tango.Portal/Tango.Portal.csproj index 4190ca4ee..75cc549e6 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Tango.Portal.csproj +++ b/Software/Visual_Studio/Web/Tango.Portal/Tango.Portal.csproj @@ -175,7 +175,6 @@ - @@ -185,14 +184,17 @@ + + + @@ -204,7 +206,9 @@ + + @@ -228,6 +232,7 @@ + @@ -250,8 +255,6 @@ - - diff --git a/Software/Visual_Studio/Web/Tango.Portal/Utils/StatisticsUtils.cs b/Software/Visual_Studio/Web/Tango.Portal/Utils/StatisticsUtils.cs new file mode 100644 index 000000000..9cf83b717 --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.Portal/Utils/StatisticsUtils.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Tango.BL.Entities; +using Tango.Portal.Models; + +namespace Tango.Portal.Utils +{ + public class StatisticsUtils + { + private static readonly Lazy _default = new Lazy(() => new StatisticsUtils()); + public static StatisticsUtils Default => _default.Value; + + private Statistics _stats; + private DateTime _fetchDate { get; set; } + + public Statistics GetStats() + { + if (_stats == null || DateTime.Now > _fetchDate.AddDays(7)) + { + _fetchDate = DateTime.Now; + _stats = new Statistics(); + + try + { + using (var db = DbUtils.CreateContext(Enumerations.PortalEnvironment.Test)) + { + var jobRuns = db.JobRuns.Select(x => new { x.ActualStartPosition, x.ActualEndPosition, x.EndPosition, x.Status }) + .ToList() + .Select(x => new JobRun() + { + ActualStartPosition = x.ActualStartPosition, + ActualEndPosition = x.ActualEndPosition, + EndPosition = x.EndPosition, + Status = x.Status + }) + .ToList(); + + int[] arr = (new List() + { + BL.Enumerations.TangoUpdateStatuses.DatabaseCompleted, + BL.Enumerations.TangoUpdateStatuses.OfflineFirmwareUpgradeCompleted, + BL.Enumerations.TangoUpdateStatuses.OfflineUpdateCompleted, + BL.Enumerations.TangoUpdateStatuses.SetupCompleted, + BL.Enumerations.TangoUpdateStatuses.UpdateCompleted + }).Cast().ToArray(); + + var upgrades = db.TangoUpdates.Where(x => arr.Contains(x.Status)).Count(); + + _stats.TotalDyedThread = (int)jobRuns.Sum(x => x.Distance) / 1000; + _stats.JobsCompleted = jobRuns.Count; + _stats.SoftwareUpgrades = upgrades; + } + } + catch (Exception) + { + + } + } + + return _stats; + } + + private StatisticsUtils() + { + _stats = new Statistics(); + } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.Portal/ViewModels/IndexVM.cs b/Software/Visual_Studio/Web/Tango.Portal/ViewModels/IndexVM.cs new file mode 100644 index 000000000..81fb5cfc4 --- /dev/null +++ b/Software/Visual_Studio/Web/Tango.Portal/ViewModels/IndexVM.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using Tango.Portal.Models; + +namespace Tango.Portal.ViewModels +{ + public class IndexVM : ViewModel + { + public Statistics Stats { get; set; } + + public IndexVM(SessionUser user) : base(user) + { + Stats = new Statistics(); + } + } +} \ No newline at end of file diff --git a/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Docs.cshtml b/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Docs.cshtml index 213856cb1..86e2d91df 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Docs.cshtml +++ b/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Docs.cshtml @@ -16,7 +16,9 @@

Explore official guides, technical manuals, and support documents to get the most from your Twine system.

-
portfolio, folder, arrow, down, download, record, documentation, icon, portfolio, portfolio, portfolio, portfolio, portfolio, documentation
+
+ documents, folder, office, text, file, blue, blue office, blue document, folder, folder, folder, office, file, file, file, file, file +
diff --git a/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Index.cshtml b/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Index.cshtml index 02a4ed1d8..1d9a48886 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Index.cshtml +++ b/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Index.cshtml @@ -1,4 +1,4 @@ -@model Tango.Portal.ViewModel +@model Tango.Portal.ViewModels.IndexVM @@ -165,7 +165,7 @@
Thread Dyed
-

100,000 meters

+

@Model.Stats.TotalDyedThread.ToString("N0") kilometers

@@ -182,7 +182,7 @@
Jobs Completed
-

5,000 Jobs

+

@Model.Stats.JobsCompleted.ToString("N0") Jobs

@@ -200,7 +200,7 @@
Software Upgrades
-

1,000 Successful Upgrades 

+

@Model.Stats.SoftwareUpgrades.ToString("N0") Upgrades 

diff --git a/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Utilities.cshtml b/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Utilities.cshtml index 498bbc5c7..c5193d878 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Utilities.cshtml +++ b/Software/Visual_Studio/Web/Tango.Portal/Views/Home/Utilities.cshtml @@ -16,7 +16,9 @@

Helpful tools and resources to support your system setup and maintenance.

-
database, backup, update, management, reset to default, database, database, database, backup, backup, backup, backup, backup, update
+
+ cogwheel, gear, gearwheel, cog, options, settings, machine, tools, preferences, gear, gear, gear, gear, gear, cog, settings, settings, settings, machine, machine, tools, tools, tools +
diff --git a/Software/Visual_Studio/Web/Tango.Portal/Views/Shared/NavigationPartial.cshtml b/Software/Visual_Studio/Web/Tango.Portal/Views/Shared/NavigationPartial.cshtml index 999687969..d90438c7d 100644 --- a/Software/Visual_Studio/Web/Tango.Portal/Views/Shared/NavigationPartial.cshtml +++ b/Software/Visual_Studio/Web/Tango.Portal/Views/Shared/NavigationPartial.cshtml @@ -5,7 +5,7 @@