You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/03/16 18:51:15 UTC

[GitHub] [incubator-pinot] joshigaurava commented on a change in pull request #6665: Query console only view for Cluster Manager

joshigaurava commented on a change in pull request #6665:
URL: https://github.com/apache/incubator-pinot/pull/6665#discussion_r595453938



##########
File path: pinot-controller/src/main/resources/app/App.tsx
##########
@@ -19,49 +19,87 @@
 
 import * as React from 'react';
 import * as ReactDOM from 'react-dom';
-import { MuiThemeProvider } from '@material-ui/core';
-import { Switch, Route, HashRouter as Router } from 'react-router-dom';
+import { CircularProgress, createStyles, makeStyles, MuiThemeProvider } from '@material-ui/core';
+import { Switch, Route, HashRouter as Router, Redirect } from 'react-router-dom';
 import theme from './theme';
 import Layout from './components/Layout';
 import RouterData from './router';
 import PinotMethodUtils from './utils/PinotMethodUtils';
 import CustomNotification from './components/CustomNotification';
 import { NotificationContextProvider } from './components/Notification/NotificationContextProvider';
+import app_state from './app_state';
+
+const useStyles = makeStyles(() =>
+  createStyles({
+    loader: {
+      position: 'fixed',
+      left: '50%',
+      top: '30%'
+    },
+  })
+);
 
 const App = () => {
   const [clusterName, setClusterName] = React.useState('');
+  const [loading, setLoading] = React.useState(true);
+
   const fetchClusterName = async () => {
     const clusterNameResponse = await PinotMethodUtils.getClusterName();
     localStorage.setItem('pinot_ui:clusterName', clusterNameResponse);
     setClusterName(clusterNameResponse);
   };
+
+  const fetchClusterConfig = async () => {
+    const clusterConfig = await PinotMethodUtils.getClusterConfigJSON();
+    app_state.queryConsoleOnlyView = clusterConfig?.queryConsoleOnlyView === 'true';

Review comment:
       `app_state.queryConsoleOnlyView` will remain `undefined`/`false` if either of `clusterConfig` or `clusterConfig.queryConsoleOnlyView` is undefined, or if `queryConsoleOnlyView` is explicitly set to "false".




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org