pan3793 commented on code in PR #2840:
URL: https://github.com/apache/incubator-kyuubi/pull/2840#discussion_r902735078


##########
kyuubi-server/web-ui/README.md:
##########
@@ -0,0 +1,95 @@
+<!--
+ - Licensed to the Apache Software Foundation (ASF) under one or more
+ - contributor license agreements.  See the NOTICE file distributed with
+ - this work for additional information regarding copyright ownership.
+ - The ASF licenses this file to You under the Apache License, Version 2.0
+ - (the "License"); you may not use this file except in compliance with
+ - the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+# Apache Kyuubi(incubating) Web UI
+
+The web ui listens at `http://localhost:10009`.
+
+The web ui is work in progress. Kyuubi server starts an HTTP server (by 
default at port 10009)
+that serves the new web pages and additional background requests.
+
+## Server Backend
+
+The server side of the ui is implemented using 
[Jetty](https://www.eclipse.org/jetty/) 
+for REST paths.
+The framework has very lightweight dependencies.
+
+## UI Frontend 
+
+The web ui is implemented using *Angular*. The ui build infrastructure uses 
*node.js*.
+
+### Preparing the Build Environment
+
+Depending on your version of Linux, Windows or MacOS, you may need to manually 
install *node.js*
+
+#### Ubuntu Linux
+
+Install *node.js* by following [these 
instructions](https://nodejs.org/en/download/).
+
+Verify that the installed version is at least *10.9.0*, via `node --version`.
+
+#### MacOS
+
+First install *brew* by following [these instructions](http://brew.sh/).
+
+Install *node.js* via:
+
+```
+brew install node
+```
+
+### Building
+
+The build process downloads all requires libraries via the *node.js* package 
management tool (*npm*)
+The final build tool is *@angular/cli*.
+
+```
+cd kyuubi-server/web-ui
+npm install

Review Comment:
   I think it is caused by different Node.js versions. I'm using Node.js 16.



##########
kyuubi-server/web-ui/.eslintignore:
##########
@@ -0,0 +1,28 @@
+.idea

Review Comment:
   License header



##########
kyuubi-server/web-ui/README.md:
##########
@@ -0,0 +1,95 @@
+<!--
+ - Licensed to the Apache Software Foundation (ASF) under one or more
+ - contributor license agreements.  See the NOTICE file distributed with
+ - this work for additional information regarding copyright ownership.
+ - The ASF licenses this file to You under the Apache License, Version 2.0
+ - (the "License"); you may not use this file except in compliance with
+ - the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+# Apache Kyuubi(incubating) Web UI
+
+The web ui listens at `http://localhost:10099`.
+
+The web ui is work in progress. Kyuubi server starts an HTTP server (by 
default at port 10009)
+that serves the new web pages and additional background requests.
+
+## Server Backend
+
+The server side of the ui is implemented using 
[Jetty](https://www.eclipse.org/jetty/) 
+for REST paths.
+The framework has very lightweight dependencies.
+
+## UI Frontend 
+
+The web ui is implemented using *Angular*. The ui build infrastructure uses 
*node.js*.

Review Comment:
   Node.js



##########
kyuubi-rest-client/src/main/java/org/apache/kyuubi/client/api/v1/dto/WebuiConfiguration.java:
##########
@@ -0,0 +1,114 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kyuubi.client.api.v1.dto;
+
+import java.util.Objects;
+
+public class WebuiConfiguration {
+
+  private long refreshInterval;
+
+  private String timezoneName;
+
+  private long timezoneOffset;

Review Comment:
   does it necessary?



##########
kyuubi-server/web-ui/.browserslistrc:
##########
@@ -0,0 +1,11 @@
+# This file is currently used by autoprefixer to adjust CSS to support the 
below specified browsers

Review Comment:
   Add a license header?



##########
kyuubi-server/web-ui/src/app/pages/overview/statistic/overview-statistic.component.html:
##########
@@ -0,0 +1,71 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<div nz-row [nzGutter]="24" *ngIf="statistic">
+  <div nz-col [nzXs]="24" [nzSm]="24" [nzMd]="6" [nzLg]="6" [nzXl]="6" 
class="col">
+    <nz-card [nzBordered]="false" nzTitle="Opened Session" 
[nzLoading]="!statistic">
+      <ng-container *ngIf="statistic">
+        <div class="total">{{ statistic['openSessionCount'] | number: '1.0-0' 
}}</div>
+      </ng-container>
+    </nz-card>
+  </div>
+  <div nz-col [nzXs]="24" [nzSm]="24" [nzMd]="6" [nzLg]="6" [nzXl]="6" 
class="col">
+    <nz-card [nzBordered]="false" nzTitle="ExecPool Size" 
[nzLoading]="!statistic">
+      <ng-container *ngIf="statistic">
+        <div class="total">{{ statistic['execPoolSize'] | number: '1.0-0' 
}}</div>
+      </ng-container>
+    </nz-card>
+  </div>
+  <div nz-col [nzXs]="24" [nzSm]="24" [nzMd]="6" [nzLg]="6" [nzXl]="6" 
class="col">
+    <nz-card [nzBordered]="false" nzTitle="ExecPool ActiveCount" 
[nzLoading]="!statistic">
+      <ng-container *ngIf="statistic">
+        <div class="total">{{ statistic['execPoolActiveCount'] | number: 
'1.0-0' }}</div>
+      </ng-container>
+    </nz-card>
+  </div>
+  <div nz-col [nzXs]="24" [nzSm]="24" [nzMd]="6" [nzLg]="6" [nzXl]="6" 
class="col">
+    <nz-card [nzBordered]="false" nzTitle="Opened Session" 
[nzLoading]="!statistic">
+      <ng-container *ngIf="statistic">
+        <div class="total">{{ statistic['openSessionCount'] | number: '1.0-0' 
}}</div>
+      </ng-container>
+    </nz-card>
+  </div>
+  <!--  <div nz-col [nzXs]="24" [nzSm]="24" [nzMd]="12" [nzLg]="12" 
[nzXl]="12" class="col">-->
+  <!--    <nz-card [nzBordered]="false" nzTitle="Running Jobs" 
[nzLoading]="!statistic">-->
+  <!--      <ng-container *ngIf="statistic">-->
+  <!--        <div class="total">{{ statistic['jobs-running'] | number: 
'1.0-0' }}</div>-->
+  <!--        <div class="footer">-->
+  <!--          <div class="field">-->
+  <!--            <span>Finished</span>-->
+  <!--            <span>{{ statistic['jobs-finished'] | number: '1.0-0' 
}}</span>-->
+  <!--          </div>-->
+  <!--          <nz-divider nzType="vertical"></nz-divider>-->
+  <!--          <div class="field">-->
+  <!--            <span>Canceled</span>-->
+  <!--            <span>{{ statistic['jobs-cancelled'] | number: '1.0-0' 
}}</span>-->
+  <!--          </div>-->
+  <!--          <nz-divider nzType="vertical"></nz-divider>-->
+  <!--          <div class="field">-->
+  <!--            <span>Failed</span>-->
+  <!--            <span>{{ statistic['jobs-failed'] | number: '1.0-0' 
}}</span>-->
+  <!--          </div>-->
+  <!--        </div>-->
+  <!--      </ng-container>-->
+  <!--    </nz-card>-->
+  <!--  </div>-->

Review Comment:
   Delete them if they are not required.



##########
kyuubi-server/pom.xml:
##########
@@ -494,6 +524,47 @@
                     </execution>
                 </executions>
             </plugin>
+
+            <plugin>
+                <groupId>com.github.eirslett</groupId>
+                <artifactId>frontend-maven-plugin</artifactId>
+                <version>1.11.0</version>

Review Comment:
   let's manage it in the root pom and extract all version stuffs to properties.
   BTW, the plugin supports Apple Sillion since 1.11.4 
https://github.com/eirslett/frontend-maven-plugin/commit/4a63273262e9bc69b9123e0e67885c33e59cc7a3,
 let's use the latest version.



##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/KyuubiRestFrontendService.scala:
##########
@@ -71,8 +71,7 @@ class KyuubiRestFrontendService(override val serverable: 
Serverable)
     val authenticationFactory = new KyuubiHttpAuthenticationFactory(conf)
     
server.addHandler(authenticationFactory.httpHandlerWrapperFactory.wrapHandler(contextHandler))
 
-    server.addStaticHandler("org/apache/kyuubi/ui/static", "/static")
-    server.addRedirectHandler("/", "/static")
+    server.addStaticHandler("web", "/")

Review Comment:
   does the change matter? I see swagger test failed.



##########
kyuubi-server/web-ui/.eslintrc.js:
##########
@@ -0,0 +1,147 @@
+module.exports = {

Review Comment:
   license header



##########
kyuubi-server/web-ui/src/app/pages/overview/statistic/overview-statistic.component.ts:
##########
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnDestroy, 
OnInit } from '@angular/core';
+// import { ChangeDetectionStrategy, Component, OnDestroy, OnInit } from 
'@angular/core';

Review Comment:
   ditto



##########
kyuubi-server/pom.xml:
##########
@@ -471,13 +471,43 @@
         </dependency>
     </dependencies>
 
+    <profiles>
+        <profile>
+            <id>skip-webui-build</id>
+            <build>
+                <pluginManagement>
+                    <plugins>
+                        <plugin>
+                            <groupId>com.github.eirslett</groupId>
+                            <artifactId>frontend-maven-plugin</artifactId>
+                            <configuration>
+                                <skip>true</skip>

Review Comment:
   we can use a property for skip to avoid including the plugin block here



##########
.rat-excludes:
##########
@@ -48,3 +48,16 @@ build/scala-*/**
 **/org/apache/kyuubi/ui/swagger/**
 **/org.apache.spark.status.AppHistoryServerPlugin
 **/metadata-store-schema*.sql
+**/statestore-schema*.sql
+**/web-ui/package.json
+**/web-ui/package-lock.json
+**/web-ui/angular.json
+**/web-ui/proxy.conf.json
+**/web-ui/tsconfig.json
+**/web-ui/tslint.json

Review Comment:
   exclude all json files by `**/*.json` ?



##########
kyuubi-server/web-ui/README.md:
##########
@@ -0,0 +1,95 @@
+<!--
+ - Licensed to the Apache Software Foundation (ASF) under one or more
+ - contributor license agreements.  See the NOTICE file distributed with
+ - this work for additional information regarding copyright ownership.
+ - The ASF licenses this file to You under the Apache License, Version 2.0
+ - (the "License"); you may not use this file except in compliance with
+ - the License.  You may obtain a copy of the License at
+ -
+ -   http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing, software
+ - distributed under the License is distributed on an "AS IS" BASIS,
+ - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ - See the License for the specific language governing permissions and
+ - limitations under the License.
+ -->
+
+# Apache Kyuubi(incubating) Web UI
+
+The web ui listens at `http://localhost:10099`.
+
+The web ui is work in progress. Kyuubi server starts an HTTP server (by 
default at port 10009)
+that serves the new web pages and additional background requests.
+
+## Server Backend
+
+The server side of the ui is implemented using 
[Jetty](https://www.eclipse.org/jetty/) 
+for REST paths.
+The framework has very lightweight dependencies.
+
+## UI Frontend 
+
+The web ui is implemented using *Angular*. The ui build infrastructure uses 
*node.js*.
+
+### Preparing the Build Environment
+
+Depending on your version of Linux, Windows or MacOS, you may need to manually 
install *node.js*

Review Comment:
   macOS



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to