mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
ui: displayEmver on updates
This commit is contained in:
committed by
Aiden McClelland
parent
4fba3a1d75
commit
fe7410c0fa
@@ -3,6 +3,7 @@ import { OsUpdateService } from 'src/app/services/os-update.service'
|
|||||||
import { Observable } from 'rxjs'
|
import { Observable } from 'rxjs'
|
||||||
import { AlertController } from '@ionic/angular'
|
import { AlertController } from '@ionic/angular'
|
||||||
import { LoaderService } from 'src/app/services/loader.service'
|
import { LoaderService } from 'src/app/services/loader.service'
|
||||||
|
import { displayEmver } from 'src/app/pipes/emver.pipe'
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'update-os-banner',
|
selector: 'update-os-banner',
|
||||||
@@ -24,7 +25,7 @@ export class UpdateOsBannerComponent {
|
|||||||
async confirmUpdate (versionLatest: string) {
|
async confirmUpdate (versionLatest: string) {
|
||||||
const alert = await this.alertCtrl.create({
|
const alert = await this.alertCtrl.create({
|
||||||
header: `Update EmbassyOS`,
|
header: `Update EmbassyOS`,
|
||||||
message: `Update EmbassyOS to version ${versionLatest}?`,
|
message: `Update EmbassyOS to version ${displayEmver(versionLatest)}?`,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: 'Cancel',
|
text: 'Cancel',
|
||||||
|
|||||||
@@ -1,10 +1,5 @@
|
|||||||
<ion-header>
|
<ion-header>
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-buttons slot="start">
|
|
||||||
<ion-button (click)="dismiss()">
|
|
||||||
<ion-icon slot="icon-only" name="close"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
<ion-title >
|
<ion-title >
|
||||||
<ion-label style="font-size: 20px;" class="ion-text-wrap">Welcome to {{ version }}!</ion-label>
|
<ion-label style="font-size: 20px;" class="ion-text-wrap">Welcome to {{ version }}!</ion-label>
|
||||||
</ion-title>
|
</ion-title>
|
||||||
@@ -22,7 +17,7 @@
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
0.2.8 also introduces automatic checks for OS updates. With this enabled, each time you visit your embassy you will be notified if a new OS version is available. This setting can be edited in your Embassy Config page.
|
0.2.8 also introduces automatic checks for OS updates. With this enabled, each time you visit your embassy you will be notified if a new OS version is available. This setting can be edited in your Embassy Config page.
|
||||||
<ion-item style="--border-radius: var(--icon-border-radius); margin-top: 15px">
|
<ion-item lines="none" style="--border-radius: var(--icon-border-radius); margin-top: 15px">
|
||||||
<ion-label>Auto Check for Updates</ion-label>
|
<ion-label>Auto Check for Updates</ion-label>
|
||||||
<ion-toggle slot="end" [(ngModel)]="autoCheckUpdates"></ion-toggle>
|
<ion-toggle slot="end" [(ngModel)]="autoCheckUpdates"></ion-toggle>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export class OsUpdateService {
|
|||||||
this.serverModel.watch().versionInstalled.pipe(take(1)),
|
this.serverModel.watch().versionInstalled.pipe(take(1)),
|
||||||
this.apiService.getVersionLatest(),
|
this.apiService.getVersionLatest(),
|
||||||
]).pipe(
|
]).pipe(
|
||||||
map(([vi, vl]) => this.updateIsAvailable(vi, vl.versionLatest) ? vl : undefined),
|
map(([vi, vl]) => this.updateIsAvailable(vi, vl.versionLatest) ? vl.versionLatest : undefined),
|
||||||
catchError(e => {
|
catchError(e => {
|
||||||
console.error(`OsUpdateService Error: ${e}`)
|
console.error(`OsUpdateService Error: ${e}`)
|
||||||
return of(undefined)
|
return of(undefined)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core'
|
|||||||
import { AlertController, ModalController, NavController } from '@ionic/angular'
|
import { AlertController, ModalController, NavController } from '@ionic/angular'
|
||||||
import { OSWelcomePage } from '../modals/os-welcome/os-welcome.page'
|
import { OSWelcomePage } from '../modals/os-welcome/os-welcome.page'
|
||||||
import { S9Server } from '../models/server-model'
|
import { S9Server } from '../models/server-model'
|
||||||
|
import { displayEmver } from '../pipes/emver.pipe'
|
||||||
import { ApiService } from './api/api.service'
|
import { ApiService } from './api/api.service'
|
||||||
import { ConfigService } from './config.service'
|
import { ConfigService } from './config.service'
|
||||||
import { Emver } from './emver.service'
|
import { Emver } from './emver.service'
|
||||||
@@ -129,7 +130,7 @@ export class StartupAlertsNotifier {
|
|||||||
const alert = await this.alertCtrl.create({
|
const alert = await this.alertCtrl.create({
|
||||||
backdropDismiss: true,
|
backdropDismiss: true,
|
||||||
header: 'New EmbassyOS Version!',
|
header: 'New EmbassyOS Version!',
|
||||||
message: `Update EmbassyOS to version ${versionLatest}?`,
|
message: `Update EmbassyOS to version ${displayEmver(versionLatest)}?`,
|
||||||
buttons: [
|
buttons: [
|
||||||
{
|
{
|
||||||
text: 'Not now',
|
text: 'Not now',
|
||||||
|
|||||||
Reference in New Issue
Block a user