add ability to view Migration History
This commit is contained in:
@ -56,6 +56,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
services.AddScoped<ILocalizationCookieService, LocalizationCookieService>();
|
services.AddScoped<ILocalizationCookieService, LocalizationCookieService>();
|
||||||
services.AddScoped<ICookieConsentService, CookieConsentService>();
|
services.AddScoped<ICookieConsentService, CookieConsentService>();
|
||||||
services.AddScoped<ITimeZoneService, TimeZoneService>();
|
services.AddScoped<ITimeZoneService, TimeZoneService>();
|
||||||
|
services.AddScoped<IMigrationHistoryService, MigrationHistoryService>();
|
||||||
services.AddScoped<IOutputCacheService, OutputCacheService>();
|
services.AddScoped<IOutputCacheService, OutputCacheService>();
|
||||||
|
|
||||||
// providers
|
// providers
|
||||||
|
|||||||
@ -2,241 +2,267 @@
|
|||||||
@inherits ModuleBase
|
@inherits ModuleBase
|
||||||
@inject ISystemService SystemService
|
@inject ISystemService SystemService
|
||||||
@inject IInstallationService InstallationService
|
@inject IInstallationService InstallationService
|
||||||
|
@inject IMigrationHistoryService MigrationHistoryService
|
||||||
@inject IStringLocalizer<Index> Localizer
|
@inject IStringLocalizer<Index> Localizer
|
||||||
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
@inject IStringLocalizer<SharedResources> SharedLocalizer
|
||||||
|
|
||||||
<TabStrip>
|
@if (_initialized)
|
||||||
<TabPanel Name="Info" Heading="Info" ResourceKey="Info">
|
{
|
||||||
<div class="container">
|
<TabStrip>
|
||||||
<div class="row mb-1 align-items-center">
|
<TabPanel Name="Info" Heading="Info" ResourceKey="Info">
|
||||||
<Label Class="col-sm-3" For="version" HelpText="Framework Version" ResourceKey="FrameworkVersion">Framework Version: </Label>
|
<div class="container">
|
||||||
<div class="col-sm-9">
|
<div class="row mb-1 align-items-center">
|
||||||
<input id="version" class="form-control" @bind="@_version" readonly />
|
<Label Class="col-sm-3" For="version" HelpText="Framework Version" ResourceKey="FrameworkVersion">Framework Version: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="version" class="form-control" @bind="@_version" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="clrversion" HelpText="Common Language Runtime Version" ResourceKey="CLRVersion">CLR Version: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="clrversion" class="form-control" @bind="@_clrversion" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="osversion" HelpText="Operating System Version" ResourceKey="OSVersion">OS Version: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="osversion" class="form-control" @bind="@_osversion" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="process" HelpText="Indicates if the current process is 32 bit or 64 bit" ResourceKey="Process">Process: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="process" class="form-control" @bind="@_process" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="machinename" HelpText="Machine Name" ResourceKey="MachineName">Machine Name: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="machinename" class="form-control" @bind="@_machinename" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="ipaddress" HelpText="Server IP Address" ResourceKey="IPAddress">IP Address: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="ipaddress" class="form-control" @bind="@_ipaddress" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="environment" HelpText="Environment name" ResourceKey="Environment">Environment: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="environment" class="form-control" @bind="@_environment" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="contentrootpath" HelpText="Root Path" ResourceKey="ContentRootPath">Root Path: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="contentrootpath" class="form-control" @bind="@_contentrootpath" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="webrootpath" HelpText="Web Path" ResourceKey="WebRootPath">Web Path: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="webrootpath" class="form-control" @bind="@_webrootpath" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="servertime" HelpText="Server Date/Time (in UTC)" ResourceKey="ServerTime">Server Date/Time: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="servertime" class="form-control" @bind="@_servertime" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="workingset" HelpText="Memory Allocation Of Service (in MB)" ResourceKey="WorkingSet">Memory Allocation: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="workingset" class="form-control" @bind="@_workingset" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="installationid" HelpText="The Unique Identifier For Your Installation" ResourceKey="InstallationId">Installation ID: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="installationid" class="form-control" @bind="@_installationid" readonly />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-1 align-items-center">
|
<br /><br />
|
||||||
<Label Class="col-sm-3" For="clrversion" HelpText="Common Language Runtime Version" ResourceKey="CLRVersion">CLR Version: </Label>
|
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
|
||||||
<div class="col-sm-9">
|
</TabPanel>
|
||||||
<input id="clrversion" class="form-control" @bind="@_clrversion" readonly />
|
<TabPanel Name="Options" Heading="Options" ResourceKey="Options">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="detailederrors" HelpText="Specify If Detailed Errors Are Enabled For Blazor. This Option Should Not Not Be Enabled In Production." ResourceKey="DetailedErrors">Detailed Errors? </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<select id="detailederrors" class="form-select" @bind="@_detailederrors">
|
||||||
|
<option value="true">@SharedLocalizer["True"]</option>
|
||||||
|
<option value="false">@SharedLocalizer["False"]</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="logginglevel" HelpText="The Minimum Logging Level For The Event Log. This Option Can Be Used To Control The Volume Of Items Stored In Your Event Log." ResourceKey="LoggingLevel">Logging Level: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<select id="logginglevel" class="form-select" @bind="@_logginglevel">
|
||||||
|
<option value="Trace">@Localizer["Trace"]</option>
|
||||||
|
<option value="Debug">@Localizer["Debug"]</option>
|
||||||
|
<option value="Information">@Localizer["Information"]</option>
|
||||||
|
<option value="Warning">@Localizer["Warning"]</option>
|
||||||
|
<option value="Error">@Localizer["Error"]</option>
|
||||||
|
<option value="Critical">@Localizer["Critical"]</option>
|
||||||
|
<option value="None">@Localizer["None"]</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="notificationlevel" HelpText="The Minimum Logging Level For Which Notifications Should Be Sent To Host Users." ResourceKey="NotificationLevel">Notification Level: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<select id="notificationlevel" class="form-select" @bind="@_notificationlevel">
|
||||||
|
<option value="Trace">@Localizer["Trace"]</option>
|
||||||
|
<option value="Debug">@Localizer["Debug"]</option>
|
||||||
|
<option value="Information">@Localizer["Information"]</option>
|
||||||
|
<option value="Warning">@Localizer["Warning"]</option>
|
||||||
|
<option value="Error">@Localizer["Error"]</option>
|
||||||
|
<option value="Critical">@Localizer["Critical"]</option>
|
||||||
|
<option value="None">@Localizer["None"]</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="swagger" HelpText="Specify If Swagger Is Enabled For Your Server API" ResourceKey="Swagger">Swagger Enabled? </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<select id="swagger" class="form-select" @bind="@_swagger">
|
||||||
|
<option value="true">@SharedLocalizer["True"]</option>
|
||||||
|
<option value="false">@SharedLocalizer["False"]</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="cachecontrol" HelpText="Provide a Cache-Control directive for static assets. For example 'public, max-age=60' indicates that static assets should be cached for 60 seconds. A blank value indicates caching is not enabled." ResourceKey="CacheControl">Static Asset Caching: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="cachecontrol" class="form-control" @bind="@_cachecontrol" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="packageregistryurl" HelpText="Specify The Url Of The Package Manager Service For Installing Modules, Themes, And Translations. If This Field Is Blank It Means The Package Manager Service Is Disabled For This Installation." ResourceKey="PackageManager">Package Manager Url: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="packageregistryurl" class="form-control" @bind="@_packageregistryurl" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="packageregistryemail" HelpText="Specify The Email Address Of The User Account Used For Interacting With The Package Manager Service. This Account Is Used For Managing Packages Across Multiple Installations." ResourceKey="PackageManagerEmail">Package Manager Email: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input id="packageregistryemail" class="form-control" @bind="@_packageregistryemail" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-1 align-items-center">
|
<br /><br />
|
||||||
<Label Class="col-sm-3" For="osversion" HelpText="Operating System Version" ResourceKey="OSVersion">OS Version: </Label>
|
<button type="button" class="btn btn-success" @onclick="SaveConfig">@SharedLocalizer["Save"]</button>
|
||||||
<div class="col-sm-9">
|
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
|
||||||
<input id="osversion" class="form-control" @bind="@_osversion" readonly />
|
<br /><br />
|
||||||
|
<a class="btn btn-primary" href="swagger/index.html" target="_new">@Localizer["Swagger"]</a>
|
||||||
|
<a class="btn btn-secondary" href="api/endpoint" target="_new">@Localizer["Endpoints"]</a>
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel Name="Log" Heading="Log" ResourceKey="Log">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row mb-1 align-items-center">
|
||||||
|
<Label Class="col-sm-3" For="log" HelpText="System log information for current day" ResourceKey="Log">Log: </Label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<textarea id="log" class="form-control" rows="10" @bind="@_log" readonly />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-1 align-items-center">
|
<br /><br />
|
||||||
<Label Class="col-sm-3" For="process" HelpText="Indicates if the current process is 32 bit or 64 bit" ResourceKey="Process">Process: </Label>
|
<button type="button" class="btn btn-danger" @onclick="ClearLog">@Localizer["Clear"]</button>
|
||||||
<div class="col-sm-9">
|
</TabPanel>
|
||||||
<input id="process" class="form-control" @bind="@_process" readonly />
|
<TabPanel Name="Migrations" Heading="Migrations" ResourceKey="Migrations">
|
||||||
</div>
|
<Pager Items="@_history" SearchProperties="MigrationId">
|
||||||
</div>
|
<Header>
|
||||||
<div class="row mb-1 align-items-center">
|
<th>@Localizer["Migration"]</th>
|
||||||
<Label Class="col-sm-3" For="machinename" HelpText="Machine Name" ResourceKey="MachineName">Machine Name: </Label>
|
<th>@Localizer["Date"]</th>
|
||||||
<div class="col-sm-9">
|
<th>@Localizer["Version"]</th>
|
||||||
<input id="machinename" class="form-control" @bind="@_machinename" readonly />
|
</Header>
|
||||||
</div>
|
<Row>
|
||||||
</div>
|
<td>@context.MigrationId</td>
|
||||||
<div class="row mb-1 align-items-center">
|
<td>@UtcToLocal(context.AppliedDate)</td>
|
||||||
<Label Class="col-sm-3" For="ipaddress" HelpText="Server IP Address" ResourceKey="IPAddress">IP Address: </Label>
|
<td>@context.AppliedVersion</td>
|
||||||
<div class="col-sm-9">
|
</Row>
|
||||||
<input id="ipaddress" class="form-control" @bind="@_ipaddress" readonly />
|
</Pager>
|
||||||
</div>
|
</TabPanel>
|
||||||
</div>
|
</TabStrip>
|
||||||
<div class="row mb-1 align-items-center">
|
<br /><br />
|
||||||
<Label Class="col-sm-3" For="environment" HelpText="Environment name" ResourceKey="Environment">Environment: </Label>
|
}
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="environment" class="form-control" @bind="@_environment" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="contentrootpath" HelpText="Root Path" ResourceKey="ContentRootPath">Root Path: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="contentrootpath" class="form-control" @bind="@_contentrootpath" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="webrootpath" HelpText="Web Path" ResourceKey="WebRootPath">Web Path: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="webrootpath" class="form-control" @bind="@_webrootpath" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="servertime" HelpText="Server Date/Time (in UTC)" ResourceKey="ServerTime">Server Date/Time: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="servertime" class="form-control" @bind="@_servertime" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="workingset" HelpText="Memory Allocation Of Service (in MB)" ResourceKey="WorkingSet">Memory Allocation: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="workingset" class="form-control" @bind="@_workingset" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="installationid" HelpText="The Unique Identifier For Your Installation" ResourceKey="InstallationId">Installation ID: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="installationid" class="form-control" @bind="@_installationid" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br /><br />
|
|
||||||
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
|
|
||||||
</TabPanel>
|
|
||||||
<TabPanel Name="Options" Heading="Options" ResourceKey="Options">
|
|
||||||
<div class="container">
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="detailederrors" HelpText="Specify If Detailed Errors Are Enabled For Blazor. This Option Should Not Not Be Enabled In Production." ResourceKey="DetailedErrors">Detailed Errors? </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<select id="detailederrors" class="form-select" @bind="@_detailederrors">
|
|
||||||
<option value="true">@SharedLocalizer["True"]</option>
|
|
||||||
<option value="false">@SharedLocalizer["False"]</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="logginglevel" HelpText="The Minimum Logging Level For The Event Log. This Option Can Be Used To Control The Volume Of Items Stored In Your Event Log." ResourceKey="LoggingLevel">Logging Level: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<select id="logginglevel" class="form-select" @bind="@_logginglevel">
|
|
||||||
<option value="Trace">@Localizer["Trace"]</option>
|
|
||||||
<option value="Debug">@Localizer["Debug"]</option>
|
|
||||||
<option value="Information">@Localizer["Information"]</option>
|
|
||||||
<option value="Warning">@Localizer["Warning"]</option>
|
|
||||||
<option value="Error">@Localizer["Error"]</option>
|
|
||||||
<option value="Critical">@Localizer["Critical"]</option>
|
|
||||||
<option value="None">@Localizer["None"]</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="notificationlevel" HelpText="The Minimum Logging Level For Which Notifications Should Be Sent To Host Users." ResourceKey="NotificationLevel">Notification Level: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<select id="notificationlevel" class="form-select" @bind="@_notificationlevel">
|
|
||||||
<option value="Trace">@Localizer["Trace"]</option>
|
|
||||||
<option value="Debug">@Localizer["Debug"]</option>
|
|
||||||
<option value="Information">@Localizer["Information"]</option>
|
|
||||||
<option value="Warning">@Localizer["Warning"]</option>
|
|
||||||
<option value="Error">@Localizer["Error"]</option>
|
|
||||||
<option value="Critical">@Localizer["Critical"]</option>
|
|
||||||
<option value="None">@Localizer["None"]</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="swagger" HelpText="Specify If Swagger Is Enabled For Your Server API" ResourceKey="Swagger">Swagger Enabled? </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<select id="swagger" class="form-select" @bind="@_swagger">
|
|
||||||
<option value="true">@SharedLocalizer["True"]</option>
|
|
||||||
<option value="false">@SharedLocalizer["False"]</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="cachecontrol" HelpText="Provide a Cache-Control directive for static assets. For example 'public, max-age=60' indicates that static assets should be cached for 60 seconds. A blank value indicates caching is not enabled." ResourceKey="CacheControl">Static Asset Caching: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="cachecontrol" class="form-control" @bind="@_cachecontrol" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="packageregistryurl" HelpText="Specify The Url Of The Package Manager Service For Installing Modules, Themes, And Translations. If This Field Is Blank It Means The Package Manager Service Is Disabled For This Installation." ResourceKey="PackageManager">Package Manager Url: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="packageregistryurl" class="form-control" @bind="@_packageregistryurl" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="packageregistryemail" HelpText="Specify The Email Address Of The User Account Used For Interacting With The Package Manager Service. This Account Is Used For Managing Packages Across Multiple Installations." ResourceKey="PackageManagerEmail">Package Manager Email: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<input id="packageregistryemail" class="form-control" @bind="@_packageregistryemail" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br /><br />
|
|
||||||
<button type="button" class="btn btn-success" @onclick="SaveConfig">@SharedLocalizer["Save"]</button>
|
|
||||||
<ActionDialog Header="Restart Application" Message="Are You Sure You Wish To Restart The Application?" Action="Restart Application" Security="SecurityAccessLevel.Host" Class="btn btn-danger" OnClick="@(async () => await RestartApplication())" ResourceKey="RestartApplication" />
|
|
||||||
<br /><br />
|
|
||||||
<a class="btn btn-primary" href="swagger/index.html" target="_new">@Localizer["Swagger"]</a>
|
|
||||||
<a class="btn btn-secondary" href="api/endpoint" target="_new">@Localizer["Endpoints"]</a>
|
|
||||||
</TabPanel>
|
|
||||||
<TabPanel Name="Log" Heading="Log" ResourceKey="Log">
|
|
||||||
<div class="container">
|
|
||||||
<div class="row mb-1 align-items-center">
|
|
||||||
<Label Class="col-sm-3" For="log" HelpText="System log information for current day" ResourceKey="Log">Log: </Label>
|
|
||||||
<div class="col-sm-9">
|
|
||||||
<textarea id="log" class="form-control" rows="10" @bind="@_log" readonly />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br /><br />
|
|
||||||
<button type="button" class="btn btn-danger" @onclick="ClearLog">@Localizer["Clear"]</button>
|
|
||||||
</TabPanel>
|
|
||||||
</TabStrip>
|
|
||||||
<br /><br />
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
public override SecurityAccessLevel SecurityAccessLevel => SecurityAccessLevel.Host;
|
||||||
|
|
||||||
private string _version = string.Empty;
|
private bool _initialized = false;
|
||||||
private string _clrversion = string.Empty;
|
|
||||||
private string _osversion = string.Empty;
|
private string _version = string.Empty;
|
||||||
|
private string _clrversion = string.Empty;
|
||||||
|
private string _osversion = string.Empty;
|
||||||
private string _process = string.Empty;
|
private string _process = string.Empty;
|
||||||
private string _machinename = string.Empty;
|
private string _machinename = string.Empty;
|
||||||
private string _ipaddress = string.Empty;
|
private string _ipaddress = string.Empty;
|
||||||
private string _environment = string.Empty;
|
private string _environment = string.Empty;
|
||||||
private string _contentrootpath = string.Empty;
|
private string _contentrootpath = string.Empty;
|
||||||
private string _webrootpath = string.Empty;
|
private string _webrootpath = string.Empty;
|
||||||
private string _servertime = string.Empty;
|
private string _servertime = string.Empty;
|
||||||
private string _workingset = string.Empty;
|
private string _workingset = string.Empty;
|
||||||
private string _installationid = string.Empty;
|
private string _installationid = string.Empty;
|
||||||
|
|
||||||
private string _detailederrors = string.Empty;
|
private string _detailederrors = string.Empty;
|
||||||
private string _logginglevel = string.Empty;
|
private string _logginglevel = string.Empty;
|
||||||
private string _notificationlevel = string.Empty;
|
private string _notificationlevel = string.Empty;
|
||||||
private string _swagger = string.Empty;
|
private string _swagger = string.Empty;
|
||||||
private string _cachecontrol = string.Empty;
|
private string _cachecontrol = string.Empty;
|
||||||
private string _packageregistryurl = string.Empty;
|
private string _packageregistryurl = string.Empty;
|
||||||
private string _packageregistryemail = string.Empty;
|
private string _packageregistryemail = string.Empty;
|
||||||
|
|
||||||
private string _log = string.Empty;
|
private string _log = string.Empty;
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
private List<MigrationHistory> _history;
|
||||||
{
|
|
||||||
_version = Constants.Version;
|
|
||||||
|
|
||||||
var systeminfo = await SystemService.GetSystemInfoAsync("environment");
|
protected override async Task OnInitializedAsync()
|
||||||
if (systeminfo != null)
|
{
|
||||||
{
|
_version = Constants.Version;
|
||||||
_clrversion = systeminfo["CLRVersion"].ToString();
|
|
||||||
_osversion = systeminfo["OSVersion"].ToString();
|
var systeminfo = await SystemService.GetSystemInfoAsync("environment");
|
||||||
|
if (systeminfo != null)
|
||||||
|
{
|
||||||
|
_clrversion = systeminfo["CLRVersion"].ToString();
|
||||||
|
_osversion = systeminfo["OSVersion"].ToString();
|
||||||
_process = systeminfo["Process"].ToString();
|
_process = systeminfo["Process"].ToString();
|
||||||
_machinename = systeminfo["MachineName"].ToString();
|
_machinename = systeminfo["MachineName"].ToString();
|
||||||
_ipaddress = systeminfo["IPAddress"].ToString();
|
_ipaddress = systeminfo["IPAddress"].ToString();
|
||||||
_environment = systeminfo["Environment"].ToString();
|
_environment = systeminfo["Environment"].ToString();
|
||||||
_contentrootpath = systeminfo["ContentRootPath"].ToString();
|
_contentrootpath = systeminfo["ContentRootPath"].ToString();
|
||||||
_webrootpath = systeminfo["WebRootPath"].ToString();
|
_webrootpath = systeminfo["WebRootPath"].ToString();
|
||||||
_servertime = systeminfo["ServerTime"].ToString() + " UTC";
|
_servertime = systeminfo["ServerTime"].ToString() + " UTC";
|
||||||
_workingset = (Convert.ToInt64(systeminfo["WorkingSet"].ToString()) / 1000000).ToString() + " MB";
|
_workingset = (Convert.ToInt64(systeminfo["WorkingSet"].ToString()) / 1000000).ToString() + " MB";
|
||||||
}
|
}
|
||||||
|
|
||||||
systeminfo = await SystemService.GetSystemInfoAsync("configuration");
|
systeminfo = await SystemService.GetSystemInfoAsync("configuration");
|
||||||
if (systeminfo != null)
|
if (systeminfo != null)
|
||||||
{
|
{
|
||||||
_installationid = systeminfo["InstallationId"].ToString();
|
_installationid = systeminfo["InstallationId"].ToString();
|
||||||
_detailederrors = systeminfo["DetailedErrors"].ToString();
|
_detailederrors = systeminfo["DetailedErrors"].ToString();
|
||||||
_logginglevel = systeminfo["Logging:LogLevel:Default"].ToString();
|
_logginglevel = systeminfo["Logging:LogLevel:Default"].ToString();
|
||||||
_notificationlevel = systeminfo["Logging:LogLevel:Notify"].ToString();
|
_notificationlevel = systeminfo["Logging:LogLevel:Notify"].ToString();
|
||||||
_swagger = systeminfo["UseSwagger"].ToString();
|
_swagger = systeminfo["UseSwagger"].ToString();
|
||||||
_cachecontrol = systeminfo["CacheControl"].ToString();
|
_cachecontrol = systeminfo["CacheControl"].ToString();
|
||||||
_packageregistryurl = systeminfo["PackageRegistryUrl"].ToString();
|
_packageregistryurl = systeminfo["PackageRegistryUrl"].ToString();
|
||||||
_packageregistryemail = systeminfo["PackageRegistryEmail"].ToString();
|
_packageregistryemail = systeminfo["PackageRegistryEmail"].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
systeminfo = await SystemService.GetSystemInfoAsync("log");
|
systeminfo = await SystemService.GetSystemInfoAsync("log");
|
||||||
if (systeminfo != null)
|
if (systeminfo != null)
|
||||||
{
|
{
|
||||||
_log = systeminfo["Log"].ToString();
|
_log = systeminfo["Log"].ToString();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
_history = await MigrationHistoryService.GetMigrationHistoryAsync();
|
||||||
|
|
||||||
|
_initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
private async Task SaveConfig()
|
private async Task SaveConfig()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -309,4 +309,13 @@
|
|||||||
<data name="Endpoints" xml:space="preserve">
|
<data name="Endpoints" xml:space="preserve">
|
||||||
<value>API Endpoints</value>
|
<value>API Endpoints</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Migration" xml:space="preserve">
|
||||||
|
<value>Migration</value>
|
||||||
|
</data>
|
||||||
|
<data name="Date" xml:space="preserve">
|
||||||
|
<value>Date</value>
|
||||||
|
</data>
|
||||||
|
<data name="Version" xml:space="preserve">
|
||||||
|
<value>Framework Version</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
34
Oqtane.Client/Services/MigrationHistoryService.cs
Normal file
34
Oqtane.Client/Services/MigrationHistoryService.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
using Oqtane.Models;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Oqtane.Documentation;
|
||||||
|
using Oqtane.Shared;
|
||||||
|
|
||||||
|
namespace Oqtane.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Service to manage <see cref="MigrationHistory/>s on the Oqtane installation.
|
||||||
|
/// </summary>
|
||||||
|
public interface IMigrationHistoryService
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Get all <see cref="MigrationHistory"/>s
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<List<MigrationHistory>> GetMigrationHistoryAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
[PrivateApi("Don't show in the documentation, as everything should use the Interface")]
|
||||||
|
public class MigrationHistoryService : ServiceBase, IMigrationHistoryService
|
||||||
|
{
|
||||||
|
public MigrationHistoryService(HttpClient http, SiteState siteState) : base(http, siteState) { }
|
||||||
|
|
||||||
|
private string Apiurl => CreateApiUrl("MigrationHistory");
|
||||||
|
|
||||||
|
public async Task<List<MigrationHistory>> GetMigrationHistoryAsync()
|
||||||
|
{
|
||||||
|
return await GetJsonAsync<List<MigrationHistory>>(Apiurl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
Oqtane.Server/Controllers/MigrationHistoryController.cs
Normal file
28
Oqtane.Server/Controllers/MigrationHistoryController.cs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Oqtane.Models;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Oqtane.Shared;
|
||||||
|
using Oqtane.Repository;
|
||||||
|
|
||||||
|
namespace Oqtane.Controllers
|
||||||
|
{
|
||||||
|
[Route(ControllerRoutes.ApiRoute)]
|
||||||
|
public class MigrationHistoryController : Controller
|
||||||
|
{
|
||||||
|
private readonly IMigrationHistoryRepository _history;
|
||||||
|
|
||||||
|
public MigrationHistoryController(IMigrationHistoryRepository history)
|
||||||
|
{
|
||||||
|
_history = history;
|
||||||
|
}
|
||||||
|
|
||||||
|
// GET: api/<controller>
|
||||||
|
[HttpGet]
|
||||||
|
[Authorize(Roles = RoleNames.Host)]
|
||||||
|
public IEnumerable<MigrationHistory> Get()
|
||||||
|
{
|
||||||
|
return _history.GetMigrationHistory();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -228,6 +228,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
services.AddScoped<IImageService, ImageService>();
|
services.AddScoped<IImageService, ImageService>();
|
||||||
services.AddScoped<ICookieConsentService, ServerCookieConsentService>();
|
services.AddScoped<ICookieConsentService, ServerCookieConsentService>();
|
||||||
services.AddScoped<ITimeZoneService, TimeZoneService>();
|
services.AddScoped<ITimeZoneService, TimeZoneService>();
|
||||||
|
services.AddScoped<IMigrationHistoryService, MigrationHistoryService>();
|
||||||
|
|
||||||
// providers
|
// providers
|
||||||
services.AddScoped<ITextEditor, Oqtane.Modules.Controls.QuillJSTextEditor>();
|
services.AddScoped<ITextEditor, Oqtane.Modules.Controls.QuillJSTextEditor>();
|
||||||
@ -276,6 +277,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||||||
services.AddTransient<IVisitorRepository, VisitorRepository>();
|
services.AddTransient<IVisitorRepository, VisitorRepository>();
|
||||||
services.AddTransient<IUrlMappingRepository, UrlMappingRepository>();
|
services.AddTransient<IUrlMappingRepository, UrlMappingRepository>();
|
||||||
services.AddTransient<ISearchContentRepository, SearchContentRepository>();
|
services.AddTransient<ISearchContentRepository, SearchContentRepository>();
|
||||||
|
services.AddTransient<IMigrationHistoryRepository, MigrationHistoryRepository>();
|
||||||
|
|
||||||
// managers
|
// managers
|
||||||
services.AddTransient<IDBContextDependencies, DBContextDependencies>();
|
services.AddTransient<IDBContextDependencies, DBContextDependencies>();
|
||||||
|
|||||||
@ -69,6 +69,7 @@ namespace Oqtane.Repository
|
|||||||
public virtual DbSet<JobLog> JobLog { get; set; }
|
public virtual DbSet<JobLog> JobLog { get; set; }
|
||||||
public virtual DbSet<Setting> Setting { get; set; }
|
public virtual DbSet<Setting> Setting { get; set; }
|
||||||
public virtual DbSet<Theme> Theme { get; set; }
|
public virtual DbSet<Theme> Theme { get; set; }
|
||||||
|
public virtual DbSet<MigrationHistory> MigrationHistory { get; set; }
|
||||||
|
|
||||||
public override int SaveChanges()
|
public override int SaveChanges()
|
||||||
{
|
{
|
||||||
|
|||||||
25
Oqtane.Server/Repository/MigrationHistoryRepository.cs
Normal file
25
Oqtane.Server/Repository/MigrationHistoryRepository.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using Oqtane.Models;
|
||||||
|
|
||||||
|
namespace Oqtane.Repository
|
||||||
|
{
|
||||||
|
public interface IMigrationHistoryRepository
|
||||||
|
{
|
||||||
|
IEnumerable<MigrationHistory> GetMigrationHistory();
|
||||||
|
}
|
||||||
|
public class MigrationHistoryRepository : IMigrationHistoryRepository
|
||||||
|
{
|
||||||
|
private MasterDBContext _db;
|
||||||
|
|
||||||
|
public MigrationHistoryRepository(MasterDBContext context)
|
||||||
|
{
|
||||||
|
_db = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IEnumerable<MigrationHistory> GetMigrationHistory()
|
||||||
|
{
|
||||||
|
return _db.MigrationHistory.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
16
Oqtane.Shared/Models/MigrationHistory.cs
Normal file
16
Oqtane.Shared/Models/MigrationHistory.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace Oqtane.Models
|
||||||
|
{
|
||||||
|
[Table("__EFMigrationsHistory")]
|
||||||
|
[Keyless]
|
||||||
|
public class MigrationHistory
|
||||||
|
{
|
||||||
|
public string MigrationId { get; set; }
|
||||||
|
public string ProductVersion { get; set; }
|
||||||
|
public DateTime AppliedDate { get; set; }
|
||||||
|
public string AppliedVersion { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user