Skip to content

Commit a98b69d

Browse files
committed
frontend/app: Add menu item to be able to close remote access while a connection is beeing established.
1 parent 4a22999 commit a98b69d

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

frontend/src/components/Frame.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { connected, connected_to, secret } from './charger_list';
77
import { setAppNavigation } from './Navbar';
88
import { enableLogging } from '../utils';
99
import Median from "median-js-bridge";
10+
import i18n from '../i18n';
1011

1112
export const chargerID = signal(0);
1213
export const chargerPort = signal(0);
@@ -34,6 +35,20 @@ export class Frame extends Component {
3435

3536
this.startWorker();
3637

38+
if (Median.isNativeApp()) {
39+
const t = i18n.t;
40+
Median.sidebar.setItems({
41+
enabled: true,
42+
persist: true,
43+
items: [
44+
{
45+
label: t("app.close_remote_access"),
46+
url: "javascript:window.close()"
47+
}
48+
]
49+
})
50+
}
51+
3752
// used by the app to detect a resumed app
3853
window.addEventListener("appResumed", () => {
3954
this.worker.terminate();

frontend/src/locales/de.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@ export const de ={
8080
"imprint": "Impressum",
8181
"terms_of_use": "AGB",
8282
"privacy_notice": "Datenschutzerklärung"
83+
},
84+
"app": {
85+
"close_remote_access": "Fernzugriff schließen"
8386
}
8487
};

frontend/src/locales/en.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,8 @@ export const en = {
8080
"imprint": "Imprint",
8181
"terms_of_use": "Terms and Conditions",
8282
"privacy_notice": "Privacy Notice"
83+
},
84+
"app": {
85+
"close_remote_access": "Close Remote-Access"
8386
}
8487
};

0 commit comments

Comments
 (0)