import React from "react"; import { Button } from "../control/button"; import { Input } from "../control/input"; import { config } from "../../config"; import { getIcon } from "../display/icon"; import { makePostBody } from "../../libs/utils"; import { styleButtonLabel } from "./info_bar"; export const classLogin = "auth-pane-login"; export const classLogout = "auth-pane-logout"; const IconSignIn = getIcon("signIn"); const IconSignOut = getIcon("signOut"); const IconAngRight = getIcon("angRight"); export class AuthPane extends React.PureComponent { constructor(props) { super(props); this.state = { adminId: "", adminPwd: "" }; } onLogin = e => { e.preventDefault(); this.props.onLogin( this.props.serverAddr, this.state.adminId, this.state.adminPwd ); }; onLogout = () => { this.props.onLogout(this.props.serverAddr); }; onChangeAdminId = adminId => { this.setState({ adminId }); }; onChangeAdminPwd = adminPwd => { this.setState({ adminPwd }); }; render() { if (this.props.isLogin) { return (