Improvements to Built-In users (#708)

This commit is contained in:
Daniel Valdivia
2021-04-27 13:07:25 -07:00
committed by GitHub
parent 38f95e3b28
commit 5838606789
10 changed files with 84 additions and 66 deletions

View File

@@ -1,25 +1,25 @@
{
"files": {
"main.css": "/static/css/main.a19f3d53.chunk.css",
"main.js": "/static/js/main.8671089f.chunk.js",
"main.js.map": "/static/js/main.8671089f.chunk.js.map",
"main.js": "/static/js/main.66e4f7d3.chunk.js",
"main.js.map": "/static/js/main.66e4f7d3.chunk.js.map",
"runtime-main.js": "/static/js/runtime-main.f48e99e5.js",
"runtime-main.js.map": "/static/js/runtime-main.f48e99e5.js.map",
"static/css/2.32daf8f7.chunk.css": "/static/css/2.32daf8f7.chunk.css",
"static/js/2.095198e4.chunk.js": "/static/js/2.095198e4.chunk.js",
"static/js/2.095198e4.chunk.js.map": "/static/js/2.095198e4.chunk.js.map",
"static/js/2.f9fdac36.chunk.js": "/static/js/2.f9fdac36.chunk.js",
"static/js/2.f9fdac36.chunk.js.map": "/static/js/2.f9fdac36.chunk.js.map",
"index.html": "/index.html",
"static/css/2.32daf8f7.chunk.css.map": "/static/css/2.32daf8f7.chunk.css.map",
"static/css/main.a19f3d53.chunk.css.map": "/static/css/main.a19f3d53.chunk.css.map",
"static/js/2.095198e4.chunk.js.LICENSE.txt": "/static/js/2.095198e4.chunk.js.LICENSE.txt",
"static/js/2.f9fdac36.chunk.js.LICENSE.txt": "/static/js/2.f9fdac36.chunk.js.LICENSE.txt",
"static/media/minio_console_logo.0837460e.svg": "/static/media/minio_console_logo.0837460e.svg",
"static/media/minio_operator_logo.1312b7c9.svg": "/static/media/minio_operator_logo.1312b7c9.svg"
},
"entrypoints": [
"static/js/runtime-main.f48e99e5.js",
"static/css/2.32daf8f7.chunk.css",
"static/js/2.095198e4.chunk.js",
"static/js/2.f9fdac36.chunk.js",
"static/css/main.a19f3d53.chunk.css",
"static/js/main.8671089f.chunk.js"
"static/js/main.66e4f7d3.chunk.js"
]
}

View File

@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.32daf8f7.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.095198e4.chunk.js"></script><script src="/static/js/main.8671089f.chunk.js"></script></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="MinIO Console"/><link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet"/><link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/><link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/><link rel="manifest" href="/manifest.json"/><link rel="mask-icon" href="/safari-pinned-tab.svg" color="#3a4e54"/><title>MinIO Console</title><link href="/static/css/2.32daf8f7.chunk.css" rel="stylesheet"><link href="/static/css/main.a19f3d53.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,l,i=r[0],a=r[1],p=r[2],c=0,s=[];c<i.length;c++)l=i[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,i=1;i<t.length;i++){var a=t[i];0!==o[a]&&(n=!1)}n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={1:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,function(r){return e[r]}.bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="/";var i=this["webpackJsonpportal-ui"]=this["webpackJsonpportal-ui"]||[],a=i.push.bind(i);i.push=r,i=i.slice();for(var p=0;p<i.length;p++)r(i[p]);var f=a;t()}([])</script><script src="/static/js/2.f9fdac36.chunk.js"></script><script src="/static/js/main.66e4f7d3.chunk.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -55,6 +55,7 @@ interface IConfigureProps {
prometheusSizeFactor: string;
logSearchSelectedStorageClass: string;
prometheusSelectedStorageClass: string;
selectedStorageClass: string;
}
const styles = (theme: Theme) =>
@@ -88,6 +89,7 @@ const Configure = ({
prometheusSelectedStorageClass,
updateAddField,
isPageValid,
selectedStorageClass,
}: IConfigureProps) => {
const [validationErrors, setValidationErrors] = useState<any>({});
@@ -214,14 +216,14 @@ const Configure = ({
(item: any) => item.value === prometheusSelectedStorageClass
);
if (filterPrometheus.length === 0) {
updateField("prometheusSelectedStorageClass", storageClasses[0].value);
updateField("prometheusSelectedStorageClass", selectedStorageClass);
}
const filterLogSearch = storageClasses.filter(
(item: any) => item.value === logSearchSelectedStorageClass
);
if (filterLogSearch.length === 0) {
updateField("logSearchSelectedStorageClass", storageClasses[0].value);
updateField("logSearchSelectedStorageClass", selectedStorageClass);
}
}
}, [
@@ -544,6 +546,8 @@ const mapState = (state: AppState) => ({
state.tenants.createTenant.fields.configure.logSearchSelectedStorageClass,
prometheusSelectedStorageClass:
state.tenants.createTenant.fields.configure.prometheusSelectedStorageClass,
selectedStorageClass:
state.tenants.createTenant.fields.nameTenant.selectedStorageClass,
});
const connector = connect(mapState, {

View File

@@ -14,17 +14,17 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import React, { useEffect, useState, useCallback, Fragment } from "react";
import React, { Fragment, useCallback, useEffect, useState } from "react";
import { connect } from "react-redux";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { Grid, Typography, Button, IconButton, Icon } from "@material-ui/core";
import { Grid, IconButton, Tooltip, Typography } from "@material-ui/core";
import CasinoIcon from "@material-ui/icons/Casino";
import DeleteIcon from "@material-ui/icons/Delete";
import {
modalBasic,
wizardCommon,
} from "../../../Common/FormComponents/common/styleLibrary";
import { updateAddField, isPageValid } from "../../actions";
import { isPageValid, updateAddField } from "../../actions";
import {
commonFormValidation,
IValidation,
@@ -34,9 +34,7 @@ import { clearValidationError } from "../../utils";
import RadioGroupSelector from "../../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
import InputBoxWrapper from "../../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
import FormSwitchWrapper from "../../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
import AddIcon from "../../../../../icons/AddIcon";
import { CreateIcon } from "../../../../../icons";
import { Casino } from "@material-ui/icons";
import AddIcon from "@material-ui/icons/Add";
interface IIdentityProviderProps {
classes: any;
@@ -63,10 +61,17 @@ const styles = (theme: Theme) =>
textAlign: "right",
},
shortened: {
gridTemplateColumns: "auto auto 30px 30px",
gridTemplateColumns: "auto auto 50px 50px",
display: "grid",
gridGap: 20,
},
buttonTray: {
gridTemplateColumns: "auto auto 10px 10px",
display: "grid",
gridGap: 0,
height: 16,
marginTop: 12,
},
...modalBasic,
...wizardCommon,
});
@@ -92,11 +97,11 @@ const IdentityProvider = ({
const [validationErrors, setValidationErrors] = useState<any>({});
// Common
let randomKey = function (): string {
let randomKey = function (length = 16): string {
let retval = "";
let legalcharacters =
"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (let i = 0; i < 16; i++) {
for (let i = 0; i < length; i++) {
retval +=
legalcharacters[Math.floor(Math.random() * legalcharacters.length)];
}
@@ -227,7 +232,8 @@ const IdentityProvider = ({
<div className={classes.shortened}>
<InputBoxWrapper
id={`accesskey-${index.toString()}`}
label={"Access Key"}
label={""}
placeholder={"Access Key"}
name={`accesskey-${index.toString()}`}
value={accessKeys[index]}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
@@ -240,7 +246,8 @@ const IdentityProvider = ({
/>
<InputBoxWrapper
id={`secretkey-${index.toString()}`}
label={"Secret Key"}
label={""}
placeholder={"Secret Key"}
name={`secretkey-${index.toString()}`}
value={secretKeys[index]}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
@@ -251,30 +258,51 @@ const IdentityProvider = ({
key={`csv-secretkey-${index.toString()}`}
error={validationErrors[`secretkey-${index.toString()}`] || ""}
/>
<IconButton
onClick={() => {
updateUserField(index, randomKey());
updatePwordField(index, randomKey());
}}
>
<CasinoIcon />
</IconButton>
<IconButton
onClick={() => {
if (accessKeys.length > 1) {
accessKeys.splice(index, 1);
secretKeys.splice(index, 1);
updateUserField(
accessKeys.length - 1,
accessKeys[accessKeys.length - 1]
);
}
}}
>
<DeleteIcon />
</IconButton>
<div className={classes.buttonTray}>
<Tooltip title="Add User" aria-label="add">
<IconButton
size={"small"}
onClick={() => {
accessKeys.push("");
secretKeys.push("");
updateUserField(accessKeys.length - 1, "");
updatePwordField(secretKeys.length - 1, "");
}}
>
<AddIcon />
</IconButton>
</Tooltip>
<Tooltip title="Randomize Credentials" aria-label="add">
<IconButton
onClick={() => {
updateUserField(index, randomKey(16));
updatePwordField(index, randomKey(32));
}}
size={"small"}
>
<CasinoIcon />
</IconButton>
</Tooltip>
<Tooltip title="Remove" aria-label="add">
<IconButton
size={"small"}
style={{ marginLeft: 16 }}
onClick={() => {
if (accessKeys.length > 1) {
accessKeys.splice(index, 1);
secretKeys.splice(index, 1);
updateUserField(
accessKeys.length - 1,
accessKeys[accessKeys.length - 1]
);
}
}}
>
<DeleteIcon />
</IconButton>
</Tooltip>
</div>
</div>
<br />
</Fragment>
);
});
@@ -303,21 +331,7 @@ const IdentityProvider = ({
{ label: "Active Directory", value: "AD" },
]}
/>
MinIO supports both OpenID and Active Directory
<Button
onClick={() => {
accessKeys.push("");
secretKeys.push("");
updateUserField(accessKeys.length - 1, "");
updatePwordField(secretKeys.length - 1, "");
}}
startIcon={<CreateIcon />}
className={classes.buttonList}
color="primary"
variant="contained"
>
Add accesskey/secretkey pair
</Button>
Add additional users
</Grid>{" "}
{idpSelection === "Built-in" && <Fragment>{inputs}</Fragment>}
{idpSelection === "OpenID" && (