github.com/minio/console@v1.4.1/web-app/src/screens/Console/Support/utils.tsx (about)

     1  // This file is part of MinIO Console Server
     2  // Copyright (c) 2022 MinIO, Inc.
     3  //
     4  // This program is free software: you can redistribute it and/or modify
     5  // it under the terms of the GNU Affero General Public License as published by
     6  // the Free Software Foundation, either version 3 of the License, or
     7  // (at your option) any later version.
     8  //
     9  // This program is distributed in the hope that it will be useful,
    10  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  // GNU Affero General Public License for more details.
    13  //
    14  // You should have received a copy of the GNU Affero General Public License
    15  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    16  
    17  import React, { Fragment, useState } from "react";
    18  import { CopyIcon, SettingsIcon, Box, Grid, Switch, InputBox } from "mds";
    19  import RegistrationStatusBanner from "./RegistrationStatusBanner";
    20  
    21  export const ClusterRegistered = ({ email }: { email: string }) => {
    22    return (
    23      <Fragment>
    24        <RegistrationStatusBanner email={email} />
    25        <Grid item xs={12} sx={{ marginTop: 25 }}>
    26          <Box
    27            sx={{
    28              padding: "20px",
    29            }}
    30          >
    31            Login to{" "}
    32            <a href="https://subnet.min.io" target="_blank">
    33              SUBNET
    34            </a>{" "}
    35            to avail support for this MinIO cluster
    36          </Box>
    37        </Grid>
    38      </Fragment>
    39    );
    40  };
    41  
    42  export const ProxyConfiguration = () => {
    43    const proxyConfigurationCommand =
    44      "mc admin config set {alias} subnet proxy={proxy}";
    45    const [displaySubnetProxy, setDisplaySubnetProxy] = useState(false);
    46    return (
    47      <Fragment>
    48        <Box
    49          withBorders
    50          sx={{
    51            display: "flex",
    52            padding: "23px",
    53            marginTop: "40px",
    54            alignItems: "start",
    55            justifyContent: "space-between",
    56          }}
    57        >
    58          <Box
    59            sx={{
    60              display: "flex",
    61              flexFlow: "column",
    62            }}
    63          >
    64            <Box
    65              sx={{
    66                display: "flex",
    67                "& .min-icon": {
    68                  height: "22px",
    69                  width: "22px",
    70                },
    71              }}
    72            >
    73              <SettingsIcon />
    74              <div style={{ marginLeft: "10px", fontWeight: 600 }}>
    75                Proxy Configuration
    76              </div>
    77            </Box>
    78            <Box
    79              sx={{
    80                marginTop: "10px",
    81                marginBottom: "10px",
    82                fontSize: "14px",
    83              }}
    84            >
    85              For airgap/firewalled environments it is possible to{" "}
    86              <a
    87                href="https://min.io/docs/minio/linux/reference/minio-mc-admin/mc-admin-config.html?ref=con"
    88                target="_blank"
    89              >
    90                configure a proxy
    91              </a>{" "}
    92              to connect to SUBNET .
    93            </Box>
    94            <Box>
    95              {displaySubnetProxy && (
    96                <InputBox
    97                  disabled
    98                  id="subnetProxy"
    99                  name="subnetProxy"
   100                  placeholder=""
   101                  onChange={() => {}}
   102                  label=""
   103                  value={proxyConfigurationCommand}
   104                  overlayIcon={<CopyIcon />}
   105                  overlayAction={() =>
   106                    navigator.clipboard.writeText(proxyConfigurationCommand)
   107                  }
   108                />
   109              )}
   110            </Box>
   111          </Box>
   112          <Box
   113            sx={{
   114              display: "flex",
   115            }}
   116          >
   117            <Switch
   118              value="enableProxy"
   119              id="enableProxy"
   120              name="enableProxy"
   121              checked={displaySubnetProxy}
   122              onChange={(event: React.ChangeEvent<HTMLInputElement>) => {
   123                setDisplaySubnetProxy(event.target.checked);
   124              }}
   125            />
   126          </Box>
   127        </Box>
   128      </Fragment>
   129    );
   130  };