This commit is contained in:
Jamie.Rees 2016-12-29 15:27:21 +00:00
commit 7081eac5bb
3 changed files with 117 additions and 26 deletions

View file

@ -34,5 +34,7 @@ namespace Ombi.UI.Models
public string Branch { get; set; } public string Branch { get; set; }
public string LogLevel { get; set; } public string LogLevel { get; set; }
public bool OAuthEnabled { get; set; } public bool OAuthEnabled { get; set; }
public string DbLocation { get; set; }
public string RunningDir { get; set; }
} }
} }

View file

@ -40,6 +40,7 @@ using Ombi.Core;
using Ombi.Core.SettingModels; using Ombi.Core.SettingModels;
using Ombi.Helpers; using Ombi.Helpers;
using Ombi.Helpers.Permissions; using Ombi.Helpers.Permissions;
using Ombi.Store;
using Ombi.UI.Models; using Ombi.UI.Models;
using ISecurityExtensions = Ombi.Core.ISecurityExtensions; using ISecurityExtensions = Ombi.Core.ISecurityExtensions;
@ -49,13 +50,14 @@ namespace Ombi.UI.Modules.Admin
{ {
public AboutModule(ISettingsService<PlexRequestSettings> settingsService, public AboutModule(ISettingsService<PlexRequestSettings> settingsService,
ISettingsService<SystemSettings> systemService, ISecurityExtensions security, ISettingsService<SystemSettings> systemService, ISecurityExtensions security,
IStatusChecker statusChecker, IResourceLinker linker) : base("admin", settingsService, security) IStatusChecker statusChecker, IResourceLinker linker, ISqliteConfiguration config) : base("admin", settingsService, security)
{ {
Before += (ctx) => Security.AdminLoginRedirect(Permissions.Administrator, ctx); Before += (ctx) => Security.AdminLoginRedirect(Permissions.Administrator, ctx);
SettingsService = systemService; SettingsService = systemService;
StatusChecker = statusChecker; StatusChecker = statusChecker;
Linker = linker; Linker = linker;
SqlConfig = config;
Get["AboutPage","/about", true] = async (x,ct) => await Index(); Get["AboutPage","/about", true] = async (x,ct) => await Index();
Post["/about", true] = async (x,ct) => await ReportIssue(); Post["/about", true] = async (x,ct) => await ReportIssue();
@ -67,6 +69,7 @@ namespace Ombi.UI.Modules.Admin
private ISettingsService<SystemSettings> SettingsService { get; } private ISettingsService<SystemSettings> SettingsService { get; }
private IStatusChecker StatusChecker { get; } private IStatusChecker StatusChecker { get; }
private IResourceLinker Linker { get; } private IResourceLinker Linker { get; }
private ISqliteConfiguration SqlConfig { get; }
private async Task<Negotiator> Index() private async Task<Negotiator> Index()
@ -105,6 +108,9 @@ namespace Ombi.UI.Modules.Admin
vm.SystemVersion = Environment.Version.ToString(); vm.SystemVersion = Environment.Version.ToString();
} }
vm.RunningDir = Environment.CurrentDirectory;
vm.DbLocation = SqlConfig.CurrentPath;
vm.ApplicationVersion = AssemblyHelper.GetFileVersion(); vm.ApplicationVersion = AssemblyHelper.GetFileVersion();
vm.Branch = EnumHelper<Branches>.GetDisplayValue(systemSettings.Branch); vm.Branch = EnumHelper<Branches>.GetDisplayValue(systemSettings.Branch);
vm.LogLevel = LogManager.Configuration.LoggingRules.FirstOrDefault(x => x.NameMatches("database"))?.Levels?.FirstOrDefault()?.Name ?? "Unknown"; vm.LogLevel = LogManager.Configuration.LoggingRules.FirstOrDefault(x => x.NameMatches("database"))?.Levels?.FirstOrDefault()?.Name ?? "Unknown";
@ -173,6 +179,8 @@ namespace Ombi.UI.Modules.Admin
sb.AppendLine(model.Branch); sb.AppendLine(model.Branch);
sb.AppendLine("#### Operating System:"); sb.AppendLine("#### Operating System:");
sb.AppendLine(model.Os); sb.AppendLine(model.Os);
sb.AppendLine("#### Log Level:");
sb.AppendLine(model.LogLevel);
sb.AppendLine(body); sb.AppendLine(body);
return sb.ToString(); return sb.ToString();

View file

@ -6,34 +6,114 @@
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<fieldset> <fieldset>
<legend>About</legend> <legend>About</legend>
<hr />
<table class="table table-condensed">
<tr>
<td>
Application Version:
</td>
<td>
@Model.ApplicationVersion
</td>
</tr>
<tr>
<td>
OS:
</td>
<td>
@Model.Os
</td>
</tr>
<div class="form-group"> <tr>
<label>Application Version: </label> <td>
<label>@Model.ApplicationVersion</label> System Version:
</div> </td>
<td>
<div class="form-group"> @Model.SystemVersion
<label class="control-label">OS: </label> </td>
<label class="control-label">@Model.Os</label> </tr>
</div> <tr>
<td>
<div class="form-group"> Branch:
<label class="control-label">System Version: </label> </td>
<label class="control-label">@Model.SystemVersion</label> <td>
</div> @Model.Branch
</td>
<div class="form-group"> </tr>
<label class="control-label">Branch: </label> <tr>
<label class="control-label">@Model.Branch</label> <td>
</div> Log Level:
<div class="form-group"> </td>
<label class="control-label">Log Level: </label> <td>
<label class="control-label">@Model.LogLevel</label> @Model.LogLevel
</div> </td>
</tr>
<tr>
<td>
Database Location:
</td>
<td>
@Model.DbLocation
</td>
</tr>
<tr>
<td>
Running Directory:
</td>
<td>
@Model.RunningDir
</td>
</tr>
</table>
<hr />
<table class="table table-condensed">
<tr>
<td>
Github
</td>
<td>
<a href="https://github.com/tidusjar/Ombi" target="_blank">https://github.com/tidusjar/Ombi</a>
</td>
</tr>
<tr>
<td>
Wiki
</td>
<td>
<a href="https://github.com/tidusjar/Ombi/wiki" target="_blank">https://github.com/tidusjar/Ombi/wiki</a>
</td>
</tr>
<tr>
<td>
Issues
</td>
<td>
<a href="https://github.com/tidusjar/Ombi/issues" target="_blank">https://github.com/tidusjar/Ombi/issues</a>
</td>
</tr>
<tr>
<td>
Chat
</td>
<td>
<a href="https://gitter.im/tidusjar/Ombi" target="_blank">https://gitter.im/tidusjar/Ombi</a>
</td>
</tr>
<tr>
<td>
Feature Requests
</td>
<td>
<a href="https://feathub.com/tidusjar/Ombi" target="_blank">https://feathub.com/tidusjar/Ombi</a>
</td>
</tr>
</table>
<hr />
@if (Model.OAuthEnabled) @if (Model.OAuthEnabled)
{ {
<div class="form-group"> <div class="form-group">
<div> <div>
<button id="save" type="submit" class="btn btn-danger-outline">Report a bug</button> <button id="save" type="submit" class="btn btn-danger-outline">Report a bug</button>
@ -45,11 +125,12 @@
{ {
<div class="form-group"> <div class="form-group">
<div> <div>
<button id="oAuth" type="submit" class="btn btn-primary-outline">Log in via Github</button> <button id="oAuth" type="submit" class="btn btn-primary-outline">Log in via Github to Report an Issue</button>
</div> </div>
</div> </div>
} }
</fieldset> </fieldset>
</div> </div>