Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions src/deepLinks/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import {
} from '../ui/main/dialogs';
import { getRootWindow } from '../ui/main/rootWindow';
import { getWebContentsByServerUrl } from '../ui/main/serverView';
import type { UiPreviewSource } from '../ui/main/serverView/uiPreview';
import {
isUiPreviewAllowed,
requestUiPreviewWithDialog,
} from '../ui/main/serverView/uiPreview';
import { DEEP_LINKS_SERVER_FOCUSED, DEEP_LINKS_SERVER_ADDED } from './actions';

export type { TelephonyLink } from '../telephony/common';
Expand Down Expand Up @@ -257,6 +262,29 @@ const performAuthDeepLink = async (args: URLSearchParams): Promise<void> => {
}
};

const performUiPreview = async ({
host,
...source
}: UiPreviewSource & { host?: string }): Promise<void> => {
if (!(await isUiPreviewAllowed())) {
return;
}

if (host) {
await performOnServer(host, async (serverUrl) => {
await requestUiPreviewWithDialog(serverUrl, source);
});
return;
}

const focusedServerUrl = select(({ currentView }) =>
typeof currentView === 'object' ? currentView.url : undefined
);
if (focusedServerUrl) {
await requestUiPreviewWithDialog(focusedServerUrl, source);
}
};

const processDeepLink = async (deepLink: string): Promise<void> => {
const telephonyLink = parseTelephonyLink(deepLink);
if (telephonyLink) {
Expand Down Expand Up @@ -304,6 +332,16 @@ const processDeepLink = async (deepLink: string): Promise<void> => {
break;
}

case 'ui-preview': {
await performUiPreview({
host: args.get('host') ?? undefined,
bundle: args.get('bundle') ?? undefined,
pr: args.get('pr') ?? undefined,
sha: args.get('sha') ?? undefined,
});
break;
}

case 'conference': {
const host = args.get('host') ?? undefined;
const path = args.get('path') ?? undefined;
Expand Down
32 changes: 31 additions & 1 deletion src/i18n/ar.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,22 @@
"menuBarUnreadCount": {
"title": "عدد غير المقروءة في شريط القوائم",
"description": "عرض عدد الإشارات غير المقروءة بجوار أيقونة شريط القوائم."
},
"uiPreview": {
"title": "تحميل إصدار من واجهة الويب",
"description": "يشغّل إصدارًا من عميل ويب Rocket.Chat بدلًا من واجهة مساحة العمل، مع الإبقاء على جلستك. أدخل رقم طلب دمج (PR) في Rocket.Chat (يُسحب من ghcr.io) أو عنوان URL لحزمة مُقدَّمة.",
"placeholder": "42364 أو http://127.0.0.1:4173/",
"load": "تحميل",
"restore": "استعادة واجهة الخادم",
"active": "نشطة في مساحة العمل هذه: {{- label}}",
"loading": "جارٍ التنزيل والتطبيق…",
"failed": "تعذّر التحميل: {{- message}}",
"cancelled": "تم الإلغاء.",
"inactive": "تُستخدم واجهة الخادم."
}
},
"sections": {
"uiPreview": "معاينة واجهة الويب"
}
},
"serverInfo": {
Expand Down Expand Up @@ -62,7 +77,8 @@
},
"menus": {
"simulateDisconnected": "محاكاة قطع الاتصال",
"resetWindowBounds": "إعادة تعيين أحجام النوافذ ومواضعها"
"resetWindowBounds": "إعادة تعيين أحجام النوافذ ومواضعها",
"restoreServerUi": "استعادة واجهة الخادم"
},
"tray": {
"presence": {
Expand All @@ -75,5 +91,19 @@
"signIn": "تسجيل الدخول إلى {{- workspace}}",
"addWorkspace": "إضافة مساحة عمل"
}
},
"dialog": {
"uiOverride": {
"title": "تحميل معاينة الواجهة",
"message": "هل تريد تحميل واجهة ويب مختلفة لـ \"{{- host}}\"؟",
"detail": "سيتم تحميل الواجهة من {{- bundle}} وستعمل بجلستك على هذا الخادم. تابع فقط إذا كنت تثق بهذا الإصدار. استخدم View > استعادة واجهة الخادم أو أعد تشغيل التطبيق للرجوع.",
"load": "تحميل الواجهة",
"cancel": "إلغاء",
"developerModeRequired": "فعّل Help > Developer Mode لتحميل معاينات الواجهة.",
"failed": "تعذّر تحميل معاينة الواجهة."
}
},
"tabBar": {
"uiPreview": "معاينة الواجهة: {{- label}}"
}
}
30 changes: 28 additions & 2 deletions src/i18n/de-DE.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@
"answerCall": "Anrufe entgegennehmen",
"recordMessage": "Nachrichten aufnehmen"
}
},
"uiOverride": {
"title": "UI-Vorschau laden",
"message": "Eine andere Web-Oberfläche für „{{- host}}“ laden?",
"detail": "Die Oberfläche wird von {{- bundle}} geladen und läuft mit deiner Sitzung auf diesem Server. Fahre nur fort, wenn du diesem Build vertraust. Nutze Darstellung > Server-UI wiederherstellen oder starte die App neu, um zurückzukehren.",
"load": "UI laden",
"cancel": "Abbrechen",
"developerModeRequired": "Aktiviere Hilfe > Entwicklermodus, um UI-Vorschauen zu laden.",
"failed": "Die UI-Vorschau konnte nicht geladen werden."
}
},
"documentViewer": {
Expand Down Expand Up @@ -294,7 +303,22 @@
"auto": "System folgen",
"light": "Hell",
"dark": "Dunkel"
},
"uiPreview": {
"title": "Einen Web-UI-Build laden",
"description": "Führt einen Build des Rocket.Chat-Webclients anstelle der eigenen Oberfläche eines Workspaces aus und behält deine Sitzung bei. Gib eine Rocket.Chat-PR-Nummer (von ghcr.io bezogen) oder die URL eines bereitgestellten Bundles ein.",
"placeholder": "42364 oder http://127.0.0.1:4173/",
"load": "Laden",
"restore": "Server-UI wiederherstellen",
"active": "Aktiv in diesem Workspace: {{- label}}",
"loading": "Wird heruntergeladen und angewendet…",
"failed": "Laden fehlgeschlagen: {{- message}}",
"cancelled": "Abgebrochen.",
"inactive": "Die UI des Servers wird verwendet."
}
},
"sections": {
"uiPreview": "Web-UI-Vorschau"
}
},
"error": {
Expand Down Expand Up @@ -354,7 +378,8 @@
"windowMenu": "&Fenster",
"zoomIn": "Vergrößern",
"zoomOut": "Verkleinern",
"simulateDisconnected": "Verbindungsabbruch simulieren"
"simulateDisconnected": "Verbindungsabbruch simulieren",
"restoreServerUi": "Server-UI wiederherstellen"
},
"loadingError": {
"title": "Server konnte nicht geladen werden",
Expand Down Expand Up @@ -429,7 +454,8 @@
"canceled": "Abgebrochen",
"failed": "Fehlgeschlagen",
"dismiss": "Schließen"
}
},
"uiPreview": "UI-Vorschau: {{- label}}"
},
"touchBar": {
"formatting": "Formatierung",
Expand Down
30 changes: 27 additions & 3 deletions src/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,15 @@
"message": "Remove the stored decision for \"{{- domain}}\"? The next visit will ask you again.",
"yes": "Remove",
"cancel": "Cancel"
},
"uiOverride": {
"title": "Load UI preview",
"message": "Load a different web UI for \"{{- host}}\"?",
"detail": "The UI will be loaded from {{- bundle}} and will run with your session on this server. Only continue if you trust this build. Use View > Restore server UI or restart the app to go back.",
"load": "Load UI",
"cancel": "Cancel",
"developerModeRequired": "Enable Help > Developer Mode to load UI previews.",
"failed": "The UI preview could not be loaded."
}
},
"documentViewer": {
Expand Down Expand Up @@ -326,7 +335,8 @@
"logging": "Logging",
"telephony": "Telephony",
"videoCalls": "Video calls",
"advanced": "Advanced"
"advanced": "Advanced",
"uiPreview": "Web UI preview"
},
"options": {
"report": {
Expand Down Expand Up @@ -475,6 +485,18 @@
"e2ePdfPreviewSizeLimit": {
"title": "PDF preview size limit in encrypted rooms (MB)",
"description": "Encrypted files are loaded into memory for previews. Files larger than this limit will be downloaded directly."
},
"uiPreview": {
"title": "Load a web UI build",
"description": "Run a Rocket.Chat web client build in place of a workspace's own UI, keeping your session. Enter a Rocket.Chat PR number (pulled from ghcr.io) or the URL of a served bundle.",
"placeholder": "42364 or http://127.0.0.1:4173/",
"load": "Load",
"restore": "Restore server UI",
"active": "Active on this workspace: {{- label}}",
"loading": "Downloading and applying…",
"failed": "Could not load: {{- message}}",
"cancelled": "Cancelled.",
"inactive": "Using the server's UI."
}
},
"appearance": "Appearance",
Expand Down Expand Up @@ -555,7 +577,8 @@
"viewMenu": "&View",
"windowMenu": "&Window",
"zoomIn": "Zoom in",
"zoomOut": "Zoom out"
"zoomOut": "Zoom out",
"restoreServerUi": "Restore server UI"
},
"loadingError": {
"title": "Server Failed to Load",
Expand Down Expand Up @@ -649,7 +672,8 @@
"canceled": "Canceled",
"failed": "Failed",
"dismiss": "Dismiss"
}
},
"uiPreview": "UI preview: {{- label}}"
},
"touchBar": {
"formatting": "Formatting",
Expand Down
30 changes: 28 additions & 2 deletions src/i18n/es.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@
},
"supportedVersion": {
"title": "Versión de espacio de trabajo no admitida"
},
"uiOverride": {
"title": "Cargar vista previa de la UI",
"message": "¿Cargar una interfaz web diferente para \"{{- host}}\"?",
"detail": "La interfaz se cargará desde {{- bundle}} y se ejecutará con tu sesión en este servidor. Continúa solo si confías en esta compilación. Usa Ver > Restaurar la UI del servidor o reinicia la aplicación para volver.",
"load": "Cargar UI",
"cancel": "Cancelar",
"developerModeRequired": "Activa Ayuda > Modo desarrollador para cargar vistas previas de la UI.",
"failed": "No se pudo cargar la vista previa de la UI."
}
},
"documentViewer": {
Expand Down Expand Up @@ -317,7 +326,22 @@
"auto": "Seguir sistema",
"light": "Claro",
"dark": "Oscuro"
},
"uiPreview": {
"title": "Cargar una compilación de la UI web",
"description": "Ejecuta una compilación del cliente web de Rocket.Chat en lugar de la UI propia de un espacio de trabajo, manteniendo tu sesión. Introduce un número de PR de Rocket.Chat (descargado de ghcr.io) o la URL de un bundle servido.",
"placeholder": "42364 o http://127.0.0.1:4173/",
"load": "Cargar",
"restore": "Restaurar la UI del servidor",
"active": "Activa en este espacio de trabajo: {{- label}}",
"loading": "Descargando y aplicando…",
"failed": "No se pudo cargar: {{- message}}",
"cancelled": "Cancelado.",
"inactive": "Usando la UI del servidor."
}
},
"sections": {
"uiPreview": "Vista previa de la UI web"
}
},
"error": {
Expand Down Expand Up @@ -378,7 +402,8 @@
"windowMenu": "&Ventana",
"zoomIn": "Acercar",
"zoomOut": "Alejar",
"simulateDisconnected": "Simular desconexión"
"simulateDisconnected": "Simular desconexión",
"restoreServerUi": "Restaurar la UI del servidor"
},
"loadingError": {
"title": "Fallo al cargar el servidor",
Expand Down Expand Up @@ -459,7 +484,8 @@
"canceled": "Cancelada",
"failed": "Fallida",
"dismiss": "Cerrar"
}
},
"uiPreview": "Vista previa de la UI: {{- label}}"
},
"touchBar": {
"formatting": "Formato",
Expand Down
30 changes: 28 additions & 2 deletions src/i18n/fi.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,15 @@
"answerCall": "vastata puheluun",
"recordMessage": "tallentaa viestin"
}
},
"uiOverride": {
"title": "Lataa käyttöliittymän esikatselu",
"message": "Ladataanko palvelimelle \"{{- host}}\" toinen verkkokäyttöliittymä?",
"detail": "Käyttöliittymä ladataan osoitteesta {{- bundle}}, ja se toimii istunnollasi tällä palvelimella. Jatka vain, jos luotat tähän koontiversioon. Palaa takaisin valitsemalla Näytä > Palauta palvelimen käyttöliittymä tai käynnistämällä sovellus uudelleen.",
"load": "Lataa käyttöliittymä",
"cancel": "Peruuta",
"developerModeRequired": "Ota Ohje > Developer Mode käyttöön ladataksesi käyttöliittymän esikatseluja.",
"failed": "Käyttöliittymän esikatselua ei voitu ladata."
}
},
"documentViewer": {
Expand Down Expand Up @@ -292,7 +301,22 @@
"auto": "Seuraa järjestelmää",
"light": "Vaalea",
"dark": "Tumma"
},
"uiPreview": {
"title": "Lataa verkkokäyttöliittymän koontiversio",
"description": "Suorittaa Rocket.Chat-verkkoasiakkaan koontiversion työtilan oman käyttöliittymän sijaan istuntosi säilyttäen. Anna Rocket.Chatin PR-numero (haetaan ghcr.io:sta) tai tarjoillun paketin URL-osoite.",
"placeholder": "42364 tai http://127.0.0.1:4173/",
"load": "Lataa",
"restore": "Palauta palvelimen käyttöliittymä",
"active": "Käytössä tässä työtilassa: {{- label}}",
"loading": "Ladataan ja otetaan käyttöön…",
"failed": "Lataus epäonnistui: {{- message}}",
"cancelled": "Peruttu.",
"inactive": "Käytetään palvelimen käyttöliittymää."
}
},
"sections": {
"uiPreview": "Verkkokäyttöliittymän esikatselu"
}
},
"error": {
Expand Down Expand Up @@ -352,7 +376,8 @@
"windowMenu": "&Ikkuna",
"zoomIn": "Lähennä",
"zoomOut": "Loitonna",
"simulateDisconnected": "Simuloi yhteyden katkeamista"
"simulateDisconnected": "Simuloi yhteyden katkeamista",
"restoreServerUi": "Palauta palvelimen käyttöliittymä"
},
"loadingError": {
"title": "Palvelimen lataus epäonnistui",
Expand Down Expand Up @@ -427,7 +452,8 @@
"canceled": "Peruutettu",
"failed": "Epäonnistui",
"dismiss": "Sulje"
}
},
"uiPreview": "Käyttöliittymän esikatselu: {{- label}}"
},
"touchBar": {
"formatting": "Muotoilu",
Expand Down
Loading
Loading