Merge branch 'feature/check/alarms' into develop
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<RenderingMethod>GPU</RenderingMethod> <!-- GPU/CPU -->
|
||||
<ShowVirtualKeyboard>false</ShowVirtualKeyboard>
|
||||
<RunningOnSecondaryScreen>false</RunningOnSecondaryScreen>
|
||||
<DeveloperMode>false</DeveloperMode>
|
||||
<DeveloperMode>true</DeveloperMode>
|
||||
</Client>
|
||||
<Connection>
|
||||
<ServerUrl>localhost</ServerUrl>
|
||||
|
||||
+254
-254
@@ -1,276 +1,276 @@
|
||||
using Client.Utils;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Schema;
|
||||
|
||||
namespace Client.Config
|
||||
{
|
||||
public class ConfigController
|
||||
{
|
||||
const String ChromeScheme = "chrome";
|
||||
|
||||
public static void ReadStartupConfig()
|
||||
{
|
||||
// Read validation file
|
||||
using Client.Utils;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.Schema;
|
||||
|
||||
namespace Client.Config
|
||||
{
|
||||
public class ConfigController
|
||||
{
|
||||
const String ChromeScheme = "chrome";
|
||||
|
||||
public static void ReadStartupConfig()
|
||||
{
|
||||
// Read validation file
|
||||
XmlSchemaSet readerSettings = new XmlSchemaSet();
|
||||
|
||||
// Add Schema
|
||||
readerSettings.Add(null, Constants.STARTUP_CONFIG_SCHEMA_PATH);
|
||||
// Open file reader
|
||||
XDocument xmlConfigFile = XDocument.Load(Constants.STARTUP_CONFIG_PATH);
|
||||
|
||||
// Validate file
|
||||
xmlConfigFile.Validate(readerSettings, ValidationHandler);
|
||||
|
||||
// Read XML Config
|
||||
Config.ClientConfig = xmlConfigFile
|
||||
.Descendants(Constants.CLIENT_CONFIG_KEY)
|
||||
.Select(x => new SubModels.Client()
|
||||
{
|
||||
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value),
|
||||
RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value),
|
||||
RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value),
|
||||
ShowVirtualKeyboard = ValidateVirtualKeyboard(x.Element("ShowVirtualKeyboard").Value),
|
||||
DeveloperMode = ValidateDeveloperMode(x.Element("DeveloperMode").Value),
|
||||
readerSettings.Add(null, Constants.STARTUP_CONFIG_SCHEMA_PATH);
|
||||
// Open file reader
|
||||
XDocument xmlConfigFile = XDocument.Load(Constants.STARTUP_CONFIG_PATH);
|
||||
|
||||
// Validate file
|
||||
xmlConfigFile.Validate(readerSettings, ValidationHandler);
|
||||
|
||||
// Read XML Config
|
||||
Config.ClientConfig = xmlConfigFile
|
||||
.Descendants(Constants.CLIENT_CONFIG_KEY)
|
||||
.Select(x => new SubModels.Client()
|
||||
{
|
||||
TranspColor = ValidateTranspColor(x.Element("TranspColor").Value),
|
||||
RenderingMethod = ValidateRendering(x.Element("RenderingMethod").Value),
|
||||
RunningOnSecondaryScreen = ValidateSecScreen(x.Element("RunningOnSecondaryScreen").Value),
|
||||
ShowVirtualKeyboard = ValidateVirtualKeyboard(x.Element("ShowVirtualKeyboard").Value),
|
||||
DeveloperMode = ValidateDeveloperMode(x.Element("DeveloperMode").Value),
|
||||
IsSCM = ValidateIsSCM(x.Element("IsSCM").Value)
|
||||
}).FirstOrDefault();
|
||||
|
||||
Config.ConnectionConfig = xmlConfigFile
|
||||
.Descendants(Constants.CONNECTION_CONFIG_KEY)
|
||||
.Select(x => new SubModels.Connection()
|
||||
{
|
||||
ServerUrl = ValidateServerUrl(x.Element("ServerUrl").Value),
|
||||
ServerPort = ValidateServerPort(x.Element("ServerPort").Value),
|
||||
Id = ValidateClientID(x.Element("Id").Value),
|
||||
DeleteCahceFolderOnStartup = ValidateDelCache(x.Element("DeleteCahceFolderOnStartup").Value),
|
||||
}).FirstOrDefault();
|
||||
|
||||
Config.VendorHmiConfig = xmlConfigFile
|
||||
.Descendants(Constants.VENDORHMI_CONFIG_KEY)
|
||||
.Select(x => new SubModels.VendorHmi()
|
||||
{
|
||||
FollowNcWindow = ValidateFollowNcWin(x.Element("FollowNcWindow").Value)
|
||||
}).FirstOrDefault();
|
||||
|
||||
Config.ProdSoftwareConfig = new SubModels.ProdSoftware();
|
||||
Config.ExtSoftwaresConfig = new SubModels.Software[] { };
|
||||
|
||||
//ReadConfig Url compositing
|
||||
Config.ConnectionConfig.ReadConfigUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.ConfigPage;
|
||||
Config.ConnectionConfig.StartingUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.StartingPage;
|
||||
|
||||
//ErrorPage content
|
||||
if (File.Exists(Constants.errorPageFile))
|
||||
Config.ConnectionConfig.ErrorPage = File.ReadAllText(Constants.errorPageFile);
|
||||
else
|
||||
throw new Exception(@"File Error: """ + Constants.errorPageFile + @""" not found");
|
||||
|
||||
}
|
||||
|
||||
private static void ValidationHandler(object sender, ValidationEventArgs e)
|
||||
{
|
||||
throw new Exception(@"Configuration Error: " + e.Message);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#region PROPERTIES_VALIDATOR
|
||||
|
||||
private static String ValidateServerUrl(String value)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(value))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - ServerUrl"" is not a valid URL");
|
||||
}
|
||||
|
||||
|
||||
private static ushort ValidateServerPort(String value)
|
||||
{
|
||||
if (ushort.TryParse(value, out ushort Port))
|
||||
return Port;
|
||||
else
|
||||
}).FirstOrDefault();
|
||||
|
||||
Config.ConnectionConfig = xmlConfigFile
|
||||
.Descendants(Constants.CONNECTION_CONFIG_KEY)
|
||||
.Select(x => new SubModels.Connection()
|
||||
{
|
||||
ServerUrl = ValidateServerUrl(x.Element("ServerUrl").Value),
|
||||
ServerPort = ValidateServerPort(x.Element("ServerPort").Value),
|
||||
Id = ValidateClientID(x.Element("Id").Value),
|
||||
DeleteCahceFolderOnStartup = ValidateDelCache(x.Element("DeleteCahceFolderOnStartup").Value),
|
||||
}).FirstOrDefault();
|
||||
|
||||
Config.VendorHmiConfig = xmlConfigFile
|
||||
.Descendants(Constants.VENDORHMI_CONFIG_KEY)
|
||||
.Select(x => new SubModels.VendorHmi()
|
||||
{
|
||||
FollowNcWindow = ValidateFollowNcWin(x.Element("FollowNcWindow").Value)
|
||||
}).FirstOrDefault();
|
||||
|
||||
Config.ProdSoftwareConfig = new SubModels.ProdSoftware();
|
||||
Config.ExtSoftwaresConfig = new SubModels.Software[] { };
|
||||
|
||||
//ReadConfig Url compositing
|
||||
Config.ConnectionConfig.ReadConfigUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.ConfigPage;
|
||||
Config.ConnectionConfig.StartingUrl = "http://" + Config.ConnectionConfig.ServerUrl + ":" + Config.ConnectionConfig.ServerPort + "/" + Constants.StartingPage;
|
||||
|
||||
//ErrorPage content
|
||||
if (File.Exists(Constants.errorPageFile))
|
||||
Config.ConnectionConfig.ErrorPage = File.ReadAllText(Constants.errorPageFile);
|
||||
else
|
||||
throw new Exception(@"File Error: """ + Constants.errorPageFile + @""" not found");
|
||||
|
||||
}
|
||||
|
||||
private static void ValidationHandler(object sender, ValidationEventArgs e)
|
||||
{
|
||||
throw new Exception(@"Configuration Error: " + e.Message);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#region PROPERTIES_VALIDATOR
|
||||
|
||||
private static String ValidateServerUrl(String value)
|
||||
{
|
||||
if (!String.IsNullOrWhiteSpace(value))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - ServerUrl"" is not a valid URL");
|
||||
}
|
||||
|
||||
|
||||
private static ushort ValidateServerPort(String value)
|
||||
{
|
||||
if (ushort.TryParse(value, out ushort Port))
|
||||
return Port;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - ServerPort"" is not a valid Id of CMS-Client");
|
||||
}
|
||||
|
||||
|
||||
private static String ValidateArgumentUrl(String value)
|
||||
{
|
||||
Uri NewUrl;
|
||||
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Argument Url Error: is not a valid URL");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Color ValidateTranspColor(String value)
|
||||
{
|
||||
Color color;
|
||||
try
|
||||
{
|
||||
color = ColorTranslator.FromHtml(value);
|
||||
return color;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new Exception(@"Configuration Error: ""Client - TranspColor"" is not a valid Hex Color");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Constants.Rendering ValidateRendering(string value)
|
||||
{
|
||||
if (value.ToUpper().Equals("CPU"))
|
||||
return Constants.Rendering.CPU;
|
||||
else if (value.ToUpper().Equals("GPU"))
|
||||
return Constants.Rendering.GPU;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - RenderingMethod"" is not a valid Rendering Method");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static bool ValidateSecScreen(string value)
|
||||
{
|
||||
Boolean secScreen;
|
||||
if (Boolean.TryParse(value, out secScreen))
|
||||
return secScreen;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - RunningOnSecondaryScreen"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
private static bool ValidateIsSCM(string value)
|
||||
{
|
||||
Boolean IsSCM;
|
||||
if (Boolean.TryParse(value, out IsSCM))
|
||||
return IsSCM;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - IsSCM"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static bool ValidateVirtualKeyboard(string value)
|
||||
{
|
||||
Boolean keyboard;
|
||||
if (Boolean.TryParse(value, out keyboard))
|
||||
return keyboard;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - ShowVirtualKeyboard"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static bool ValidateDeveloperMode(string value)
|
||||
{
|
||||
Boolean DeveloperMode;
|
||||
if (Boolean.TryParse(value, out DeveloperMode))
|
||||
return DeveloperMode;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - DeveloperMode"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static Boolean ValidateFollowNcWin(String value)
|
||||
{
|
||||
Boolean FollowNc;
|
||||
if (Boolean.TryParse(value, out FollowNc))
|
||||
return FollowNc;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""VendorHmi - FollowNcWindow"" is not a valid Boolean Type");
|
||||
}
|
||||
|
||||
|
||||
private static ushort ValidateClientID(String value)
|
||||
{
|
||||
ushort Client;
|
||||
if (ushort.TryParse(value, out Client))
|
||||
return Client;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - Id"" is not a valid Id of CMS-Client");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Boolean ValidateDelCache(String value)
|
||||
{
|
||||
Boolean DelCache;
|
||||
if (Boolean.TryParse(value, out DelCache))
|
||||
return DelCache;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - DeleteCahceFolderOnStartup"" is not a valid Boolean Type");
|
||||
|
||||
private static String ValidateArgumentUrl(String value)
|
||||
{
|
||||
Uri NewUrl;
|
||||
if (Uri.TryCreate(value, UriKind.Absolute, out NewUrl) && (NewUrl.Scheme == Uri.UriSchemeHttp || NewUrl.Scheme == Uri.UriSchemeHttps || NewUrl.Scheme == Uri.UriSchemeFile || NewUrl.Scheme == ChromeScheme))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Argument Url Error: is not a valid URL");
|
||||
}
|
||||
|
||||
|
||||
private static String ValidateSFTPath(String value)
|
||||
{
|
||||
if (File.Exists(value))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: File """ + value + @""" not found");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static String ValidateSFTSName(String value)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
{
|
||||
if (value.Count() <= 3)
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: Short Name """ + value + @""" cannot be over 3 Letters");
|
||||
}
|
||||
else
|
||||
|
||||
private static Color ValidateTranspColor(String value)
|
||||
{
|
||||
Color color;
|
||||
try
|
||||
{
|
||||
color = ColorTranslator.FromHtml(value);
|
||||
return color;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
throw new Exception(@"Configuration Error: ""Client - TranspColor"" is not a valid Hex Color");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Constants.Rendering ValidateRendering(string value)
|
||||
{
|
||||
if (value.ToUpper().Equals("CPU"))
|
||||
return Constants.Rendering.CPU;
|
||||
else if (value.ToUpper().Equals("GPU"))
|
||||
return Constants.Rendering.GPU;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - RenderingMethod"" is not a valid Rendering Method");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static bool ValidateSecScreen(string value)
|
||||
{
|
||||
Boolean secScreen;
|
||||
if (Boolean.TryParse(value, out secScreen))
|
||||
return secScreen;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - RunningOnSecondaryScreen"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
private static bool ValidateIsSCM(string value)
|
||||
{
|
||||
Boolean IsSCM;
|
||||
if (Boolean.TryParse(value, out IsSCM))
|
||||
return IsSCM;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - IsSCM"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static bool ValidateVirtualKeyboard(string value)
|
||||
{
|
||||
Boolean keyboard;
|
||||
if (Boolean.TryParse(value, out keyboard))
|
||||
return keyboard;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - ShowVirtualKeyboard"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static bool ValidateDeveloperMode(string value)
|
||||
{
|
||||
Boolean DeveloperMode;
|
||||
if (Boolean.TryParse(value, out DeveloperMode))
|
||||
return DeveloperMode;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Client - DeveloperMode"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static Boolean ValidateFollowNcWin(String value)
|
||||
{
|
||||
Boolean FollowNc;
|
||||
if (Boolean.TryParse(value, out FollowNc))
|
||||
return FollowNc;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""VendorHmi - FollowNcWindow"" is not a valid Boolean Type");
|
||||
}
|
||||
|
||||
|
||||
private static ushort ValidateClientID(String value)
|
||||
{
|
||||
ushort Client;
|
||||
if (ushort.TryParse(value, out Client))
|
||||
return Client;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - Id"" is not a valid Id of CMS-Client");
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static Boolean ValidateDelCache(String value)
|
||||
{
|
||||
Boolean DelCache;
|
||||
if (Boolean.TryParse(value, out DelCache))
|
||||
return DelCache;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: ""Connection - DeleteCahceFolderOnStartup"" is not a valid Boolean Type");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static String ValidateSFTPath(String value)
|
||||
{
|
||||
if (File.Exists(value))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: File """ + value + @""" not found");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static String ValidateSFTSName(String value)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
{
|
||||
if (value.Count() <= 3)
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: Short Name """ + value + @""" cannot be over 3 Letters");
|
||||
}
|
||||
else
|
||||
throw new Exception(@"Configuration Error: Software Short Name Must be setted");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static bool ValidateInMainMenuBar(String value)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
{
|
||||
return Boolean.Parse(value);
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
|
||||
private static bool ValidateInMainMenuBar(String value)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
{
|
||||
return Boolean.Parse(value);
|
||||
}
|
||||
else
|
||||
throw new Exception(@"Configuration Error: In-Main-Menu-Bar Must be setted");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static String ValidateSFTLName(String value)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: Software Long Name Must be setted");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static String ExtractBase64Icon(String value)
|
||||
{
|
||||
Image im = Icon.ExtractAssociatedIcon(value).ToBitmap();
|
||||
MemoryStream m = new MemoryStream();
|
||||
im.Save(m, ImageFormat.Png);
|
||||
}
|
||||
|
||||
|
||||
private static String ValidateSFTLName(String value)
|
||||
{
|
||||
if (!String.IsNullOrEmpty(value))
|
||||
return value;
|
||||
else
|
||||
throw new Exception(@"Configuration Error: Software Long Name Must be setted");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static String ExtractBase64Icon(String value)
|
||||
{
|
||||
Image im = Icon.ExtractAssociatedIcon(value).ToBitmap();
|
||||
MemoryStream m = new MemoryStream();
|
||||
im.Save(m, ImageFormat.Png);
|
||||
return "data:image/png;base64," + Convert.ToBase64String(m.ToArray());
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,17 +4,18 @@
|
||||
{
|
||||
|
||||
//Folders
|
||||
public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
|
||||
public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + "\\";
|
||||
//public static string BASE_PATH = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\";
|
||||
public static string BROWSER_CACHE_FOLDER = BASE_PATH + "LocalStorage";
|
||||
public static string STARTUP_CONFIG_SCHEMA_PATH = BASE_PATH + "ClientValidator.xsd";
|
||||
public static string STARTUP_CONFIG_PATH = BASE_PATH + "Config.xml";
|
||||
public static string STARTUP_CONFIG_PATH = BASE_PATH + "lib\\Config.xml";
|
||||
public static string CEF_PATH = BASE_PATH + "CEF";
|
||||
public static string CEF_X86_PATH = BASE_PATH + "CEF\\Release_X86";
|
||||
public static string CEF_X64_PATH = BASE_PATH + "CEF\\Release_X64";
|
||||
public static string CEF_LOCALES_PATH = BASE_PATH + "CEF\\Resources\\locales";
|
||||
public static string CEF_EXCEPTIONLOG_PATH = BASE_PATH + "ExceptionLog";
|
||||
public static string errorPageFile = BASE_PATH + "error.pg";
|
||||
public static string JOB_OPENING_PATH = "C:\\CMS\\ACTIVE\\TMP\\clientTmpJob\\";
|
||||
public static string JOB_OPENING_PATH = "C:\\CMS\\ThermoActive\\TMP\\clientTmpJob\\";
|
||||
public static string PART_PRG_FOLDER = "C:\\PartPrg";
|
||||
|
||||
//Config Names
|
||||
|
||||
+8
-3
@@ -1,6 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="lib;libs" />
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -288,4 +288,10 @@
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Target Name="AfterBuild">
|
||||
<ItemGroup>
|
||||
<MoveToLibFolder Exclude="Config.xml" Include="$(OutputPath)*.dll ; $(OutputPath)*.pdb ; $(OutputPath)*.xml" />
|
||||
</ItemGroup>
|
||||
<Move SourceFiles="@(MoveToLibFolder)" DestinationFolder="$(OutputPath)lib" OverwriteReadOnlyFiles="true" />
|
||||
</Target>
|
||||
</Project>
|
||||
+150
-150
@@ -4,154 +4,154 @@
|
||||
https://go.microsoft.com/fwlink/?LinkId=301879
|
||||
-->
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup useLegacyV2RuntimeActivationPolicy="true">
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="enableDirectoryBrowsing" value="true" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
<add key="ServerServiceName" value="MariaDB" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.6.2" />
|
||||
<httpRuntime targetFramework="4.6.2" />
|
||||
<httpModules>
|
||||
</httpModules>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.10.4.0" newVersion="6.10.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<probing privatePath="lib;libs" />
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<connectionStrings>
|
||||
<add name="mySQLDatabaseConnection" providerName="MySql.Data.MySqlClient" connectionString="Server=localhost;Database=step;Uid=root;Pwd=root;" />
|
||||
</connectionStrings>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||
<providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.10.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||
</provider>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<system.diagnostics>
|
||||
<sources>
|
||||
<source name="SignalR.SqlMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.ServiceBusMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.RedisMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.ScaleoutMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.WebSocketTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.ServerSentEventsTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.ForeverFrameTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.LongPollingTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.TransportHeartBeat">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.ReflectedHubDescriptorProvider">
|
||||
<listeners>
|
||||
<add name="SignalR-Init" />
|
||||
</listeners>
|
||||
</source>
|
||||
</sources>
|
||||
<!-- Sets the trace verbosity level -->
|
||||
<switches>
|
||||
<add name="SignalRSwitch" value="Verbose" />
|
||||
</switches>
|
||||
<!-- Specifies the trace writer for output -->
|
||||
<sharedListeners>
|
||||
<!-- Listener for transport events -->
|
||||
<add name="SignalR-Transports" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/transports.log" />
|
||||
<!-- Listener for scaleout provider events -->
|
||||
<add name="SignalR-Bus" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/bus.log" />
|
||||
<!-- Listener for hub discovery events -->
|
||||
<add name="SignalR-Init" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/init.log" />
|
||||
</sharedListeners>
|
||||
<trace autoflush="true" />
|
||||
</system.diagnostics>
|
||||
<configSections>
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<startup useLegacyV2RuntimeActivationPolicy="true">
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
</startup>
|
||||
<appSettings>
|
||||
<add key="enableDirectoryBrowsing" value="true" />
|
||||
<add key="ClientSettingsProvider.ServiceUri" value="" />
|
||||
<add key="ServerServiceName" value="MariaDB" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.6.2" />
|
||||
<httpRuntime targetFramework="4.6.2" />
|
||||
<httpModules>
|
||||
</httpModules>
|
||||
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||
<providers>
|
||||
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||
<providers>
|
||||
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
</system.web>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-3.1.0.0" newVersion="3.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.10.4.0" newVersion="6.10.4.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Cors" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<probing privatePath="lib;libs" />
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<connectionStrings>
|
||||
<add name="mySQLDatabaseConnection" providerName="MySql.Data.MySqlClient" connectionString="Server=localhost;Database=step;Uid=root;Pwd=root;" />
|
||||
</connectionStrings>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
|
||||
<providers>
|
||||
<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.10.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
|
||||
</provider>
|
||||
</providers>
|
||||
</entityFramework>
|
||||
<system.diagnostics>
|
||||
<sources>
|
||||
<source name="SignalR.SqlMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.ServiceBusMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.RedisMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.ScaleoutMessageBus">
|
||||
<listeners>
|
||||
<add name="SignalR-Bus" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.WebSocketTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.ServerSentEventsTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.ForeverFrameTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.LongPollingTransport">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.Transports.TransportHeartBeat">
|
||||
<listeners>
|
||||
<add name="SignalR-Transports" />
|
||||
</listeners>
|
||||
</source>
|
||||
<source name="SignalR.ReflectedHubDescriptorProvider">
|
||||
<listeners>
|
||||
<add name="SignalR-Init" />
|
||||
</listeners>
|
||||
</source>
|
||||
</sources>
|
||||
<!-- Sets the trace verbosity level -->
|
||||
<switches>
|
||||
<add name="SignalRSwitch" value="Verbose" />
|
||||
</switches>
|
||||
<!-- Specifies the trace writer for output -->
|
||||
<sharedListeners>
|
||||
<!-- Listener for transport events -->
|
||||
<add name="SignalR-Transports" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/transports.log" />
|
||||
<!-- Listener for scaleout provider events -->
|
||||
<add name="SignalR-Bus" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/bus.log" />
|
||||
<!-- Listener for hub discovery events -->
|
||||
<add name="SignalR-Init" type="System.Diagnostics.TextWriterTraceListener" initializeData="logs/init.log" />
|
||||
</sharedListeners>
|
||||
<trace autoflush="true" />
|
||||
</system.diagnostics>
|
||||
</configuration>
|
||||
@@ -4,6 +4,7 @@ using Microsoft.Owin.Cors;
|
||||
using Microsoft.Owin.FileSystems;
|
||||
using Microsoft.Owin.Security.OAuth;
|
||||
using Microsoft.Owin.StaticFiles;
|
||||
using Microsoft.Owin.StaticFiles.ContentTypes;
|
||||
using Newtonsoft.Json;
|
||||
using Owin;
|
||||
using System;
|
||||
@@ -62,9 +63,20 @@ namespace Thermo.Active.App_Start
|
||||
EnableDefaultFiles = !directoryBrowsing,
|
||||
EnableDirectoryBrowsing = directoryBrowsing,
|
||||
RequestPath = PathString.Empty,
|
||||
FileSystem = new PhysicalFileSystem(WEBSITE_DIRECTORY)
|
||||
FileSystem = new PhysicalFileSystem(WEBSITE_DIRECTORY),
|
||||
|
||||
};
|
||||
|
||||
options.StaticFileOptions.ServeUnknownFileTypes = true;
|
||||
options.StaticFileOptions.ContentTypeProvider = new FileExtensionContentTypeProvider();
|
||||
((FileExtensionContentTypeProvider)options.StaticFileOptions.ContentTypeProvider).Mappings.Add("json", "application/json");
|
||||
((FileExtensionContentTypeProvider)options.StaticFileOptions.ContentTypeProvider).Mappings.Add("ttf", "font/truetype");
|
||||
|
||||
|
||||
//// Setup configuration sources.
|
||||
//Configuration = new Configuration().AddJsonFile("config.json").AddEnvironmentVariables();
|
||||
//contentProvider.Mappings.Add(".woff2", "application/font-woff2");
|
||||
|
||||
app.UseFileServer(options);
|
||||
if (!ServerPortIsAvailable(ServerStartupConfig.ServerPort))
|
||||
{
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
"env": "development",
|
||||
"api": {
|
||||
"enabled": true,
|
||||
"apiServerUrl": "http://seriate.steamware.net:9000/"
|
||||
"apiServerUrl": "http://localhost:9000/"
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,6 @@
|
||||
"env": "development",
|
||||
"api": {
|
||||
"enabled": false,
|
||||
"apiServerUrl": "http://seriate.steamware.net:9000/"
|
||||
"apiServerUrl": "http://localhost:9000/"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<script src="Scripts/jquery.mousewheel.js"></script>
|
||||
<script src="Scripts/jquery.signalR-2.2.2.min.js"></script>
|
||||
<script src="Scripts/raphael-2.1.4.min.js"></script>
|
||||
<script src="http://seriate.steamware.net:9000/signalr/hubs" async></script>
|
||||
<script src="http://localhost:9000/signalr/hubs" async></script>
|
||||
|
||||
<link href="assets/styles/style.css" rel="stylesheet" />
|
||||
</head>
|
||||
@@ -28,4 +28,4 @@
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user