Added an about page #865

pull/1520/head
Jamie.Rees 7 years ago
parent 25d8f9b40d
commit ba1638187c

@ -30,7 +30,7 @@
<ul class="nav navbar-nav navbar-right">
<li *ngIf="hasRole('Admin') " [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Ombi']"><i class="fa fa-cog"></i> Settings</a></li>
<li *ngIf="hasRole('Admin') " [routerLinkActive]="['active']"><a [routerLink]="['/Settings/About']"><i class="fa fa-cog"></i> Settings</a></li>
<li [routerLinkActive]="['active']" class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user"></i> Welcome {{user.name}} <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">

@ -101,3 +101,12 @@ export interface IAuthenticationSettings extends ISettings {
requireNonAlphanumeric: boolean;
requireUppercase: boolean;
}
export interface IAbout {
version: string;
branch: string;
osArchitecture: string;
osDescription: string;
processArchitecture: string;
applicationBasePath: string;
}

@ -4,6 +4,7 @@ import { AuthHttp } from "angular2-jwt";
import { Observable } from "rxjs/Rx";
import {
IAbout,
IAuthenticationSettings,
ICustomizationSettings,
IDiscordNotifcationSettings,
@ -29,6 +30,10 @@ export class SettingsService extends ServiceAuthHelpers {
super(httpAuth, "/api/v1/Settings");
}
public about(): Observable<IAbout> {
return this.httpAuth.get(`${this.url}/About/`).map(this.extractData).catch(this.handleError);
}
public getOmbi(): Observable<IOmbiSettings> {
return this.httpAuth.get(`${this.url}/Ombi/`).map(this.extractData).catch(this.handleError);
}

@ -0,0 +1,90 @@

<settings-menu></settings-menu>
<div *ngIf="about">
<fieldset>
<legend>About</legend>
<form>
<div class="col-md-8">
<table class="table table-striped table-hover table-responsive table-condensed">
<thead>
</thead>
<tbody>
<tr>
<td>
<span>Version</span>
</td>
<td>
<span>{{about.version}}</span>
</td>
</tr>
<tr>
<td>
<span>Branch</span>
</td>
<td>
<span>{{about.branch}}</span>
</td>
</tr>
<tr>
<td>
<span>Github</span>
</td>
<td>
<a href="https://github.com/tidusjar/Ombi" target="_blank">https://github.com/tidusjar/Ombi</a>
</td>
</tr>
<tr>
<td>
<span>Gitter</span>
</td>
<td>
<a href="https://gitter.im/tidusjar/Ombi" target="_blank">https://gitter.im/tidusjar/Ombi</a>
</td>
</tr>
<tr>
<td>
<span>Forums</span>
</td>
<td>
<a href="https://forums.ombi.io/" target="_blank">https://forums.ombi.io</a>
</td>
</tr>
<tr>
<td>
<span>OS Architecture</span>
</td>
<td>
<span>{{about.osArchitecture}}</span>
</td>
</tr>
<tr>
<td>
<span>OS Description</span>
</td>
<td>
<span>{{about.osDescription}}</span>
</td>
</tr>
<tr>
<td>
<span>Process Architecture</span>
</td>
<td>
<span>{{about.processArchitecture}}</span>
</td>
</tr>
<tr>
<td>
<span>Application Base Path</span>
</td>
<td>
<span>{{about.applicationBasePath}}</span>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</fieldset>
</div>

@ -0,0 +1,17 @@
import { Component, OnInit } from "@angular/core";
import { IAbout } from "../../interfaces/ISettings";
import { SettingsService } from "../../services";
@Component({
templateUrl: "./about.component.html",
})
export class AboutComponent implements OnInit {
public about: IAbout;
constructor(private settingsService: SettingsService) { }
public ngOnInit() {
this.settingsService.about().subscribe(x => this.about = x);
}
}

@ -11,6 +11,7 @@ import { AuthService } from "../auth/auth.service";
import { RadarrService, SonarrService, TesterService, UpdateService, ValidationService } from "../services";
import { PipeModule } from "../pipes/pipe.module";
import { AboutComponent } from "./about/about.component";
import { CustomizationComponent } from "./customization/customization.component";
import { EmbyComponent } from "./emby/emby.component";
import { LandingPageComponent } from "./landingpage/landingpage.component";
@ -34,6 +35,7 @@ import { AutoCompleteModule, CalendarModule, InputSwitchModule, InputTextModule,
const routes: Routes = [
{ path: "Settings/Ombi", component: OmbiComponent, canActivate: [AuthGuard] },
{ path: "Settings/About", component: AboutComponent, canActivate: [AuthGuard] },
{ path: "Settings/Plex", component: PlexComponent, canActivate: [AuthGuard] },
{ path: "Settings/Emby", component: EmbyComponent, canActivate: [AuthGuard] },
{ path: "Settings/Sonarr", component: SonarrComponent, canActivate: [AuthGuard] },
@ -86,6 +88,7 @@ const routes: Routes = [
PushbulletComponent,
UserManagementComponent,
UpdateComponent,
AboutComponent,
],
exports: [
RouterModule,

@ -67,6 +67,7 @@
<i class="fa fa-tachometer" aria-hidden="true"></i> System <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/About']">About</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Update']">Update</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/Logs']">Logs (Not available)</a></li>
<li [routerLinkActive]="['active']"><a [routerLink]="['/Settings/ScheduledJobs']">Scheduled Jobs (Not available)</a></li>

@ -1,11 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using AutoMapper;
using Hangfire;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.PlatformAbstractions;
using Ombi.Api.Emby;
using Ombi.Attributes;
using Ombi.Core.Models.UI;
@ -13,6 +15,7 @@ using Ombi.Core.Settings;
using Ombi.Core.Settings.Models;
using Ombi.Core.Settings.Models.External;
using Ombi.Helpers;
using Ombi.Models;
using Ombi.Schedule.Jobs;
using Ombi.Schedule.Jobs.Emby;
using Ombi.Schedule.Jobs.Radarr;
@ -24,6 +27,7 @@ using Ombi.Store.Repository;
namespace Ombi.Controllers
{
/// <inheritdoc />
/// <summary>
/// The Settings Controller
/// </summary>
@ -42,8 +46,8 @@ namespace Ombi.Controllers
/// <param name="cacher">The cacher.</param>
/// <param name="embyCacher">The embyCacher.</param>
/// <param name="radarrCacher">The radarrCacher.</param>
public SettingsController(ISettingsResolver resolver,
IMapper mapper,
public SettingsController(ISettingsResolver resolver,
IMapper mapper,
INotificationTemplatesRepository templateRepo,
IEmbyApi embyApi,
IPlexContentCacher cacher,
@ -89,6 +93,25 @@ namespace Ombi.Controllers
return await Save(ombi);
}
[HttpGet("about")]
public AboutViewModel About()
{
var model = new AboutViewModel
{
FrameworkDescription = RuntimeInformation.FrameworkDescription,
OsArchitecture = RuntimeInformation.OSArchitecture.ToString(),
OsDescription = RuntimeInformation.OSDescription,
ProcessArchitecture = RuntimeInformation.ProcessArchitecture.ToString(),
ApplicationBasePath =PlatformServices.Default.Application.ApplicationBasePath
};
var version = AssemblyHelper.GetRuntimeVersion();
var productArray = version.Split('-');
model.Version = productArray[0];
model.Branch = productArray[1];
return model;
}
[HttpPost("ombi/resetApi")]
public async Task<string> ResetApiKey()
{

@ -0,0 +1,13 @@
namespace Ombi.Models
{
public class AboutViewModel
{
public string Version { get; set; }
public string Branch { get; set; }
public string FrameworkDescription { get; set; }
public string OsArchitecture { get; set; }
public string OsDescription { get; set; }
public string ProcessArchitecture { get; set; }
public string ApplicationBasePath { get; set; }
}
}
Loading…
Cancel
Save