Make Lambda Notification Targets a page (#1105)

* Make Lambda Notification Targets a page

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Error messasge tweak

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>

* Updated test cases

Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Daniel Valdivia
2021-10-13 12:37:32 -07:00
committed by GitHub
parent 410b4555e3
commit ed73d99590
40 changed files with 1163 additions and 1281 deletions

5
iconos/Lambda.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" width="227.615" height="256" viewBox="0 0 227.615 256">
<g id="lambda-icn" transform="translate(-89.849 -94.42)">
<path id="Trazado_442" data-name="Trazado 442" d="M71.316,41.17a15.363,15.363,0,0,0,0,30.727c23.352,0,32.017,14.872,40.928,34.353l1.475,3.134c1.229,2.643,3.872,8.542,7.436,16.408L37.271,274.264A15.363,15.363,0,0,0,64,289.382l72.823-128.623c19.481,44,44,99.494,44.431,100.415A58.2,58.2,0,0,0,252.3,294.544a15.375,15.375,0,0,0-9.1-29.375,27.531,27.531,0,0,1-33.861-16.593c-2.458-5.531-59.856-135.751-67.6-152.282l-1.352-2.95C132.462,76.506,116.3,41.17,71.316,41.17Z" transform="translate(54.335 53.25)" fill="#020202"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 692 B

7
iconos/Tiers.svg Normal file
View File

@@ -0,0 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" width="236.312" height="256" viewBox="0 0 236.312 256">
<g id="tiers-icn" transform="translate(-34.003 -3)">
<g id="tiers" transform="translate(34.003 3)">
<path id="Trazado_441" data-name="Trazado 441" d="M122.387,3a9.847,9.847,0,0,0-5.154,1.308L8.925,66.851a9.847,9.847,0,0,0,0,17.039l33.4,19.289-33.4,19.289a9.847,9.847,0,0,0,0,17.058l33.4,19.27-33.4,19.289a9.847,9.847,0,0,0,0,17.058l108.308,62.54a9.847,9.847,0,0,0,9.846,0l108.308-62.54a9.847,9.847,0,0,0,0-17.058l-33.4-19.289,33.4-19.27a9.847,9.847,0,0,0,0-17.058l-33.4-19.289,33.4-19.289a9.847,9.847,0,0,0,0-17.039L127.079,4.311A9.847,9.847,0,0,0,122.387,3ZM62.041,114.563l55.192,31.866a9.847,9.847,0,0,0,9.846,0l55.192-31.866,28.5,16.443L122.156,182.16,33.54,131.006Zm-.02,55.617,55.212,31.866a9.847,9.847,0,0,0,9.846,0l55.212-31.866,28.481,16.443-88.615,51.155L33.54,186.622Z" transform="translate(-4 -3)"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 942 B

View File

@@ -22,49 +22,52 @@ import (
// endpoints definition
var (
configuration = "/settings"
users = "/users"
usersDetail = "/users/:userName+"
groups = "/groups"
iamPolicies = "/policies"
policiesDetail = "/policies/*"
dashboard = "/dashboard"
metrics = "/metrics"
profiling = "/profiling"
buckets = "/buckets"
bucketsGeneral = "/buckets/*"
bucketsAdmin = "/buckets/:bucketName/admin/*"
bucketsAdminMain = "/buckets/:bucketName/admin"
bucketsBrowserMenu = "/buckets"
bucketsBrowserList = "/buckets/*"
bucketsBrowser = "/buckets/:bucketName/browse/*"
bucketsBrowserMain = "/buckets/:bucketName/browse"
serviceAccounts = "/account"
changePassword = "/account/change-password"
tenants = "/tenants"
tenantsAdd = "/tenants/add"
tenantsAddSub = "/tenants/add/*"
tenantsDetail = "/namespaces/:tenantNamespace/tenants/:tenantName"
tenantHop = "/namespaces/:tenantNamespace/tenants/:tenantName/hop"
podsDetail = "/namespaces/:tenantNamespace/tenants/:tenantName/pods/:podName"
tenantsDetailSummary = "/namespaces/:tenantNamespace/tenants/:tenantName/summary"
tenantsDetailMetrics = "/namespaces/:tenantNamespace/tenants/:tenantName/metrics"
tenantsDetailPods = "/namespaces/:tenantNamespace/tenants/:tenantName/pods"
tenantsDetailPools = "/namespaces/:tenantNamespace/tenants/:tenantName/pools"
tenantsDetailVolumes = "/namespaces/:tenantNamespace/tenants/:tenantName/volumes"
tenantsDetailLicense = "/namespaces/:tenantNamespace/tenants/:tenantName/license"
tenantsDetailSecurity = "/namespaces/:tenantNamespace/tenants/:tenantName/security"
storage = "/storage"
storageVolumes = "/storage/volumes"
storageDrives = "/storage/drives"
remoteBuckets = "/remote-buckets"
replication = "/replication"
license = "/license"
watch = "/watch"
heal = "/heal"
trace = "/trace"
logs = "/logs"
healthInfo = "/health-info"
configuration = "/settings"
notificationEndpoints = "/notification-endpoints"
notificationEndpointsAddAny = "/notification-endpoints/add/:service"
notificationEndpointsAdd = "/notification-endpoints/add"
users = "/users"
usersDetail = "/users/:userName+"
groups = "/groups"
iamPolicies = "/policies"
policiesDetail = "/policies/*"
dashboard = "/dashboard"
metrics = "/metrics"
profiling = "/profiling"
buckets = "/buckets"
bucketsGeneral = "/buckets/*"
bucketsAdmin = "/buckets/:bucketName/admin/*"
bucketsAdminMain = "/buckets/:bucketName/admin"
bucketsBrowserMenu = "/buckets"
bucketsBrowserList = "/buckets/*"
bucketsBrowser = "/buckets/:bucketName/browse/*"
bucketsBrowserMain = "/buckets/:bucketName/browse"
serviceAccounts = "/account"
changePassword = "/account/change-password"
tenants = "/tenants"
tenantsAdd = "/tenants/add"
tenantsAddSub = "/tenants/add/*"
tenantsDetail = "/namespaces/:tenantNamespace/tenants/:tenantName"
tenantHop = "/namespaces/:tenantNamespace/tenants/:tenantName/hop"
podsDetail = "/namespaces/:tenantNamespace/tenants/:tenantName/pods/:podName"
tenantsDetailSummary = "/namespaces/:tenantNamespace/tenants/:tenantName/summary"
tenantsDetailMetrics = "/namespaces/:tenantNamespace/tenants/:tenantName/metrics"
tenantsDetailPods = "/namespaces/:tenantNamespace/tenants/:tenantName/pods"
tenantsDetailPools = "/namespaces/:tenantNamespace/tenants/:tenantName/pools"
tenantsDetailVolumes = "/namespaces/:tenantNamespace/tenants/:tenantName/volumes"
tenantsDetailLicense = "/namespaces/:tenantNamespace/tenants/:tenantName/license"
tenantsDetailSecurity = "/namespaces/:tenantNamespace/tenants/:tenantName/security"
storage = "/storage"
storageVolumes = "/storage/volumes"
storageDrives = "/storage/drives"
remoteBuckets = "/remote-buckets"
replication = "/replication"
license = "/license"
watch = "/watch"
heal = "/heal"
trace = "/trace"
logs = "/logs"
healthInfo = "/health-info"
)
type ConfigurationActionSet struct {
@@ -287,33 +290,36 @@ var displayRules = map[string]func() bool{
// endpointRules contains the mapping between endpoints and ActionSets, additional rules can be added here
var endpointRules = map[string]ConfigurationActionSet{
configuration: configurationActionSet,
users: usersActionSet,
usersDetail: usersActionSet,
groups: groupsActionSet,
iamPolicies: iamPoliciesActionSet,
policiesDetail: iamPoliciesActionSet,
dashboard: dashboardActionSet,
metrics: dashboardActionSet,
profiling: profilingActionSet,
buckets: bucketsActionSet,
bucketsGeneral: bucketsActionSet,
bucketsAdmin: bucketsActionSet,
bucketsAdminMain: bucketsActionSet,
serviceAccounts: serviceAccountsActionSet,
changePassword: changePasswordActionSet,
remoteBuckets: remoteBucketsActionSet,
replication: replicationActionSet,
bucketsBrowser: objectBrowserActionSet,
bucketsBrowserMenu: objectBrowserActionSet,
bucketsBrowserList: objectBrowserActionSet,
bucketsBrowserMain: objectBrowserActionSet,
license: licenseActionSet,
watch: watchActionSet,
heal: healActionSet,
trace: traceActionSet,
logs: logsActionSet,
healthInfo: healthInfoActionSet,
configuration: configurationActionSet,
notificationEndpoints: configurationActionSet,
notificationEndpointsAdd: configurationActionSet,
notificationEndpointsAddAny: configurationActionSet,
users: usersActionSet,
usersDetail: usersActionSet,
groups: groupsActionSet,
iamPolicies: iamPoliciesActionSet,
policiesDetail: iamPoliciesActionSet,
dashboard: dashboardActionSet,
metrics: dashboardActionSet,
profiling: profilingActionSet,
buckets: bucketsActionSet,
bucketsGeneral: bucketsActionSet,
bucketsAdmin: bucketsActionSet,
bucketsAdminMain: bucketsActionSet,
serviceAccounts: serviceAccountsActionSet,
changePassword: changePasswordActionSet,
remoteBuckets: remoteBucketsActionSet,
replication: replicationActionSet,
bucketsBrowser: objectBrowserActionSet,
bucketsBrowserMenu: objectBrowserActionSet,
bucketsBrowserList: objectBrowserActionSet,
bucketsBrowserMain: objectBrowserActionSet,
license: licenseActionSet,
watch: watchActionSet,
heal: healActionSet,
trace: traceActionSet,
logs: logsActionSet,
healthInfo: healthInfoActionSet,
}
// operatorRules contains the mapping between endpoints and ActionSets for operator only mode

View File

@@ -70,7 +70,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
"admin:*",
},
},
want: 23,
want: 26,
},
{
name: "all s3 endpoints",
@@ -89,7 +89,7 @@ func TestGetAuthorizedEndpoints(t *testing.T) {
"s3:*",
},
},
want: 25,
want: 28,
},
{
name: "Console User - default endpoints",

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="49.035" height="47.998" viewBox="0 0 49.035 47.998"><defs><style>.a{fill:#d0d2d4;}.b{fill:#0e2d90;}.c{fill:#adb9de;}</style></defs><path d="M89.091,200.387,75.719,187.176H40.056v13.211Z" transform="translate(-40.056 -152.389)"/><path class="a" d="M201.19,90.4V42.416H187.662V77.244Z" transform="translate(-152.155 -42.401)"/><path class="b" d="M57.736,114.687v.1H40.056V128H71.42Z" transform="translate(-40.056 -97.312)"/><path class="c" d="M127.346,73.042h.008V42.354H113.662V59.728Z" transform="translate(-96.074 -42.354)"/><path d="M53.434,56.086,40.056,43.069V56.276H53.434Z" transform="translate(-40.056 -42.897)"/><path class="a" d="M53.434,55.543V42.354H40.056v.172Z" transform="translate(-40.056 -42.354)"/></svg>

After

Width:  |  Height:  |  Size: 768 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="42.034" height="45.939" viewBox="0 0 42.034 45.939"><defs><style>.a{fill:#00a9e5;}.b{fill:#353535;}.c{fill:#00bfb3;}.d{fill:#019b8f;}.e{fill:#f9b110;}.f{fill:#fed10a;}</style></defs><path class="a" d="M132.9,115.5h-12c.057.287.172.574.23.8a21.107,21.107,0,0,1,.747,4.307c.057.574.057,1.206.057,1.78s0,1.206-.057,1.78a21.106,21.106,0,0,1-.747,4.307c-.057.287-.172.574-.23.8h12a6.891,6.891,0,0,0,0-13.782Z" transform="translate(-101.318 -99.421)"/><path class="b" d="M107.358,124.171c.057-.574.057-1.206.057-1.78s0-1.206-.057-1.78a21.106,21.106,0,0,0-.747-4.307c-.057-.287-.172-.574-.23-.8H87.834a23.487,23.487,0,0,0,0,13.782h18.548c.057-.287.172-.574.23-.8A21.107,21.107,0,0,0,107.358,124.171Z" transform="translate(-86.8 -99.421)"/><path class="c" d="M128.072,143.5h-14.93a23.6,23.6,0,0,1-1.55,2.929,22.29,22.29,0,0,1-3.043,3.9c-.4.4-.8.747-1.206,1.148a22.846,22.846,0,0,1-2.642,2.01,22.725,22.725,0,0,0,12.633,3.79,23.018,23.018,0,0,0,19.122-10.221A11.712,11.712,0,0,0,128.072,143.5Z" transform="translate(-94.421 -111.343)"/><path class="d" d="M105.375,146.429a23.6,23.6,0,0,0,1.55-2.929H90.1a22.705,22.705,0,0,0,8.441,9.992,29.127,29.127,0,0,0,2.641-2.01c.4-.345.8-.747,1.206-1.148a22.635,22.635,0,0,0,2.986-3.9Z" transform="translate(-88.205 -111.343)"/><path class="e" d="M102.289,97.258c-.4-.4-.8-.747-1.206-1.148a22.847,22.847,0,0,0-2.641-2.01A23.475,23.475,0,0,0,90,104.092h16.825a23.6,23.6,0,0,0-1.55-2.929A18.059,18.059,0,0,0,102.289,97.258Z" transform="translate(-88.162 -90.31)"/><path class="f" d="M117.333,87.5A22.725,22.725,0,0,0,104.7,91.29a29.13,29.13,0,0,1,2.642,2.01c.4.345.8.747,1.206,1.148a22.29,22.29,0,0,1,3.043,3.9,23.605,23.605,0,0,1,1.55,2.929h14.93a11.712,11.712,0,0,0,8.384-3.56A23.018,23.018,0,0,0,117.333,87.5Z" transform="translate(-94.421 -87.5)"/></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32.752" height="53.177" viewBox="0 0 32.752 53.177"><defs><style>.a{fill:#2a2a2a;}</style></defs><path class="a" d="M25.82,29.454a6.911,6.911,0,0,0-5.2,2.362l-3.258-2.306a8.786,8.786,0,0,0,.018-6.039l3.25-2.282a6.915,6.915,0,1,0-1.456-2.614l-3.253,2.283a8.948,8.948,0,0,0-5.544-3.222v-3.92A6.943,6.943,0,1,0,7.4,13.683v3.971a8.943,8.943,0,0,0,.062,17.63v4.193a6.932,6.932,0,1,0,2.976,0V35.285a8.951,8.951,0,0,0,5.45-3.17l3.279,2.321a6.93,6.93,0,1,0,6.648-4.982Zm0-16.209a3.361,3.361,0,1,1-3.361,3.361,3.365,3.365,0,0,1,3.361-3.361ZM5.593,6.932a3.361,3.361,0,1,1,3.361,3.361A3.365,3.365,0,0,1,5.593,6.932Zm6.722,39.313a3.361,3.361,0,1,1-3.361-3.361A3.365,3.365,0,0,1,12.315,46.245ZM8.954,31.152a4.688,4.688,0,1,1,4.688-4.687A4.693,4.693,0,0,1,8.954,31.152ZM25.82,39.747a3.361,3.361,0,1,1,3.361-3.361A3.365,3.365,0,0,1,25.82,39.747Z"/></svg>

After

Width:  |  Height:  |  Size: 886 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="229" height="80" viewBox="0 0 229 80"><defs><style>.a,.c{fill:none;}.a{stroke:#e5e5e5;}.b{stroke:none;}</style></defs><g class="a"><rect class="b" width="229" height="80" rx="10"/><rect class="c" x="0.5" y="0.5" width="228" height="79" rx="9.5"/></g></svg>

After

Width:  |  Height:  |  Size: 303 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="45.923" height="45.923" viewBox="0 0 45.923 45.923"><defs><style>.a{fill:#fff;}.b{fill:#606;}</style></defs><path class="a" d="M46,25.927v7.016h.136A34.792,34.792,0,0,1,80.969,67.3h6.813A41.859,41.859,0,0,0,46,25.927Zm0,14.485v7.016h.136A20.246,20.246,0,0,1,66.393,67.3h6.813A27.3,27.3,0,0,0,46,40.412Zm45.9,8.737V35a60.59,60.59,0,0,0-6.043-7.2A59.1,59.1,0,0,0,77.936,21.4H62.907A49.439,49.439,0,0,1,91.9,49.149Z" transform="translate(-45.977 -21.4)"/><path class="b" d="M46.036,47.428H45.9V64.992A2.318,2.318,0,0,0,48.209,67.3H66.293A20.231,20.231,0,0,0,46.036,47.428Zm0-14.485H45.9v7.469A27.283,27.283,0,0,1,73.105,67.3h7.741a34.743,34.743,0,0,0-34.81-34.358ZM91.823,65.015V49.149A49.463,49.463,0,0,0,62.852,21.4H48.209A2.318,2.318,0,0,0,45.9,23.709v2.241A41.8,41.8,0,0,1,87.659,67.323h1.856a2.318,2.318,0,0,0,2.309-2.309ZM85.78,27.805A64.821,64.821,0,0,1,91.823,35V23.686A2.279,2.279,0,0,0,89.537,21.4H77.881A57.512,57.512,0,0,1,85.78,27.805Z" transform="translate(-45.9 -21.4)"/></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="50.771" height="49.812" viewBox="0 0 50.771 49.812"><defs><style>.a,.b{fill:#0e698f;}.b{fill-rule:evenodd;}</style></defs><path class="a" d="M289.628,38.55a15.85,15.85,0,0,0-6.693.945c-.514.217-1.333.222-1.417.867.282.3.326.738.551,1.1a8.687,8.687,0,0,0,1.811,2.126c.711.537,1.443,1.11,2.205,1.575,1.355.826,2.868,1.3,4.174,2.126.769.488,1.533,1.1,2.284,1.653.371.272.62.7,1.1.867v-.079c-.253-.322-.319-.766-.551-1.1l-1.024-1.024a16.8,16.8,0,0,0-3.622-3.465c-1.077-.773-3.488-1.817-3.937-3.071l-.079-.079a17.361,17.361,0,0,0,2.363-.551c1.184-.318,2.242-.236,3.465-.552l1.654-.473V39.1c-.618-.634-1.059-1.474-1.733-2.047a50.482,50.482,0,0,0-5.669-4.253c-1.1-.694-2.458-1.145-3.622-1.733-.392-.2-1.081-.3-1.339-.63a16.691,16.691,0,0,1-1.417-2.678c-.988-1.9-1.959-3.982-2.835-5.985a32.281,32.281,0,0,0-1.732-3.937A34.779,34.779,0,0,0,260.176,4.923a16.041,16.041,0,0,0-4.41-1.417l-2.6-.158a13.841,13.841,0,0,1-1.575-1.181c-1.975-1.248-7.041-3.962-8.5-.394-.924,2.252,1.381,4.45,2.2,5.592a16.886,16.886,0,0,1,1.732,2.6c.272.592.319,1.185.551,1.811a41.587,41.587,0,0,0,1.811,4.646,16.425,16.425,0,0,0,1.26,2.126c.29.4.787.57.866,1.182a9.624,9.624,0,0,0-.787,2.6c-1.231,3.881-.767,8.7,1.024,11.577.549.882,1.843,2.773,3.622,2.047,1.556-.634,1.209-2.6,1.654-4.331.1-.393.039-.682.236-.945v.079l1.417,2.835a19.3,19.3,0,0,0,4.489,4.646c.818.618,1.462,1.686,2.52,2.047V40.2h-.079c-.2-.319-.526-.452-.787-.709a18.044,18.044,0,0,1-1.811-2.047,47.913,47.913,0,0,1-3.859-6.3c-.552-1.06-1.031-2.229-1.5-3.308-.179-.416-.177-1.044-.551-1.26a15.749,15.749,0,0,0-1.654,2.363,20.226,20.226,0,0,0-.945,5.2c-.138.049-.077.015-.158.079-1.1-.265-1.482-1.394-1.89-2.362a14.886,14.886,0,0,1-.316-9.214c.235-.73,1.3-3.028.867-3.7-.2-.673-.881-1.062-1.26-1.575a12.4,12.4,0,0,1-1.26-2.205c-.844-1.91-1.238-4.054-2.126-5.985A17.477,17.477,0,0,0,246.631,6.5a15.612,15.612,0,0,1-1.89-2.678c-.18-.39-.425-1.016-.158-1.417a.625.625,0,0,1,.473-.473c.457-.352,1.729.117,2.2.315a19.2,19.2,0,0,1,3.387,1.732c.514.341,1.033,1,1.654,1.182h.709c1.109.255,2.351.079,3.386.394a20.465,20.465,0,0,1,4.961,2.363,30.711,30.711,0,0,1,10.789,11.813c.408.783.585,1.531.945,2.363.726,1.676,1.64,3.4,2.362,5.04a23.549,23.549,0,0,0,2.441,4.646c.536.715,2.6,1.1,3.543,1.5a20.859,20.859,0,0,1,2.363.945c1.192.719,2.347,1.575,3.465,2.363.559.394,2.277,1.257,2.362,1.969Z" transform="translate(-242.873 0)"/><path class="b" d="M273.184,24.357a5.649,5.649,0,0,0-1.418.157v.079h.079a10.766,10.766,0,0,0,1.1,1.417l.788,1.654.078-.078a1.923,1.923,0,0,0,.709-1.732c-.2-.206-.225-.464-.394-.709C273.9,24.817,273.468,24.632,273.184,24.357Z" transform="translate(-261.629 -15.811)"/></svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="51.66" height="53.482" viewBox="0 0 51.66 53.482"><defs><style>.a{fill:#34a574;}.b{fill:#27aae1;}.c{fill:#8dc63f;}.d{fill:#375c93;}.e{fill:#fff;}</style></defs><path class="a" d="M142.8,5.3h25.83V26.24H142.8Z" transform="translate(-116.97 -5.3)"/><path class="b" d="M8.1,5.3H33.93V26.24H8.1Z" transform="translate(-8.1 -5.3)"/><path class="c" d="M142.8,114.6h25.83v20.94H142.8Z" transform="translate(-116.97 -93.641)"/><path class="d" d="M8.1,114.6H33.93v20.94H8.1Z" transform="translate(-8.1 -93.641)"/><path class="c" d="M123,223.2l12.637,11.7V223.2Z" transform="translate(-100.967 -181.416)"/><path class="d" d="M126.312,222.8l.134,3.682L122.4,222.7Z" transform="translate(-100.482 -181.012)"/><path class="e" d="M79.465,73.435V56.1H85.64V78.517H76.282L57.394,60.875V78.536H51.2V56.1h9.684Z" transform="translate(-42.935 -46.359)"/></svg>

After

Width:  |  Height:  |  Size: 888 B

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="50.821" height="50.82" viewBox="0 0 50.821 50.82"><defs><style>.a{fill:#38bef2;}</style></defs><path class="a" d="M24.482,50.438l-9.431-9.431A3.931,3.931,0,0,1,9.814,35.77L.386,26.342a1.317,1.317,0,0,1,0-1.864l9.427-9.426a3.931,3.931,0,0,1,5.237-5.237L24.479.386a1.317,1.317,0,0,1,1.862,0L35.77,9.814a3.931,3.931,0,0,1,5.237,5.237l9.428,9.428a1.316,1.316,0,0,1,0,1.864L41.007,35.77a3.931,3.931,0,0,1-5.237,5.237l-9.429,9.428a1.32,1.32,0,0,1-1.86,0ZM16.965,35.869a3.871,3.871,0,0,1,.337,1.583,3.922,3.922,0,0,1-.44,1.8L25.411,47.8l8.549-8.549a3.907,3.907,0,0,1-.035-3.535L25.369,27.2Zm19.074,1.583a1.413,1.413,0,1,0,1.413-1.413A1.415,1.415,0,0,0,36.039,37.453Zm-24.084,0a1.413,1.413,0,1,0,1.413-1.413A1.415,1.415,0,0,0,11.955,37.453Zm3.3-3.444,7.077-7.3H17.079a3.981,3.981,0,0,1-1.34,1.836,3.923,3.923,0,0,1-4.742,0,3.982,3.982,0,0,1-1.34-1.836H4.32l7.248,7.248a3.9,3.9,0,0,1,3.691.049Zm23.994-.049L46.5,26.711H41.215a3.97,3.97,0,0,1-1.322,1.946,3.915,3.915,0,0,1-4.88,0,3.969,3.969,0,0,1-1.322-1.946H28.446L35.7,33.932a3.906,3.906,0,0,1,3.55.027Zm-3.214-8.384a1.413,1.413,0,1,0,1.413-1.413A1.415,1.415,0,0,0,36.039,25.575Zm-24.084-.165A1.413,1.413,0,1,0,13.368,24,1.415,1.415,0,0,0,11.955,25.411Zm27.831-3a3.956,3.956,0,0,1,1.346,1.779h5.449l-7.329-7.328a3.905,3.905,0,0,1-3.767-.089L28.292,24.19h5.48a3.929,3.929,0,0,1,6.014-1.779ZM15.773,22.3A3.977,3.977,0,0,1,17.1,24.19h5.235l-7.3-7.263a3.9,3.9,0,0,1-3.472-.066L4.24,24.19H9.633A3.976,3.976,0,0,1,10.964,22.3a3.919,3.919,0,0,1,4.808,0Zm1.089-10.733a3.9,3.9,0,0,1-.006,3.61l8.481,8.438,8.484-8.748a3.876,3.876,0,0,1-.3-1.5,3.919,3.919,0,0,1,.441-1.8L25.411,3.019Zm19.178,1.8a1.413,1.413,0,1,0,1.413-1.413A1.415,1.415,0,0,0,36.039,13.368Zm-24.084,0a1.413,1.413,0,1,0,1.413-1.413A1.415,1.415,0,0,0,11.955,13.368Z"/></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 7.3 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="49.23" height="42.194" viewBox="0 0 49.23 42.194"><defs><style>.a{fill:#a41e11;}.b{fill:#d82c20;}.c{fill:#fff;}.d{fill:#7a0c00;}.e{fill:#ad2115;}</style></defs><path class="a" d="M218.623,310.094c-2.627,1.369-16.236,6.965-19.134,8.475s-4.507,1.5-6.8.4-16.771-6.944-19.38-8.191c-1.3-.623-1.99-1.149-1.99-1.646v-4.976s18.854-4.1,21.9-5.2,4.1-1.132,6.69-.183,18.079,3.744,20.639,4.681c0,0,0,4.444,0,4.905,0,.492-.59,1.032-1.928,1.728Z" transform="translate(-171.323 -277.559)"/><path class="b" d="M218.622,295.26c-2.627,1.369-16.236,6.965-19.134,8.475s-4.507,1.5-6.8.4-16.771-6.945-19.38-8.191-2.664-2.105-.1-3.109,16.966-6.655,20.01-7.747,4.1-1.132,6.69-.182,16.119,6.334,18.679,7.271,2.659,1.711.032,3.081Z" transform="translate(-171.322 -267.702)"/><path class="a" d="M218.623,282.054c-2.627,1.369-16.236,6.965-19.134,8.476s-4.507,1.5-6.8.4-16.771-6.944-19.38-8.191c-1.3-.623-1.99-1.149-1.99-1.645v-4.977s18.854-4.1,21.9-5.2,4.1-1.132,6.69-.183,18.079,3.743,20.639,4.681c0,0,0,4.444,0,4.906C220.551,280.818,219.96,281.358,218.623,282.054Z" transform="translate(-171.323 -257.634)"/><path class="b" d="M218.622,267.22c-2.627,1.369-16.236,6.965-19.134,8.476s-4.507,1.5-6.8.4-16.771-6.944-19.38-8.191-2.664-2.105-.1-3.109,16.966-6.654,20.01-7.746,4.1-1.132,6.69-.183,16.119,6.333,18.679,7.271,2.659,1.711.032,3.081Z" transform="translate(-171.322 -247.777)"/><path class="a" d="M218.623,252.976c-2.627,1.369-16.236,6.965-19.134,8.476s-4.507,1.5-6.8.4-16.771-6.944-19.38-8.191c-1.3-.623-1.99-1.149-1.99-1.645V247.04s18.854-4.1,21.9-5.2,4.1-1.132,6.69-.183,18.079,3.743,20.639,4.681c0,0,0,4.444,0,4.906,0,.491-.59,1.031-1.928,1.728Z" transform="translate(-171.323 -236.97)"/><path class="b" d="M218.622,238.141c-2.627,1.369-16.236,6.965-19.134,8.476s-4.507,1.5-6.8.4-16.771-6.944-19.38-8.191-2.664-2.105-.1-3.109,16.966-6.654,20.01-7.746,4.1-1.132,6.69-.182,16.119,6.333,18.679,7.271,2.659,1.711.032,3.08Z" transform="translate(-171.322 -227.113)"/><path class="c" d="M249.968,239.756l-4.266.443-.955,2.3-1.542-2.564-4.925-.443,3.675-1.325-1.1-2.034,3.441,1.346,3.244-1.062-.877,2.1Z" transform="translate(-218.903 -233.521)"/><path class="c" d="M240.2,274.773l-7.961-3.3,11.408-1.751Z" transform="translate(-214.611 -257.39)"/><ellipse class="c" cx="6.097" cy="2.363" rx="6.097" ry="2.363" transform="translate(8.456 7.513)"/><path class="d" d="M296.09,250.83l6.751,2.668-6.746,2.665Z" transform="translate(-259.984 -243.967)"/><path class="e" d="M270.28,253.785l7.469-2.955.006,5.333-.732.286Z" transform="translate(-241.643 -243.967)"/></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="46.215" height="43.025" viewBox="0 0 46.215 43.025"><defs><style>.a{fill:#c83b51;}.b{fill:#696969;}</style></defs><path class="a" d="M51.317,19.006c-1.922,3.232-3.764,6.361-5.644,9.467a2.475,2.475,0,0,0-.336,2.461A4.6,4.6,0,0,1,42.076,37.2a4.7,4.7,0,0,1-5.786-3.9A4.8,4.8,0,0,1,40.562,27.9c.233-.033.471-.037.863-.066l4.232-7.1C43,18.094,41.411,15,41.762,11.166a10.884,10.884,0,0,1,3.261-6.972,11.072,11.072,0,0,1,13.815-1.45,10.755,10.755,0,0,1,4.5,12.508L59.475,14.2a7.332,7.332,0,0,0-1.56-6.7,6.691,6.691,0,0,0-4.189-2.191,6.814,6.814,0,0,0-7.443,4.823c-1.083,3.647.556,6.627,5.034,8.872Z" transform="translate(-29.658 -0.973)"/><path class="b" d="M110.984,45.394l4.092,7.218a11.141,11.141,0,0,1,10.238,19.58,10.958,10.958,0,0,1-14.294-1.423l3.154-2.639c3.97,2.571,7.443,2.45,10.021-.595a6.909,6.909,0,0,0-.111-9.014c-2.611-2.935-6.107-3.024-10.334-.207-1.753-3.111-3.537-6.2-5.235-9.329a3.184,3.184,0,0,0-2.495-1.892,4.439,4.439,0,0,1-3.63-4.3,4.685,4.685,0,0,1,8.337-3.174,4.409,4.409,0,0,1,.814,4.364c-.15.447-.345.879-.556,1.409Z" transform="translate(-83.835 -31.182)"/><path class="b" d="M30.387,129.273H22.094a11.364,11.364,0,0,1-5.47,7.587,11.06,11.06,0,0,1-7.417,1.321A11.269,11.269,0,0,1,.029,128.1a11.154,11.154,0,0,1,8.548-11.649c.353,1.281.709,2.575,1.062,3.853-4.688,2.392-6.311,5.406-5,9.175a6.83,6.83,0,0,0,8,4.431c3.638-.718,5.473-3.742,5.249-8.594,3.449,0,6.9-.036,10.35.018a3.779,3.779,0,0,0,3.4-1.306,4.471,4.471,0,0,1,6.545.068,4.7,4.7,0,1,1-6.795,6.5A16.224,16.224,0,0,1,30.387,129.273Z" transform="translate(-0.001 -95.529)"/></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1,33 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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 * as React from "react";
import { SvgIcon, SvgIconProps } from "@material-ui/core";
const LambdaIcon = (props: SvgIconProps) => {
return (
<SvgIcon {...props}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 227.615 256">
<path
data-name="Trazado 442"
d="M35.802 0a15.363 15.363 0 000 30.727c23.352 0 32.017 14.872 40.928 34.353l1.475 3.134c1.229 2.643 3.872 8.542 7.436 16.408L1.757 233.094a15.363 15.363 0 0026.729 15.118l72.823-128.623c19.481 44 44 99.494 44.431 100.415a58.2 58.2 0 0071.046 33.37 15.376 15.376 0 00-9.1-29.375 27.531 27.531 0 01-33.861-16.593c-2.458-5.531-59.856-135.751-67.6-152.282l-1.352-2.95C96.948 35.336 80.786 0 35.802 0z"
/>
</svg>
</SvgIcon>
);
};
export default LambdaIcon;

View File

@@ -0,0 +1,33 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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 * as React from "react";
import { SvgIcon, SvgIconProps } from "@material-ui/core";
const TiersIcon = (props: SvgIconProps) => {
return (
<SvgIcon {...props}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 236.312 256">
<path
data-name="Trazado 441"
d="M118.387 0a9.847 9.847 0 00-5.154 1.308L4.925 63.851a9.847 9.847 0 000 17.039l33.4 19.289-33.4 19.289a9.847 9.847 0 000 17.058l33.4 19.27-33.4 19.289a9.847 9.847 0 000 17.058l108.308 62.54a9.847 9.847 0 009.846 0l108.308-62.54a9.847 9.847 0 000-17.058l-33.4-19.289 33.4-19.27a9.847 9.847 0 000-17.058l-33.4-19.289 33.4-19.289a9.847 9.847 0 000-17.039L123.079 1.311A9.847 9.847 0 00118.387 0zM58.041 111.563l55.192 31.866a9.847 9.847 0 009.846 0l55.192-31.866 28.5 16.443-88.615 51.154-88.616-51.154zm-.02 55.617l55.212 31.866a9.847 9.847 0 009.846 0l55.212-31.866 28.481 16.443-88.615 51.155-88.617-51.156z"
/>
</svg>
</SvgIcon>
);
};
export default TiersIcon;

View File

@@ -99,3 +99,5 @@ export { default as FileVideoIcon } from "./FileVideoIcon";
export { default as ArrowRightIcon } from "./ArrowRightIcon";
export { default as CalendarIcon } from "./CalendarIcon";
export { default as UptimeIcon } from "./UptimeIcon";
export { default as LambdaIcon } from "./LambdaIcon";
export { default as TiersIcon } from "./TiersIcon";

View File

@@ -359,8 +359,8 @@ export const typesSelection = {
iconContainer: {
display: "flex" as const,
flexDirection: "row" as const,
maxWidth: 455,
justifyContent: "space-between" as const,
maxWidth: 1180,
justifyContent: "start" as const,
flexWrap: "wrap" as const,
width: "100%",
},
@@ -388,21 +388,40 @@ export const typesSelection = {
height: "80px",
},
lambdaNotif: {
backgroundColor: "#fff",
border: "#393939 1px solid",
background:
"linear-gradient(90deg, rgba(249,249,250,1) 0%, rgba(250,250,251,1) 68%, rgba(254,254,254,1) 100%)",
border: "#E5E5E5 1px solid",
borderRadius: 5,
width: 101,
height: 91,
width: 250,
height: 80,
display: "flex",
alignItems: "center",
justifyContent: "start",
marginBottom: 16,
marginRight: 8,
cursor: "pointer",
padding: 0,
overflow: "hidden",
},
lambdaNotifIcon: {
backgroundColor: "#FEFEFE",
display: "flex",
alignItems: "center",
justifyContent: "center",
marginBottom: 16,
cursor: "pointer",
width: 80,
height: 80,
"& img": {
maxWidth: 71,
maxHeight: 71,
maxWidth: 46,
maxHeight: 46,
},
},
lambdaNotifTitle: {
color: "#07193E",
fontSize: 16,
fontFamily: "Lato,sans-serif",
paddingLeft: 18,
},
};
export const logsCommon = {

View File

@@ -35,7 +35,7 @@ interface IMainErrorProps {
const styles = (theme: Theme) =>
createStyles({
mainErrorContainer: {
position: "absolute",
position: "fixed",
width: "100%",
backgroundColor: "#fff",
border: "#C72C48 1px solid",

View File

@@ -20,7 +20,6 @@ import { Grid } from "@material-ui/core";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { containerForHeader } from "../Common/FormComponents/common/styleLibrary";
import ConfigurationsList from "./ConfigurationPanels/ConfigurationsList";
import ListNotificationEndpoints from "./NotificationEndpoints/ListNotificationEndpoints";
import ListTiersConfiguration from "./TiersConfiguration/ListTiersConfiguration";
import { AppState } from "../../../store";
import { connect } from "react-redux";
@@ -68,15 +67,6 @@ const ConfigurationMain = ({
>
<ListItemText primary="Configurations" />
</ListItem>
<ListItem
button
selected={selectedTab === 1}
onClick={() => {
setSelectedTab(1);
}}
>
<ListItemText primary="Lambda Notifications" />
</ListItem>
<ListItem
button
selected={selectedTab === 2}
@@ -95,12 +85,6 @@ const ConfigurationMain = ({
<ConfigurationsList />
</Grid>
)}
{selectedTab === 1 && (
<Grid item xs={12}>
<h1 className={classes.sectionTitle}>Lambda Notifications</h1>
<ListNotificationEndpoints />
</Grid>
)}
{selectedTab === 2 && distributedSetup && (
<Grid item xs={12}>
<h1 className={classes.sectionTitle}>Tiers</h1>

View File

@@ -22,7 +22,7 @@ import history from "../../../../history";
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
import { configurationElements } from "../utils";
import { IConfigurationElement } from "../types";
import EditConfiguration from "../CustomForms/EditConfiguration";
import EditConfiguration from "../../NotificationEndpoints/CustomForms/EditConfiguration";
import {
actionsTray,
containerForHeader,

View File

@@ -23,7 +23,7 @@ import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import InputAdornment from "@material-ui/core/InputAdornment";
import AddIcon from "@material-ui/icons/Add";
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
import EditConfiguration from "../CustomForms/EditConfiguration";
import EditConfiguration from "../../NotificationEndpoints/CustomForms/EditConfiguration";
import SearchIcon from "../../../../icons/SearchIcon";
interface IMatchParams {

View File

@@ -1,99 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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, { Fragment } from "react";
import Grid from "@material-ui/core/Grid";
import { Button } from "@material-ui/core";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { servicesList } from "./utils";
import {
settingsCommon,
typesSelection,
} from "../../Common/FormComponents/common/styleLibrary";
interface INotificationTypeSelector {
classes: any;
setService: (trigger: string) => any;
}
const nonLogos = servicesList.filter((elService) => elService.logo === "");
const withLogos = servicesList.filter((elService) => elService.logo !== "");
const styles = (theme: Theme) =>
createStyles({
...settingsCommon,
customTitle: {
...settingsCommon.customTitle,
marginTop: 0,
},
...typesSelection,
});
const NotificationTypeSelector = ({
classes,
setService,
}: INotificationTypeSelector) => {
return (
<Fragment>
<Grid container>
<Grid item xs={12}>
<Grid item xs={12} className={classes.customTitle}>
Pick a supported service
</Grid>
<Grid item xs={12} className={classes.centerElements}>
<div className={classes.nonIconContainer}>
{nonLogos.map((item) => {
return (
<Button
variant="contained"
color="primary"
key={`non-icon-${item.targetTitle}`}
onClick={() => {
setService(item.actionTrigger);
}}
>
{item.targetTitle.toUpperCase()}
</Button>
);
})}
</div>
<div className={classes.iconContainer}>
{withLogos.map((item) => {
return (
<button
key={`icon-${item.targetTitle}`}
className={classes.lambdaNotif}
onClick={() => {
setService(item.actionTrigger);
}}
>
<img
src={item.logo}
className={classes.logoButton}
alt={item.targetTitle}
/>
</button>
);
})}
</div>
</Grid>
</Grid>
</Grid>
</Fragment>
);
};
export default withStyles(styles)(NotificationTypeSelector);

View File

@@ -1,93 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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 { NotificationEndpointItem } from "./types";
import {
notifyAmqp,
notifyElasticsearch,
notifyKafka,
notifyMqtt,
notifyMysql,
notifyNats,
notifyNsq,
notifyPostgres,
notifyRedis,
notifyWebhooks,
} from "../utils";
export const notificationTransform = (
notificationElements: NotificationEndpointItem[]
) => {
return notificationElements.map((element) => {
return {
service_name: `${element.service}:${element.account_id}`,
status: element.status,
};
});
};
export const servicesList = [
{
actionTrigger: notifyPostgres,
targetTitle: "Postgres SQL",
logo: "/postgres.png",
},
{
actionTrigger: notifyKafka,
targetTitle: "Kafka",
logo: "/kafka.png",
},
{
actionTrigger: notifyAmqp,
targetTitle: "AMQP",
logo: "/amqp.png",
},
{
actionTrigger: notifyMqtt,
targetTitle: "MQTT",
logo: "/mqtt.png",
},
{
actionTrigger: notifyRedis,
targetTitle: "Redis",
logo: "/redis.png",
},
{
actionTrigger: notifyNats,
targetTitle: "NATS",
logo: "/nats.png",
},
{
actionTrigger: notifyMysql,
targetTitle: "Mysql",
logo: "/mysql.png",
},
{
actionTrigger: notifyElasticsearch,
targetTitle: "Elastic Search",
logo: "/elasticsearch.png",
},
{
actionTrigger: notifyWebhooks,
targetTitle: "Webhook",
logo: "",
},
{
actionTrigger: notifyNsq,
targetTitle: "NSQ",
logo: "",
},
];

View File

@@ -41,6 +41,7 @@ import AddTierConfiguration from "./AddTierConfiguration";
import UpdateTierCredentiasModal from "./UpdateTierCredentiasModal";
import RefreshIcon from "../../../../icons/RefreshIcon";
import SearchIcon from "../../../../icons/SearchIcon";
import history from "../../../../history";
interface IListTiersConfig {
classes: any;
@@ -341,11 +342,17 @@ const ListTiersConfiguration = ({
typeSelect("minio");
}}
>
<img
src={"/minioTier.png"}
className={classes.logoButton}
alt={"MinIO"}
/>
<div className={classes.lambdaNotifIcon}>
<img
src={"/minioTier.png"}
className={classes.logoButton}
alt={"MinIO"}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>MinIO</b>
</div>
</button>
<button
className={classes.lambdaNotif}
@@ -353,23 +360,36 @@ const ListTiersConfiguration = ({
typeSelect("gcs");
}}
>
<img
src={"/gcs.png"}
className={classes.logoButton}
alt={"GCS"}
/>
<div className={classes.lambdaNotifIcon}>
<img
src={"/gcs.png"}
className={classes.logoButton}
alt={"GCS"}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>Google Cloud Storage</b>
</div>
</button>
<button
className={classes.lambdaNotif}
onClick={() => {
typeSelect("s3");
}}
>
<img
src={"/amazon.png"}
className={classes.logoButton}
alt={"s3"}
/>
<div className={classes.lambdaNotifIcon}>
<img
src={"/amazon.png"}
className={classes.logoButton}
alt={"s3"}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>AWS S3</b>
</div>
</button>
<button
className={classes.lambdaNotif}
@@ -377,11 +397,17 @@ const ListTiersConfiguration = ({
typeSelect("azure");
}}
>
<img
src={"/azure.png"}
className={classes.logoButton}
alt={"Azure"}
/>
<div className={classes.lambdaNotifIcon}>
<img
src={"/azure.png"}
className={classes.logoButton}
alt={"Azure"}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>Azure Blob Storage</b>
</div>
</button>
</div>
</Grid>

View File

@@ -15,17 +15,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import { IConfigurationElement, IElementValue } from "./types";
export const notifyPostgres = "notify_postgres";
export const notifyMysql = "notify_mysql";
export const notifyKafka = "notify_kafka";
export const notifyAmqp = "notify_amqp";
export const notifyMqtt = "notify_mqtt";
export const notifyRedis = "notify_redis";
export const notifyNats = "notify_nats";
export const notifyElasticsearch = "notify_elasticsearch";
export const notifyWebhooks = "notify_webhook";
export const notifyNsq = "notify_nsq";
export const configurationElements: IConfigurationElement[] = [
{
configuration_id: "region",
@@ -373,466 +362,6 @@ export const fieldsConfigurations: any = {
],
};
const commonFields = [
{
name: "queue-dir",
label: "Queue Directory",
required: true,
tooltip: "staging dir for undelivered messages e.g. '/home/events'",
type: "string",
placeholder: "Enter Queue Directory",
},
{
name: "queue-limit",
label: "Queue Limit",
required: false,
tooltip: "maximum limit for undelivered messages, defaults to '10000'",
type: "number",
placeholder: "Enter Queue Limit",
},
{
name: "comment",
label: "Comment",
required: false,
type: "comment",
placeholder: "Enter Comment",
},
];
export const notificationEndpointsFields: any = {
[notifyKafka]: [
{
name: "brokers",
label: "Brokers",
required: true,
tooltip: "Comma separated list of Kafka broker addresses",
type: "string",
placeholder: "Enter Brokers",
},
{
name: "topic",
label: "Topic",
tooltip: "Kafka topic used for bucket notifications",
type: "string",
placeholder: "Enter Topic",
},
{
name: "sasl_username",
label: "SASL Username",
tooltip: "Username for SASL/PLAIN or SASL/SCRAM authentication",
type: "string",
placeholder: "Enter SASL Username",
},
{
name: "sasl_password",
label: "SASL Password",
tooltip: "Password for SASL/PLAIN or SASL/SCRAM authentication",
type: "string",
placeholder: "Enter SASL Password",
},
{
name: "sasl_mechanism",
label: "SASL Mechanism",
tooltip: "SASL authentication mechanism, default 'PLAIN'",
type: "string",
},
{
name: "tls_client_auth",
label: "TLS Client Auth",
tooltip:
"Client Auth determines the Kafka server's policy for TLS client auth",
type: "string",
placeholder: "Enter TLS Client Auth",
},
{
name: "sasl",
label: "SASL",
tooltip: "Set to 'on' to enable SASL authentication",
type: "on|off",
},
{
name: "tls",
label: "TLS",
tooltip: "Set to 'on' to enable TLS",
type: "on|off",
},
{
name: "tls_skip_verify",
label: "TLS skip verify",
tooltip:
'Trust server TLS without verification, defaults to "on" (verify)',
type: "on|off",
},
{
name: "client_tls_cert",
label: "client TLS cert",
tooltip: "Path to client certificate for mTLS auth",
type: "path",
placeholder: "Enter TLS Client Cert",
},
{
name: "client_tls_key",
label: "client TLS key",
tooltip: "Path to client key for mTLS auth",
type: "path",
placeholder: "Enter TLS Client Key",
},
{
name: "version",
label: "Version",
tooltip: "Specify the version of the Kafka cluster e.g '2.2.0'",
type: "string",
placeholder: "Enter Kafka Version",
},
...commonFields,
],
[notifyAmqp]: [
{
name: "url",
required: true,
label: "URL",
tooltip:
"AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`",
type: "url",
},
{
name: "exchange",
label: "Exchange",
tooltip: "Name of the AMQP exchange",
type: "string",
placeholder: "Enter Exchange",
},
{
name: "exchange_type",
label: "Exchange Type",
tooltip: "AMQP exchange type",
type: "string",
placeholder: "Enter Exchange Type",
},
{
name: "routing_key",
label: "Routing Key",
tooltip: "Routing key for publishing",
type: "string",
placeholder: "Enter Routing Key",
},
{
name: "mandatory",
label: "Mandatory",
tooltip:
"Quietly ignore undelivered messages when set to 'off', default is 'on'",
type: "on|off",
},
{
name: "durable",
label: "Durable",
tooltip:
"Persist queue across broker restarts when set to 'on', default is 'off'",
type: "on|off",
},
{
name: "no_wait",
label: "No Wait",
tooltip:
"Non-blocking message delivery when set to 'on', default is 'off'",
type: "on|off",
},
{
name: "internal",
label: "Internal",
tooltip:
"Set to 'on' for exchange to be not used directly by publishers, but only when bound to other exchanges",
type: "on|off",
},
{
name: "auto_deleted",
label: "Auto Deleted",
tooltip:
"Auto delete queue when set to 'on', when there are no consumers",
type: "on|off",
},
{
name: "delivery_mode",
label: "Delivery Mode",
tooltip: "Set to '1' for non-persistent or '2' for persistent queue",
type: "number",
placeholder: "Enter Delivery Mode",
},
...commonFields,
],
[notifyRedis]: [
{
name: "address",
required: true,
label: "Address",
tooltip: "Redis server's address. For example: `localhost:6379`",
type: "address",
placeholder: "Enter Address",
},
{
name: "key",
required: true,
label: "Key",
tooltip: "Redis key to store/update events, key is auto-created",
type: "string",
placeholder: "Enter Key",
},
{
name: "password",
label: "Password",
tooltip: "Redis server password",
type: "string",
placeholder: "Enter Password",
},
...commonFields,
],
[notifyMqtt]: [
{
name: "broker",
required: true,
label: "Broker",
tooltip: "MQTT server endpoint e.g. `tcp://localhost:1883`",
type: "uri",
placeholder: "Enter Brokers",
},
{
name: "topic",
required: true,
label: "Topic",
tooltip: "name of the MQTT topic to publish",
type: "string",
placeholder: "Enter Topic",
},
{
name: "username",
label: "Username",
tooltip: "MQTT username",
type: "string",
placeholder: "Enter Username",
},
{
name: "password",
label: "Password",
tooltip: "MQTT password",
type: "string",
placeholder: "Enter Password",
},
{
name: "qos",
label: "QOS",
tooltip: "Set the quality of service priority, defaults to '0'",
type: "number",
placeholder: "Enter QOS",
},
{
name: "keep_alive_interval",
label: "Keep Alive Interval",
tooltip: "Keep-alive interval for MQTT connections in s,m,h,d",
type: "duration",
placeholder: "Enter Keep Alive Internal",
},
{
name: "reconnect_interval",
label: "Reconnect Interval",
tooltip: "Reconnect interval for MQTT connections in s,m,h,d",
type: "duration",
placeholder: "Enter Reconnect Interval",
},
...commonFields,
],
[notifyNats]: [
{
name: "address",
required: true,
label: "Address",
tooltip: "NATS server address e.g. '0.0.0.0:4222'",
type: "address",
placeholder: "Enter Address",
},
{
name: "subject",
required: true,
label: "Subject",
tooltip: "NATS subscription subject",
type: "string",
placeholder: "Enter NATS Subject",
},
{
name: "username",
label: "Username",
tooltip: "NATS username",
type: "string",
placeholder: "Enter NATS Username",
},
{
name: "password",
label: "Password",
tooltip: "NATS password",
type: "string",
placeholder: "Enter NATS password",
},
{
name: "token",
label: "Token",
tooltip: "NATS token",
type: "string",
placeholder: "Enter NATS token",
},
{
name: "tls",
label: "TLS",
tooltip: "Set to 'on' to enable TLS",
type: "on|off",
},
{
name: "tls_skip_verify",
label: "TLS Skip Verify",
tooltip:
'Trust server TLS without verification, defaults to "on" (verify)',
type: "on|off",
},
{
name: "ping_interval",
label: "Ping Interval",
tooltip: "Client ping commands interval in s,m,h,d. Disabled by default",
type: "duration",
placeholder: "Enter Ping Interval",
},
{
name: "streaming",
label: "Streaming",
tooltip: "Set to 'on', to use streaming NATS server",
type: "on|off",
},
{
name: "streaming_async",
label: "Streaming async",
tooltip: "Set to 'on', to enable asynchronous publish",
type: "on|off",
},
{
name: "streaming_max_pub_acks_in_flight",
label: "Streaming max publish ACKS in flight",
tooltip: "Number of messages to publish without waiting for ACKs",
type: "number",
placeholder: "Enter Streaming in flight value",
},
{
name: "streaming_cluster_id",
label: "Streaming Cluster ID",
tooltip: "Unique ID for NATS streaming cluster",
type: "string",
placeholder: "Enter Streaming Cluster ID",
},
{
name: "cert_authority",
label: "Cert Authority",
tooltip: "Path to certificate chain of the target NATS server",
type: "string",
placeholder: "Enter Cert Authority",
},
{
name: "client_cert",
label: "Client Cert",
tooltip: "Client cert for NATS mTLS auth",
type: "string",
placeholder: "Enter Client Cert",
},
{
name: "client_key",
label: "Client Key",
tooltip: "Client cert key for NATS mTLS auth",
type: "string",
placeholder: "Enter Client Key",
},
...commonFields,
],
[notifyElasticsearch]: [
{
name: "url",
required: true,
label: "URL",
tooltip:
"Elasticsearch server's address, with optional authentication info",
type: "url",
placeholder: "Enter URL",
},
{
name: "index",
required: true,
label: "Index",
tooltip:
"Elasticsearch index to store/update events, index is auto-created",
type: "string",
placeholder: "Enter Index",
},
{
name: "format",
required: true,
label: "Format",
tooltip:
"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",
type: "enum",
placeholder: "Enter Format",
},
...commonFields,
],
[notifyWebhooks]: [
{
name: "endpoint",
required: true,
label: "Endpoint",
tooltip:
"webhook server endpoint e.g. http://localhost:8080/minio/events",
type: "url",
placeholder: "Enter Endpoint",
},
{
name: "auth_token",
label: "Auth Token",
tooltip: "opaque string or JWT authorization token",
type: "string",
placeholder: "Enter auth_token",
},
...commonFields,
],
[notifyNsq]: [
{
name: "nsqd_address",
required: true,
label: "NSQD Address",
tooltip: "NSQ server address e.g. '127.0.0.1:4150'",
type: "address",
placeholder: "Enter nsqd_address",
},
{
name: "topic",
required: true,
label: "Topic",
tooltip: "NSQ topic",
type: "string",
placeholder: "Enter Topic",
},
{
name: "tls",
label: "TLS",
tooltip: "set to 'on' to enable TLS",
type: "on|off",
},
{
name: "tls_skip_verify",
label: "TLS Skip Verify",
tooltip:
'trust server TLS without verification, defaults to "on" (verify)',
type: "on|off",
},
...commonFields,
],
};
export const removeEmptyFields = (formFields: IElementValue[]) => {
const nonEmptyFields = formFields.filter((field) => field.value !== "");

View File

@@ -56,6 +56,9 @@ import Metrics from "./Dashboard/Metrics";
import Hop from "./Tenants/TenantDetails/hop/Hop";
import MainError from "./Common/MainError/MainError";
import AddTenant from "./Tenants/AddTenant/AddTenant";
import NotificationEndpoints from "./NotificationEndpoints/NotificationEndpoints";
import AddNotificationEndpoint from "./NotificationEndpoints/AddNotificationEndpoint";
import NotificationTypeSelector from "./NotificationEndpoints/NotificationTypeSelector";
const drawerWidth = 245;
@@ -278,6 +281,18 @@ const Console = ({
component: ConfigurationMain,
path: "/settings",
},
{
component: AddNotificationEndpoint,
path: "/notification-endpoints/add/:service",
},
{
component: NotificationTypeSelector,
path: "/notification-endpoints/add",
},
{
component: NotificationEndpoints,
path: "/notification-endpoints",
},
{
component: Account,
path: "/account",

View File

@@ -38,6 +38,7 @@ import {
DashboardIcon,
GroupsIcon,
IAMPoliciesIcon,
LambdaIcon,
TraceIcon,
UsersIcon,
VersionIcon,
@@ -366,6 +367,14 @@ const Menu = ({
name: "Settings",
icon: <SettingsIcon />,
},
{
group: "common",
type: "item",
component: NavLink,
to: "/notification-endpoints",
name: "Notification Endpoints",
icon: <LambdaIcon />,
},
{
group: "Tools",
type: "item",

View File

@@ -1,380 +0,0 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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, { useCallback, useEffect, useState } from "react";
import get from "lodash/get";
import { connect } from "react-redux";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { Button, LinearProgress } from "@material-ui/core";
import Grid from "@material-ui/core/Grid";
import { serverNeedsRestart, setErrorSnackMessage } from "../../../actions";
import {
notificationEndpointsFields,
notifyPostgres,
notifyMysql,
notifyKafka,
notifyAmqp,
notifyMqtt,
notifyRedis,
notifyNats,
notifyElasticsearch,
notifyWebhooks,
notifyNsq,
removeEmptyFields,
} from "../Configurations/utils";
import { IElementValue } from "../Configurations/types";
import { modalBasic } from "../Common/FormComponents/common/styleLibrary";
import { ErrorResponseHandler } from "../../../common/types";
import ConfMySql from "../Configurations/CustomForms/ConfMySql";
import ConfTargetGeneric from "../Configurations/ConfTargetGeneric";
import ModalWrapper from "../Common/ModalWrapper/ModalWrapper";
import ConfPostgres from "../Configurations/CustomForms/ConfPostgres";
import api from "../../../common/api";
const styles = (theme: Theme) =>
createStyles({
errorBlock: {
color: "red",
},
strongText: {
fontWeight: 700,
},
keyName: {
marginLeft: 5,
},
buttonContainer: {
textAlign: "right",
},
logoButton: {
height: "80px",
},
lambdaNotif: {
backgroundColor: "#fff",
border: "#393939 1px solid",
borderRadius: 5,
width: 101,
height: 91,
display: "flex",
alignItems: "center",
justifyContent: "center",
marginBottom: 16,
cursor: "pointer",
"& img": {
maxWidth: 71,
maxHeight: 71,
},
},
iconContainer: {
display: "flex",
flexDirection: "row",
width: 455,
justifyContent: "space-between",
flexWrap: "wrap",
},
nonIconContainer: {
marginBottom: 16,
"& button": {
marginRight: 16,
},
},
pickTitle: {
fontWeight: 600,
color: "#393939",
fontSize: 14,
marginBottom: 16,
},
lambdaFormIndicator: {
display: "flex",
marginBottom: 40,
},
lambdaName: {
fontSize: 18,
fontWeight: 700,
color: "#000",
marginBottom: 6,
},
lambdaSubname: {
fontSize: 12,
color: "#000",
fontWeight: 600,
},
lambdaIcon: {
borderRadius: 5,
border: "#393939 1px solid",
width: 53,
height: 48,
display: "flex",
justifyContent: "center",
alignItems: "center",
marginRight: 16,
"& img": {
width: 38,
},
},
...modalBasic,
});
interface IAddNotificationEndpointProps {
open: boolean;
closeModalAndRefresh: any;
serverNeedsRestart: typeof serverNeedsRestart;
classes: any;
setErrorSnackMessage: typeof setErrorSnackMessage;
}
const AddNotificationEndpoint = ({
open,
closeModalAndRefresh,
serverNeedsRestart,
setErrorSnackMessage,
classes,
}: IAddNotificationEndpointProps) => {
//Local States
const [service, setService] = useState<string>("");
const [valuesArr, setValueArr] = useState<IElementValue[]>([]);
const [saving, setSaving] = useState<boolean>(false);
//Effects
useEffect(() => {
if (saving) {
const payload = {
key_values: removeEmptyFields(valuesArr),
};
api
.invoke("PUT", `/api/v1/configs/${service}`, payload)
.then((res) => {
setSaving(false);
serverNeedsRestart(true);
closeModalAndRefresh();
})
.catch((err: ErrorResponseHandler) => {
setSaving(false);
setErrorSnackMessage(err);
});
}
}, [
saving,
serverNeedsRestart,
service,
valuesArr,
closeModalAndRefresh,
setErrorSnackMessage,
]);
//Fetch Actions
const submitForm = (event: React.FormEvent) => {
event.preventDefault();
setSaving(true);
};
const onValueChange = useCallback(
(newValue) => {
setValueArr(newValue);
},
[setValueArr]
);
let srvComponent = <React.Fragment />;
switch (service) {
case notifyPostgres: {
srvComponent = <ConfPostgres onChange={onValueChange} />;
break;
}
case notifyMysql: {
srvComponent = <ConfMySql onChange={onValueChange} />;
break;
}
default: {
const fields = get(notificationEndpointsFields, service, []);
srvComponent = (
<ConfTargetGeneric fields={fields} onChange={onValueChange} />
);
}
}
const servicesList = [
{
actionTrigger: notifyPostgres,
targetTitle: "Postgres SQL",
logo: "/postgres.png",
},
{
actionTrigger: notifyKafka,
targetTitle: "Kafka",
logo: "/kafka.png",
},
{
actionTrigger: notifyAmqp,
targetTitle: "AMQP",
logo: "/amqp.png",
},
{
actionTrigger: notifyMqtt,
targetTitle: "MQTT",
logo: "/mqtt.png",
},
{
actionTrigger: notifyRedis,
targetTitle: "Redis",
logo: "/redis.png",
},
{
actionTrigger: notifyNats,
targetTitle: "NATS",
logo: "/nats.png",
},
{
actionTrigger: notifyMysql,
targetTitle: "Mysql",
logo: "/mysql.png",
},
{
actionTrigger: notifyElasticsearch,
targetTitle: "Elastic Search",
logo: "/elasticsearch.png",
},
{
actionTrigger: notifyWebhooks,
targetTitle: "Webhook",
logo: "",
},
{
actionTrigger: notifyNsq,
targetTitle: "NSQ",
logo: "",
},
];
const nonLogos = servicesList.filter((elService) => elService.logo === "");
const withLogos = servicesList.filter((elService) => elService.logo !== "");
const targetElement = servicesList.find(
(element) => element.actionTrigger === service
);
const goBack = () => {
setService("");
};
return (
<ModalWrapper modalOpen={open} onClose={closeModalAndRefresh} title={""}>
{service === "" && (
<Grid container>
<Grid item xs={12}>
<div className={classes.pickTitle}>Pick a supported service:</div>
<div className={classes.nonIconContainer}>
{nonLogos.map((item) => {
return (
<Button
variant="contained"
color="primary"
key={`non-icon-${item.targetTitle}`}
onClick={() => {
setService(item.actionTrigger);
}}
>
{item.targetTitle.toUpperCase()}
</Button>
);
})}
</div>
<div className={classes.iconContainer}>
{withLogos.map((item) => {
return (
<button
key={`icon-${item.targetTitle}`}
className={classes.lambdaNotif}
onClick={() => {
setService(item.actionTrigger);
}}
>
<img
src={item.logo}
className={classes.logoButton}
alt={item.targetTitle}
/>
</button>
);
})}
</div>
</Grid>
<Grid item xs={12}>
<br />
</Grid>
{saving && (
<Grid item xs={12}>
<LinearProgress />
</Grid>
)}
</Grid>
)}
{service !== "" && (
<React.Fragment>
<form noValidate onSubmit={submitForm}>
<Grid item xs={12} className={classes.lambdaFormIndicator}>
{targetElement && targetElement.logo !== "" && (
<div className={classes.lambdaIcon}>
<img
src={targetElement.logo}
alt={targetElement.targetTitle}
/>
</div>
)}
<div className={classes.lambdaTitle}>
<div className={classes.lambdaName}>
{targetElement ? targetElement.targetTitle : ""}
</div>
<div className={classes.lambdaSubname}>
Add Lambda Notification Target
</div>
</div>
</Grid>
<Grid item xs={12}>
{srvComponent}
</Grid>
<Grid item xs={12} className={classes.buttonContainer}>
<button
type="button"
color="primary"
className={classes.clearButton}
onClick={goBack}
>
Back
</button>
<Button
type="submit"
variant="contained"
color="primary"
disabled={saving}
>
Save
</Button>
</Grid>
<Grid item xs={9} />
</form>
</React.Fragment>
)}
</ModalWrapper>
);
};
const connector = connect(null, { serverNeedsRestart, setErrorSnackMessage });
export default connector(withStyles(styles)(AddNotificationEndpoint));

View File

@@ -20,24 +20,27 @@ import get from "lodash/get";
import Grid from "@material-ui/core/Grid";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { Button } from "@material-ui/core";
import ConfPostgres from "../CustomForms/ConfPostgres";
import api from "../../../../common/api";
import { serverNeedsRestart, setErrorSnackMessage } from "../../../../actions";
import ConfPostgres from "./CustomForms/ConfPostgres";
import api from "../../../common/api";
import { serverNeedsRestart, setErrorSnackMessage } from "../../../actions";
import {
notificationEndpointsFields,
notifyMysql,
notifyPostgres,
removeEmptyFields,
} from "../utils";
import { IElementValue } from "../types";
} from "./utils";
import {
modalBasic,
settingsCommon,
} from "../../Common/FormComponents/common/styleLibrary";
} from "../Common/FormComponents/common/styleLibrary";
import { servicesList } from "./utils";
import { ErrorResponseHandler } from "../../../../common/types";
import ConfMySql from "../CustomForms/ConfMySql";
import ConfTargetGeneric from "../ConfTargetGeneric";
import { ErrorResponseHandler } from "../../../common/types";
import ConfMySql from "./CustomForms/ConfMySql";
import ConfTargetGeneric from "./ConfTargetGeneric";
import { IElementValue } from "../Configurations/types";
import PageHeader from "../Common/PageHeader/PageHeader";
import { BackSettingsIcon } from "../../../icons";
import history from "../../../history";
const styles = (theme: Theme) =>
createStyles({
@@ -60,14 +63,52 @@ const styles = (theme: Theme) =>
...settingsCommon.customTitle,
marginTop: 0,
},
settingsFormContainer: {
...settingsCommon.settingsFormContainer,
height: "calc(100vh - 422px)",
lambdaNotif: {
background:
"linear-gradient(90deg, rgba(249,249,250,1) 0%, rgba(250,250,251,1) 68%, rgba(254,254,254,1) 100%)",
border: "#E5E5E5 1px solid",
borderRadius: 5,
height: 80,
display: "flex",
alignItems: "center",
justifyContent: "start",
marginBottom: 16,
marginRight: 8,
cursor: "pointer",
padding: 0,
overflow: "hidden",
},
lambdaNotifIcon: {
backgroundColor: "#FEFEFE",
display: "flex",
alignItems: "center",
justifyContent: "center",
width: 80,
height: 80,
"& img": {
maxWidth: 46,
maxHeight: 46,
},
},
lambdaNotifTitle: {
color: "#07193E",
fontSize: 16,
fontFamily: "Lato,sans-serif",
paddingLeft: 18,
},
mainCont: {
maxWidth: 1180,
paddingLeft: 38,
paddingRight: 38,
},
backTo: {
margin: "20px 0px 0",
},
});
interface IAddNotificationEndpointProps {
service: string;
match: any;
saveAndRefresh: any;
serverNeedsRestart: typeof serverNeedsRestart;
setErrorSnackMessage: typeof setErrorSnackMessage;
@@ -75,7 +116,7 @@ interface IAddNotificationEndpointProps {
}
const AddNotificationEndpoint = ({
service,
match,
saveAndRefresh,
serverNeedsRestart,
classes,
@@ -84,7 +125,7 @@ const AddNotificationEndpoint = ({
//Local States
const [valuesArr, setValueArr] = useState<IElementValue[]>([]);
const [saving, setSaving] = useState<boolean>(false);
const service = match.params["service"];
//Effects
useEffect(() => {
@@ -97,7 +138,7 @@ const AddNotificationEndpoint = ({
.then(() => {
setSaving(false);
serverNeedsRestart(true);
saveAndRefresh();
history.push("/notification-endpoints");
})
.catch((err: ErrorResponseHandler) => {
setSaving(false);
@@ -151,36 +192,63 @@ const AddNotificationEndpoint = ({
return (
<Fragment>
{service !== "" && (
<Fragment>
<form noValidate onSubmit={submitForm}>
<Grid item xs={12} className={classes.customTitle}>
{targetElement ? targetElement.targetTitle : ""} - Add Lambda
Notification Target
</Grid>
<Grid item xs={12} className={classes.settingsFormContainer}>
{srvComponent}
</Grid>
<Grid item xs={12} className={classes.settingsButtonContainer}>
<Grid
item
xs={12}
className={classes.innerSettingsButtonContainer}
>
<PageHeader label="Notification Endpoints" />
<form noValidate onSubmit={submitForm}>
<Grid container className={classes.mainCont}>
<Grid item xs={12} className={classes.backTo}>
<button
onClick={() => {
history.push("/notification-endpoints/add");
}}
className={classes.backButton}
>
<BackSettingsIcon />
Back To Supported Services
</button>
</Grid>
{service !== "" && (
<Fragment>
<Grid item xs={12}>
{targetElement && (
<div
key={`icon-${targetElement.targetTitle}`}
className={classes.lambdaNotif}
>
<div className={classes.lambdaNotifIcon}>
<img
src={targetElement.logo}
className={classes.logoButton}
alt={targetElement.targetTitle}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>
{targetElement ? targetElement.targetTitle : ""} Lambda
Notification Target
</b>
</div>
</div>
)}
</Grid>
<Grid item xs={12}>
{srvComponent}
</Grid>
<Grid item xs={12} className={classes.settingsButtonContainer}>
<Button
type="submit"
variant="contained"
color="primary"
disabled={saving}
>
Save
Save Notification Target
</Button>
</Grid>
</Grid>
<Grid item xs={9} />
</form>
</Fragment>
)}
</Fragment>
)}
</Grid>
</form>
</Fragment>
);
};

View File

@@ -17,7 +17,7 @@
import React, { useEffect, useState, Fragment } from "react";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import Grid from "@material-ui/core/Grid";
import { IElementValue, KVField } from "./types";
import { IElementValue, KVField } from "../Configurations/types";
import { modalBasic } from "../Common/FormComponents/common/styleLibrary";
import InputBoxWrapper from "../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
import CSVMultiSelector from "../Common/FormComponents/CSVMultiSelector/CSVMultiSelector";

View File

@@ -19,7 +19,7 @@ import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import Grid from "@material-ui/core/Grid";
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
import RadioGroupSelector from "../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
import { IElementValue } from "../types";
import { IElementValue } from "../../Configurations/types";
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
import CommentBoxWrapper from "../../Common/FormComponents/CommentBoxWrapper/CommentBoxWrapper";
import FormSwitchWrapper from "../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";

View File

@@ -20,7 +20,7 @@ import Grid from "@material-ui/core/Grid";
import InputBoxWrapper from "../../Common/FormComponents/InputBoxWrapper/InputBoxWrapper";
import RadioGroupSelector from "../../Common/FormComponents/RadioGroupSelector/RadioGroupSelector";
import SelectWrapper from "../../Common/FormComponents/SelectWrapper/SelectWrapper";
import { IElementValue } from "../types";
import { IElementValue } from "../../Configurations/types";
import { modalBasic } from "../../Common/FormComponents/common/styleLibrary";
import CommentBoxWrapper from "../../Common/FormComponents/CommentBoxWrapper/CommentBoxWrapper";
import FormSwitchWrapper from "../../Common/FormComponents/FormSwitchWrapper/FormSwitchWrapper";

View File

@@ -27,8 +27,14 @@ import {
fieldBasic,
settingsCommon,
} from "../../Common/FormComponents/common/styleLibrary";
import { fieldsConfigurations, removeEmptyFields } from "../utils";
import { IConfigurationElement, IElementValue } from "../types";
import {
fieldsConfigurations,
removeEmptyFields,
} from "../../Configurations/utils";
import {
IConfigurationElement,
IElementValue,
} from "../../Configurations/types";
import { ErrorResponseHandler } from "../../../../common/types";
const styles = (theme: Theme) =>

View File

@@ -29,23 +29,24 @@ import {
TransformedEndpointItem,
} from "./types";
import { notificationTransform } from "./utils";
import { AddIcon } from "../../../../icons";
import TableWrapper from "../../Common/TableWrapper/TableWrapper";
import { AddIcon } from "../../../icons";
import TableWrapper from "../Common/TableWrapper/TableWrapper";
import AddNotificationEndpoint from "./AddNotificationEndpoint";
import { setErrorSnackMessage } from "../../../../actions";
import { setErrorSnackMessage } from "../../../actions";
import {
actionsTray,
containerForHeader,
searchField,
settingsCommon,
} from "../../Common/FormComponents/common/styleLibrary";
import { ErrorResponseHandler } from "../../../../common/types";
import api from "../../../../common/api";
import SlideOptions from "../../Common/SlideOptions/SlideOptions";
import BackSettingsIcon from "../../../../icons/BackSettingsIcon";
} from "../Common/FormComponents/common/styleLibrary";
import { ErrorResponseHandler } from "../../../common/types";
import api from "../../../common/api";
import SlideOptions from "../Common/SlideOptions/SlideOptions";
import BackSettingsIcon from "../../../icons/BackSettingsIcon";
import NotificationTypeSelector from "./NotificationTypeSelector";
import RefreshIcon from "../../../../icons/RefreshIcon";
import SearchIcon from "../../../../icons/SearchIcon";
import RefreshIcon from "../../../icons/RefreshIcon";
import SearchIcon from "../../../icons/SearchIcon";
import history from "../../../history";
interface IListNotificationEndpoints {
classes: any;
@@ -77,10 +78,6 @@ const styles = (theme: Theme) =>
lambdaContainer: {
padding: "15px 0",
},
actionsTray: {
...actionsTray.actionsTray,
padding: "0 38px",
},
});
const ListNotificationEndpoints = ({
@@ -163,6 +160,45 @@ const ListNotificationEndpoints = ({
return (
<Fragment>
<Grid container>
<Grid item xs={12} className={classes.actionsTray}>
<TextField
placeholder="Filter"
className={classes.searchField}
id="search-resource"
label=""
onChange={(event) => {
setFilter(event.target.value);
}}
InputProps={{
disableUnderline: true,
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
</InputAdornment>
),
}}
/>
<IconButton
color="primary"
aria-label="Refresh List"
component="span"
onClick={() => {
setIsLoading(true);
}}
>
<RefreshIcon />
</IconButton>
<Button
variant="contained"
color="primary"
startIcon={<AddIcon />}
onClick={() => {
history.push("/notification-endpoints/add");
}}
>
Add Notification Target
</Button>
</Grid>
<Grid item xs={12}>
<Grid item xs={12}>
<div className={classes.settingsOptionsContainer}>
@@ -170,43 +206,6 @@ const ListNotificationEndpoints = ({
slideOptions={[
<Fragment>
<Grid item xs={12} className={classes.lambdaContainer}>
<Grid item xs={12} className={classes.actionsTray}>
<TextField
placeholder="Filter"
className={classes.searchField}
id="search-resource"
label=""
onChange={(event) => {
setFilter(event.target.value);
}}
InputProps={{
disableUnderline: true,
startAdornment: (
<InputAdornment position="start">
<SearchIcon />
</InputAdornment>
),
}}
/>
<IconButton
color="primary"
aria-label="Refresh List"
component="span"
onClick={() => {
setIsLoading(true);
}}
>
<RefreshIcon />
</IconButton>
<Button
variant="contained"
color="primary"
startIcon={<AddIcon />}
onClick={openNewLambdaSelector}
>
Add Notification Target
</Button>
</Grid>
<Grid item xs={12}>
<TableWrapper
itemActions={[]}
@@ -240,29 +239,7 @@ const ListNotificationEndpoints = ({
</button>
</Grid>
<Grid item xs={12}>
<NotificationTypeSelector
setService={(serviceName: string) => {
setService(serviceName);
setCurrentPanel(2);
}}
/>
</Grid>
</Fragment>,
<Fragment>
<Grid item xs={12} className={classes.backContainer}>
<button
onClick={backClick}
className={classes.backButton}
>
<BackSettingsIcon />
Back To Supported Services
</button>
</Grid>
<Grid item xs={12}>
<AddNotificationEndpoint
service={service}
saveAndRefresh={saveAndRefresh}
/>
<NotificationTypeSelector />
</Grid>
</Fragment>,
]}

View File

@@ -0,0 +1,71 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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, { Fragment, useState } from "react";
import PageHeader from "../Common/PageHeader/PageHeader";
import { Grid } from "@material-ui/core";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { containerForHeader } from "../Common/FormComponents/common/styleLibrary";
import { AppState } from "../../../store";
import { connect } from "react-redux";
import { ISessionResponse } from "../types";
import ListNotificationEndpoints from "./ListNotificationEndpoints";
interface INotificationEndpoints {
classes: any;
session: ISessionResponse;
distributedSetup: boolean;
}
const styles = (theme: Theme) =>
createStyles({
headerLabel: {
fontSize: 22,
fontWeight: 600,
color: "#000",
marginTop: 4,
},
...containerForHeader(theme.spacing(4)),
});
const NotificationEndpoints = ({
classes,
session,
distributedSetup,
}: INotificationEndpoints) => {
const [selectedTab, setSelectedTab] = useState<number>(0);
return (
<Fragment>
<PageHeader label="Notification Endpoints" />
<Grid container className={classes.container}>
<Grid item xs={12}>
<ListNotificationEndpoints />
</Grid>
</Grid>
</Fragment>
);
};
const mapState = (state: AppState) => ({
session: state.console.session,
distributedSetup: state.system.distributedSetup,
});
const connector = connect(mapState, {});
export default withStyles(styles)(connector(NotificationEndpoints));

View File

@@ -0,0 +1,93 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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, { Fragment, useState } from "react";
import Grid from "@material-ui/core/Grid";
import { createStyles, Theme, withStyles } from "@material-ui/core/styles";
import { servicesList } from "./utils";
import {
settingsCommon,
typesSelection,
} from "../Common/FormComponents/common/styleLibrary";
import PageHeader from "../Common/PageHeader/PageHeader";
import history from "../../../history";
interface INotificationTypeSelector {
classes: any;
}
const withLogos = servicesList.filter((elService) => elService.logo !== "");
const styles = (theme: Theme) =>
createStyles({
...settingsCommon,
mainCont: {
paddingLeft: 50,
paddingRight: 50,
},
mainTitle: {
fontSize: 18,
color: "#000",
fontWeight: 600,
marginBottom: 10,
marginTop: 10,
},
...typesSelection,
});
const NotificationTypeSelector = ({ classes }: INotificationTypeSelector) => {
return (
<Fragment>
<PageHeader label="Notification Endpoints" />
<Grid container className={classes.mainCont}>
<Grid item xs={12} className={classes.mainTitle}>
Pick a supported service
</Grid>
<Grid item xs={12} className={classes.centerElements}>
<div className={classes.iconContainer}>
{withLogos.map((item) => {
return (
<button
key={`icon-${item.targetTitle}`}
className={classes.lambdaNotif}
onClick={() => {
history.push(
`/notification-endpoints/add/${item.actionTrigger}`
);
}}
>
<div className={classes.lambdaNotifIcon}>
<img
src={item.logo}
className={classes.logoButton}
alt={item.targetTitle}
/>
</div>
<div className={classes.lambdaNotifTitle}>
<b>{item.targetTitle}</b>
</div>
</button>
);
})}
</div>
</Grid>
</Grid>
</Fragment>
);
};
export default withStyles(styles)(NotificationTypeSelector);

View File

@@ -0,0 +1,560 @@
// This file is part of MinIO Console Server
// Copyright (c) 2021 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// 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 { NotificationEndpointItem } from "./types";
import { IElementValue } from "../Configurations/types";
export const notifyPostgres = "notify_postgres";
export const notifyMysql = "notify_mysql";
export const notifyKafka = "notify_kafka";
export const notifyAmqp = "notify_amqp";
export const notifyMqtt = "notify_mqtt";
export const notifyRedis = "notify_redis";
export const notifyNats = "notify_nats";
export const notifyElasticsearch = "notify_elasticsearch";
export const notifyWebhooks = "notify_webhook";
export const notifyNsq = "notify_nsq";
export const notificationTransform = (
notificationElements: NotificationEndpointItem[]
) => {
return notificationElements.map((element) => {
return {
service_name: `${element.service}:${element.account_id}`,
status: element.status,
};
});
};
export const servicesList = [
{
actionTrigger: notifyPostgres,
targetTitle: "Postgres SQL",
logo: "/postgres-logo.svg",
},
{
actionTrigger: notifyKafka,
targetTitle: "Kafka",
logo: "/kafka-logo.svg",
},
{
actionTrigger: notifyAmqp,
targetTitle: "AMQP",
logo: "/amqp-logo.svg",
},
{
actionTrigger: notifyMqtt,
targetTitle: "MQTT",
logo: "/mqtt-logo.svg",
},
{
actionTrigger: notifyRedis,
targetTitle: "Redis",
logo: "/redis-logo.svg",
},
{
actionTrigger: notifyNats,
targetTitle: "NATS",
logo: "/nats-logo.svg",
},
{
actionTrigger: notifyMysql,
targetTitle: "Mysql",
logo: "/mysql-logo.svg",
},
{
actionTrigger: notifyElasticsearch,
targetTitle: "Elastic Search",
logo: "/elasticsearch-logo.svg",
},
{
actionTrigger: notifyWebhooks,
targetTitle: "Webhook",
logo: "/webhooks-logo.svg",
},
{
actionTrigger: notifyNsq,
targetTitle: "NSQ",
logo: "/nsq-logo.svg",
},
];
const commonFields = [
{
name: "queue-dir",
label: "Queue Directory",
required: true,
tooltip: "staging dir for undelivered messages e.g. '/home/events'",
type: "string",
placeholder: "Enter Queue Directory",
},
{
name: "queue-limit",
label: "Queue Limit",
required: false,
tooltip: "maximum limit for undelivered messages, defaults to '10000'",
type: "number",
placeholder: "Enter Queue Limit",
},
{
name: "comment",
label: "Comment",
required: false,
type: "comment",
placeholder: "Enter Comment",
},
];
export const removeEmptyFields = (formFields: IElementValue[]) => {
const nonEmptyFields = formFields.filter((field) => field.value !== "");
return nonEmptyFields;
};
export const notificationEndpointsFields: any = {
[notifyKafka]: [
{
name: "brokers",
label: "Brokers",
required: true,
tooltip: "Comma separated list of Kafka broker addresses",
type: "string",
placeholder: "Enter Brokers",
},
{
name: "topic",
label: "Topic",
tooltip: "Kafka topic used for bucket notifications",
type: "string",
placeholder: "Enter Topic",
},
{
name: "sasl_username",
label: "SASL Username",
tooltip: "Username for SASL/PLAIN or SASL/SCRAM authentication",
type: "string",
placeholder: "Enter SASL Username",
},
{
name: "sasl_password",
label: "SASL Password",
tooltip: "Password for SASL/PLAIN or SASL/SCRAM authentication",
type: "string",
placeholder: "Enter SASL Password",
},
{
name: "sasl_mechanism",
label: "SASL Mechanism",
tooltip: "SASL authentication mechanism, default 'PLAIN'",
type: "string",
},
{
name: "tls_client_auth",
label: "TLS Client Auth",
tooltip:
"Client Auth determines the Kafka server's policy for TLS client auth",
type: "string",
placeholder: "Enter TLS Client Auth",
},
{
name: "sasl",
label: "SASL",
tooltip: "Set to 'on' to enable SASL authentication",
type: "on|off",
},
{
name: "tls",
label: "TLS",
tooltip: "Set to 'on' to enable TLS",
type: "on|off",
},
{
name: "tls_skip_verify",
label: "TLS skip verify",
tooltip:
'Trust server TLS without verification, defaults to "on" (verify)',
type: "on|off",
},
{
name: "client_tls_cert",
label: "client TLS cert",
tooltip: "Path to client certificate for mTLS auth",
type: "path",
placeholder: "Enter TLS Client Cert",
},
{
name: "client_tls_key",
label: "client TLS key",
tooltip: "Path to client key for mTLS auth",
type: "path",
placeholder: "Enter TLS Client Key",
},
{
name: "version",
label: "Version",
tooltip: "Specify the version of the Kafka cluster e.g '2.2.0'",
type: "string",
placeholder: "Enter Kafka Version",
},
...commonFields,
],
[notifyAmqp]: [
{
name: "url",
required: true,
label: "URL",
tooltip:
"AMQP server endpoint e.g. `amqp://myuser:mypassword@localhost:5672`",
type: "url",
},
{
name: "exchange",
label: "Exchange",
tooltip: "Name of the AMQP exchange",
type: "string",
placeholder: "Enter Exchange",
},
{
name: "exchange_type",
label: "Exchange Type",
tooltip: "AMQP exchange type",
type: "string",
placeholder: "Enter Exchange Type",
},
{
name: "routing_key",
label: "Routing Key",
tooltip: "Routing key for publishing",
type: "string",
placeholder: "Enter Routing Key",
},
{
name: "mandatory",
label: "Mandatory",
tooltip:
"Quietly ignore undelivered messages when set to 'off', default is 'on'",
type: "on|off",
},
{
name: "durable",
label: "Durable",
tooltip:
"Persist queue across broker restarts when set to 'on', default is 'off'",
type: "on|off",
},
{
name: "no_wait",
label: "No Wait",
tooltip:
"Non-blocking message delivery when set to 'on', default is 'off'",
type: "on|off",
},
{
name: "internal",
label: "Internal",
tooltip:
"Set to 'on' for exchange to be not used directly by publishers, but only when bound to other exchanges",
type: "on|off",
},
{
name: "auto_deleted",
label: "Auto Deleted",
tooltip:
"Auto delete queue when set to 'on', when there are no consumers",
type: "on|off",
},
{
name: "delivery_mode",
label: "Delivery Mode",
tooltip: "Set to '1' for non-persistent or '2' for persistent queue",
type: "number",
placeholder: "Enter Delivery Mode",
},
...commonFields,
],
[notifyRedis]: [
{
name: "address",
required: true,
label: "Address",
tooltip: "Redis server's address. For example: `localhost:6379`",
type: "address",
placeholder: "Enter Address",
},
{
name: "key",
required: true,
label: "Key",
tooltip: "Redis key to store/update events, key is auto-created",
type: "string",
placeholder: "Enter Key",
},
{
name: "password",
label: "Password",
tooltip: "Redis server password",
type: "string",
placeholder: "Enter Password",
},
...commonFields,
],
[notifyMqtt]: [
{
name: "broker",
required: true,
label: "Broker",
tooltip: "MQTT server endpoint e.g. `tcp://localhost:1883`",
type: "uri",
placeholder: "Enter Brokers",
},
{
name: "topic",
required: true,
label: "Topic",
tooltip: "name of the MQTT topic to publish",
type: "string",
placeholder: "Enter Topic",
},
{
name: "username",
label: "Username",
tooltip: "MQTT username",
type: "string",
placeholder: "Enter Username",
},
{
name: "password",
label: "Password",
tooltip: "MQTT password",
type: "string",
placeholder: "Enter Password",
},
{
name: "qos",
label: "QOS",
tooltip: "Set the quality of service priority, defaults to '0'",
type: "number",
placeholder: "Enter QOS",
},
{
name: "keep_alive_interval",
label: "Keep Alive Interval",
tooltip: "Keep-alive interval for MQTT connections in s,m,h,d",
type: "duration",
placeholder: "Enter Keep Alive Internal",
},
{
name: "reconnect_interval",
label: "Reconnect Interval",
tooltip: "Reconnect interval for MQTT connections in s,m,h,d",
type: "duration",
placeholder: "Enter Reconnect Interval",
},
...commonFields,
],
[notifyNats]: [
{
name: "address",
required: true,
label: "Address",
tooltip: "NATS server address e.g. '0.0.0.0:4222'",
type: "address",
placeholder: "Enter Address",
},
{
name: "subject",
required: true,
label: "Subject",
tooltip: "NATS subscription subject",
type: "string",
placeholder: "Enter NATS Subject",
},
{
name: "username",
label: "Username",
tooltip: "NATS username",
type: "string",
placeholder: "Enter NATS Username",
},
{
name: "password",
label: "Password",
tooltip: "NATS password",
type: "string",
placeholder: "Enter NATS password",
},
{
name: "token",
label: "Token",
tooltip: "NATS token",
type: "string",
placeholder: "Enter NATS token",
},
{
name: "tls",
label: "TLS",
tooltip: "Set to 'on' to enable TLS",
type: "on|off",
},
{
name: "tls_skip_verify",
label: "TLS Skip Verify",
tooltip:
'Trust server TLS without verification, defaults to "on" (verify)',
type: "on|off",
},
{
name: "ping_interval",
label: "Ping Interval",
tooltip: "Client ping commands interval in s,m,h,d. Disabled by default",
type: "duration",
placeholder: "Enter Ping Interval",
},
{
name: "streaming",
label: "Streaming",
tooltip: "Set to 'on', to use streaming NATS server",
type: "on|off",
},
{
name: "streaming_async",
label: "Streaming async",
tooltip: "Set to 'on', to enable asynchronous publish",
type: "on|off",
},
{
name: "streaming_max_pub_acks_in_flight",
label: "Streaming max publish ACKS in flight",
tooltip: "Number of messages to publish without waiting for ACKs",
type: "number",
placeholder: "Enter Streaming in flight value",
},
{
name: "streaming_cluster_id",
label: "Streaming Cluster ID",
tooltip: "Unique ID for NATS streaming cluster",
type: "string",
placeholder: "Enter Streaming Cluster ID",
},
{
name: "cert_authority",
label: "Cert Authority",
tooltip: "Path to certificate chain of the target NATS server",
type: "string",
placeholder: "Enter Cert Authority",
},
{
name: "client_cert",
label: "Client Cert",
tooltip: "Client cert for NATS mTLS auth",
type: "string",
placeholder: "Enter Client Cert",
},
{
name: "client_key",
label: "Client Key",
tooltip: "Client cert key for NATS mTLS auth",
type: "string",
placeholder: "Enter Client Key",
},
...commonFields,
],
[notifyElasticsearch]: [
{
name: "url",
required: true,
label: "URL",
tooltip:
"Elasticsearch server's address, with optional authentication info",
type: "url",
placeholder: "Enter URL",
},
{
name: "index",
required: true,
label: "Index",
tooltip:
"Elasticsearch index to store/update events, index is auto-created",
type: "string",
placeholder: "Enter Index",
},
{
name: "format",
required: true,
label: "Format",
tooltip:
"'namespace' reflects current bucket/object list and 'access' reflects a journal of object operations, defaults to 'namespace'",
type: "enum",
placeholder: "Enter Format",
},
...commonFields,
],
[notifyWebhooks]: [
{
name: "endpoint",
required: true,
label: "Endpoint",
tooltip:
"webhook server endpoint e.g. http://localhost:8080/minio/events",
type: "url",
placeholder: "Enter Endpoint",
},
{
name: "auth_token",
label: "Auth Token",
tooltip: "opaque string or JWT authorization token",
type: "string",
placeholder: "Enter auth_token",
},
...commonFields,
],
[notifyNsq]: [
{
name: "nsqd_address",
required: true,
label: "NSQD Address",
tooltip: "NSQ server address e.g. '127.0.0.1:4150'",
type: "address",
placeholder: "Enter nsqd_address",
},
{
name: "topic",
required: true,
label: "Topic",
tooltip: "NSQ topic",
type: "string",
placeholder: "Enter Topic",
},
{
name: "tls",
label: "TLS",
tooltip: "set to 'on' to enable TLS",
type: "on|off",
},
{
name: "tls_skip_verify",
label: "TLS Skip Verify",
tooltip:
'trust server TLS without verification, defaults to "on" (verify)',
type: "on|off",
},
...commonFields,
],
};