/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import React, { useEffect, useState } from "react"; import { BrowserRouter as Router, Link, Route, Switch } from "react-router-dom"; import Button from "components/Button"; import Axios from "axios"; import Amplify, { Hub } from "aws-amplify"; import { AmplifyAuthenticator, AmplifySignIn } from "@aws-amplify/ui-react"; import { AuthState, onAuthUIStateChange } from "@aws-amplify/ui-components"; import Footer from "components/layout/footer"; import Home from "pages/home/Home"; import ServiceLog from "pages/dataInjection/serviceLog/ServiceLog"; import ServiceLogCreateChooseType from "pages/dataInjection/serviceLog/create/CreateChooseType"; import ImportOpenSearchCluster from "pages/clusters/importcluster/ImportCluster"; import CreateS3 from "pages/dataInjection/serviceLog/create/s3/CreateS3"; import CreateCloudTrail from "pages/dataInjection/serviceLog/create/cloudtrail/CreateCloudTrail"; import CreateELB from "pages/dataInjection/serviceLog/create/elb/CreateELB"; import CreateWAF from "pages/dataInjection/serviceLog/create/waf/CreateWAF"; import CreateVPCLog from "pages/dataInjection/serviceLog/create/vpc/CreateVPC"; import ESDomainList from "pages/clusters/domain/DomainList"; import ESDomainDetail from "pages/clusters/domain/DomainDetail"; import NginxForOpenSearch from "pages/clusters/domain/NginxForOpenSearch"; import CreateRDS from "pages/dataInjection/serviceLog/create/rds/CreateRDS"; import CreateCloudFront from "pages/dataInjection/serviceLog/create/cloudfront/CreateCloudFront"; import CreateLambda from "pages/dataInjection/serviceLog/create/lambda/CreateLambda"; import ApplicationLog from "pages/dataInjection/applicationLog/ApplicationLog"; import LogConfig from "pages/resources/logConfig/LogConfig"; import InstanceGroupList from "pages/resources/instanceGroup/InstanceGroupList"; import ConfigDetail from "pages/resources/logConfig/ConfigDetail"; import CreateLogConfig from "pages/resources/logConfig/CreateLogConfig"; import EditLogConfig from "pages/resources/logConfig/EditLogConfig"; import InstanceGroupDetail from "pages/resources/instanceGroup/InstanceGroupDetail"; import CreateInstanceGroup from "pages/resources/instanceGroup/create/CreateInstanceGroup"; import ApplicationLogDetail from "pages/dataInjection/applicationLog/ApplicationLogDetail"; import CreatePipeline from "pages/dataInjection/applicationLog/create/CreatePipeline"; import CreateIngestion from "pages/dataInjection/applicationLog/createIngestion/CreateIngestion"; import CreateSysLogIngestion from "pages/dataInjection/applicationLog/createSyslogIngestion/CreateSysLogIngestion"; import CrossAccountList from "pages/resources/crossAccount/CrossAccountList"; import LinkAnAccount from "pages/resources/crossAccount/LinkAnAccount"; import { AMPLIFY_CONFIG_JSON, AMPLIFY_ZH_DICT } from "assets/js/const"; import { useDispatch } from "react-redux"; import { ActionType } from "reducer/appReducer"; import LoadingText from "components/LoadingText"; import ServiceLogDetail from "pages/dataInjection/serviceLog/ServiceLogDetail"; import DomainAlarm from "pages/clusters/domain/DomainAlarm"; import LHeader from "components/layout/header"; import { AmplifyConfigType, AppSyncAuthType } from "types"; import { AuthProvider, useAuth } from "react-oidc-context"; import EksLogList from "pages/containers/eksLog/EksLogList"; import ImportEksCluster from "pages/containers/eksLog/create/ImportEksCluster"; import EksLogDetail from "pages/containers/eksLog/EksLogDetail"; import EksLogIngest from "pages/containers/eksLog/createIngestion/EksLogIngest"; import EksIngestionDetail from "pages/dataInjection/ingestiondetail/EksIngestionDetail"; import { WebStorageStateStore } from "oidc-client-ts"; import CreateConfig from "pages/dataInjection/serviceLog/create/config/CreateConfig"; import CrossAccountDetail from "pages/resources/crossAccount/CrossAccountDetail"; import AppIngestionDetail from "pages/dataInjection/ingestiondetail/AppIngestionDetail"; import { useTranslation } from "react-i18next"; import { I18n } from "aws-amplify"; import CreateEKSIngestion from "pages/dataInjection/applicationLog/createEKSIngestion/CreateEKSIngestion"; export interface SignedInAppProps { oidcSignOut?: () => void; } const AmplifyLoginPage: React.FC = () => { const { t } = useTranslation(); return (