Skip to content

Commit

Permalink
Fixed some issues with incomming data from mc
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Perez committed Apr 21, 2020
1 parent d9270f4 commit 9ed7983
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 75 deletions.
108 changes: 54 additions & 54 deletions portal-ui/bindata_assetfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
package portal

import (
"github.com/elazarl/go-bindata-assetfs"
"bytes"
"compress/gzip"
"fmt"
"github.com/elazarl/go-bindata-assetfs"
"io"
"io/ioutil"
"os"
Expand Down Expand Up @@ -990,47 +990,47 @@ func AssetNames() []string {

// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"build/amqp.png": buildAmqpPng,
"build/android-icon-144x144.png": buildAndroidIcon144x144Png,
"build/android-icon-192x192.png": buildAndroidIcon192x192Png,
"build/android-icon-36x36.png": buildAndroidIcon36x36Png,
"build/android-icon-48x48.png": buildAndroidIcon48x48Png,
"build/android-icon-72x72.png": buildAndroidIcon72x72Png,
"build/android-icon-96x96.png": buildAndroidIcon96x96Png,
"build/apple-icon-180x180.png": buildAppleIcon180x180Png,
"build/asset-manifest.json": buildAssetManifestJson,
"build/elasticsearch.png": buildElasticsearchPng,
"build/favicon-16x16.png": buildFavicon16x16Png,
"build/favicon-32x32.png": buildFavicon32x32Png,
"build/favicon-96x96.png": buildFavicon96x96Png,
"build/favicon.ico": buildFaviconIco,
"build/images/BG_Illustration.svg": buildImagesBg_illustrationSvg,
"build/index.html": buildIndexHtml,
"build/kafka.png": buildKafkaPng,
"build/logo192.png": buildLogo192Png,
"build/logo512.png": buildLogo512Png,
"build/manifest.json": buildManifestJson,
"build/mqtt.png": buildMqttPng,
"build/mysql.png": buildMysqlPng,
"build/nats.png": buildNatsPng,
"build/postgres.png": buildPostgresPng,
"build/amqp.png": buildAmqpPng,
"build/android-icon-144x144.png": buildAndroidIcon144x144Png,
"build/android-icon-192x192.png": buildAndroidIcon192x192Png,
"build/android-icon-36x36.png": buildAndroidIcon36x36Png,
"build/android-icon-48x48.png": buildAndroidIcon48x48Png,
"build/android-icon-72x72.png": buildAndroidIcon72x72Png,
"build/android-icon-96x96.png": buildAndroidIcon96x96Png,
"build/apple-icon-180x180.png": buildAppleIcon180x180Png,
"build/asset-manifest.json": buildAssetManifestJson,
"build/elasticsearch.png": buildElasticsearchPng,
"build/favicon-16x16.png": buildFavicon16x16Png,
"build/favicon-32x32.png": buildFavicon32x32Png,
"build/favicon-96x96.png": buildFavicon96x96Png,
"build/favicon.ico": buildFaviconIco,
"build/images/BG_Illustration.svg": buildImagesBg_illustrationSvg,
"build/index.html": buildIndexHtml,
"build/kafka.png": buildKafkaPng,
"build/logo192.png": buildLogo192Png,
"build/logo512.png": buildLogo512Png,
"build/manifest.json": buildManifestJson,
"build/mqtt.png": buildMqttPng,
"build/mysql.png": buildMysqlPng,
"build/nats.png": buildNatsPng,
"build/postgres.png": buildPostgresPng,
"build/precache-manifest.5dc36f54c3eb282135e230b3d99eb06b.js": buildPrecacheManifest5dc36f54c3eb282135e230b3d99eb06bJs,
"build/redis.png": buildRedisPng,
"build/robots.txt": buildRobotsTxt,
"build/safari-pinned-tab.svg": buildSafariPinnedTabSvg,
"build/service-worker.js": buildServiceWorkerJs,
"build/static/css/2.9df7aa81.chunk.css": buildStaticCss29df7aa81ChunkCss,
"build/static/css/2.9df7aa81.chunk.css.map": buildStaticCss29df7aa81ChunkCssMap,
"build/static/css/main.dc35c5d0.chunk.css": buildStaticCssMainDc35c5d0ChunkCss,
"build/static/css/main.dc35c5d0.chunk.css.map": buildStaticCssMainDc35c5d0ChunkCssMap,
"build/static/js/2.2a127a0b.chunk.js": buildStaticJs22a127a0bChunkJs,
"build/static/js/2.2a127a0b.chunk.js.LICENSE.txt": buildStaticJs22a127a0bChunkJsLicenseTxt,
"build/static/js/2.2a127a0b.chunk.js.map": buildStaticJs22a127a0bChunkJsMap,
"build/static/js/main.42f01d1f.chunk.js": buildStaticJsMain42f01d1fChunkJs,
"build/static/js/main.42f01d1f.chunk.js.map": buildStaticJsMain42f01d1fChunkJsMap,
"build/static/js/runtime-main.61095d74.js": buildStaticJsRuntimeMain61095d74Js,
"build/static/js/runtime-main.61095d74.js.map": buildStaticJsRuntimeMain61095d74JsMap,
"build/static/media/minio_console_logo.0851e1d0.svg": buildStaticMediaMinio_console_logo0851e1d0Svg,
"build/redis.png": buildRedisPng,
"build/robots.txt": buildRobotsTxt,
"build/safari-pinned-tab.svg": buildSafariPinnedTabSvg,
"build/service-worker.js": buildServiceWorkerJs,
"build/static/css/2.9df7aa81.chunk.css": buildStaticCss29df7aa81ChunkCss,
"build/static/css/2.9df7aa81.chunk.css.map": buildStaticCss29df7aa81ChunkCssMap,
"build/static/css/main.dc35c5d0.chunk.css": buildStaticCssMainDc35c5d0ChunkCss,
"build/static/css/main.dc35c5d0.chunk.css.map": buildStaticCssMainDc35c5d0ChunkCssMap,
"build/static/js/2.2a127a0b.chunk.js": buildStaticJs22a127a0bChunkJs,
"build/static/js/2.2a127a0b.chunk.js.LICENSE.txt": buildStaticJs22a127a0bChunkJsLicenseTxt,
"build/static/js/2.2a127a0b.chunk.js.map": buildStaticJs22a127a0bChunkJsMap,
"build/static/js/main.42f01d1f.chunk.js": buildStaticJsMain42f01d1fChunkJs,
"build/static/js/main.42f01d1f.chunk.js.map": buildStaticJsMain42f01d1fChunkJsMap,
"build/static/js/runtime-main.61095d74.js": buildStaticJsRuntimeMain61095d74Js,
"build/static/js/runtime-main.61095d74.js.map": buildStaticJsRuntimeMain61095d74JsMap,
"build/static/media/minio_console_logo.0851e1d0.svg": buildStaticMediaMinio_console_logo0851e1d0Svg,
}

// AssetDir returns the file names below a certain
Expand Down Expand Up @@ -1092,20 +1092,20 @@ var _bintree = &bintree{nil, map[string]*bintree{
"images": &bintree{nil, map[string]*bintree{
"BG_Illustration.svg": &bintree{buildImagesBg_illustrationSvg, map[string]*bintree{}},
}},
"index.html": &bintree{buildIndexHtml, map[string]*bintree{}},
"kafka.png": &bintree{buildKafkaPng, map[string]*bintree{}},
"logo192.png": &bintree{buildLogo192Png, map[string]*bintree{}},
"logo512.png": &bintree{buildLogo512Png, map[string]*bintree{}},
"manifest.json": &bintree{buildManifestJson, map[string]*bintree{}},
"mqtt.png": &bintree{buildMqttPng, map[string]*bintree{}},
"mysql.png": &bintree{buildMysqlPng, map[string]*bintree{}},
"nats.png": &bintree{buildNatsPng, map[string]*bintree{}},
"postgres.png": &bintree{buildPostgresPng, map[string]*bintree{}},
"index.html": &bintree{buildIndexHtml, map[string]*bintree{}},
"kafka.png": &bintree{buildKafkaPng, map[string]*bintree{}},
"logo192.png": &bintree{buildLogo192Png, map[string]*bintree{}},
"logo512.png": &bintree{buildLogo512Png, map[string]*bintree{}},
"manifest.json": &bintree{buildManifestJson, map[string]*bintree{}},
"mqtt.png": &bintree{buildMqttPng, map[string]*bintree{}},
"mysql.png": &bintree{buildMysqlPng, map[string]*bintree{}},
"nats.png": &bintree{buildNatsPng, map[string]*bintree{}},
"postgres.png": &bintree{buildPostgresPng, map[string]*bintree{}},
"precache-manifest.5dc36f54c3eb282135e230b3d99eb06b.js": &bintree{buildPrecacheManifest5dc36f54c3eb282135e230b3d99eb06bJs, map[string]*bintree{}},
"redis.png": &bintree{buildRedisPng, map[string]*bintree{}},
"robots.txt": &bintree{buildRobotsTxt, map[string]*bintree{}},
"safari-pinned-tab.svg": &bintree{buildSafariPinnedTabSvg, map[string]*bintree{}},
"service-worker.js": &bintree{buildServiceWorkerJs, map[string]*bintree{}},
"redis.png": &bintree{buildRedisPng, map[string]*bintree{}},
"robots.txt": &bintree{buildRobotsTxt, map[string]*bintree{}},
"safari-pinned-tab.svg": &bintree{buildSafariPinnedTabSvg, map[string]*bintree{}},
"service-worker.js": &bintree{buildServiceWorkerJs, map[string]*bintree{}},
"static": &bintree{nil, map[string]*bintree{
"css": &bintree{nil, map[string]*bintree{
"2.9df7aa81.chunk.css": &bintree{buildStaticCss29df7aa81ChunkCss, map[string]*bintree{}},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class ListBuckets extends React.Component<
.then((res: BucketList) => {
this.setState({
loading: false,
records: res.buckets,
totalRecords: res.total,
records: res.buckets || [],
totalRecords: !res.buckets ? 0 : res.total,
error: ""
});
// if we get 0 results, and page > 0 , go down 1 page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class DeleteEvent extends React.Component<
if (bucketEvent == null) {
return;
}

this.setState({ deleteLoading: true }, () => {
api
.invoke(
Expand Down
11 changes: 4 additions & 7 deletions portal-ui/src/screens/Console/Buckets/ViewBucket/ViewBucket.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,19 +123,16 @@ class ViewBucket extends React.Component<IViewBucketProps, IViewBucketState> {
api
.invoke("GET", `/api/v1/buckets/${bucketName}/events`)
.then((res: BucketEventList) => {
const events = res.events;

this.setState({
loading: false,
records: res.events,
records: events || [],
totalRecords: res.total,
error: ""
});
// if we get 0 results, and page > 0 , go down 1 page
if (
(res.events === undefined ||
res.events == null ||
res.events.length === 0) &&
page > 0
) {
if ((!events || res.events.length === 0) && page > 0) {
const newPage = page - 1;
this.setState({ page: newPage }, () => {
this.fetchEvents();
Expand Down
5 changes: 1 addition & 4 deletions portal-ui/src/screens/Console/Groups/Groups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@ const Groups = ({ classes }: IGroupsProps) => {
resGroups = res.groups.sort(groupsSort);
}
setRecords(resGroups);
let total = 0;
if (res.total !== null) {
total = res.total;
}
const total = !res.total ? 0 : res.total;
setTotalRecords(total);
setError("");
isLoading(false);
Expand Down
2 changes: 1 addition & 1 deletion portal-ui/src/screens/Console/Users/AddUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class AddUserContent extends React.Component<
addLoading: false,
addError: "",
accessKey: res.accessKey,
selectedGroups: res.memberOf,
selectedGroups: res.memberOf || [],
enabled: res.status
});
})
Expand Down
10 changes: 3 additions & 7 deletions portal-ui/src/screens/Console/Users/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,15 @@ class Users extends React.Component<IUsersProps, IUsersState> {
api
.invoke("GET", `/api/v1/users?offset=${offset}&limit=${rowsPerPage}`)
.then((res: UsersList) => {
const usersList = !res.users ? [] : res.users;
this.setState({
loading: false,
records: res.users.sort(usersSort),
records: usersList.sort(usersSort),
totalRecords: res.users.length,
error: ""
});
// if we get 0 results, and page > 0 , go down 1 page
if (
(res.users === undefined ||
res.users == null ||
res.users.length === 0) &&
page > 0
) {
if ((!usersList || res.users.length === 0) && page > 0) {
const newPage = page - 1;
this.setState({ page: newPage }, () => {
this.fetchRecords();
Expand Down

0 comments on commit 9ed7983

Please sign in to comment.