Skip to content

Commit

Permalink
style(octra): improved server offline message
Browse files Browse the repository at this point in the history
  • Loading branch information
julianpoemp committed Oct 14, 2024
1 parent 26300ae commit 7c82d1b
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 10 deletions.
12 changes: 8 additions & 4 deletions apps/octra/src/app/core/pages/login/login.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ <h4>{{ 'login.online mode' | transloco }}</h4>
</div>
<ng-template #showServerOffline>
<div
class="text-center justify-content-center d-flex flex-column flex-fill h-100 bg-warning p-3 opacity-75"
class="text-center justify-content-center d-flex flex-column flex-fill h-100 p-3 opacity-75"
>
{{ 'login.api not available' | transloco }}
<i class="bi bi-exclamation-triangle-fill text-warning fs-1"></i>
<div [innerHTML]="'login.api not available' | transloco : {
email_link: email_link
}">
</div>
</div>
</ng-template>
<br />
Expand All @@ -68,8 +72,8 @@ <h4>{{ 'login.online mode' | transloco }}</h4>
<div class="card login-card position-relative" #localmode>
<p style="position: absolute; top: 0; right: 0; text-align: right; margin-top:10px; margin-right:10px;">
<a (click)="startDemo()" class="link pointer">{{
'login.demo' | transloco
}}</a>
'login.demo' | transloco
}}</a>
</p>
<div class="card-body">
<section>
Expand Down
16 changes: 16 additions & 0 deletions apps/octra/src/app/core/pages/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export class LoginComponent
@ViewChild('localmode', { static: true }) localmode!: ElementRef;
@ViewChild('onlinemode', { static: true }) onlinemode!: ElementRef;

email_link = '';

state: {
online: {
apiStatus: 'init' | 'available' | 'unavailable';
Expand Down Expand Up @@ -91,6 +93,20 @@ export class LoginComponent
public authStoreService: AuthenticationStoreService
) {
super();

const subject = 'Octra Server is offline';
const body = `Hello,
I just want to let you know, that the OCTRA server is currently offline.
Best,
an OCTRA user
`;
const url = `mailto:octra@phonetik.uni-muenchen.de?subject=${encodeURI(
subject
)}&body=${encodeURI(body)}`;

this.email_link = `<br/><a href="${url}">octra@phonetik.uni-muenchen.de</a>`;
}

onOfflineSubmit = (removeData: boolean) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/octra/src/assets/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
"simple editor": "Dictaphone Editor"
},
"login": {
"api not available": "Der Server ist aktuell nicht erreichbar. Bitte versuche es später erneut. Sollte sich das auch nach 4 Stunden nicht ändern, sende uns bitte eine Nachricht über das Feedback Formular.",
"api not available": "Der Server ist aktuell nicht erreichbar. Bitte versuche es später erneut. Sollte diese Fehlermeldung nach 15 Minuten weiterhin sichtbar sein, schreibe bitte eine E-Mail an {{email_link}}.",
"demo": "Öffne Demo",
"last used": "zuletzt genutzt",
"local and remove": "Daten des online Modus löschen & weiter",
Expand Down
2 changes: 1 addition & 1 deletion apps/octra/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
"simple editor": "Dictaphone Editor"
},
"login": {
"api not available": "The server is currently not available. Please try it again later. If this message is still visible after 4 hours please send us a message via the feedback form.",
"api not available": "The server is currently unavailable. Please try again later. If this error message is still visible after 15 minutes, please send an e-mail to {{email_link}}.",
"demo": "Open demo",
"last used": "recently used",
"local and remove": "Remove online mode data & continue",
Expand Down
2 changes: 1 addition & 1 deletion apps/octra/src/assets/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"simple editor": "Editor del Dittafono"
},
"login": {
"api not available": "Il server non è al momento disponibile. Per favore, prova di nuovo più tardi. Se questo messaggio appare ancora dopo 4 ore invia una segnalazione tramite il modulo feedback.",
"api not available": "",
"demo": "Clicca qui per usare OCTRA su un file audio di default (demo)",
"last used": "usato di recente",
"local and remove": "Rimuovi dati della modalità online & continua",
Expand Down
2 changes: 1 addition & 1 deletion apps/octra/src/assets/i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"simple editor": "딕터폰 편집기"
},
"login": {
"api not available": "서버를 현재 사용할 수 없습니다. 나중에 다시 시도하십시오. 4시간 후에도 이 메시지가 계속 보인다면 피드백 양식을 통해 메시지를 보내 주십시오.",
"api not available": "",
"demo": "기본 오디오 파일(데모)에서 OCTRA를 사용하려면 여기를 클릭하십시오.",
"last used": "최근에 사용됨",
"local and remove": "온라인 모드 데이터 제거 후 계속 진행\t",
Expand Down
2 changes: 1 addition & 1 deletion apps/octra/src/assets/i18n/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"simple editor": "Dictafoon-editor"
},
"login": {
"api not available": "De server is momenteel niet beschikbaar. Probeer het later nog eens. Als dit bericht na 4 uur nog steeds zichtbaar is, stuur ons dan een bericht via het feedbackformulier.",
"api not available": "",
"demo": "Klik hier om OCTRA te gebruiken op een standaard audiobestand (demo)",
"last used": "laatst gebruikt",
"local and remove": "Gegevens online modus verwijderen & doorgaan",
Expand Down
2 changes: 1 addition & 1 deletion apps/octra/src/assets/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
"simple editor": "听写式编辑器"
},
"login": {
"api not available": "服务器暂时不可用。请稍后再试。如果服务器不可用超过了4小时,请使用反馈表格告知我们。",
"api not available": "",
"demo": "点击此处使用OCTRO的默认音频(演示)",
"last used": "最近使用",
"local and remove": "移除在线模式的数据并且继续",
Expand Down

0 comments on commit 7c82d1b

Please sign in to comment.