tachtler:haproxy_archlinux
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
tachtler:haproxy_archlinux [2023/01/21 17:59] – [/etc/systemd/system/var-lib-haproxy-dev-log.mount] klaus | tachtler:haproxy_archlinux [2023/12/28 15:21] (aktuell) – [Maintenance-Konfiguration: /etc/haproxy/maintenance.htm] klaus | ||
---|---|---|---|
Zeile 1492: | Zeile 1492: | ||
Content-Type: | Content-Type: | ||
- | < | + | < |
- | <title> | + | <html lang=" |
< | < | ||
<meta charset=" | <meta charset=" | ||
<meta http-equiv=" | <meta http-equiv=" | ||
<meta name=" | <meta name=" | ||
+ | <title data-i18n-key=" | ||
+ | < | ||
+ | html, body { padding: 0; margin: 0; width: 100%; height: 100%; } | ||
+ | * {box-sizing: | ||
+ | body { text-align: center; padding: 0; background: #d6433b; color: #fff; font-family: | ||
+ | h1 { font-size: 24px; font-weight: | ||
+ | body { font-family: | ||
+ | article { display: block; width: 700px; padding: 50px; margin: 0 auto; } | ||
+ | b { color: #fff; font-weight: | ||
+ | svg { width: 75px; margin-top: 1em; } | ||
+ | </ | ||
</ | </ | ||
- | <style> | + | <body> |
- | | + | |
- | * {box-sizing: | + | <div class=" |
- | body { text-align: center; padding: 0; background: #d6433b; color: #fff; font-family: | + | <svg xmlns=" |
- | h1 { font-size: 24px; font-weight: | + | < |
- | body { font-family: | + | <p data-i18n-key=" |
- | | + | </div> |
- | b { color: #fff; font-weight: | + | |
- | svg { width: 75px; margin-top: 1em; } | + | <script> |
- | </style> | + | // The locale our app first shows |
- | <article> | + | const defaultLocale = " |
- | <svg xmlns=" | + | const supportedLocales = [" |
- | <h1>We& | + | // Check if locale ist supported |
- | < | + | function isSupported(locale) { |
- | | + | |
- | <h1>Wir sind bald wieder da!</h1> | + | } |
- | <div> | + | // Retrieve the first locale we support from the given |
- | | + | // array, or return our default locale |
- | </div> | + | function supportedOrDefault(locales) { |
- | </article> | + | return locales.find(isSupported) || defaultLocale; |
+ | } | ||
+ | // Detect browser locale | ||
+ | function browserLocales(languageCodeOnly = false) { | ||
+ | return navigator.languages.map((locale) => | ||
+ | languageCodeOnly ? locale.split(" | ||
+ | ); | ||
+ | } | ||
+ | // Translations | ||
+ | const translations = { | ||
+ | // German translations | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | // English translations | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | }; | ||
+ | // When the page content is ready | ||
+ | document.addEventListener(" | ||
+ | document | ||
+ | // Find all elements that have the key attribute | ||
+ | .querySelectorAll(" | ||
+ | .forEach(translateElement); | ||
+ | }); | ||
+ | // Replace the inner text of the given HTML element | ||
+ | // with the translation in the active locale, | ||
+ | // corresponding to the element' | ||
+ | function translateElement(element) { | ||
+ | const key = element.getAttribute(" | ||
+ | const initialLocale = supportedOrDefault(browserLocales(true)); | ||
+ | const translation = translations[initialLocale][key]; | ||
+ | element.innerHTML = translation; | ||
+ | } | ||
+ | </script> | ||
+ | </body> | ||
+ | </html> | ||
</ | </ | ||
Zeile 1762: | Zeile 1814: | ||
code: 200, check duration: 8ms, status: 3/3 UP | code: 200, check duration: 8ms, status: 3/3 UP | ||
</ | </ | ||
- | |||
- | |||
- | |||
- | FIXME **Hier geht es weiter... / To be continued ...** | ||
tachtler/haproxy_archlinux.1674320373.txt.gz · Zuletzt geändert: 2023/01/21 17:59 von klaus