!wip fixed some things with the updater UI #1460 #865

pull/1514/head
Jamie.Rees 7 years ago
parent 2e0beba738
commit 2b5e5282bd

@ -1,13 +1,15 @@
using System; using System.Reflection;
using System.Reflection;
namespace Ombi.Helpers namespace Ombi.Helpers
{ {
public static class AssemblyHelper public static class AssemblyHelper
{ {
public static string GetRuntimeVersion() => public static string GetRuntimeVersion()
Assembly.GetEntryAssembly() {
var version = Assembly.GetEntryAssembly()
.GetCustomAttribute<AssemblyInformationalVersionAttribute>() .GetCustomAttribute<AssemblyInformationalVersionAttribute>()
.InformationalVersion; .InformationalVersion;
return version.Equals("1.0.0") ? "3.0.0-DotNetCore" : version;
}
} }
} }

@ -1,5 +1,4 @@
import { Injectable } from "@angular/core"; import { Injectable } from "@angular/core";
import { Http } from "@angular/http";
import { AuthHttp } from "angular2-jwt"; import { AuthHttp } from "angular2-jwt";
import { Observable } from "rxjs/Rx"; import { Observable } from "rxjs/Rx";
@ -7,11 +6,11 @@ import { ServiceAuthHelpers } from "./service.helpers";
@Injectable() @Injectable()
export class UpdateService extends ServiceAuthHelpers { export class UpdateService extends ServiceAuthHelpers {
constructor(http: AuthHttp, private regularHttp: Http) { constructor(http: AuthHttp) {
super(http, "/api/v1/Jobs/"); super(http, "/api/v1/Job/");
} }
public forceUpdate(): Observable<boolean> { public forceUpdate(): Observable<boolean> {
return this.regularHttp.post(`${this.url}update/`, { headers: this.headers }).map(this.extractData); return this.http.post(`${this.url}update/`, { headers: this.headers }).map(this.extractData);
} }
public checkForNewUpdate(): Observable<boolean> { public checkForNewUpdate(): Observable<boolean> {

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

@ -3,7 +3,14 @@
<div *ngIf="form"> <div *ngIf="form">
<fieldset> <fieldset>
<legend>Update Settings</legend> <legend>Update Settings</legend>
<div class="form-group" style="float: right">
<div *ngIf="updateAvailable">
<button (click)="update()" class="btn btn-success-outline">Update</button>
</div>
<div *ngIf="!updateAvailable">
<button (click)="checkForUpdate()" class="btn btn-primary-outline">Check For Update</button>
</div>
</div>
<form novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)" style="padding-top:5%;"> <form novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)" style="padding-top:5%;">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
@ -13,16 +20,7 @@
</div> </div>
</div> </div>
<div class="form-group" *ngIf="!updateAvailable">
<div>
<button (click)="checkForUpdate()" class="btn btn-primary-outline">Check For Update</button>
</div>
</div>
<div class="form-group" *ngIf="updateAvailable">
<div>
<button (click)="update()" class="btn btn-success-outline">Update</button>
</div>
</div>
<div class="form-group"> <div class="form-group">

@ -19,6 +19,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>bin\Release\netcoreapp2.0\Swagger.xml</DocumentationFile> <DocumentationFile>bin\Release\netcoreapp2.0\Swagger.xml</DocumentationFile>
<NoWarn>1701;1702;1705;1591;</NoWarn> <NoWarn>1701;1702;1705;1591;</NoWarn>
<DefineConstants>TRACE;RELEASE;NETCOREAPP2_0</DefineConstants>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save