shuqi7 commented on a change in pull request #7493: No SQL mode in web console
URL: https://github.com/apache/incubator-druid/pull/7493#discussion_r277107097
 
 

 ##########
 File path: web-console/src/views/servers-view.tsx
 ##########
 @@ -100,14 +123,37 @@ export class ServersView extends 
React.Component<ServersViewProps, ServersViewSt
     );
   }
 
+  static getServers = async (): Promise<ServerQueryResultRow[]> => {
+    const allServerResp = await 
axios.get('/druid/coordinator/v1/servers?simple');
+    const allServers = allServerResp.data;
+    return allServers.filter((s: any) => s.type === 'historical').map((s: any) 
=> {
+      return {
+        host: s.host.split(':')[0],
+        plaintext_port: parseInt(s.host.split(':')[1], 10),
+        server: s.host,
+        curr_size: s.currSize,
+        max_size: s.maxSize,
+        tier: s.tier,
+        tls_port: -1
+      };
+    });
+  }
+
   componentDidMount(): void {
+    const { noSqlMode } = this.props;
     this.serverQueryManager = new QueryManager({
       processQuery: async (query: string) => {
-        const servers = await queryDruidSql({ query });
-
+        let servers: ServerQueryResultRow[];
+        if (!noSqlMode) {
+          servers = await queryDruidSql({ query });
+          if (servers.length === 0) {
 
 Review comment:
   Will implement another way of querying the servers in a separate PR

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to