Skip to content

Commit d6aceb5

Browse files
authored
Add get healthInfo api using websockets (#543)
Integrate also HealthInfo API with Console UI
1 parent 1c10976 commit d6aceb5

32 files changed

+1817
-402
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ swagger-gen:
5050
@swagger generate server -A console --main-package=console --exclude-main -P models.Principal -f ./swagger.yml -r NOTICE
5151

5252
assets:
53-
@(cd portal-ui; yarn install; make build-static; cd ..)
53+
@(cd portal-ui; yarn install; make build-static; yarn prettier --write . --loglevel warn; cd ..)
5454

5555
test:
5656
@(GO111MODULE=on go test -race -v github.com/minio/console/restapi/...)

go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
319319
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
320320
github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo=
321321
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
322+
github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ=
322323
github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
323324
github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
324325
github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw=
@@ -602,6 +603,7 @@ github.com/goreleaser/nfpm v1.2.1/go.mod h1:TtWrABZozuLOttX2uDlYyECfQX7x5XYkVxhj
602603
github.com/goreleaser/nfpm v1.3.0/go.mod h1:w0p7Kc9TAUgWMyrub63ex3M2Mgw88M4GZXoTq5UCb40=
603604
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
604605
github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
606+
github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4=
605607
github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q=
606608
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
607609
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
@@ -922,6 +924,7 @@ github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88J
922924
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
923925
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
924926
github.com/miekg/dns v1.1.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
927+
github.com/miekg/dns v1.1.35 h1:oTfOaDH+mZkdcgdIjH6yBajRGtIwcwcaR+rt23ZSrJs=
925928
github.com/miekg/dns v1.1.35/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM=
926929
github.com/minio/cli v1.22.0 h1:VTQm7lmXm3quxO917X3p+el1l0Ca5X3S4PM2ruUYO68=
927930
github.com/minio/cli v1.22.0/go.mod h1:bYxnK0uS629N3Bq+AOZZ+6lwF77Sodk4+UL9vNuXhOY=
@@ -1346,6 +1349,7 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
13461349
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
13471350
go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
13481351
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
1352+
go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0=
13491353
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
13501354
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
13511355
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=

pkg/acl/endpoints.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var (
4343
heal = "/heal"
4444
trace = "/trace"
4545
logs = "/logs"
46+
healthInfo = "/health-info"
4647
)
4748

4849
type ConfigurationActionSet struct {
@@ -231,6 +232,16 @@ var traceActionSet = ConfigurationActionSet{
231232
),
232233
}
233234

235+
// healthInfoActionSet contains the list of admin actions required for this endpoint to work
236+
var healthInfoActionSet = ConfigurationActionSet{
237+
actionTypes: iampolicy.NewActionSet(
238+
iampolicy.AllAdminActions,
239+
),
240+
actions: iampolicy.NewActionSet(
241+
iampolicy.HealthInfoAdminAction,
242+
),
243+
}
244+
234245
// endpointRules contains the mapping between endpoints and ActionSets, additional rules can be added here
235246
var endpointRules = map[string]ConfigurationActionSet{
236247
configuration: configurationActionSet,
@@ -252,6 +263,7 @@ var endpointRules = map[string]ConfigurationActionSet{
252263
heal: healActionSet,
253264
trace: traceActionSet,
254265
logs: logsActionSet,
266+
healthInfo: healthInfoActionSet,
255267
}
256268

257269
// operatorRules contains the mapping between endpoints and ActionSets for operator only mode

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: 18,
7676
},
7777
{
7878
name: "all s3 endpoints",
@@ -91,7 +91,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
9191
"s3:*",
9292
},
9393
},
94-
want: 19,
94+
want: 20,
9595
},
9696
{
9797
name: "Console User - default endpoints",

portal-ui/.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build
2+
coverage

portal-ui/.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

portal-ui/bindata_assetfs.go

Lines changed: 142 additions & 142 deletions
Large diffs are not rendered by default.

portal-ui/config-overrides.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const rewireReactHotLoader = require('react-app-rewire-hot-loader');
1+
const rewireReactHotLoader = require("react-app-rewire-hot-loader");
22

33
/* config-overrides.js */
44
module.exports = function override(config, env) {
5-
if (env === 'development') {
6-
config.resolve.alias['react-dom'] = '@hot-loader/react-dom';
7-
}
8-
config = rewireReactHotLoader(config, env);
9-
return config;
5+
if (env === "development") {
6+
config.resolve.alias["react-dom"] = "@hot-loader/react-dom";
7+
}
8+
config = rewireReactHotLoader(config, env);
9+
return config;
1010
};

portal-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"proxy": "http://localhost:9090/",
8080
"devDependencies": {
8181
"jest": "^24.9.0",
82-
"prettier": "^1.19.1",
82+
"prettier": "2.2.1",
8383
"typescript": "^4.1.2"
8484
}
8585
}

portal-ui/public/index.html

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,44 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />
66
<meta name="theme-color" content="#000000" />
7-
<meta
8-
name="description"
9-
content="MinIO Console"
10-
/>
7+
<meta name="description" content="MinIO Console" />
118
<!--
129
manifest.json provides metadata used when your web app is installed on a
1310
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1411
-->
15-
<link href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap" rel="stylesheet">
16-
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-icon-180x180.png">
17-
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
18-
<link rel="icon" type="image/png" sizes="96x96" href="%PUBLIC_URL%/favicon-96x96.png">
19-
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
20-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
21-
<link rel="mask-icon" href="%PUBLIC_URL%/safari-pinned-tab.svg" color="#3a4e54">
12+
<link
13+
href="https://fonts.googleapis.com/css2?family=Lato:wght@400;500;700;900&display=swap"
14+
rel="stylesheet"
15+
/>
16+
<link
17+
rel="apple-touch-icon"
18+
sizes="180x180"
19+
href="%PUBLIC_URL%/apple-icon-180x180.png"
20+
/>
21+
<link
22+
rel="icon"
23+
type="image/png"
24+
sizes="32x32"
25+
href="%PUBLIC_URL%/favicon-32x32.png"
26+
/>
27+
<link
28+
rel="icon"
29+
type="image/png"
30+
sizes="96x96"
31+
href="%PUBLIC_URL%/favicon-96x96.png"
32+
/>
33+
<link
34+
rel="icon"
35+
type="image/png"
36+
sizes="16x16"
37+
href="%PUBLIC_URL%/favicon-16x16.png"
38+
/>
39+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
40+
<link
41+
rel="mask-icon"
42+
href="%PUBLIC_URL%/safari-pinned-tab.svg"
43+
color="#3a4e54"
44+
/>
2245
<!--
2346
Notice the use of %PUBLIC_URL% in the tags above.
2447
It will be replaced with the URL of the `public` folder during the build.

0 commit comments

Comments
 (0)