3.0.0.6 Main page layouts. Demo account registration.

This commit is contained in:
Andy Howard
2025-02-13 11:29:19 +00:00
parent 6cc179ae0a
commit 797ad08e5d
40 changed files with 20844 additions and 14989 deletions
@@ -34,7 +34,7 @@ namespace Sarand.BusinessMgr.Web.Control.App
{
//-------------------------------------------------------------------
// Processing indicators.
private bool generateDatabaseDefinitions_Control = false;
private bool generateDatabaseDefinitions_Control = true;
private bool generateDatabaseDefinitions_BusMgr = false;
private bool generateDatabaseDefinitions_Security = false;
private bool generateDatabaseDefinitions_CodeTypes = false;
@@ -113,8 +113,8 @@ namespace Sarand.BusinessMgr.Web.Control.App
// Common filter.
public class FilterData
{
/// <summary>Id for currently selected Association.</summary>
public String InstanceContext { get; set; }
/// <summary>Currently selected Repository Context</summary>
public String RepositoryContext { get; set; }
}
/// <summary>
/// Common filter properties.
@@ -329,6 +329,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account
SaLogger.Warn($"{SysUtil.Fn} Failed to insert user: " + ControlAccountMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + ControlAccountMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.created"]);
}
else
{
@@ -337,6 +338,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Account
SaLogger.Warn($"{SysUtil.Fn} Failed to update user [Id:" + SysId.ToString(user.Id) + "]: " + ControlAccountMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ControlAccountMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.updated"]);
}
// Construct response.
@@ -264,6 +264,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
SaLogger.Warn($"{SysUtil.Fn} Failed to insert owner: " + ControlInstanceMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + ControlInstanceMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.created"]);
}
else
{
@@ -272,6 +273,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
SaLogger.Warn($"{SysUtil.Fn} Failed to update owner [Id:" + SysId.ToString(owner.Id) + "]: " + ControlInstanceMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ControlInstanceMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.updated"]);
}
// Construct response.
@@ -362,6 +362,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
SaLogger.Warn($"{SysUtil.Fn} Failed to insert repository: " + ControlInstanceMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + ControlInstanceMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.created"]);
}
else
{
@@ -370,6 +371,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
SaLogger.Warn($"{SysUtil.Fn} Failed to update repository [Id:" + SysId.ToString(repository.Id) + "]: " + ControlInstanceMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ControlInstanceMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.updated"]);
}
// Construct response.
@@ -63,10 +63,10 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
{
// Validate Repository.
SessionData_Control.Profile.Filter.InstanceContext = model.DatabaseFilter.Context;
SessionData_Control.Profile.Filter.RepositoryContext = model.DatabaseFilter.Context;
if (StringUtil.IsBlank(model.DatabaseFilter.Context))
{
SaLogger.Warn($"{SysUtil.Fn} Instance Context not supplied.");
SaLogger.Warn($"{SysUtil.Fn} Repository Context not supplied.");
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
}
SbmcRepository repository = ControlInstanceMgr.GetRepositoryByContext(model.DatabaseFilter.Context);
@@ -169,10 +169,10 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
{
// Validate Repository.
SessionData_Control.Profile.Filter.InstanceContext = model.DatabaseFilter.Context;
SessionData_Control.Profile.Filter.RepositoryContext = model.DatabaseFilter.Context;
if (StringUtil.IsBlank(model.DatabaseFilter.Context))
{
SaLogger.Warn($"{SysUtil.Fn} Instance Context not supplied.");
SaLogger.Warn($"{SysUtil.Fn} Repository Context not supplied.");
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
}
SbmcRepository repository = ControlInstanceMgr.GetRepositoryByContext(model.DatabaseFilter.Context);
@@ -36,7 +36,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
// Refresh model.
RefreshModel(model);
model.DatabaseFilter.Context = SessionData_Control.Profile.Filter.InstanceContext;
model.DatabaseFilter.Context = SessionData_Control.Profile.Filter.RepositoryContext;
// Core Database view.
return View("Views/Instance/Repository/Database/Tables.cshtml", model);
@@ -59,7 +59,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Instance
// Refresh model.
Model_System model = new Model_System(Localiser);
RefreshModel(model);
model.DatabaseFilter.Instance = SessionData_Control.Profile.Filter.InstanceContext;
model.DatabaseFilter.Context = SessionData_Control.Profile.Filter.RepositoryContext;
// Core Database view.
return View("Views/Instance/Repository/Database/Schema.cshtml", model);
@@ -414,6 +414,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Param
SaLogger.Warn($"{SysUtil.Fn} Failed to insert Item Param: " + ControlItemMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + ControlItemMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.created"]);
}
else
{
@@ -422,6 +423,7 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.Param
SaLogger.Warn($"{SysUtil.Fn} Failed to update Item Param [Id:" + SysId.ToString(itemParam.Id) + "]: " + ControlItemMgr.ErrorStateMessage);
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ControlItemMgr.ErrorStateMessage));
}
responseData.SetNotification(messageTitle, Localiser["msg.item.updated"]);
}
// Construct response.
@@ -147,11 +147,11 @@ namespace Sarand.BusinessMgr.Web.Control.Controllers.System
return null;
}
/// <summary>
/// Get database by Instance Context.
/// Get database by Repository Context.
/// </summary>
private ISacsDatabase GetDatabaseByContext(String instanceContext)
private ISacsDatabase GetDatabaseByContext(String repositoryContext)
{
SbmcRepository repository = ControlInstanceMgr.GetRepositoryByContext(instanceContext);
SbmcRepository repository = ControlInstanceMgr.GetRepositoryByContext(repositoryContext);
if (repository != null)
{
SacsDatabaseConsole.OdbcConfig config = SbmCoreInstanceConsole_Dbas.GetRepositoryOdbcConfig(repository);
@@ -543,4 +543,10 @@
<data name="caption.repository.database" xml:space="preserve">
<value>Repository Database</value>
</data>
<data name="msg.item.updated" xml:space="preserve">
<value>Item updated.</value>
</data>
<data name="msg.item.created" xml:space="preserve">
<value>Item created.</value>
</data>
</root>
@@ -93,11 +93,11 @@
<body>
@* Header *@
<header id="sbc-page-header">
<header id="sbc-page-header" class="bg-white border-bottom">
<div class="container">
@* Navigation bar *@
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom">
<div class="container">
@* Navigation bar *@
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light">
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">SBM Control</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
@@ -170,13 +170,13 @@
}
</ul>
</div>
</div>
</nav>
</nav>
</div>
</header>
@* Page body *@
<div id="sbc-page-body">
<main role="main" class="container pt-2 pb-2 fullheight">
<main role="main" class="container fullheight">
@RenderBody()
</main>
</div>
@@ -150,12 +150,21 @@ ul.nav.sbc-burger .dropdown:hover
opacity: .75;
}
.navbar-light .navbar-toggler-icon {
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(0, 0, 0, 0.8)' stroke-width='4' stroke-linecap='round' stroke-miterlimit='10' d='M4 6h22M4 14h22M4 22h22'/%3e%3c/svg%3e");
}
ul.nav.sbc-burger.navbar-light .dropdown:hover
{
background-color: #f8f8f8;
border-color: #606060;
}
ul.nav.sbc-burger.navbar-dark .navbar-toggler-icon
{
background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3e%3cpath stroke='rgba(255, 255, 255, 1.0)' stroke-width='4' stroke-linecap='round' stroke-miterlimit='10' d='M4 6h22M4 14h22M4 22h22'/%3e%3c/svg%3e");
}
ul.nav.sbc-burger.navbar-dark .dropdown:hover
{
border-color: #c0c0c0;
@@ -51,12 +51,12 @@ body
{
html
{
height: 100vh;
height: 100%;
}
body.sbc-layout-flex
{
height: 100vh;
height: 100%;
display: flex;
flex-direction: column;
}
@@ -69,7 +69,18 @@ body
}
}
/* Responsive */
/* Page layout */
#sbc-page-body
{
background-color: #f8ffff;
}
#sbc-page-body main.container
{
position: relative;
padding: 4px 4px;
}
#sbc-page-body > .container, header > .container, footer > .container
{
@@ -106,13 +117,26 @@ body
{
}
a.navbar-brand
.navbar
{
padding: 6px 2px;
}
.navbar a.navbar-brand
{
padding-top: 0.3rem;
padding-bottom: 0.1rem;
white-space: normal;
text-align: center;
word-break: break-all;
}
.navbar li.nav-item a.nav-link
{
padding-top: 0.3rem;
padding-bottom: 0.1rem;
}
.border-top
{
border-top: 1px solid #e5e5e5;
@@ -145,7 +169,7 @@ button.accept-policy
#sbc-page-footer
{
padding: 4px 0;
padding: 3px 0;
}
#sbc-page-footer, #sbc-page-footer div
@@ -250,11 +274,10 @@ a:focus
#sbc-notification
{
display: none;
position: fixed;
top: 0;
right: 0;
position: absolute;
top: 7px;
right: 48px;
min-width: 180px;
margin-right: 12px;
z-index: 1000;
border: 1px solid #808080;
border-bottom-left-radius: 4px;
@@ -313,25 +313,21 @@
win.clearTimeout(sbc.toNotification);
var $win = $(win);
var $not = $('#sbc-notification').hide();
var $main = $('#sbc-page-body main');
if (!$not.length)
{
$not = $('<div id="sbc-notification"><div class="content"><div class="heading"><div class="close" onclick="sbc.hideNotification()">&#10006;</div><div class="title"></div></div><div class="message"></div></div></div>');
$('body').append($not);
($main.length ? $main : $('body')).append($not);
}
var $hdr = $('.heading', $not).css({ 'background-color': 'rgba(247,217,0,0.7)' });
$('.title', $not).html(title);
$('.message', $not).html(msg);
var $bdy = $('#sbc-page-body');
//sbc.debug(sbc.topMargin($bdy));
var fbr = $bdy[0].getBoundingClientRect();
var fn = function () { $hdr.delay(1500).animate({ backgroundColor: '#f0f0f0' }, 500); };
$not.css({ 'top': Math.max(0, fbr.top - sbc.topMargin($bdy)), 'right': $win.width() - fbr.right }).slideDown(500, fn);
$not.find('.title').html(title).end().find('.message').html(msg);
$not.show(500, function () { $hdr.delay(1500).animate({ backgroundColor: '#f0f0f0' }, 500); });
sbc.toNotification = setTimeout(sbc.hideNotification, 4000);
}
sbc.hideNotification = function ()
{
win.clearTimeout(sbc.toNotification);
$('#sbc-notification').slideUp(500);
$('#sbc-notification').hide(500);
}
sbc.doPleaseWait = function ()
{
File diff suppressed because it is too large Load Diff