-
+ Other Sessions
+
-
+ Kill All
+
+
+
+
+
- {{ getPlatformName(session.value.metadata.platforms) }}
- Last Active: {{ session.value['last-active'] | date : 'medium' }}
- {{ session.value['user-agent'] }}
+ {{ getPlatformName(session.metadata.platforms) }}
+ Last Active: {{ session['last-active'] | date : 'medium' }}
+ {{ session['user-agent'] }}
-
-
- Kill
+
+
+
+
+ You are not logged in anywhere else
+
+
-
-
\ No newline at end of file
+
diff --git a/frontend/projects/ui/src/app/pages/server-routes/sessions/sessions.page.ts b/frontend/projects/ui/src/app/pages/server-routes/sessions/sessions.page.ts
index f59e3ed51..6a5834648 100644
--- a/frontend/projects/ui/src/app/pages/server-routes/sessions/sessions.page.ts
+++ b/frontend/projects/ui/src/app/pages/server-routes/sessions/sessions.page.ts
@@ -1,8 +1,12 @@
import { Component } from '@angular/core'
-import { AlertController, LoadingController } from '@ionic/angular'
+import {
+ AlertController,
+ IonicSafeString,
+ LoadingController,
+} from '@ionic/angular'
import { ErrorToastService } from '@start9labs/shared'
import { ApiService } from 'src/app/services/api/embassy-api.service'
-import { PlatformType, RR } from 'src/app/services/api/api.types'
+import { PlatformType, Session } from 'src/app/services/api/api.types'
@Component({
selector: 'sessions',
@@ -11,7 +15,8 @@ import { PlatformType, RR } from 'src/app/services/api/api.types'
})
export class SessionsPage {
loading = true
- sessionInfo: RR.GetSessionsRes
+ currentSession: Session
+ otherSessions: SessionWithId[] = []
constructor(
private readonly loadingCtrl: LoadingController,
@@ -22,7 +27,22 @@ export class SessionsPage {
async ngOnInit() {
try {
- this.sessionInfo = await this.embassyApi.getSessions({})
+ const sessionInfo = await this.embassyApi.getSessions({})
+ this.currentSession = sessionInfo.sessions[sessionInfo.current]
+ delete sessionInfo.sessions[sessionInfo.current]
+ this.otherSessions = Object.entries(sessionInfo.sessions)
+ .map(([id, session]) => {
+ return {
+ id,
+ ...session,
+ }
+ })
+ .sort((a, b) => {
+ return (
+ new Date(b['last-active']).valueOf() -
+ new Date(a['last-active']).valueOf()
+ )
+ })
} catch (e: any) {
this.errToast.present(e)
} finally {
@@ -30,19 +50,21 @@ export class SessionsPage {
}
}
- async presentAlertKill(id: string) {
+ async presentAlertKillAll() {
const alert = await this.alertCtrl.create({
- header: 'Caution',
- message: `Are you sure you want to kill this session?`,
+ header: 'Confirm',
+ message: new IonicSafeString(
+ `Kill all sessions?
Note: you will not be logged out of your current session on this device.`,
+ ),
buttons: [
{
text: 'Cancel',
role: 'cancel',
},
{
- text: 'Kill',
+ text: 'Kill All',
handler: () => {
- this.kill(id)
+ this.kill(this.otherSessions.map(s => s.id))
},
cssClass: 'enter-click',
},
@@ -51,15 +73,36 @@ export class SessionsPage {
await alert.present()
}
- async kill(id: string): Promise {
+ async presentAlertKill(id: string) {
+ const alert = await this.alertCtrl.create({
+ header: 'Confirm',
+ message: `Kill this session?`,
+ buttons: [
+ {
+ text: 'Cancel',
+ role: 'cancel',
+ },
+ {
+ text: 'Kill',
+ handler: () => {
+ this.kill([id])
+ },
+ cssClass: 'enter-click',
+ },
+ ],
+ })
+ await alert.present()
+ }
+
+ async kill(ids: string[]): Promise {
const loader = await this.loadingCtrl.create({
message: 'Killing session...',
})
await loader.present()
try {
- await this.embassyApi.killSessions({ ids: [id] })
- delete this.sessionInfo.sessions[id]
+ await this.embassyApi.killSessions({ ids })
+ this.otherSessions = this.otherSessions.filter(s => !ids.includes(s.id))
} catch (e: any) {
this.errToast.present(e)
} finally {
@@ -99,3 +142,7 @@ export class SessionsPage {
return 0
}
}
+
+interface SessionWithId extends Session {
+ id: string
+}
diff --git a/frontend/projects/ui/src/app/pages/server-routes/ssh-keys/ssh-keys.page.html b/frontend/projects/ui/src/app/pages/server-routes/ssh-keys/ssh-keys.page.html
index 66d17fffa..35751ea61 100644
--- a/frontend/projects/ui/src/app/pages/server-routes/ssh-keys/ssh-keys.page.html
+++ b/frontend/projects/ui/src/app/pages/server-routes/ssh-keys/ssh-keys.page.html
@@ -9,13 +9,15 @@
-
- Adding SSH keys to your Embassy is useful for command line access, as well as for debugging purposes.
- View instructions
+ Adding SSH keys to your Embassy is useful for command line access, as
+ well as for debugging purposes.
+ View instructions
@@ -23,23 +25,37 @@
Saved Keys
-
- Add new key
+
+
+ Add new key
+
-
-
+
+
-
-
-
+
+
+
-
+
@@ -53,13 +69,16 @@
{{ ssh['created-at'] | date: 'short' }}
{{ ssh.alg }} {{ ssh.fingerprint }}
-
+
Remove
-
-
+
-
-
\ No newline at end of file
+
diff --git a/frontend/projects/ui/src/app/pages/server-routes/wifi/wifi.page.html b/frontend/projects/ui/src/app/pages/server-routes/wifi/wifi.page.html
index 6cbea6b0a..3fb4fc887 100644
--- a/frontend/projects/ui/src/app/pages/server-routes/wifi/wifi.page.html
+++ b/frontend/projects/ui/src/app/pages/server-routes/wifi/wifi.page.html
@@ -163,8 +163,10 @@
-
- Join other network
+
+
+ Join another network
+
diff --git a/frontend/projects/ui/src/styles.scss b/frontend/projects/ui/src/styles.scss
index 21bafae43..db31afd59 100644
--- a/frontend/projects/ui/src/styles.scss
+++ b/frontend/projects/ui/src/styles.scss
@@ -247,6 +247,7 @@ ion-item-divider {
ion-item {
border-radius: 6px;
+ --ripple-color: transparent;
}
ion-label {