diff --git a/build/RELEASE.md b/build/RELEASE.md index a99cb0528..bdbecc00e 100644 --- a/build/RELEASE.md +++ b/build/RELEASE.md @@ -70,3 +70,7 @@ - `make eos_raspberrypi.img` - `tar --format=posix -cS -f- eos---_raspberrypi.img | gzip > eos---_raspberrypi.tar.gz` - Artifact `./eos---_raspberrypi.tar.gz` + +## `embassy-sdk` + +- Build and deploy to all registries \ No newline at end of file diff --git a/frontend/package-lock.json b/frontend/package-lock.json index c038136dd..095efe38c 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "embassy-os", - "version": "0.3.3", + "version": "0.3.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "embassy-os", - "version": "0.3.3", + "version": "0.3.4", "dependencies": { "@angular/animations": "^14.1.0", "@angular/common": "^14.1.0", diff --git a/frontend/projects/marketplace/src/pages/show/about/about.component.html b/frontend/projects/marketplace/src/pages/show/about/about.component.html index bf5c70269..142552650 100644 --- a/frontend/projects/marketplace/src/pages/show/about/about.component.html +++ b/frontend/projects/marketplace/src/pages/show/about/about.component.html @@ -24,3 +24,12 @@

{{ pkg.manifest.description.long }}

+
+ + View marketing website + + +
diff --git a/frontend/projects/marketplace/src/pages/show/additional/additional.component.html b/frontend/projects/marketplace/src/pages/show/additional/additional.component.html index fc06782b4..8937e8c74 100644 --- a/frontend/projects/marketplace/src/pages/show/additional/additional.component.html +++ b/frontend/projects/marketplace/src/pages/show/additional/additional.component.html @@ -1,13 +1,3 @@ -
- - View marketing website - - -
-
Intended to replace diff --git a/frontend/projects/setup-wizard/src/app/pages/embassy/embassy.page.ts b/frontend/projects/setup-wizard/src/app/pages/embassy/embassy.page.ts index 6be587ce6..855051879 100644 --- a/frontend/projects/setup-wizard/src/app/pages/embassy/embassy.page.ts +++ b/frontend/projects/setup-wizard/src/app/pages/embassy/embassy.page.ts @@ -154,9 +154,7 @@ export class EmbassyPage { await this.stateService.setupEmbassy(logicalname, password) await this.navCtrl.navigateForward(`/loading`) } catch (e: any) { - this.errorToastService.present({ - message: `${e.message}\n\nRestart Embassy to try again.`, - }) + this.errorToastService.present(e) console.error(e) } finally { loader.dismiss() diff --git a/frontend/projects/setup-wizard/src/app/pages/home/home.page.html b/frontend/projects/setup-wizard/src/app/pages/home/home.page.html index 38c3594f2..7fa43e6a0 100644 --- a/frontend/projects/setup-wizard/src/app/pages/home/home.page.html +++ b/frontend/projects/setup-wizard/src/app/pages/home/home.page.html @@ -66,22 +66,6 @@ - - - - -

- Restore From Backup -

-

Restore an Embassy from an encrypted backup

-
-
-

- Use Existing Drive + Use Existing Drive

- Use an existing, valid Embassy data drive (not a backup) + Attach an existing embassyOS data drive ( + not + a backup)

@@ -110,15 +96,33 @@

- Transfer + Transfer

- Transfer data from an existing, valid Embassy data drive - (not a backup) to a new drive
(e.g. in order to - transfer data to another device) + Transfer data from an existing embassyOS data drive (not a + backup) to a new, preferred drive +

+ + + + + +

+ + Restore From Backup (Disaster Recovery) + +

+

Restore embassyOS data from an encrypted backup

+
+
diff --git a/frontend/projects/setup-wizard/src/app/services/state.service.ts b/frontend/projects/setup-wizard/src/app/services/state.service.ts index 9122318a0..4379ee13d 100644 --- a/frontend/projects/setup-wizard/src/app/services/state.service.ts +++ b/frontend/projects/setup-wizard/src/app/services/state.service.ts @@ -49,9 +49,7 @@ export class StateService { ) } } catch (e: any) { - this.errorToastService.present({ - message: `${e.message}\n\nRestart Embassy to try again.`, - }) + this.errorToastService.present(e) } setTimeout(() => this.pollDataTransferProgress(), 0) // prevent call stack from growing } diff --git a/frontend/projects/shared/src/classes/http-error.ts b/frontend/projects/shared/src/classes/http-error.ts index 06414abcd..df5d66806 100644 --- a/frontend/projects/shared/src/classes/http-error.ts +++ b/frontend/projects/shared/src/classes/http-error.ts @@ -3,8 +3,6 @@ import { HttpErrorResponse } from '@angular/common/http' export class HttpError { readonly code = this.error.status readonly message = this.error.statusText - readonly details = null - readonly revision = null constructor(private readonly error: HttpErrorResponse) {} } diff --git a/frontend/projects/shared/src/services/error-toast.service.ts b/frontend/projects/shared/src/services/error-toast.service.ts index da255f40a..2ac1314f7 100644 --- a/frontend/projects/shared/src/services/error-toast.service.ts +++ b/frontend/projects/shared/src/services/error-toast.service.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core' import { IonicSafeString, ToastController } from '@ionic/angular' +import { HttpError } from '../classes/http-error' @Injectable({ providedIn: 'root', @@ -9,7 +10,7 @@ export class ErrorToastService { constructor(private readonly toastCtrl: ToastController) {} - async present(e: { message: string }, link?: string): Promise { + async present(e: HttpError | string, link?: string): Promise { console.error(e) if (this.toast) return @@ -42,12 +43,21 @@ export class ErrorToastService { } export function getErrorMessage( - { message }: { message: string }, + e: HttpError | string, link?: string, ): string | IonicSafeString { - if (!message) { - message = 'Unknown Error.' + let message = '' + + if (typeof e === 'string') { + message = e + } else if (e.code === 0) { + message = + 'Request Error. Your browser blocked the request. This is usually caused by a corrupt browser cache or an overly aggressive ad blocker. Please clear your browser cache and/or adjust your ad blocker and try again' + } else if (!e.message) { + message = 'Unknown Error' link = 'https://docs.start9.com/latest/support/faq' + } else { + message = e.message } if (link) { diff --git a/frontend/projects/ui/src/app/app.component.ts b/frontend/projects/ui/src/app/app.component.ts index 46a150b83..522219024 100644 --- a/frontend/projects/ui/src/app/app.component.ts +++ b/frontend/projects/ui/src/app/app.component.ts @@ -6,13 +6,14 @@ import { PatchDataService } from './services/patch-data.service' import { PatchMonitorService } from './services/patch-monitor.service' import { ConnectionService } from './services/connection.service' import { Title } from '@angular/platform-browser' -import { ServerNameService } from './services/server-name.service' import { ClientStorageService, WidgetDrawer, } from './services/client-storage.service' import { ThemeSwitcherService } from './services/theme-switcher.service' import { THEME } from '@start9labs/shared' +import { PatchDB } from 'patch-db-client' +import { DataModel } from './services/patch-db/data-model' @Component({ selector: 'app-root', @@ -30,7 +31,7 @@ export class AppComponent implements OnDestroy { private readonly patchData: PatchDataService, private readonly patchMonitor: PatchMonitorService, private readonly splitPane: SplitPaneTracker, - private readonly serverNameService: ServerNameService, + private readonly patch: PatchDB, readonly authService: AuthService, readonly connection: ConnectionService, readonly clientStorageService: ClientStorageService, @@ -38,9 +39,9 @@ export class AppComponent implements OnDestroy { ) {} ngOnInit() { - this.serverNameService.name$.subscribe(({ current }) => - this.titleService.setTitle(current), - ) + this.patch + .watch$('ui', 'name') + .subscribe(name => this.titleService.setTitle(name || 'embassyOS')) } splitPaneVisible({ detail }: any) { diff --git a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts index 28cebe402..6e0c8f726 100644 --- a/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts +++ b/frontend/projects/ui/src/app/pages/server-routes/server-show/server-show.page.ts @@ -9,7 +9,6 @@ import { import { ApiService } from 'src/app/services/api/embassy-api.service' import { ActivatedRoute } from '@angular/router' import { PatchDB } from 'patch-db-client' -import { ServerNameService } from 'src/app/services/server-name.service' import { combineLatest, firstValueFrom, map, Observable, of } from 'rxjs' import { ErrorToastService } from '@start9labs/shared' import { EOSService } from 'src/app/services/eos.service' @@ -52,7 +51,6 @@ export class ServerShowPage { private readonly patch: PatchDB, private readonly eosService: EOSService, private readonly ClientStorageService: ClientStorageService, - private readonly serverNameService: ServerNameService, private readonly authService: AuthService, private readonly toastCtrl: ToastController, private readonly config: ConfigService, @@ -60,19 +58,18 @@ export class ServerShowPage { ) {} async presentModalName(): Promise { - const name = await firstValueFrom(this.serverNameService.name$) + const chosenName = await firstValueFrom(this.patch.watch$('ui', 'name')) const options: GenericInputOptions = { title: 'Set Device Name', message: 'This will be displayed in your browser tab', label: 'Device Name', useMask: false, - placeholder: name.default, + placeholder: 'embassyOS', nullable: true, - initialValue: name.current, + initialValue: chosenName, buttonText: 'Save', - submitFn: (value: string) => - this.setDbValue('name', value || name.default), + submitFn: (name: string) => this.setName(name || null), } const modal = await this.modalCtrl.create({ @@ -227,14 +224,14 @@ export class ServerShowPage { } } - private async setDbValue(key: string, value: string): Promise { + private async setName(value: string | null): Promise { const loader = await this.loadingCtrl.create({ message: 'Saving...', }) await loader.present() try { - await this.embassyApi.setDbValue([key], value) + await this.embassyApi.setDbValue(['name'], value) } finally { loader.dismiss() } @@ -393,8 +390,8 @@ export class ServerShowPage { disabled$: this.eosService.updatingOrBackingUp$, }, { - title: 'Set Device Name', - description: 'Give your device a name for easy identification', + title: 'Browser Tab Title', + description: `Customize the display name of your browser tab. This does not affect your server's LAN address.`, icon: 'pricetag-outline', action: () => this.presentModalName(), detail: false, @@ -429,7 +426,7 @@ export class ServerShowPage { disabled$: of(false), }, { - title: 'Sideload Service', + title: 'Sideload a Service', description: `Manually install a service`, icon: 'push-outline', action: () => diff --git a/frontend/projects/ui/src/app/pages/updates/updates.page.html b/frontend/projects/ui/src/app/pages/updates/updates.page.html index 67f33cb22..df21506b8 100644 --- a/frontend/projects/ui/src/app/pages/updates/updates.page.html +++ b/frontend/projects/ui/src/app/pages/updates/updates.page.html @@ -7,105 +7,127 @@ - + - -
-

{{ host.name }}

- +
+
+ +
+

{{ host.name }}

+

{{ host.url }}

+
- - -
- - Request Failed - - - - -
- - - - - - -

- {{ pkg.manifest.title }} -

-

- {{ local.manifest.version | displayEmver }} -    - - {{ pkg.manifest.version | displayEmver }} - -

-

- {{ error }} -

-
- -
- - - - - - {{ marketplaceService.updateErrors[pkg.manifest.id] ? - 'Retry' : 'Update' }} - - - -
-
-
-
-
What's New
-

-
-
- - -

All services are up to date!

-
-
-
- - - -
+ + + Request Failed + + + + + +
+ + + + + + + + + + + + +

{{ pkg.manifest.title }}

+

+ + {{ local.manifest.version | displayEmver }} + +   + +   + + {{ pkg.manifest.version | displayEmver }} + +

+

+ + {{ error }} + +

+
+
+
+
+ + + + + + {{ + marketplaceService.updateErrors[pkg.manifest.id] + ? 'Retry' : 'Update' }} + + + +
+
+
+
+

+
+
+
+
+
+
+
+
+
+ + All services are up to date! + +
+
+ + + + diff --git a/frontend/projects/ui/src/app/pages/updates/updates.page.scss b/frontend/projects/ui/src/app/pages/updates/updates.page.scss index 1c65a7eaa..9c2c63209 100644 --- a/frontend/projects/ui/src/app/pages/updates/updates.page.scss +++ b/frontend/projects/ui/src/app/pages/updates/updates.page.scss @@ -8,9 +8,57 @@ } .header { - margin-bottom: 20px; + padding: 1.5rem; + background: var(--ion-color-medium-tint); + + &_items { + display: flex; + align-items: center; + flex-direction: row; + } + h1 { - font-weight: bold; - margin: 0 12px 0 0; + font-size: 28px; + letter-spacing: 1px; + margin: 0 0 5px 0; + } + + p { + font-size: 14px; + margin: 0; } } + +img { + height: 85%; + width: 85%; +} + +.align-center { + display: flex; + justify-content: center; + align-items: center; +} + +.pl-1 { + padding-left: 1rem; +} + +p { + font-size: 1rem; + margin-top: 0; +} + +ion-item { + --background-hover: none; +} + +.accordian-padding { + padding: 0.5rem; +} + +@media (max-width: 500px) { + .accordian-padding { + padding: 0.5rem 0 0.5rem 0; + } +} \ No newline at end of file diff --git a/frontend/projects/ui/src/app/services/api/api.fixures.ts b/frontend/projects/ui/src/app/services/api/api.fixures.ts index c627943fd..6530cb5a2 100644 --- a/frontend/projects/ui/src/app/services/api/api.fixures.ts +++ b/frontend/projects/ui/src/app/services/api/api.fixures.ts @@ -20,7 +20,7 @@ export module Mock { updated: true, } export const MarketplaceEos: RR.GetMarketplaceEosRes = { - version: '0.3.3', + version: '0.3.4', headline: 'Our biggest release ever.', 'release-notes': { '0.3.3': 'Some **Markdown** release _notes_ for 0.3.3', @@ -725,7 +725,7 @@ export module Mock { manifest: { ...Mock.MockManifestLnd, version: '0.11.1', - 'release-notes': 'release notes for LND 0.11.0', + 'release-notes': 'release notes for LND 0.11.1', }, categories: ['bitcoin', 'lightning', 'cryptocurrency'], versions: ['0.11.0', '0.11.1'], @@ -1838,9 +1838,9 @@ export module Mock { export const lnd: PackageDataEntry = { state: PackageState.Installed, 'static-files': { - license: '/public/package-data/lnd/0.20.0/LICENSE.md', + license: '/public/package-data/lnd/0.11.0/LICENSE.md', icon: '/assets/img/service-icons/lnd.png', - instructions: '/public/package-data/lnd/0.20.0/INSTRUCTIONS.md', + instructions: '/public/package-data/lnd/0.11.0/INSTRUCTIONS.md', }, manifest: MockManifestLnd, installed: { diff --git a/frontend/projects/ui/src/app/services/api/mock-patch.ts b/frontend/projects/ui/src/app/services/api/mock-patch.ts index ace194349..118e35f4e 100644 --- a/frontend/projects/ui/src/app/services/api/mock-patch.ts +++ b/frontend/projects/ui/src/app/services/api/mock-patch.ts @@ -44,7 +44,7 @@ export const mockPatchData: DataModel = { }, 'server-info': { id: 'abcdefgh', - version: '0.3.3', + version: '0.3.4', 'last-backup': new Date(new Date().valueOf() - 604800001).toISOString(), 'lan-address': 'https://embassy-abcdefgh.local', 'tor-address': 'http://myveryownspecialtoraddress.onion', @@ -476,7 +476,7 @@ export const mockPatchData: DataModel = { manifest: { id: 'lnd', title: 'Lightning Network Daemon', - version: '0.11.1', + version: '0.11.0', description: { short: 'A bolt spec compliant client.', long: 'More info about LND. More info about LND. More info about LND.', @@ -626,7 +626,10 @@ export const mockPatchData: DataModel = { }, }, installed: { - manifest: {} as Manifest, + manifest: { + ...Mock.MockManifestLnd, + version: '0.11.0', + }, 'last-backup': null, status: { configured: true, diff --git a/frontend/projects/ui/src/app/services/client-storage.service.ts b/frontend/projects/ui/src/app/services/client-storage.service.ts index 6ee1f6236..c1ffdb386 100644 --- a/frontend/projects/ui/src/app/services/client-storage.service.ts +++ b/frontend/projects/ui/src/app/services/client-storage.service.ts @@ -25,7 +25,6 @@ export class ClientStorageService { constructor(private readonly storage: StorageService) {} init() { - console.log('EMBAWD', enableWidgets) this.showDevTools$.next(!!this.storage.get(SHOW_DEV_TOOLS)) this.showDiskRepair$.next(!!this.storage.get(SHOW_DISK_REPAIR)) this.widgetDrawer$.next( diff --git a/frontend/projects/ui/src/app/services/server-name.service.ts b/frontend/projects/ui/src/app/services/server-name.service.ts deleted file mode 100644 index 6090f5672..000000000 --- a/frontend/projects/ui/src/app/services/server-name.service.ts +++ /dev/null @@ -1,29 +0,0 @@ -import { Injectable } from '@angular/core' -import { PatchDB } from 'patch-db-client' -import { combineLatest, filter, map, Observable } from 'rxjs' -import { DataModel } from './patch-db/data-model' - -export interface ServerNameInfo { - current: string - default: string -} - -@Injectable({ providedIn: 'root' }) -export class ServerNameService { - private readonly chosenName$ = this.patch.watch$('ui', 'name') - private readonly hostname$ = this.patch.watch$('server-info', 'hostname') - - readonly name$: Observable = combineLatest([ - this.chosenName$, - this.hostname$, - ]).pipe( - map(([chosen, hostname]) => { - return { - current: chosen || hostname, - default: hostname, - } - }), - ) - - constructor(private readonly patch: PatchDB) {} -} diff --git a/frontend/projects/ui/src/index.html b/frontend/projects/ui/src/index.html index a7014320b..6a2f0fe98 100644 --- a/frontend/projects/ui/src/index.html +++ b/frontend/projects/ui/src/index.html @@ -1,22 +1,25 @@ + + + embassyOS - - - Embassy + - + + + - - - - - - - - - - - + + + + + +