diff --git a/web/projects/shared/src/i18n/dictionaries/de.ts b/web/projects/shared/src/i18n/dictionaries/de.ts index 046d1ff9a..13c47c42d 100644 --- a/web/projects/shared/src/i18n/dictionaries/de.ts +++ b/web/projects/shared/src/i18n/dictionaries/de.ts @@ -704,4 +704,5 @@ export default { 774: 'Der Portstatus kann nicht ermittelt werden, solange der Dienst nicht läuft', 775: 'Diese Adresse funktioniert nicht aus Ihrem lokalen Netzwerk aufgrund einer Router-Hairpinning-Einschränkung', 776: 'Aktion nicht gefunden', + 777: 'Diese Domain wird auch gelten für', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/en.ts b/web/projects/shared/src/i18n/dictionaries/en.ts index 4e16b3f7b..b5571a5b8 100644 --- a/web/projects/shared/src/i18n/dictionaries/en.ts +++ b/web/projects/shared/src/i18n/dictionaries/en.ts @@ -704,4 +704,5 @@ export const ENGLISH: Record = { 'Port status cannot be determined while service is not running': 774, 'This address will not work from your local network due to a router hairpinning limitation': 775, 'Action not found': 776, + 'This domain will also apply to': 777, } diff --git a/web/projects/shared/src/i18n/dictionaries/es.ts b/web/projects/shared/src/i18n/dictionaries/es.ts index 2e98c2fd4..ca7fa0343 100644 --- a/web/projects/shared/src/i18n/dictionaries/es.ts +++ b/web/projects/shared/src/i18n/dictionaries/es.ts @@ -704,4 +704,5 @@ export default { 774: 'El estado del puerto no se puede determinar mientras el servicio no está en ejecución', 775: 'Esta dirección no funcionará desde tu red local debido a una limitación de hairpinning del router', 776: 'Acción no encontrada', + 777: 'Este dominio también se aplicará a', } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/fr.ts b/web/projects/shared/src/i18n/dictionaries/fr.ts index 6b5db3b09..46d18b709 100644 --- a/web/projects/shared/src/i18n/dictionaries/fr.ts +++ b/web/projects/shared/src/i18n/dictionaries/fr.ts @@ -704,4 +704,5 @@ export default { 774: "L'état du port ne peut pas être déterminé tant que le service n'est pas en cours d'exécution", 775: "Cette adresse ne fonctionnera pas depuis votre réseau local en raison d'une limitation de hairpinning du routeur", 776: 'Action introuvable', + 777: "Ce domaine s'appliquera également à", } satisfies i18n diff --git a/web/projects/shared/src/i18n/dictionaries/pl.ts b/web/projects/shared/src/i18n/dictionaries/pl.ts index e5a43ef7f..2a4854520 100644 --- a/web/projects/shared/src/i18n/dictionaries/pl.ts +++ b/web/projects/shared/src/i18n/dictionaries/pl.ts @@ -704,4 +704,5 @@ export default { 774: 'Status portu nie może być określony, gdy usługa nie jest uruchomiona', 775: 'Ten adres nie będzie działać z Twojej sieci lokalnej z powodu ograniczenia hairpinning routera', 776: 'Nie znaleziono akcji', + 777: 'Ta domena będzie również dotyczyć', } satisfies i18n diff --git a/web/projects/ui/src/app/routes/portal/components/interfaces/addresses/addresses.component.ts b/web/projects/ui/src/app/routes/portal/components/interfaces/addresses/addresses.component.ts index 64770362d..3cabcc0aa 100644 --- a/web/projects/ui/src/app/routes/portal/components/interfaces/addresses/addresses.component.ts +++ b/web/projects/ui/src/app/routes/portal/components/interfaces/addresses/addresses.component.ts @@ -132,6 +132,7 @@ export class InterfaceAddressesComponent { }), }), ), + note: await this.getSharedHostNote(), buttons: [ { text: this.i18n.transform('Save')!, @@ -185,32 +186,12 @@ export class InterfaceAddressesComponent { : {}), }) - let note = '' - const pkgId = this.packageId() - if (pkgId) { - const pkg = await firstValueFrom( - this.patch.watch$('packageData', pkgId), - ) - if (pkg) { - const hostId = iface.addressInfo.hostId - const otherNames = Object.values(pkg.serviceInterfaces) - .filter( - si => - si.addressInfo.hostId === hostId && si.id !== iface.id, - ) - .map(si => si.name) - if (otherNames.length) { - note = `This domain also applies to ${otherNames.join(', ')}` - } - } - } - this.formDialog.open(FormComponent, { label: 'Add public domain', size: 's', data: { spec: await configBuilderToSpec(addSpec), - note, + note: await this.getSharedHostNote(), buttons: [ { text: this.i18n.transform('Save')!, @@ -254,6 +235,28 @@ export class InterfaceAddressesComponent { } } + private async getSharedHostNote(): Promise { + const iface = this.value() + const pkgId = this.packageId() + if (!iface || !pkgId) return '' + + const pkg = await firstValueFrom( + this.patch.watch$('packageData', pkgId), + ) + if (!pkg) return '' + + const hostId = iface.addressInfo.hostId + const otherNames = Object.values(pkg.serviceInterfaces) + .filter( + si => si.addressInfo.hostId === hostId && si.id !== iface.id, + ) + .map(si => si.name) + + if (!otherNames.length) return '' + + return `${this.i18n.transform('This domain will also apply to')} ${otherNames.join(', ')}` + } + private async savePublicDomain( fqdn: string, authority?: 'local' | string,