Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
707 changes: 0 additions & 707 deletions admin/assets/index-BjzFuPMB.js

This file was deleted.

707 changes: 707 additions & 0 deletions admin/assets/index-DMt_aucS.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
/>
<script type="text/javascript" onerror="setTimeout(function(){window.location.reload()}, 5000)" src="./lib/js/socket.io.js"></script>
<title>ioBroker.web</title>
<script type="module" crossorigin src="./assets/index-BjzFuPMB.js"></script>
<script type="module" crossorigin src="./assets/index-DMt_aucS.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-Bd3GtHgn.css">
</head>
<body>
Expand Down
1 change: 1 addition & 0 deletions build/main.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export declare class WebAdapter extends Adapter {
resolveLink(link: string, instanceObj: ioBroker.InstanceObject | undefined, instancesMap: Record<string, ioBroker.InstanceObject>): string | {
[instance: `${string}.${number}`]: string;
};
getSocketPath(): string;
getInfoJs(): string;
checkUser: (userName: string | undefined, password: string | undefined, cb: (err: Error | null, result?: {
logged_in: boolean;
Expand Down
14 changes: 14 additions & 0 deletions build/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/main.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@
"loginBackgroundImage": false,
"loginOauth2": false,
"port": 8082,
"rootPath": "",
"secure": false,
"showAdminInstances": false,
"showFolderIndex": false,
Expand Down
9 changes: 9 additions & 0 deletions src-admin/src/Tabs/Additionally.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,15 @@ class Additionally extends Component<AdditionallyProps> {
helperText={I18n.t('This path will be opened if no path specified')}
/>
</div>
<div>
<TextField
variant="standard"
value={native.rootPath || ''}
onChange={e => onChange('rootPath', e.target.value)}
label={I18n.t('rootPath')}
helperText={I18n.t('rootPath_hint')}
/>
</div>
<h4>{I18n.t('Cache options')}</h4>
<div>
<TextField
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "Öffentliches Zertifikat",
"renew_certificates": "Diese Instanz für automatische Updates verwenden",
"reset_cors_settings": "CORS-Einstellungen auf Standard zurücksetzen",
"rootPath": "Root-Pfad",
"rootPath_hint": "Öffentlicher URL-Pfad-Präfix, wenn web hinter einem Reverse-Proxy betrieben wird (z.B. /web/). Wird für WebSocket-Verbindungen verwendet. Leer lassen, wenn web direkt unter der Domain erreichbar ist.",
"set_certificates": "Zertifikate wählen bzw. Zertifikate in den Systemeinstellungen (oben rechts) hinterlegen.",
"show_admin_instances": "Nicht-Web-Instanzen anzeigen",
"show_folders": "Ordnerinhalt anzeigen",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "'Public' certificate",
"renew_certificates": "Use this instance for automatic update",
"reset_cors_settings": "Set CORS settings to default",
"rootPath": "Root path",
"rootPath_hint": "Public URL path prefix when web is served behind a reverse proxy (e.g. /web/). Used for WebSocket connections. Leave empty if web is accessed at the domain root.",
"set_certificates": "Set certificates or load it first in the system settings (right top).",
"show_admin_instances": "Show non-web instances",
"show_folders": "Show folders content",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "Certificado público",
"renew_certificates": "Use esta instancia para la actualización automática",
"reset_cors_settings": "Establecer la configuración de CORS a la predeterminada",
"rootPath": "Ruta raíz",
"rootPath_hint": "Prefijo de ruta URL pública cuando web se ejecuta detrás de un proxy inverso (p. ej. /web/). Se utiliza para conexiones WebSocket. Déjelo vacío si web se accede desde la raíz del dominio.",
"set_certificates": "Establezca certificados o cárguelos primero en la configuración del sistema (arriba a la derecha).",
"show_admin_instances": "Mostrar instancias no web",
"show_folders": "Mostrar el contenido de las carpetas",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "Certificat public",
"renew_certificates": "Utilisez cette instance pour la mise à jour automatique",
"reset_cors_settings": "Définir les paramètres CORS par défaut",
"rootPath": "Chemin racine",
"rootPath_hint": "Préfixe de chemin URL public lorsque web est servi derrière un proxy inverse (p. ex. /web/). Utilisé pour les connexions WebSocket. Laisser vide si web est accessible à la racine du domaine.",
"set_certificates": "Définissez des certificats ou chargez-les d'abord dans les paramètres du système (en haut à droite).",
"show_admin_instances": "Afficher les instances non Web",
"show_folders": "Afficher le contenu des dossiers",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "Certificato pubblico",
"renew_certificates": "Utilizza questa istanza per l'aggiornamento automatico",
"reset_cors_settings": "Imposta le impostazioni CORS come predefinite",
"rootPath": "Percorso root",
"rootPath_hint": "Prefisso del percorso URL pubblico quando web è servito dietro un reverse proxy (ad es. /web/). Utilizzato per le connessioni WebSocket. Lasciare vuoto se web è accessibile dalla radice del dominio.",
"set_certificates": "Imposta i certificati o caricali prima nelle impostazioni di sistema (in alto a destra).",
"show_admin_instances": "Mostra istanze non web",
"show_folders": "Mostra il contenuto delle cartelle",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "Openbaar certificaat",
"renew_certificates": "Gebruik deze instantie voor automatische update",
"reset_cors_settings": "CORS-instellingen instellen op standaard",
"rootPath": "Root-pad",
"rootPath_hint": "Openbaar URL-padprefix wanneer web achter een reverse proxy draait (bijv. /web/). Wordt gebruikt voor WebSocket-verbindingen. Laat leeg als web direct op het domein wordt benaderd.",
"set_certificates": "Stel certificaten in of laad het eerst in de systeeminstellingen (rechtsboven).",
"show_admin_instances": "Niet-webinstanties weergeven",
"show_folders": "Inhoud van mappen weergeven",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "Certyfikat publiczny",
"renew_certificates": "Użyj tej instancji do automatycznej aktualizacji",
"reset_cors_settings": "Przywróć ustawienia CORS do domyślnych",
"rootPath": "Ścieżka root",
"rootPath_hint": "Publiczny prefiks ścieżki URL, gdy web działa za reverse proxy (np. /web/). Używany dla połączeń WebSocket. Pozostaw puste, jeśli web jest dostępny w korzeniu domeny.",
"set_certificates": "Ustaw certyfikaty lub załaduj najpierw w ustawieniach systemu (prawy górny).",
"show_admin_instances": "Pokaż wystąpienia niebędące stroną internetową",
"show_folders": "Pokaż zawartość folderów",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "Certificado público",
"renew_certificates": "Use esta instância para atualização automática",
"reset_cors_settings": "Definir as configurações do CORS para o padrão",
"rootPath": "Caminho raiz",
"rootPath_hint": "Prefixo de caminho URL público quando web é servido atrás de um proxy reverso (ex.: /web/). Usado para conexões WebSocket. Deixe vazio se web é acessado na raiz do domínio.",
"set_certificates": "Defina certificados ou carregue primeiro nas configurações do sistema (parte superior direita).",
"show_admin_instances": "Mostrar instâncias não-web",
"show_folders": "Mostrar o conteúdo das pastas",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "'Public' сертификат",
"renew_certificates": "Обновлять сертификаты в этом экземпляре",
"reset_cors_settings": "Установить настройки CORS по умолчанию",
"rootPath": "Корневой путь",
"rootPath_hint": "Публичный префикс URL-пути, когда web работает за обратным прокси (например, /web/). Используется для WebSocket-соединений. Оставьте пустым, если web доступен в корне домена.",
"set_certificates": "Нужно выбрать сертификаты или сначала загрузить их в системных настройках.",
"show_admin_instances": "Показать не веб-примеры",
"show_folders": "Показать содержимое папок",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "«Публічний» сертифікат",
"renew_certificates": "Використовуйте цей екземпляр для автоматичного оновлення",
"reset_cors_settings": "Установіть налаштування CORS за замовчуванням",
"rootPath": "Кореневий шлях",
"rootPath_hint": "Публічний префікс URL-шляху, коли web працює за зворотним проксі (наприклад, /web/). Використовується для WebSocket-з'єднань. Залиште порожнім, якщо web доступний у корені домену.",
"set_certificates": "Спершу встановіть сертифікати або завантажте їх у налаштуваннях системи (справа вгорі).",
"show_admin_instances": "Показати невеб-екземпляри",
"show_folders": "Показати вміст папок",
Expand Down
2 changes: 2 additions & 0 deletions src-admin/src/i18n/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@
"public_certificate": "公共证书",
"renew_certificates": "自动更新Let's Encrypt证书",
"reset_cors_settings": "将 CORS 设置设置为默认值",
"rootPath": "根路径",
"rootPath_hint": "当 web 在反向代理后运行时使用的公共 URL 路径前缀(例如 /web/)。用于 WebSocket 连接。如果 web 在域名根目录下访问,请留空。",
"set_certificates": "首先在系统设置中(右上角)设置或加载证书。",
"show_admin_instances": "显示非 Web 实例",
"show_folders": "显示文件夹内容",
Expand Down
104 changes: 52 additions & 52 deletions src-login/build/index.html

Large diffs are not rendered by default.

277 changes: 277 additions & 0 deletions src-www/build/assets/index-DqtpjWjP.js

Large diffs are not rendered by default.

277 changes: 0 additions & 277 deletions src-www/build/assets/index-O6PSQUbV.js

This file was deleted.

2 changes: 1 addition & 1 deletion src-www/build/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
window.loginLanguage = lang;
}
</script>
<script type="module" crossorigin src="./assets/index-O6PSQUbV.js"></script>
<script type="module" crossorigin src="./assets/index-DqtpjWjP.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-orw50gLe.css">
</head>
<body>
Expand Down
15 changes: 15 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1120,9 +1120,24 @@ export class WebAdapter extends Adapter {
return result || link;
}

getSocketPath(): string {
let rootPath = (this.config.rootPath || '').trim();
if (!rootPath || rootPath === '/') {
return '';
}
if (!rootPath.startsWith('/')) {
rootPath = `/${rootPath}`;
}
if (!rootPath.endsWith('/')) {
rootPath += '/';
}
return rootPath;
}

getInfoJs(): string {
const result = [
`var socketUrl = "${this.socketUrl}";`,
`var socketPath = "${this.getSocketPath()}";`,
`var socketSession = "";`,
Comment on lines 1139 to 1141

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, also got this recommendation.
I followed the existing pattern of socketUrl.

Not sure, but if the extra stringify should be added, it should be added for both (like copilot suggests)

`window._authIoBroker = ${this.config.auth};`,
`window.sysLang = "${this.lang}";`,
Expand Down
1 change: 1 addition & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export interface WebAdapterConfig {
loginBackgroundImage: boolean;
loginOauth2: boolean;
port: number | string;
rootPath: string;
secure: boolean;
showFolderIndex: boolean;
socketio: `system.adapter.${string}.${number}` | '';
Expand Down
277 changes: 277 additions & 0 deletions www/assets/index-DqtpjWjP.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
window.loginLanguage = lang;
}
</script>
<script type="module" crossorigin src="./assets/index-O6PSQUbV.js"></script>
<script type="module" crossorigin src="./assets/index-DqtpjWjP.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-orw50gLe.css">
</head>
<body>
Expand Down
104 changes: 52 additions & 52 deletions www/login/index.html

Large diffs are not rendered by default.

Loading