mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
restart after server name change
This commit is contained in:
@@ -680,7 +680,7 @@ export default {
|
||||
755: 'Schnittstelle(n)',
|
||||
756: 'Keine Portweiterleitungsregeln',
|
||||
757: 'Portweiterleitungsregeln am Gateway erforderlich',
|
||||
763: 'Sie sind derzeit über Ihre .local-Adresse verbunden. Das Ändern des Hostnamens erfordert einen Wechsel zur neuen .local-Adresse.',
|
||||
763: 'Sie sind derzeit über Ihre .local-Adresse verbunden. Das Ändern des Hostnamens erfordert einen Wechsel zur neuen .local-Adresse. Ein Neustart des Servers ist ebenfalls erforderlich.',
|
||||
764: 'Hostname geändert',
|
||||
765: 'Neue Adresse öffnen',
|
||||
766: 'Ihr Server ist jetzt erreichbar unter',
|
||||
@@ -722,4 +722,6 @@ export default {
|
||||
804: 'Ich habe ein Backup meiner Daten',
|
||||
805: 'Öffentliche Domain hinzufügen',
|
||||
806: 'Ergebnis',
|
||||
807: 'Nach dem Öffnen der neuen Adresse werden Sie zum Neustart aufgefordert.',
|
||||
808: 'Ein Neustart ist erforderlich, damit die Dienstschnittstellen den neuen Hostnamen verwenden.',
|
||||
} satisfies i18n
|
||||
|
||||
@@ -680,7 +680,7 @@ export const ENGLISH: Record<string, number> = {
|
||||
'Interface(s)': 755,
|
||||
'No port forwarding rules': 756,
|
||||
'Port forwarding rules required on gateway': 757,
|
||||
'You are currently connected via your .local address. Changing the hostname will require you to switch to the new .local address.': 763,
|
||||
'You are currently connected via your .local address. Changing the hostname will require you to switch to the new .local address. A server restart will also be needed.': 763,
|
||||
'Hostname Changed': 764,
|
||||
'Open new address': 765,
|
||||
'Your server is now reachable at': 766,
|
||||
@@ -723,4 +723,6 @@ export const ENGLISH: Record<string, number> = {
|
||||
'I have a backup of my data': 804,
|
||||
'Add Public Domain': 805,
|
||||
'Result': 806,
|
||||
'After opening the new address, you will be prompted to restart.': 807,
|
||||
'A restart is required for service interfaces to use the new hostname.': 808,
|
||||
}
|
||||
|
||||
@@ -680,7 +680,7 @@ export default {
|
||||
755: 'Interfaz/Interfaces',
|
||||
756: 'Sin reglas de redirección de puertos',
|
||||
757: 'Reglas de redirección de puertos requeridas en la puerta de enlace',
|
||||
763: 'Actualmente está conectado a través de su dirección .local. Cambiar el nombre de host requerirá que cambie a la nueva dirección .local.',
|
||||
763: 'Actualmente está conectado a través de su dirección .local. Cambiar el nombre de host requerirá que cambie a la nueva dirección .local. También será necesario reiniciar el servidor.',
|
||||
764: 'Nombre de host cambiado',
|
||||
765: 'Abrir nueva dirección',
|
||||
766: 'Su servidor ahora es accesible en',
|
||||
@@ -722,4 +722,6 @@ export default {
|
||||
804: 'Tengo una copia de seguridad de mis datos',
|
||||
805: 'Agregar dominio público',
|
||||
806: 'Resultado',
|
||||
807: 'Después de abrir la nueva dirección, se le pedirá que reinicie.',
|
||||
808: 'Se requiere un reinicio para que las interfaces de servicio utilicen el nuevo nombre de host.',
|
||||
} satisfies i18n
|
||||
|
||||
@@ -680,7 +680,7 @@ export default {
|
||||
755: 'Interface(s)',
|
||||
756: 'Aucune règle de redirection de port',
|
||||
757: 'Règles de redirection de ports requises sur la passerelle',
|
||||
763: "Vous êtes actuellement connecté via votre adresse .local. Changer le nom d'hôte nécessitera de passer à la nouvelle adresse .local.",
|
||||
763: "Vous êtes actuellement connecté via votre adresse .local. Changer le nom d'hôte nécessitera de passer à la nouvelle adresse .local. Un redémarrage du serveur sera également nécessaire.",
|
||||
764: "Nom d'hôte modifié",
|
||||
765: 'Ouvrir la nouvelle adresse',
|
||||
766: 'Votre serveur est maintenant accessible à',
|
||||
@@ -722,4 +722,6 @@ export default {
|
||||
804: "J'ai une sauvegarde de mes données",
|
||||
805: 'Ajouter un domaine public',
|
||||
806: 'Résultat',
|
||||
807: 'Après avoir ouvert la nouvelle adresse, vous serez invité à redémarrer.',
|
||||
808: "Un redémarrage est nécessaire pour que les interfaces de service utilisent le nouveau nom d'hôte.",
|
||||
} satisfies i18n
|
||||
|
||||
@@ -680,7 +680,7 @@ export default {
|
||||
755: 'Interfejs(y)',
|
||||
756: 'Brak reguł przekierowania portów',
|
||||
757: 'Reguły przekierowania portów wymagane na bramce',
|
||||
763: 'Jesteś obecnie połączony przez adres .local. Zmiana nazwy hosta będzie wymagać przełączenia na nowy adres .local.',
|
||||
763: 'Jesteś obecnie połączony przez adres .local. Zmiana nazwy hosta będzie wymagać przełączenia na nowy adres .local. Konieczne będzie również ponowne uruchomienie serwera.',
|
||||
764: 'Nazwa hosta zmieniona',
|
||||
765: 'Otwórz nowy adres',
|
||||
766: 'Twój serwer jest teraz dostępny pod adresem',
|
||||
@@ -722,4 +722,6 @@ export default {
|
||||
804: 'Mam kopię zapasową moich danych',
|
||||
805: 'Dodaj domenę publiczną',
|
||||
806: 'Wynik',
|
||||
807: 'Po otwarciu nowego adresu zostaniesz poproszony o ponowne uruchomienie.',
|
||||
808: 'Ponowne uruchomienie jest wymagane, aby interfejsy usług używały nowej nazwy hosta.',
|
||||
} satisfies i18n
|
||||
|
||||
@@ -4,10 +4,11 @@ import {
|
||||
Component,
|
||||
inject,
|
||||
INJECTOR,
|
||||
OnInit,
|
||||
} from '@angular/core'
|
||||
import { toSignal } from '@angular/core/rxjs-interop'
|
||||
import { FormsModule } from '@angular/forms'
|
||||
import { RouterLink } from '@angular/router'
|
||||
import { ActivatedRoute, Router, RouterLink } from '@angular/router'
|
||||
import { WA_WINDOW } from '@ng-web-apis/common'
|
||||
import {
|
||||
DialogService,
|
||||
@@ -277,7 +278,7 @@ import { UPDATE } from './update.component'
|
||||
TuiAnimated,
|
||||
],
|
||||
})
|
||||
export default class SystemGeneralComponent {
|
||||
export default class SystemGeneralComponent implements OnInit {
|
||||
private readonly dialogs = inject(TuiResponsiveDialogService)
|
||||
private readonly loader = inject(TuiNotificationMiddleService)
|
||||
private readonly errorService = inject(ErrorService)
|
||||
@@ -287,6 +288,20 @@ export default class SystemGeneralComponent {
|
||||
private readonly i18n = inject(i18nPipe)
|
||||
private readonly injector = inject(INJECTOR)
|
||||
private readonly win = inject(WA_WINDOW)
|
||||
private readonly route = inject(ActivatedRoute)
|
||||
private readonly router = inject(Router)
|
||||
|
||||
ngOnInit() {
|
||||
this.route.queryParams
|
||||
.pipe(filter(params => params['restart'] === 'hostname'))
|
||||
.subscribe(async () => {
|
||||
await this.router.navigate([], {
|
||||
relativeTo: this.route,
|
||||
queryParams: {},
|
||||
})
|
||||
this.promptHostnameRestart()
|
||||
})
|
||||
}
|
||||
|
||||
count = 0
|
||||
|
||||
@@ -399,7 +414,7 @@ export default class SystemGeneralComponent {
|
||||
label: 'Warning',
|
||||
data: {
|
||||
content:
|
||||
'You are currently connected via your .local address. Changing the hostname will require you to switch to the new .local address.',
|
||||
'You are currently connected via your .local address. Changing the hostname will require you to switch to the new .local address. A server restart will also be needed.',
|
||||
yes: 'Save',
|
||||
no: 'Cancel',
|
||||
},
|
||||
@@ -419,20 +434,23 @@ export default class SystemGeneralComponent {
|
||||
|
||||
if (wasLocal) {
|
||||
const { protocol, port } = this.win.location
|
||||
const newUrl = `${protocol}//${hostname}.local${port ? ':' + port : ''}`
|
||||
const portSuffix = port ? ':' + port : ''
|
||||
const newUrl = `${protocol}//${hostname}.local${portSuffix}/system/general?restart=hostname`
|
||||
|
||||
this.dialog
|
||||
.openConfirm({
|
||||
label: 'Hostname Changed',
|
||||
data: {
|
||||
content:
|
||||
`${this.i18n.transform('Your server is now reachable at')} ${hostname}.local` as i18nKey,
|
||||
`${this.i18n.transform('Your server is now reachable at')} ${hostname}.local. ${this.i18n.transform('After opening the new address, you will be prompted to restart.')}` as i18nKey,
|
||||
yes: 'Open new address',
|
||||
no: 'Dismiss',
|
||||
},
|
||||
})
|
||||
.pipe(filter(Boolean))
|
||||
.subscribe(() => this.win.open(newUrl, '_blank'))
|
||||
} else {
|
||||
this.promptHostnameRestart()
|
||||
}
|
||||
} catch (e: any) {
|
||||
this.errorService.handleError(e)
|
||||
@@ -563,6 +581,21 @@ export default class SystemGeneralComponent {
|
||||
.subscribe(() => this.restart())
|
||||
}
|
||||
|
||||
private promptHostnameRestart() {
|
||||
this.dialog
|
||||
.openConfirm({
|
||||
label: 'Restart to apply',
|
||||
data: {
|
||||
content:
|
||||
'A restart is required for service interfaces to use the new hostname.',
|
||||
yes: 'Restart now',
|
||||
no: 'Later',
|
||||
},
|
||||
})
|
||||
.pipe(filter(Boolean))
|
||||
.subscribe(() => this.restart())
|
||||
}
|
||||
|
||||
private promptLanguageRestart() {
|
||||
this.dialog
|
||||
.openConfirm({
|
||||
|
||||
Reference in New Issue
Block a user