2021-09-13 18:33:13 +02:00
|
|
|
/*
|
|
|
|
This file is part of GNU Taler
|
2022-06-06 17:05:26 +02:00
|
|
|
(C) 2022 Taler Systems S.A.
|
2021-09-13 18:33:13 +02:00
|
|
|
|
|
|
|
GNU Taler is free software; you can redistribute it and/or modify it under the
|
|
|
|
terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; either version 3, or (at your option) any later version.
|
|
|
|
|
|
|
|
GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
|
|
|
A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
2022-03-14 19:20:32 +01:00
|
|
|
import { WalletDiagnostics } from "@gnu-taler/taler-util";
|
2021-11-16 17:59:53 +01:00
|
|
|
import { Fragment, h, VNode } from "preact";
|
2022-03-29 04:41:07 +02:00
|
|
|
import { useTranslationContext } from "../context/translation.js";
|
2021-06-16 22:17:12 +02:00
|
|
|
|
2021-08-13 23:04:05 +02:00
|
|
|
interface Props {
|
|
|
|
timedOut: boolean;
|
2021-11-15 15:18:58 +01:00
|
|
|
diagnostics: WalletDiagnostics | undefined;
|
2021-08-13 23:04:05 +02:00
|
|
|
}
|
2021-06-16 22:17:12 +02:00
|
|
|
|
2021-11-16 17:59:53 +01:00
|
|
|
export function Diagnostics({ timedOut, diagnostics }: Props): VNode {
|
2022-03-14 19:20:32 +01:00
|
|
|
const { i18n } = useTranslationContext();
|
2021-06-16 22:17:12 +02:00
|
|
|
if (timedOut) {
|
2022-02-23 19:18:37 +01:00
|
|
|
return (
|
|
|
|
<p>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
Diagnostics timed out. Could not talk to the wallet backend.
|
2022-02-23 19:44:14 +01:00
|
|
|
</i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
</p>
|
|
|
|
);
|
2021-06-16 22:17:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (diagnostics) {
|
|
|
|
if (diagnostics.errors.length === 0) {
|
2021-11-16 17:59:53 +01:00
|
|
|
return <Fragment />;
|
2021-06-16 22:17:12 +02:00
|
|
|
}
|
2021-11-16 17:59:53 +01:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
style={{
|
|
|
|
borderLeft: "0.5em solid red",
|
|
|
|
paddingLeft: "1em",
|
|
|
|
paddingTop: "0.2em",
|
|
|
|
paddingBottom: "0.2em",
|
|
|
|
}}
|
|
|
|
>
|
2022-02-23 19:18:37 +01:00
|
|
|
<p>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>Problems detected:</i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
</p>
|
2021-11-16 17:59:53 +01:00
|
|
|
<ol>
|
|
|
|
{diagnostics.errors.map((errMsg) => (
|
|
|
|
<li key={errMsg}>{errMsg}</li>
|
|
|
|
))}
|
|
|
|
</ol>
|
|
|
|
{diagnostics.firefoxIdbProblem ? (
|
|
|
|
<p>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
Please check in your <code>about:config</code> settings that you
|
|
|
|
have IndexedDB enabled (check the preference name{" "}
|
|
|
|
<code>dom.indexedDB.enabled</code>).
|
2022-02-23 19:44:14 +01:00
|
|
|
</i18n.Translate>
|
2021-11-16 17:59:53 +01:00
|
|
|
</p>
|
|
|
|
) : null}
|
|
|
|
{diagnostics.dbOutdated ? (
|
|
|
|
<p>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
Your wallet database is outdated. Currently automatic migration is
|
2022-03-23 14:50:12 +01:00
|
|
|
not supported. Please go <i18n.Translate>here</i18n.Translate>
|
2022-02-23 19:18:37 +01:00
|
|
|
to reset the wallet database.
|
2022-02-23 19:44:14 +01:00
|
|
|
</i18n.Translate>
|
2021-11-16 17:59:53 +01:00
|
|
|
</p>
|
|
|
|
) : null}
|
|
|
|
</div>
|
|
|
|
);
|
2021-06-16 22:17:12 +02:00
|
|
|
}
|
|
|
|
|
2022-02-23 19:18:37 +01:00
|
|
|
return (
|
|
|
|
<p>
|
2022-02-23 19:44:14 +01:00
|
|
|
<i18n.Translate>Running diagnostics</i18n.Translate> ...
|
2022-02-23 19:18:37 +01:00
|
|
|
</p>
|
|
|
|
);
|
2021-06-16 22:17:12 +02:00
|
|
|
}
|