+ Backups
+
+
+
+ Create Backup
+ Back up your Embassy and all its services
+
+
+ Last Backup: {{ patch.data['server-info']['last-backup'] ? (patch.data['server-info']['last-backup'] | date: 'short') : 'never' }}
+
+
+
+
+
{{ cat.key }}
diff --git a/ui/src/app/pages/server-routes/server-show/server-show.page.ts b/ui/src/app/pages/server-routes/server-show/server-show.page.ts
index b8f50a6ab..a61d0ad7d 100644
--- a/ui/src/app/pages/server-routes/server-show/server-show.page.ts
+++ b/ui/src/app/pages/server-routes/server-show/server-show.page.ts
@@ -105,15 +105,6 @@ export class ServerShowPage {
private setButtons (): void {
this.settings = {
- 'Backups': [
- {
- title: 'Create Backup',
- description: 'Back up your Embassy and all its services',
- icon: 'save-outline',
- action: () => this.navCtrl.navigateForward(['backup'], { relativeTo: this.route }),
- detail: true,
- },
- ],
'Insights': [
{
title: 'About',
diff --git a/ui/src/app/services/api/api.fixures.ts b/ui/src/app/services/api/api.fixures.ts
index feaa85dfd..b2cfdf1cb 100644
--- a/ui/src/app/services/api/api.fixures.ts
+++ b/ui/src/app/services/api/api.fixures.ts
@@ -974,7 +974,7 @@ export module Mock {
'signal-strength': 50,
}
- export const Disks: RR.GetDisksRes = [
+ export const Drives: RR.GetDrivesRes = [
{
logicalname: '/dev/sda',
model: null,
diff --git a/ui/src/app/services/api/api.types.ts b/ui/src/app/services/api/api.types.ts
index 6c63312a8..83b9f8683 100644
--- a/ui/src/app/services/api/api.types.ts
+++ b/ui/src/app/services/api/api.types.ts
@@ -121,10 +121,10 @@ export module RR {
export type CreateBackupReq = WithExpire<{ logicalname: string, password: string }> // backup.create
export type CreateBackupRes = WithRevision
- // disk
+ // drive
- export type GetDisksReq = { } // disk.list
- export type GetDisksRes = DiskInfo[]
+ export type GetDrivesReq = { } // disk.list
+ export type GetDrivesRes = DriveInfo[]
export type GetBackupInfoReq = { logicalname: string, password: string } // disk.backup-info
export type GetBackupInfoRes = BackupInfo
@@ -287,7 +287,7 @@ export interface SessionMetadata {
export type PlatformType = 'cli' | 'ios' | 'ipad' | 'iphone' | 'android' | 'phablet' | 'tablet' | 'cordova' | 'capacitor' | 'electron' | 'pwa' | 'mobile' | 'mobileweb' | 'desktop' | 'hybrid'
-export interface DiskInfo {
+export interface DriveInfo {
logicalname: string
vendor: string | null
model: string | null
@@ -300,10 +300,10 @@ export interface PartitionInfo {
label: string | null
capacity: number
used: number | null
- 'embassy-os': EmbassyOsDiskInfo | null
+ 'embassy-os': EmbassyOsDriveInfo | null
}
-export interface EmbassyOsDiskInfo {
+export interface EmbassyOsDriveInfo {
version: string
full: boolean
}
diff --git a/ui/src/app/services/api/embassy-api.service.ts b/ui/src/app/services/api/embassy-api.service.ts
index 448914ba2..458b6b4de 100644
--- a/ui/src/app/services/api/embassy-api.service.ts
+++ b/ui/src/app/services/api/embassy-api.service.ts
@@ -126,9 +126,9 @@ export abstract class ApiService implements Source, Http {
() => this.createBackupRaw(params),
)()
- // disk
+ // drive
- abstract getDisks (params: RR.GetDisksReq): Promise
+ abstract getDrives (params: RR.GetDrivesReq): Promise
abstract getBackupInfo (params: RR.GetBackupInfoReq): Promise
diff --git a/ui/src/app/services/api/embassy-live-api.service.ts b/ui/src/app/services/api/embassy-live-api.service.ts
index 158f3b516..fda5742ae 100644
--- a/ui/src/app/services/api/embassy-live-api.service.ts
+++ b/ui/src/app/services/api/embassy-live-api.service.ts
@@ -191,9 +191,9 @@ export class LiveApiService extends ApiService {
return this.http.rpcRequest({ method: 'backup.create', params })
}
- // disk
+ // drives
- getDisks (params: RR.GetDisksReq): Promise {
+ getDrives (params: RR.GetDrivesReq): Promise {
return this.http.rpcRequest({ method: 'disk.list', params })
}
diff --git a/ui/src/app/services/api/embassy-mock-api.service.ts b/ui/src/app/services/api/embassy-mock-api.service.ts
index b59cb534e..c1ed0435d 100644
--- a/ui/src/app/services/api/embassy-mock-api.service.ts
+++ b/ui/src/app/services/api/embassy-mock-api.service.ts
@@ -263,7 +263,7 @@ export class MockApiService extends ApiService {
async createBackupRaw (params: RR.CreateBackupReq): Promise {
await pauseFor(2000)
const path = '/server-info/status'
- const patch = [
+ let patch = [
{
op: PatchOp.REPLACE,
path,
@@ -271,8 +271,37 @@ export class MockApiService extends ApiService {
},
]
const res = await this.http.rpcRequest>({ method: 'db.patch', params: { patch } })
- setTimeout(() => {
- const patch = [
+
+ const ids = ['bitcoind', 'lnd']
+
+ setTimeout(async () => {
+ for (let i = 0; i < ids.length; i++) {
+ const appPath = `/package-data/${ids[i]}/installed/status/main/status`
+ let appPatch = [
+ {
+ op: PatchOp.REPLACE,
+ path: appPath,
+ value: PackageMainStatus.BackingUp,
+ },
+ ]
+ this.http.rpcRequest>({ method: 'db.patch', params: { patch: appPatch } })
+
+ await pauseFor(8000)
+
+ appPatch = [
+ {
+ op: PatchOp.REPLACE,
+ path: appPath,
+ value: PackageMainStatus.Stopped,
+ },
+ ]
+ this.http.rpcRequest>({ method: 'db.patch', params: { patch: appPatch } })
+ }
+
+ await pauseFor(1000)
+
+ // set server back to running
+ patch = [
{
op: PatchOp.REPLACE,
path,
@@ -280,15 +309,16 @@ export class MockApiService extends ApiService {
},
]
this.http.rpcRequest>({ method: 'db.patch', params: { patch } })
- }, this.revertTime)
+ }, 200)
+
return res
}
- // disk
+ // drives
- async getDisks (params: RR.GetDisksReq): Promise {
+ async getDrives (params: RR.GetDrivesReq): Promise {
await pauseFor(2000)
- return Mock.Disks
+ return Mock.Drives
}
async getBackupInfo (params: RR.GetBackupInfoReq): Promise {
diff --git a/ui/src/app/util/misc.util.ts b/ui/src/app/util/misc.util.ts
index f9a1d9828..74e737eb3 100644
--- a/ui/src/app/util/misc.util.ts
+++ b/ui/src/app/util/misc.util.ts
@@ -1,6 +1,6 @@
import { OperatorFunction } from 'rxjs'
import { map } from 'rxjs/operators'
-import { BackupInfo, DiskInfo, PartitionInfo } from '../services/api/api.types'
+import { DriveInfo, PartitionInfo } from '../services/api/api.types'
export type Omit = Pick>
export type PromiseRes = { result: 'resolve', value: T } | { result: 'reject', value: Error }
@@ -193,11 +193,10 @@ export function debounce (delay: number = 300): MethodDecorator {
}
}
-export interface MappedDiskInfo extends DiskInfo {
+export interface MappedDriveInfo extends DriveInfo {
partitions: MappedPartitionInfo[]
}
export interface MappedPartitionInfo extends PartitionInfo {
hasBackup: boolean
- backupInfo: BackupInfo | null
}
\ No newline at end of file
diff --git a/ui/src/global.scss b/ui/src/global.scss
index 061902667..8148f1e50 100644
--- a/ui/src/global.scss
+++ b/ui/src/global.scss
@@ -120,6 +120,13 @@ ion-toast {
white-space: normal !important;
}
+.inline {
+ * {
+ display: inline-block;
+ vertical-align: middle;
+ }
+}
+
img {
border-radius: 100%;
}
@@ -132,13 +139,6 @@ ion-title {
font-family: 'Montserrat';
}
-ion-note {
- max-width: 140px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
-
ion-badge {
font-weight: bold;
}