From 7049e095709d2fc77e7585207e8c83c5170f72f9 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sat, 20 Mar 2021 12:29:34 +0800 Subject: [PATCH] Add error handling to face page. --- web/src/auth/Face.js | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/web/src/auth/Face.js b/web/src/auth/Face.js index ff41ecd0..44865ebb 100644 --- a/web/src/auth/Face.js +++ b/web/src/auth/Face.js @@ -13,7 +13,7 @@ // limitations under the License. import React from "react"; -import {Alert, Button, Checkbox, Col, Form, Input, Row} from "antd"; +import {Alert, Button, Checkbox, Col, Form, Input, Result, Row} from "antd"; import {LockOutlined, UserOutlined} from "@ant-design/icons"; import * as AuthBackend from "./AuthBackend"; import * as Provider from "./Provider"; @@ -98,12 +98,12 @@ class Face extends React.Component { }); }; - renderForm(application) { + renderMessage() { if (this.state.msg !== null) { return (
) + } else { + return null; + } + } + + renderMessageLarge() { + if (this.state.msg !== null) { + return ( +
+ + Details + , + , + ]} + > + +
+ ) + } else { + return null; + } + } + + renderForm(application) { + if (this.state.msg !== null) { + return this.renderMessage() } return ( @@ -215,7 +246,7 @@ class Face extends React.Component { render() { const application = this.getApplicationObj(); if (application === null) { - return null; + return this.renderMessageLarge(); } return (