load default marketplace URL on startup

This commit is contained in:
Matt Hill
2022-02-08 11:57:44 -07:00
committed by Aiden McClelland
parent d3c5648608
commit bd90259f1c
5 changed files with 71 additions and 99 deletions

View File

@@ -19,11 +19,7 @@ import { Emver } from './services/emver.service'
import { SplitPaneTracker } from './services/split-pane.service' import { SplitPaneTracker } from './services/split-pane.service'
import { ToastButton } from '@ionic/core' import { ToastButton } from '@ionic/core'
import { PatchDbService } from './services/patch-db/patch-db.service' import { PatchDbService } from './services/patch-db/patch-db.service'
import { import { ServerStatus, UIData } from './services/patch-db/data-model'
ServerStatus,
UIData,
UIMarketplaceData,
} from './services/patch-db/data-model'
import { import {
ConnectionFailure, ConnectionFailure,
ConnectionService, ConnectionService,
@@ -35,7 +31,7 @@ import { ErrorToastService } from './services/error-toast.service'
import { Subscription } from 'rxjs' import { Subscription } from 'rxjs'
import { LocalStorageService } from './services/local-storage.service' import { LocalStorageService } from './services/local-storage.service'
import { EOSService } from './services/eos.service' import { EOSService } from './services/eos.service'
import { v4 } from 'uuid' import { MarketplaceService } from './pages/marketplace-routes/marketplace.service'
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
@@ -100,6 +96,7 @@ export class AppComponent {
private readonly emver: Emver, private readonly emver: Emver,
private readonly connectionService: ConnectionService, private readonly connectionService: ConnectionService,
private readonly startupAlertsService: StartupAlertsService, private readonly startupAlertsService: StartupAlertsService,
private readonly marketplaceService: MarketplaceService,
private readonly toastCtrl: ToastController, private readonly toastCtrl: ToastController,
private readonly errToast: ErrorToastService, private readonly errToast: ErrorToastService,
private readonly config: ConfigService, private readonly config: ConfigService,
@@ -138,7 +135,6 @@ export class AppComponent {
this.watchConnection(), this.watchConnection(),
// watch router to highlight selected menu item // watch router to highlight selected menu item
this.watchRouter(), this.watchRouter(),
// watch status to display/hide maintenance page
]) ])
this.patch this.patch
@@ -160,6 +156,8 @@ export class AppComponent {
this.watchVersion(), this.watchVersion(),
// watch unread notification count to display toast // watch unread notification count to display toast
this.watchNotifications(), this.watchNotifications(),
// watch marketplace URL for changes
this.marketplaceService.init(),
// run startup alerts // run startup alerts
this.startupAlertsService.runChecks(), this.startupAlertsService.runChecks(),
]) ])

View File

@@ -1,4 +1,5 @@
import { Injectable } from '@angular/core' import { Injectable } from '@angular/core'
import { Subscription } from 'rxjs'
import { import {
MarketplaceData, MarketplaceData,
MarketplacePkg, MarketplacePkg,
@@ -23,15 +24,15 @@ export class MarketplaceService {
} = {} } = {}
marketplaceUrl: string marketplaceUrl: string
constructor ( constructor(
private readonly api: ApiService, private readonly api: ApiService,
private readonly emver: Emver, private readonly emver: Emver,
private readonly patch: PatchDbService, private readonly patch: PatchDbService,
private readonly config: ConfigService, private readonly config: ConfigService,
) { } ) {}
async init () { init(): Subscription {
this.patch.watch$('ui', 'marketplace').subscribe(marketplace => { return this.patch.watch$('ui', 'marketplace').subscribe(marketplace => {
if (!marketplace || !marketplace['selected-id']) { if (!marketplace || !marketplace['selected-id']) {
this.marketplaceUrl = this.config.marketplace.url this.marketplaceUrl = this.config.marketplace.url
} else { } else {
@@ -41,7 +42,7 @@ export class MarketplaceService {
}) })
} }
async load (): Promise<void> { async load(): Promise<void> {
try { try {
const [data, pkgs] = await Promise.all([ const [data, pkgs] = await Promise.all([
this.getMarketplaceData({}), this.getMarketplaceData({}),
@@ -66,7 +67,7 @@ export class MarketplaceService {
} }
} }
async getUpdates (localPkgs: { async getUpdates(localPkgs: {
[id: string]: PackageDataEntry [id: string]: PackageDataEntry
}): Promise<MarketplacePkg[]> { }): Promise<MarketplacePkg[]> {
const id = this.patch.getData().ui.marketplace?.['selected-id'] const id = this.patch.getData().ui.marketplace?.['selected-id']
@@ -96,7 +97,7 @@ export class MarketplaceService {
}) })
} }
async getPkg (id: string, version = '*'): Promise<MarketplacePkg> { async getPkg(id: string, version = '*'): Promise<MarketplacePkg> {
const pkgs = await this.getMarketplacePkgs({ const pkgs = await this.getMarketplacePkgs({
ids: [{ id, version }], ids: [{ id, version }],
'eos-version-compat': 'eos-version-compat':
@@ -111,11 +112,11 @@ export class MarketplaceService {
} }
} }
async cacheReleaseNotes (id: string): Promise<void> { async cacheReleaseNotes(id: string): Promise<void> {
this.releaseNotes[id] = await this.getReleaseNotes({ id }) this.releaseNotes[id] = await this.getReleaseNotes({ id })
} }
private async getPkgs ( private async getPkgs(
page: number, page: number,
perPage: number, perPage: number,
): Promise<MarketplacePkg[]> { ): Promise<MarketplacePkg[]> {
@@ -129,7 +130,7 @@ export class MarketplaceService {
return pkgs return pkgs
} }
async getMarketplaceData ( async getMarketplaceData(
params: RR.GetMarketplaceDataReq, params: RR.GetMarketplaceDataReq,
url?: string, url?: string,
): Promise<RR.GetMarketplaceDataRes> { ): Promise<RR.GetMarketplaceDataRes> {
@@ -137,7 +138,7 @@ export class MarketplaceService {
return this.api.marketplaceProxy('/package/v0/data', params, url) return this.api.marketplaceProxy('/package/v0/data', params, url)
} }
async getMarketplacePkgs ( async getMarketplacePkgs(
params: RR.GetMarketplacePackagesReq, params: RR.GetMarketplacePackagesReq,
): Promise<RR.GetMarketplacePackagesRes> { ): Promise<RR.GetMarketplacePackagesRes> {
if (params.query) params.category = undefined if (params.query) params.category = undefined
@@ -151,7 +152,7 @@ export class MarketplaceService {
) )
} }
async getReleaseNotes ( async getReleaseNotes(
params: RR.GetReleaseNotesReq, params: RR.GetReleaseNotesReq,
): Promise<RR.GetReleaseNotesRes> { ): Promise<RR.GetReleaseNotesRes> {
return this.api.marketplaceProxy( return this.api.marketplaceProxy(

View File

@@ -25,11 +25,6 @@
> >
</ion-item> </ion-item>
<!-- <ion-item button (click)="presentModalValueEdit('password')">
<ion-label>Change Password</ion-label>
<ion-note slot="end">********</ion-note>
</ion-item> -->
<ion-item-divider>Marketplace</ion-item-divider> <ion-item-divider>Marketplace</ion-item-divider>
<ion-item <ion-item
button button

View File

@@ -7,17 +7,15 @@ import { ConfigService } from '../config.service'
@Injectable() @Injectable()
export class LiveApiService extends ApiService { export class LiveApiService extends ApiService {
private marketplaceUrl: string constructor(
constructor (
private readonly http: HttpService, private readonly http: HttpService,
private readonly config: ConfigService, private readonly config: ConfigService,
) { ) {
super() super()
; (window as any).rpcClient = this ;(window as any).rpcClient = this
} }
async getStatic (url: string): Promise<string> { async getStatic(url: string): Promise<string> {
return this.http.httpRequest({ return this.http.httpRequest({
method: Method.GET, method: Method.GET,
url, url,
@@ -27,75 +25,75 @@ export class LiveApiService extends ApiService {
// db // db
async getRevisions (since: number): Promise<RR.GetRevisionsRes> { async getRevisions(since: number): Promise<RR.GetRevisionsRes> {
return this.http.rpcRequest({ method: 'db.revisions', params: { since } }) return this.http.rpcRequest({ method: 'db.revisions', params: { since } })
} }
async getDump (): Promise<RR.GetDumpRes> { async getDump(): Promise<RR.GetDumpRes> {
return this.http.rpcRequest({ method: 'db.dump' }) return this.http.rpcRequest({ method: 'db.dump' })
} }
async setDbValueRaw (params: RR.SetDBValueReq): Promise<RR.SetDBValueRes> { async setDbValueRaw(params: RR.SetDBValueReq): Promise<RR.SetDBValueRes> {
return this.http.rpcRequest({ method: 'db.put.ui', params }) return this.http.rpcRequest({ method: 'db.put.ui', params })
} }
// auth // auth
async login (params: RR.LoginReq): Promise<RR.loginRes> { async login(params: RR.LoginReq): Promise<RR.loginRes> {
return this.http.rpcRequest({ method: 'auth.login', params }) return this.http.rpcRequest({ method: 'auth.login', params })
} }
async logout (params: RR.LogoutReq): Promise<RR.LogoutRes> { async logout(params: RR.LogoutReq): Promise<RR.LogoutRes> {
return this.http.rpcRequest({ method: 'auth.logout', params }) return this.http.rpcRequest({ method: 'auth.logout', params })
} }
async getSessions (params: RR.GetSessionsReq): Promise<RR.GetSessionsRes> { async getSessions(params: RR.GetSessionsReq): Promise<RR.GetSessionsRes> {
return this.http.rpcRequest({ method: 'auth.session.list', params }) return this.http.rpcRequest({ method: 'auth.session.list', params })
} }
async killSessions (params: RR.KillSessionsReq): Promise<RR.KillSessionsRes> { async killSessions(params: RR.KillSessionsReq): Promise<RR.KillSessionsRes> {
return this.http.rpcRequest({ method: 'auth.session.kill', params }) return this.http.rpcRequest({ method: 'auth.session.kill', params })
} }
// server // server
async setShareStatsRaw ( async setShareStatsRaw(
params: RR.SetShareStatsReq, params: RR.SetShareStatsReq,
): Promise<RR.SetShareStatsRes> { ): Promise<RR.SetShareStatsRes> {
return this.http.rpcRequest({ method: 'server.config.share-stats', params }) return this.http.rpcRequest({ method: 'server.config.share-stats', params })
} }
async getServerLogs ( async getServerLogs(
params: RR.GetServerLogsReq, params: RR.GetServerLogsReq,
): Promise<RR.GetServerLogsRes> { ): Promise<RR.GetServerLogsRes> {
return this.http.rpcRequest({ method: 'server.logs', params }) return this.http.rpcRequest({ method: 'server.logs', params })
} }
async getServerMetrics ( async getServerMetrics(
params: RR.GetServerMetricsReq, params: RR.GetServerMetricsReq,
): Promise<RR.GetServerMetricsRes> { ): Promise<RR.GetServerMetricsRes> {
return this.http.rpcRequest({ method: 'server.metrics', params }) return this.http.rpcRequest({ method: 'server.metrics', params })
} }
async updateServerRaw ( async updateServerRaw(
params: RR.UpdateServerReq, params: RR.UpdateServerReq,
): Promise<RR.UpdateServerRes> { ): Promise<RR.UpdateServerRes> {
return this.http.rpcRequest({ method: 'server.update', params }) return this.http.rpcRequest({ method: 'server.update', params })
} }
async restartServer ( async restartServer(
params: RR.RestartServerReq, params: RR.RestartServerReq,
): Promise<RR.RestartServerRes> { ): Promise<RR.RestartServerRes> {
return this.http.rpcRequest({ method: 'server.restart', params }) return this.http.rpcRequest({ method: 'server.restart', params })
} }
async shutdownServer ( async shutdownServer(
params: RR.ShutdownServerReq, params: RR.ShutdownServerReq,
): Promise<RR.ShutdownServerRes> { ): Promise<RR.ShutdownServerRes> {
return this.http.rpcRequest({ method: 'server.shutdown', params }) return this.http.rpcRequest({ method: 'server.shutdown', params })
} }
async systemRebuild ( async systemRebuild(
params: RR.RestartServerReq, params: RR.RestartServerReq,
): Promise<RR.RestartServerRes> { ): Promise<RR.RestartServerRes> {
return this.http.rpcRequest({ method: 'server.rebuild', params }) return this.http.rpcRequest({ method: 'server.rebuild', params })
@@ -103,7 +101,7 @@ export class LiveApiService extends ApiService {
// marketplace URLs // marketplace URLs
async marketplaceProxy<T> (path: string, params: {}, url: string): Promise<T> { async marketplaceProxy<T>(path: string, params: {}, url: string): Promise<T> {
const fullURL = `${url}${path}?${new URLSearchParams(params).toString()}` const fullURL = `${url}${path}?${new URLSearchParams(params).toString()}`
return this.http.rpcRequest({ return this.http.rpcRequest({
method: 'marketplace.get', method: 'marketplace.get',
@@ -111,7 +109,7 @@ export class LiveApiService extends ApiService {
}) })
} }
async getEos ( async getEos(
params: RR.GetMarketplaceEOSReq, params: RR.GetMarketplaceEOSReq,
): Promise<RR.GetMarketplaceEOSRes> { ): Promise<RR.GetMarketplaceEOSRes> {
return this.marketplaceProxy( return this.marketplaceProxy(
@@ -121,26 +119,21 @@ export class LiveApiService extends ApiService {
) )
} }
// password
// async updatePassword (params: RR.UpdatePasswordReq): Promise<RR.UpdatePasswordRes> {
// return this.http.rpcRequest({ method: 'password.set', params })
// }
// notification // notification
async getNotificationsRaw ( async getNotificationsRaw(
params: RR.GetNotificationsReq, params: RR.GetNotificationsReq,
): Promise<RR.GetNotificationsRes> { ): Promise<RR.GetNotificationsRes> {
return this.http.rpcRequest({ method: 'notification.list', params }) return this.http.rpcRequest({ method: 'notification.list', params })
} }
async deleteNotification ( async deleteNotification(
params: RR.DeleteNotificationReq, params: RR.DeleteNotificationReq,
): Promise<RR.DeleteNotificationRes> { ): Promise<RR.DeleteNotificationRes> {
return this.http.rpcRequest({ method: 'notification.delete', params }) return this.http.rpcRequest({ method: 'notification.delete', params })
} }
async deleteAllNotifications ( async deleteAllNotifications(
params: RR.DeleteAllNotificationsReq, params: RR.DeleteAllNotificationsReq,
): Promise<RR.DeleteAllNotificationsRes> { ): Promise<RR.DeleteAllNotificationsRes> {
return this.http.rpcRequest({ return this.http.rpcRequest({
@@ -151,79 +144,79 @@ export class LiveApiService extends ApiService {
// wifi // wifi
async getWifi ( async getWifi(
params: RR.GetWifiReq, params: RR.GetWifiReq,
timeout?: number, timeout?: number,
): Promise<RR.GetWifiRes> { ): Promise<RR.GetWifiRes> {
return this.http.rpcRequest({ method: 'wifi.get', params, timeout }) return this.http.rpcRequest({ method: 'wifi.get', params, timeout })
} }
async setWifiCountry ( async setWifiCountry(
params: RR.SetWifiCountryReq, params: RR.SetWifiCountryReq,
): Promise<RR.SetWifiCountryRes> { ): Promise<RR.SetWifiCountryRes> {
return this.http.rpcRequest({ method: 'wifi.country.set', params }) return this.http.rpcRequest({ method: 'wifi.country.set', params })
} }
async addWifi (params: RR.AddWifiReq): Promise<RR.AddWifiRes> { async addWifi(params: RR.AddWifiReq): Promise<RR.AddWifiRes> {
return this.http.rpcRequest({ method: 'wifi.add', params }) return this.http.rpcRequest({ method: 'wifi.add', params })
} }
async connectWifi (params: RR.ConnectWifiReq): Promise<RR.ConnectWifiRes> { async connectWifi(params: RR.ConnectWifiReq): Promise<RR.ConnectWifiRes> {
return this.http.rpcRequest({ method: 'wifi.connect', params }) return this.http.rpcRequest({ method: 'wifi.connect', params })
} }
async deleteWifi (params: RR.DeleteWifiReq): Promise<RR.DeleteWifiRes> { async deleteWifi(params: RR.DeleteWifiReq): Promise<RR.DeleteWifiRes> {
return this.http.rpcRequest({ method: 'wifi.delete', params }) return this.http.rpcRequest({ method: 'wifi.delete', params })
} }
// ssh // ssh
async getSshKeys (params: RR.GetSSHKeysReq): Promise<RR.GetSSHKeysRes> { async getSshKeys(params: RR.GetSSHKeysReq): Promise<RR.GetSSHKeysRes> {
return this.http.rpcRequest({ method: 'ssh.list', params }) return this.http.rpcRequest({ method: 'ssh.list', params })
} }
async addSshKey (params: RR.AddSSHKeyReq): Promise<RR.AddSSHKeyRes> { async addSshKey(params: RR.AddSSHKeyReq): Promise<RR.AddSSHKeyRes> {
return this.http.rpcRequest({ method: 'ssh.add', params }) return this.http.rpcRequest({ method: 'ssh.add', params })
} }
async deleteSshKey (params: RR.DeleteSSHKeyReq): Promise<RR.DeleteSSHKeyRes> { async deleteSshKey(params: RR.DeleteSSHKeyReq): Promise<RR.DeleteSSHKeyRes> {
return this.http.rpcRequest({ method: 'ssh.delete', params }) return this.http.rpcRequest({ method: 'ssh.delete', params })
} }
// backup // backup
async getBackupTargets ( async getBackupTargets(
params: RR.GetBackupTargetsReq, params: RR.GetBackupTargetsReq,
): Promise<RR.GetBackupTargetsRes> { ): Promise<RR.GetBackupTargetsRes> {
return this.http.rpcRequest({ method: 'backup.target.list', params }) return this.http.rpcRequest({ method: 'backup.target.list', params })
} }
async addBackupTarget ( async addBackupTarget(
params: RR.AddBackupTargetReq, params: RR.AddBackupTargetReq,
): Promise<RR.AddBackupTargetRes> { ): Promise<RR.AddBackupTargetRes> {
params.path = params.path.replace('/\\/g', '/') params.path = params.path.replace('/\\/g', '/')
return this.http.rpcRequest({ method: 'backup.target.cifs.add', params }) return this.http.rpcRequest({ method: 'backup.target.cifs.add', params })
} }
async updateBackupTarget ( async updateBackupTarget(
params: RR.UpdateBackupTargetReq, params: RR.UpdateBackupTargetReq,
): Promise<RR.UpdateBackupTargetRes> { ): Promise<RR.UpdateBackupTargetRes> {
return this.http.rpcRequest({ method: 'backup.target.cifs.update', params }) return this.http.rpcRequest({ method: 'backup.target.cifs.update', params })
} }
async removeBackupTarget ( async removeBackupTarget(
params: RR.RemoveBackupTargetReq, params: RR.RemoveBackupTargetReq,
): Promise<RR.RemoveBackupTargetRes> { ): Promise<RR.RemoveBackupTargetRes> {
return this.http.rpcRequest({ method: 'backup.target.cifs.remove', params }) return this.http.rpcRequest({ method: 'backup.target.cifs.remove', params })
} }
async getBackupInfo ( async getBackupInfo(
params: RR.GetBackupInfoReq, params: RR.GetBackupInfoReq,
): Promise<RR.GetBackupInfoRes> { ): Promise<RR.GetBackupInfoRes> {
return this.http.rpcRequest({ method: 'backup.target.info', params }) return this.http.rpcRequest({ method: 'backup.target.info', params })
} }
async createBackupRaw ( async createBackupRaw(
params: RR.CreateBackupReq, params: RR.CreateBackupReq,
): Promise<RR.CreateBackupRes> { ): Promise<RR.CreateBackupRes> {
return this.http.rpcRequest({ method: 'backup.create', params }) return this.http.rpcRequest({ method: 'backup.create', params })
@@ -231,7 +224,7 @@ export class LiveApiService extends ApiService {
// package // package
async getPackageProperties ( async getPackageProperties(
params: RR.GetPackagePropertiesReq, params: RR.GetPackagePropertiesReq,
): Promise<RR.GetPackagePropertiesRes<2>['data']> { ): Promise<RR.GetPackagePropertiesRes<2>['data']> {
return this.http return this.http
@@ -239,95 +232,95 @@ export class LiveApiService extends ApiService {
.then(parsePropertiesPermissive) .then(parsePropertiesPermissive)
} }
async getPackageLogs ( async getPackageLogs(
params: RR.GetPackageLogsReq, params: RR.GetPackageLogsReq,
): Promise<RR.GetPackageLogsRes> { ): Promise<RR.GetPackageLogsRes> {
return this.http.rpcRequest({ method: 'package.logs', params }) return this.http.rpcRequest({ method: 'package.logs', params })
} }
async getPkgMetrics ( async getPkgMetrics(
params: RR.GetPackageMetricsReq, params: RR.GetPackageMetricsReq,
): Promise<RR.GetPackageMetricsRes> { ): Promise<RR.GetPackageMetricsRes> {
return this.http.rpcRequest({ method: 'package.metrics', params }) return this.http.rpcRequest({ method: 'package.metrics', params })
} }
async installPackageRaw ( async installPackageRaw(
params: RR.InstallPackageReq, params: RR.InstallPackageReq,
): Promise<RR.InstallPackageRes> { ): Promise<RR.InstallPackageRes> {
return this.http.rpcRequest({ method: 'package.install', params }) return this.http.rpcRequest({ method: 'package.install', params })
} }
async dryUpdatePackage ( async dryUpdatePackage(
params: RR.DryUpdatePackageReq, params: RR.DryUpdatePackageReq,
): Promise<RR.DryUpdatePackageRes> { ): Promise<RR.DryUpdatePackageRes> {
return this.http.rpcRequest({ method: 'package.update.dry', params }) return this.http.rpcRequest({ method: 'package.update.dry', params })
} }
async getPackageConfig ( async getPackageConfig(
params: RR.GetPackageConfigReq, params: RR.GetPackageConfigReq,
): Promise<RR.GetPackageConfigRes> { ): Promise<RR.GetPackageConfigRes> {
return this.http.rpcRequest({ method: 'package.config.get', params }) return this.http.rpcRequest({ method: 'package.config.get', params })
} }
async drySetPackageConfig ( async drySetPackageConfig(
params: RR.DrySetPackageConfigReq, params: RR.DrySetPackageConfigReq,
): Promise<RR.DrySetPackageConfigRes> { ): Promise<RR.DrySetPackageConfigRes> {
return this.http.rpcRequest({ method: 'package.config.set.dry', params }) return this.http.rpcRequest({ method: 'package.config.set.dry', params })
} }
async setPackageConfigRaw ( async setPackageConfigRaw(
params: RR.SetPackageConfigReq, params: RR.SetPackageConfigReq,
): Promise<RR.SetPackageConfigRes> { ): Promise<RR.SetPackageConfigRes> {
return this.http.rpcRequest({ method: 'package.config.set', params }) return this.http.rpcRequest({ method: 'package.config.set', params })
} }
async restorePackagesRaw ( async restorePackagesRaw(
params: RR.RestorePackagesReq, params: RR.RestorePackagesReq,
): Promise<RR.RestorePackagesRes> { ): Promise<RR.RestorePackagesRes> {
return this.http.rpcRequest({ method: 'package.backup.restore', params }) return this.http.rpcRequest({ method: 'package.backup.restore', params })
} }
async executePackageAction ( async executePackageAction(
params: RR.ExecutePackageActionReq, params: RR.ExecutePackageActionReq,
): Promise<RR.ExecutePackageActionRes> { ): Promise<RR.ExecutePackageActionRes> {
return this.http.rpcRequest({ method: 'package.action', params }) return this.http.rpcRequest({ method: 'package.action', params })
} }
async startPackageRaw ( async startPackageRaw(
params: RR.StartPackageReq, params: RR.StartPackageReq,
): Promise<RR.StartPackageRes> { ): Promise<RR.StartPackageRes> {
return this.http.rpcRequest({ method: 'package.start', params }) return this.http.rpcRequest({ method: 'package.start', params })
} }
async dryStopPackage ( async dryStopPackage(
params: RR.DryStopPackageReq, params: RR.DryStopPackageReq,
): Promise<RR.DryStopPackageRes> { ): Promise<RR.DryStopPackageRes> {
return this.http.rpcRequest({ method: 'package.stop.dry', params }) return this.http.rpcRequest({ method: 'package.stop.dry', params })
} }
async stopPackageRaw (params: RR.StopPackageReq): Promise<RR.StopPackageRes> { async stopPackageRaw(params: RR.StopPackageReq): Promise<RR.StopPackageRes> {
return this.http.rpcRequest({ method: 'package.stop', params }) return this.http.rpcRequest({ method: 'package.stop', params })
} }
async dryUninstallPackage ( async dryUninstallPackage(
params: RR.DryUninstallPackageReq, params: RR.DryUninstallPackageReq,
): Promise<RR.DryUninstallPackageRes> { ): Promise<RR.DryUninstallPackageRes> {
return this.http.rpcRequest({ method: 'package.uninstall.dry', params }) return this.http.rpcRequest({ method: 'package.uninstall.dry', params })
} }
async deleteRecoveredPackageRaw ( async deleteRecoveredPackageRaw(
params: RR.DeleteRecoveredPackageReq, params: RR.DeleteRecoveredPackageReq,
): Promise<RR.DeleteRecoveredPackageRes> { ): Promise<RR.DeleteRecoveredPackageRes> {
return this.http.rpcRequest({ method: 'package.delete-recovered', params }) return this.http.rpcRequest({ method: 'package.delete-recovered', params })
} }
async uninstallPackageRaw ( async uninstallPackageRaw(
params: RR.UninstallPackageReq, params: RR.UninstallPackageReq,
): Promise<RR.UninstallPackageRes> { ): Promise<RR.UninstallPackageRes> {
return this.http.rpcRequest({ method: 'package.uninstall', params }) return this.http.rpcRequest({ method: 'package.uninstall', params })
} }
async dryConfigureDependency ( async dryConfigureDependency(
params: RR.DryConfigureDependencyReq, params: RR.DryConfigureDependencyReq,
): Promise<RR.DryConfigureDependencyRes> { ): Promise<RR.DryConfigureDependencyRes> {
return this.http.rpcRequest({ return this.http.rpcRequest({

View File

@@ -107,9 +107,6 @@ export class ServerConfigService {
'share-stats': async (enabled: boolean) => { 'share-stats': async (enabled: boolean) => {
return this.embassyApi.setShareStats({ value: enabled }) return this.embassyApi.setShareStats({ value: enabled })
}, },
// password: async (password: string) => {
// return this.embassyApi.updatePassword({ password })
// },
} }
} }
@@ -129,16 +126,4 @@ export const serverConfig: ConfigSpec = {
) as any, ) as any,
default: false, default: false,
}, },
// password: {
// type: 'string',
// name: 'Change Password',
// description: `Your Embassy's master password, used for authentication and disk encryption.`,
// nullable: false,
// // @TODO regex for 12 chars
// // pattern: '',
// 'pattern-description': 'Must contain at least 12 characters.',
// warning: 'If you forget your master password, there is absolutely no way to recover your data. This can result in loss of money! Keep in mind, old backups will still be encrypted by the password used to encrypt them.',
// masked: false,
// copyable: false,
// },
} }