Skip to content

Commit 5838606

Browse files
authored
Improvements to Built-In users (#708)
1 parent 38f95e3 commit 5838606

File tree

10 files changed

+84
-66
lines changed

10 files changed

+84
-66
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.a19f3d53.chunk.css",
4-
"main.js": "/static/js/main.8671089f.chunk.js",
5-
"main.js.map": "/static/js/main.8671089f.chunk.js.map",
4+
"main.js": "/static/js/main.66e4f7d3.chunk.js",
5+
"main.js.map": "/static/js/main.66e4f7d3.chunk.js.map",
66
"runtime-main.js": "/static/js/runtime-main.f48e99e5.js",
77
"runtime-main.js.map": "/static/js/runtime-main.f48e99e5.js.map",
88
"static/css/2.32daf8f7.chunk.css": "/static/css/2.32daf8f7.chunk.css",
9-
"static/js/2.095198e4.chunk.js": "/static/js/2.095198e4.chunk.js",
10-
"static/js/2.095198e4.chunk.js.map": "/static/js/2.095198e4.chunk.js.map",
9+
"static/js/2.f9fdac36.chunk.js": "/static/js/2.f9fdac36.chunk.js",
10+
"static/js/2.f9fdac36.chunk.js.map": "/static/js/2.f9fdac36.chunk.js.map",
1111
"index.html": "/index.html",
1212
"static/css/2.32daf8f7.chunk.css.map": "/static/css/2.32daf8f7.chunk.css.map",
1313
"static/css/main.a19f3d53.chunk.css.map": "/static/css/main.a19f3d53.chunk.css.map",
14-
"static/js/2.095198e4.chunk.js.LICENSE.txt": "/static/js/2.095198e4.chunk.js.LICENSE.txt",
14+
"static/js/2.f9fdac36.chunk.js.LICENSE.txt": "/static/js/2.f9fdac36.chunk.js.LICENSE.txt",
1515
"static/media/minio_console_logo.0837460e.svg": "/static/media/minio_console_logo.0837460e.svg",
1616
"static/media/minio_operator_logo.1312b7c9.svg": "/static/media/minio_operator_logo.1312b7c9.svg"
1717
},
1818
"entrypoints": [
1919
"static/js/runtime-main.f48e99e5.js",
2020
"static/css/2.32daf8f7.chunk.css",
21-
"static/js/2.095198e4.chunk.js",
21+
"static/js/2.f9fdac36.chunk.js",
2222
"static/css/main.a19f3d53.chunk.css",
23-
"static/js/main.8671089f.chunk.js"
23+
"static/js/main.66e4f7d3.chunk.js"
2424
]
2525
}

portal-ui/build/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +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>
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.f9fdac36.chunk.js"></script><script src="/static/js/main.66e4f7d3.chunk.js"></script></body></html>

portal-ui/build/static/js/2.095198e4.chunk.js renamed to portal-ui/build/static/js/2.f9fdac36.chunk.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/build/static/js/2.095198e4.chunk.js.map renamed to portal-ui/build/static/js/2.f9fdac36.chunk.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/build/static/js/main.8671089f.chunk.js renamed to portal-ui/build/static/js/main.66e4f7d3.chunk.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/build/static/js/main.66e4f7d3.chunk.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

portal-ui/build/static/js/main.8671089f.chunk.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

portal-ui/src/screens/Console/Tenants/AddTenant/Steps/Configure.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ interface IConfigureProps {
5555
prometheusSizeFactor: string;
5656
logSearchSelectedStorageClass: string;
5757
prometheusSelectedStorageClass: string;
58+
selectedStorageClass: string;
5859
}
5960

6061
const styles = (theme: Theme) =>
@@ -88,6 +89,7 @@ const Configure = ({
8889
prometheusSelectedStorageClass,
8990
updateAddField,
9091
isPageValid,
92+
selectedStorageClass,
9193
}: IConfigureProps) => {
9294
const [validationErrors, setValidationErrors] = useState<any>({});
9395

@@ -214,14 +216,14 @@ const Configure = ({
214216
(item: any) => item.value === prometheusSelectedStorageClass
215217
);
216218
if (filterPrometheus.length === 0) {
217-
updateField("prometheusSelectedStorageClass", storageClasses[0].value);
219+
updateField("prometheusSelectedStorageClass", selectedStorageClass);
218220
}
219221

220222
const filterLogSearch = storageClasses.filter(
221223
(item: any) => item.value === logSearchSelectedStorageClass
222224
);
223225
if (filterLogSearch.length === 0) {
224-
updateField("logSearchSelectedStorageClass", storageClasses[0].value);
226+
updateField("logSearchSelectedStorageClass", selectedStorageClass);
225227
}
226228
}
227229
}, [
@@ -544,6 +546,8 @@ const mapState = (state: AppState) => ({
544546
state.tenants.createTenant.fields.configure.logSearchSelectedStorageClass,
545547
prometheusSelectedStorageClass:
546548
state.tenants.createTenant.fields.configure.prometheusSelectedStorageClass,
549+
selectedStorageClass:
550+
state.tenants.createTenant.fields.nameTenant.selectedStorageClass,
547551
});
548552

549553
const connector = connect(mapState, {

portal-ui/src/screens/Console/Tenants/AddTenant/Steps/IdentityProvider.tsx

Lines changed: 63 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
// You should have received a copy of the GNU Affero General Public License
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616

17-
import React, { useEffect, useState, useCallback, Fragment } from "react";
17+
import React, { Fragment, useCallback, useEffect, useState } from "react";
1818
import { connect } from "react-redux";
1919
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
20-
import { Grid, Typography, Button, IconButton, Icon } from "@material-ui/core";
20+
import { Grid, IconButton, Tooltip, Typography } from "@material-ui/core";
2121
import CasinoIcon from "@material-ui/icons/Casino";
2222
import DeleteIcon from "@material-ui/icons/Delete";
2323
import {
2424
modalBasic,
2525
wizardCommon,
2626
} from "../../../Common/FormComponents/common/styleLibrary";
27-
import { updateAddField, isPageValid } from "../../actions";
27+
import { isPageValid, updateAddField } from "../../actions";
2828
import {
2929
commonFormValidation,
3030
IValidation,
@@ -34,9 +34,7 @@ import { clearValidationError } from "../../utils";
3434
import RadioGroupSelector from "../../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
3535
import InputBoxWrapper from "../../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
3636
import FormSwitchWrapper from "../../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";
37-
import AddIcon from "../../../../../icons/AddIcon";
38-
import { CreateIcon } from "../../../../../icons";
39-
import { Casino } from "@material-ui/icons";
37+
import AddIcon from "@material-ui/icons/Add";
4038

4139
interface IIdentityProviderProps {
4240
classes: any;
@@ -63,10 +61,17 @@ const styles = (theme: Theme) =>
6361
textAlign: "right",
6462
},
6563
shortened: {
66-
gridTemplateColumns: "auto auto 30px 30px",
64+
gridTemplateColumns: "auto auto 50px 50px",
6765
display: "grid",
6866
gridGap: 20,
6967
},
68+
buttonTray: {
69+
gridTemplateColumns: "auto auto 10px 10px",
70+
display: "grid",
71+
gridGap: 0,
72+
height: 16,
73+
marginTop: 12,
74+
},
7075
...modalBasic,
7176
...wizardCommon,
7277
});
@@ -92,11 +97,11 @@ const IdentityProvider = ({
9297
const [validationErrors, setValidationErrors] = useState<any>({});
9398

9499
// Common
95-
let randomKey = function (): string {
100+
let randomKey = function (length = 16): string {
96101
let retval = "";
97102
let legalcharacters =
98103
"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
99-
for (let i = 0; i < 16; i++) {
104+
for (let i = 0; i < length; i++) {
100105
retval +=
101106
legalcharacters[Math.floor(Math.random() * legalcharacters.length)];
102107
}
@@ -227,7 +232,8 @@ const IdentityProvider = ({
227232
<div className={classes.shortened}>
228233
<InputBoxWrapper
229234
id={`accesskey-${index.toString()}`}
230-
label={"Access Key"}
235+
label={""}
236+
placeholder={"Access Key"}
231237
name={`accesskey-${index.toString()}`}
232238
value={accessKeys[index]}
233239
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
@@ -240,7 +246,8 @@ const IdentityProvider = ({
240246
/>
241247
<InputBoxWrapper
242248
id={`secretkey-${index.toString()}`}
243-
label={"Secret Key"}
249+
label={""}
250+
placeholder={"Secret Key"}
244251
name={`secretkey-${index.toString()}`}
245252
value={secretKeys[index]}
246253
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
@@ -251,30 +258,51 @@ const IdentityProvider = ({
251258
key={`csv-secretkey-${index.toString()}`}
252259
error={validationErrors[`secretkey-${index.toString()}`] || ""}
253260
/>
254-
<IconButton
255-
onClick={() => {
256-
updateUserField(index, randomKey());
257-
updatePwordField(index, randomKey());
258-
}}
259-
>
260-
<CasinoIcon />
261-
</IconButton>
262-
<IconButton
263-
onClick={() => {
264-
if (accessKeys.length > 1) {
265-
accessKeys.splice(index, 1);
266-
secretKeys.splice(index, 1);
267-
updateUserField(
268-
accessKeys.length - 1,
269-
accessKeys[accessKeys.length - 1]
270-
);
271-
}
272-
}}
273-
>
274-
<DeleteIcon />
275-
</IconButton>
261+
<div className={classes.buttonTray}>
262+
<Tooltip title="Add User" aria-label="add">
263+
<IconButton
264+
size={"small"}
265+
onClick={() => {
266+
accessKeys.push("");
267+
secretKeys.push("");
268+
updateUserField(accessKeys.length - 1, "");
269+
updatePwordField(secretKeys.length - 1, "");
270+
}}
271+
>
272+
<AddIcon />
273+
</IconButton>
274+
</Tooltip>
275+
<Tooltip title="Randomize Credentials" aria-label="add">
276+
<IconButton
277+
onClick={() => {
278+
updateUserField(index, randomKey(16));
279+
updatePwordField(index, randomKey(32));
280+
}}
281+
size={"small"}
282+
>
283+
<CasinoIcon />
284+
</IconButton>
285+
</Tooltip>
286+
<Tooltip title="Remove" aria-label="add">
287+
<IconButton
288+
size={"small"}
289+
style={{ marginLeft: 16 }}
290+
onClick={() => {
291+
if (accessKeys.length > 1) {
292+
accessKeys.splice(index, 1);
293+
secretKeys.splice(index, 1);
294+
updateUserField(
295+
accessKeys.length - 1,
296+
accessKeys[accessKeys.length - 1]
297+
);
298+
}
299+
}}
300+
>
301+
<DeleteIcon />
302+
</IconButton>
303+
</Tooltip>
304+
</div>
276305
</div>
277-
<br />
278306
</Fragment>
279307
);
280308
});
@@ -303,21 +331,7 @@ const IdentityProvider = ({
303331
{ label: "Active Directory", value: "AD" },
304332
]}
305333
/>
306-
MinIO supports both OpenID and Active Directory
307-
<Button
308-
onClick={() => {
309-
accessKeys.push("");
310-
secretKeys.push("");
311-
updateUserField(accessKeys.length - 1, "");
312-
updatePwordField(secretKeys.length - 1, "");
313-
}}
314-
startIcon={<CreateIcon />}
315-
className={classes.buttonList}
316-
color="primary"
317-
variant="contained"
318-
>
319-
Add accesskey/secretkey pair
320-
</Button>
334+
Add additional users
321335
</Grid>{" "}
322336
{idpSelection === "Built-in" && <Fragment>{inputs}</Fragment>}
323337
{idpSelection === "OpenID" && (

0 commit comments

Comments
 (0)