TS - OperationsMgrWeb login page UI and function
This commit is contained in:
@@ -1,12 +1,14 @@
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.Core.IO;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Web.Consoles;
|
||||
using Sarand.OperationsMgr.Win.Dbas.App;
|
||||
using Sarand.Win.Dbas.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@@ -43,6 +45,49 @@ namespace Sarand.OperationsMgr.Web.App
|
||||
public SaOperationsMgrWebApp (IHostingEnvironment env, IConfigurationSection instanceConfig, String initialLogMessage)
|
||||
{
|
||||
app = this;
|
||||
OpnSystem_WinDbas.InitStatics();
|
||||
ContentRootPath = env.ContentRootPath;
|
||||
IsDevelopment = env.IsDevelopment();
|
||||
|
||||
// Locate IIS logs folder.
|
||||
String logsFolder = null;
|
||||
String folder = env.ContentRootPath;
|
||||
DirectoryInfo info = null;
|
||||
while (logsFolder == null && (info = Directory.GetParent(folder)) != null)
|
||||
{
|
||||
folder = info.FullName;
|
||||
logsFolder = folder + Path.DirectorySeparatorChar + "logs" + Path.DirectorySeparatorChar + "LogFiles";
|
||||
if (!Directory.Exists(logsFolder))
|
||||
logsFolder = null;
|
||||
}
|
||||
|
||||
// Configure root logging folder.
|
||||
if (logsFolder != null)
|
||||
{
|
||||
logsFolder = logsFolder + Path.DirectorySeparatorChar + "SaOperationsMgr";
|
||||
if (FileUtil.ValidateDirectory(logsFolder, true))
|
||||
LoggingRootFolder = logsFolder;
|
||||
}
|
||||
|
||||
// Initialise properties.
|
||||
properties = new PropertySet();
|
||||
// ToDo Web app - Logging properties - by user session?
|
||||
properties.AddProperty("Logging", "Folder", LoggingRootFolder);
|
||||
properties.AddProperty("Logging", "Level", "Info");
|
||||
properties.AddProperty("Logging", "ExtendedLogging", "");
|
||||
|
||||
// Configure logging.
|
||||
Logger.LogFilenamePrefix = "SLM-Web";
|
||||
Logger.LogFolder = properties.GetPropertyValue("Logging", "Folder");
|
||||
#if DEBUG
|
||||
Logger.ConsoleLevel = SaMessageLevel.Trace;
|
||||
#endif
|
||||
Logger.LogFileLevel = EnumUtil.StartsWith(properties.GetPropertyValue("Logging", "Level"), SaMessageLevel.Info);
|
||||
Logger.Info(initialLogMessage, true);
|
||||
Logger.Info("Logging level: " + Logger.LogFileLevel);
|
||||
|
||||
// Initialise global objects.
|
||||
InitGlobals(instanceConfig);
|
||||
}
|
||||
public void Dispose ()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.Core.Base;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
// U t i l i t i e s C o n t r o l l e r
|
||||
//-----------------------------------------------------------------------
|
||||
// A s s e t s
|
||||
//=======================================================================
|
||||
partial class UtilitiesController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Action - Utilities.
|
||||
public IActionResult Utilities (Models.Model_Utilities_Utilities model)
|
||||
{
|
||||
Logger.Debug(GetType().Name + ".Utilities");
|
||||
|
||||
if (!ValidSession)
|
||||
return new RedirectResult(GetRedirectLocation(RedirectLocation.Home_SessionExpired), false);
|
||||
|
||||
ViewData["Title"] = Localiser["view.title.assets.assets"];
|
||||
//ViewData["Message"] = "Containers";
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A j a x - R e s p o n s e D a t a
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Summary Utility information</summary>
|
||||
public class UtilityInfo
|
||||
{
|
||||
}
|
||||
/// <summary>Detailed Utility data</summary>
|
||||
public class UtilityData : UtilityInfo
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// A j a x - A s s e t L i s t
|
||||
//-------------------------------------------------------------------
|
||||
public class AjaxResponse_UtilityList : AjaxResponse
|
||||
{
|
||||
public List<UtilityData> Utilities { get; set; } = new List<UtilityData>();
|
||||
}
|
||||
// Ajax request.
|
||||
[HttpGet, HttpPost]
|
||||
public IActionResult GetUtilityList (Models.Model_Utilities_Utilities model)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.Core.Base;
|
||||
using Sarand.OperationsMgr.Core.App;
|
||||
using Sarand.OperationsMgr.Web.App;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
// U t i l i t i e s C o n t r o l l e r
|
||||
//=======================================================================
|
||||
public partial class UtilitiesController : Controller_Base
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public UtilitiesController (OpnLocaliser localiser) : base(localiser)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public IActionResult Error ()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Models
|
||||
{
|
||||
public class Model_Utilities_Base : Model_Base
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected Model_Utilities_Base ()
|
||||
{
|
||||
// Data paging.
|
||||
DataPageNo = 1;
|
||||
DataPageLength = 20;
|
||||
DataItemCount = 0;
|
||||
DataItemTotal = 0;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Filter properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Form properties.
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Sarand.OperationsMgr.Web.Models
|
||||
{
|
||||
public class Model_Utilities_Utilities : Model_Utilities_Base
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public Model_Utilities_Utilities ()
|
||||
{
|
||||
// Additional includes.
|
||||
AdditionalFiles_CSS.Add("css/slm-assets-assets.css");
|
||||
AdditionalFiles_JS.Add("js/slm-assets-assets.js");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Filter properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Form properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user