Skip to content

Commit 06f3333

Browse files
cesnietordvaldivia
andauthored
Move trace and logs UI to Operator Console (#375)
Co-authored-by: Daniel Valdivia <hola@danielvaldivia.com>
1 parent 3cd024e commit 06f3333

23 files changed

+256
-222
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ require (
1919
github.com/minio/mc v0.0.0-20201001165056-7f2df96e4821
2020
github.com/minio/minio v0.0.0-20200927172404-27d9bd04e544
2121
github.com/minio/minio-go/v7 v7.0.6-0.20200923173112-bc846cb9b089
22-
github.com/minio/operator v0.0.0-20200930213302-ab2bbdfae96c
22+
github.com/minio/operator v0.0.0-20201022162018-527e5c32132b
2323
github.com/mitchellh/go-homedir v1.1.0
2424
github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 // indirect
2525
github.com/secure-io/sio-go v0.3.1

go.sum

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ github.com/Azure/azure-storage-blob-go v0.10.0/go.mod h1:ep1edmW+kNQx4UfWM9heESN
6060
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
6161
github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
6262
github.com/Azure/go-autorest v14.1.1+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
63+
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
6364
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
6465
github.com/Azure/go-autorest/autorest v0.9.0 h1:MRvx8gncNaXJqOoLmhNjUAKh33JJF8LyxPhomEtOsjs=
6566
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
6667
github.com/Azure/go-autorest/autorest v0.9.3/go.mod h1:GsRuLYvwzLjjjRoWEIyMUaYq8GNUx2nRB378IPt/1p0=
68+
github.com/Azure/go-autorest/autorest v0.10.2 h1:NuSF3gXetiHyUbVdneJMEVyPUYAe5wh+aN08JYAf1tI=
6769
github.com/Azure/go-autorest/autorest v0.10.2/go.mod h1:/FALq9T/kS7b5J5qsQ+RSTUdAmGFqi0vUdVNNx8q630=
6870
github.com/Azure/go-autorest/autorest/adal v0.5.0 h1:q2gDruN08/guU9vAjuPWff0+QIrpH6ediguzdAzXAUU=
6971
github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0=
@@ -72,11 +74,13 @@ github.com/Azure/go-autorest/autorest/adal v0.8.1/go.mod h1:ZjhuQClTqx435SRJ2iMl
7274
github.com/Azure/go-autorest/autorest/adal v0.8.2/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
7375
github.com/Azure/go-autorest/autorest/adal v0.8.3/go.mod h1:ZjhuQClTqx435SRJ2iMlOxPYt3d2C/T/7TiQCVZSn3Q=
7476
github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg=
77+
github.com/Azure/go-autorest/autorest/adal v0.9.1 h1:xjPqigMQe2+0DAJ5A6MLUPp5D2r2Io8qHCuCMMI/yJU=
7578
github.com/Azure/go-autorest/autorest/adal v0.9.1/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg=
7679
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2/go.mod h1:90gmfKdlmKgfjUpnCEpOJzsUEjrWDSLwHIG73tSXddM=
7780
github.com/Azure/go-autorest/autorest/azure/cli v0.3.1/go.mod h1:ZG5p860J94/0kI9mNJVoIoLgXcirM2gF5i2kWloofxw=
7881
github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA=
7982
github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g=
83+
github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw=
8084
github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74=
8185
github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
8286
github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0=
@@ -86,8 +90,10 @@ github.com/Azure/go-autorest/autorest/to v0.2.0/go.mod h1:GunWKJp1AEqgMaGLV+iocm
8690
github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA=
8791
github.com/Azure/go-autorest/autorest/validation v0.1.0/go.mod h1:Ha3z/SqBeaalWQvokg3NZAlQTalVMtOIAs1aGK7G6u8=
8892
github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI=
93+
github.com/Azure/go-autorest/logger v0.1.0 h1:ruG4BSDXONFRrZZJ2GUXDiUyVpayPmb1GnWeHDdaNKY=
8994
github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc=
9095
github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk=
96+
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
9197
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
9298
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
9399
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@@ -540,6 +546,7 @@ github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTV
540546
github.com/googleapis/gnostic v0.2.2 h1:DcFegQ7+ECdmkJMfVwWlC+89I4esJ7p8nkGt9ainGDk=
541547
github.com/googleapis/gnostic v0.2.2/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
542548
github.com/gookit/color v1.2.4/go.mod h1:AhIE+pS6D4Ql0SQWbBeXPHw7gY0/sjHoA4s/n1KB7xg=
549+
github.com/gophercloud/gophercloud v0.1.0 h1:P/nh25+rzXouhytV2pUHBb65fnds26Ghl8/391+sT5o=
543550
github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8=
544551
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
545552
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
@@ -798,8 +805,8 @@ github.com/minio/minio-go/v7 v7.0.2/go.mod h1:dJ80Mv2HeGkYLH1sqS/ksz07ON6csH3S6J
798805
github.com/minio/minio-go/v7 v7.0.5-0.20200811211821-14ed05478889/go.mod h1:CSt2ETZNs+bIIhWTse0mcZKZWMGrFU7Er7RR0TmkDYk=
799806
github.com/minio/minio-go/v7 v7.0.6-0.20200923173112-bc846cb9b089 h1:9DDs/Gc3fNHOQxQmwIFWs7YDLMTBh59r2XQ6RqEUA1I=
800807
github.com/minio/minio-go/v7 v7.0.6-0.20200923173112-bc846cb9b089/go.mod h1:CSt2ETZNs+bIIhWTse0mcZKZWMGrFU7Er7RR0TmkDYk=
801-
github.com/minio/operator v0.0.0-20200930213302-ab2bbdfae96c h1:OIKdzEJDFmUokbJ1rIdlr3kcfsBfXelYgSCTN/+Ppec=
802-
github.com/minio/operator v0.0.0-20200930213302-ab2bbdfae96c/go.mod h1:6lavbNo2YuJWeQR5bZYsEWdbpRCO2KrTyfQ0PtC/AN4=
808+
github.com/minio/operator v0.0.0-20201022162018-527e5c32132b h1:ggfD6V3nodTzhHJHCYIT1F897gscrz+hHsan0a2Wtqw=
809+
github.com/minio/operator v0.0.0-20201022162018-527e5c32132b/go.mod h1:At+++4/6W5BEXK11tN5DKIvkJKhYBZybbb5zmxb0LQI=
803810
github.com/minio/selfupdate v0.3.1 h1:BWEFSNnrZVMUWXbXIgLDNDjbejkmpAmZvy/nCz1HlEs=
804811
github.com/minio/selfupdate v0.3.1/go.mod h1:b8ThJzzH7u2MkF6PcIra7KaXO9Khf6alWPvMSyTDCFM=
805812
github.com/minio/sha256-simd v0.1.1 h1:5QHSlgo3nt5yKOJrC7W8w7X+NFl8cMPZm96iu8kKUJU=

models/create_tenant_request.go

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

pkg/acl/endpoints.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ var (
2828
iamPolicies = "/policies"
2929
dashboard = "/dashboard"
3030
profiling = "/profiling"
31-
trace = "/trace"
32-
logs = "/logs"
3331
watch = "/watch"
3432
notifications = "/notification-endpoints"
3533
buckets = "/buckets"
@@ -61,16 +59,6 @@ var configurationActionSet = ConfigurationActionSet{
6159
),
6260
}
6361

64-
// logsActionSet contains the list of admin actions required for this endpoint to work
65-
var logsActionSet = ConfigurationActionSet{
66-
actionTypes: iampolicy.NewActionSet(
67-
iampolicy.AllAdminActions,
68-
),
69-
actions: iampolicy.NewActionSet(
70-
iampolicy.ConsoleLogAdminAction,
71-
),
72-
}
73-
7462
// dashboardActionSet contains the list of admin actions required for this endpoint to work
7563
var dashboardActionSet = ConfigurationActionSet{
7664
actionTypes: iampolicy.NewActionSet(
@@ -119,16 +107,6 @@ var profilingActionSet = ConfigurationActionSet{
119107
),
120108
}
121109

122-
// traceActionSet contains the list of admin actions required for this endpoint to work
123-
var traceActionSet = ConfigurationActionSet{
124-
actionTypes: iampolicy.NewActionSet(
125-
iampolicy.AllAdminActions,
126-
),
127-
actions: iampolicy.NewActionSet(
128-
iampolicy.TraceAdminAction,
129-
),
130-
}
131-
132110
// usersActionSet contains the list of admin actions required for this endpoint to work
133111
var usersActionSet = ConfigurationActionSet{
134112
actionTypes: iampolicy.NewActionSet(
@@ -252,8 +230,6 @@ var endpointRules = map[string]ConfigurationActionSet{
252230
iamPolicies: iamPoliciesActionSet,
253231
dashboard: dashboardActionSet,
254232
profiling: profilingActionSet,
255-
trace: traceActionSet,
256-
logs: logsActionSet,
257233
watch: watchActionSet,
258234
notifications: notificationsActionSet,
259235
buckets: bucketsActionSet,

pkg/acl/endpoints_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
7272
"admin:*",
7373
},
7474
},
75-
want: 17,
75+
want: 15,
7676
},
7777
{
7878
name: "all s3 endpoints",
@@ -91,7 +91,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
9191
"s3:*",
9292
},
9393
},
94-
want: 20,
94+
want: 18,
9595
},
9696
{
9797
name: "no endpoints",

portal-ui/src/screens/Console/Console.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ import ListNotificationEndpoints from "./NotificationEndopoints/ListNotification
4242
import ConfigurationsList from "./Configurations/ConfigurationPanels/ConfigurationsList";
4343
import { Button, LinearProgress } from "@material-ui/core";
4444
import WebhookPanel from "./Configurations/ConfigurationPanels/WebhookPanel";
45-
import Trace from "./Trace/Trace";
46-
import Logs from "./Logs/Logs";
4745
import Heal from "./Heal/Heal";
4846
import Watch from "./Watch/Watch";
4947
import ListTenants from "./Tenants/ListTenants/ListTenants";
@@ -256,14 +254,6 @@ const Console = ({
256254
component: Policies,
257255
path: "/policies",
258256
},
259-
{
260-
component: Trace,
261-
path: "/trace",
262-
},
263-
{
264-
component: Logs,
265-
path: "/logs",
266-
},
267257
{
268258
component: Heal,
269259
path: "/heal",

portal-ui/src/screens/Console/Menu/Menu.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,11 @@ import {
4343
LambdaNotificationsIcon,
4444
MirroringIcon,
4545
ServiceAccountsIcon,
46-
TraceIcon,
4746
UsersIcon,
4847
WarpIcon,
4948
} from "../../../icons";
5049
import { clearSession } from "../../../common/utils";
5150
import HealIcon from "../../../icons/HealIcon";
52-
import ConsoleIcon from "../../../icons/ConsoleIcon";
5351
import LicenseIcon from "../../../icons/LicenseIcon";
5452
import LogoutIcon from "../../../icons/LogoutIcon";
5553

@@ -242,14 +240,6 @@ const Menu = ({ userLoggedIn, classes, pages }: IMenuProps) => {
242240
name: "IAM Policies",
243241
icon: <IAMPoliciesIcon />,
244242
},
245-
{
246-
group: "Tools",
247-
type: "item",
248-
component: NavLink,
249-
to: "/logs",
250-
name: "Logs",
251-
icon: <ConsoleIcon />,
252-
},
253243
{
254244
group: "Tools",
255245
type: "item",
@@ -258,14 +248,6 @@ const Menu = ({ userLoggedIn, classes, pages }: IMenuProps) => {
258248
name: "Watch",
259249
icon: <WatchIcon />,
260250
},
261-
{
262-
group: "Tools",
263-
type: "item",
264-
component: NavLink,
265-
to: "/trace",
266-
name: "Trace",
267-
icon: <TraceIcon />,
268-
},
269251
{
270252
group: "Tools",
271253
type: "item",

portal-ui/src/screens/Console/Logs/Logs.tsx renamed to portal-ui/src/screens/Console/Tenants/TenantDetails/Logs/Logs.tsx

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,19 @@
1515
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
import React, { useState, useEffect } from "react";
1717
import { IMessageEvent, w3cwebsocket as W3CWebSocket } from "websocket";
18-
import { AppState } from "../../../store";
18+
import { AppState } from "../../../../../store";
1919
import { connect } from "react-redux";
2020
import { logMessageReceived, logResetMessages } from "./actions";
2121
import { LogMessage } from "./types";
2222
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
23-
import { timeFromDate } from "../../../common/utils";
24-
import { wsProtocol } from "../../../utils/wsUtils";
23+
import { timeFromDate } from "../../../../../common/utils";
24+
import { wsProtocol } from "../../../../../utils/wsUtils";
2525
import {
2626
actionsTray,
2727
containerForHeader,
2828
searchField,
29-
} from "../Common/FormComponents/common/styleLibrary";
29+
} from "../../../Common/FormComponents/common/styleLibrary";
3030
import { Grid } from "@material-ui/core";
31-
import PageHeader from "../Common/PageHeader/PageHeader";
3231
import TextField from "@material-ui/core/TextField";
3332
import InputAdornment from "@material-ui/core/InputAdornment";
3433
import SearchIcon from "@material-ui/icons/Search";
@@ -73,13 +72,17 @@ interface ILogs {
7372
logMessageReceived: typeof logMessageReceived;
7473
logResetMessages: typeof logResetMessages;
7574
messages: LogMessage[];
75+
namespace: string;
76+
tenant: string;
7677
}
7778

7879
const Logs = ({
7980
classes,
8081
logMessageReceived,
8182
logResetMessages,
8283
messages,
84+
namespace,
85+
tenant,
8386
}: ILogs) => {
8487
const [highlight, setHighlight] = useState("");
8588

@@ -92,7 +95,7 @@ const Logs = ({
9295
const wsProt = wsProtocol(url.protocol);
9396

9497
const c = new W3CWebSocket(
95-
`${wsProt}://${url.hostname}:${port}/ws/console`
98+
`${wsProt}://${url.hostname}:${port}/ws/console/${namespace}/${tenant}`
9699
);
97100

98101
let interval: any | null = null;
@@ -321,38 +324,33 @@ const Logs = ({
321324
});
322325

323326
return (
324-
<React.Fragment>
325-
<PageHeader label="Logs" />
326-
<Grid container>
327-
<Grid item xs={12} className={classes.container}>
328-
<Grid item xs={12} className={classes.actionsTray}>
329-
<TextField
330-
placeholder="Highlight Line"
331-
className={classes.searchField}
332-
id="search-resource"
333-
label=""
334-
onChange={(val) => {
335-
setHighlight(val.target.value);
336-
}}
337-
InputProps={{
338-
disableUnderline: true,
339-
startAdornment: (
340-
<InputAdornment position="start">
341-
<SearchIcon />
342-
</InputAdornment>
343-
),
344-
}}
345-
/>
346-
</Grid>
347-
<Grid item xs={12}>
348-
<br />
349-
</Grid>
350-
<Grid item xs={12}>
351-
<div className={classes.logList}>{renderLines}</div>
352-
</Grid>
353-
</Grid>
327+
<Grid item xs={12}>
328+
<Grid item xs={12} className={classes.actionsTray}>
329+
<TextField
330+
placeholder="Highlight Line"
331+
className={classes.searchField}
332+
id="search-resource"
333+
label=""
334+
onChange={(val) => {
335+
setHighlight(val.target.value);
336+
}}
337+
InputProps={{
338+
disableUnderline: true,
339+
startAdornment: (
340+
<InputAdornment position="start">
341+
<SearchIcon />
342+
</InputAdornment>
343+
),
344+
}}
345+
/>
346+
</Grid>
347+
<Grid item xs={12}>
348+
<br />
349+
</Grid>
350+
<Grid item xs={12}>
351+
<div className={classes.logList}>{renderLines}</div>
354352
</Grid>
355-
</React.Fragment>
353+
</Grid>
356354
);
357355
};
358356

0 commit comments

Comments
 (0)