Skip to content

Commit 05db2a5

Browse files
vivekratnavelanuengineer
authored andcommitted
HDDS-1487. Bootstrap React framework for Recon UI (#831)
HDDS-1487. Bootstrap React framework for Recon UI. Contributed by Vivek Ratnavel Subramanian.
1 parent f633002 commit 05db2a5

File tree

30 files changed

+10744
-73
lines changed

30 files changed

+10744
-73
lines changed

hadoop-ozone/ozone-recon/pom.xml

Lines changed: 76 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,84 @@
7575
<excludeFilterFile>${basedir}/dev-support/findbugsExcludeFile.xml</excludeFilterFile>
7676
</configuration>
7777
</plugin>
78+
<!--
79+
1. used for local installation of node and yarn
80+
2. to install dependencies with yarn install
81+
3. building the frontend application
82+
-->
83+
<plugin>
84+
<groupId>com.github.eirslett</groupId>
85+
<artifactId>frontend-maven-plugin</artifactId>
86+
<version>1.6</version>
87+
<configuration>
88+
<installDirectory>target</installDirectory>
89+
<workingDirectory>${basedir}/src/main/resources/webapps/recon/ozone-recon-web</workingDirectory>
90+
</configuration>
91+
<executions>
92+
<execution>
93+
<id>Install node and yarn locally to the project</id>
94+
<goals>
95+
<goal>install-node-and-yarn</goal>
96+
</goals>
97+
<configuration>
98+
<nodeVersion>v12.1.0</nodeVersion>
99+
<yarnVersion>v1.9.2</yarnVersion>
100+
</configuration>
101+
</execution>
102+
<execution>
103+
<id>yarn install</id>
104+
<goals>
105+
<goal>yarn</goal>
106+
</goals>
107+
<configuration>
108+
<arguments>install</arguments>
109+
</configuration>
110+
</execution>
111+
<execution>
112+
<id>Build frontend</id>
113+
<goals>
114+
<goal>yarn</goal>
115+
</goals>
116+
<configuration>
117+
<arguments>run build</arguments>
118+
</configuration>
119+
</execution>
120+
</executions>
121+
</plugin>
78122
<plugin>
79123
<groupId>org.apache.maven.plugins</groupId>
80-
<artifactId>maven-dependency-plugin</artifactId>
124+
<artifactId>maven-resources-plugin</artifactId>
81125
<executions>
82126
<execution>
83-
<id>copy-common-html</id>
84-
<phase>prepare-package</phase>
127+
<id>Copy frontend build to target</id>
128+
<phase>process-resources</phase>
85129
<goals>
86-
<goal>unpack</goal>
130+
<goal>copy-resources</goal>
87131
</goals>
88132
<configuration>
89-
<artifactItems>
90-
<artifactItem>
91-
<groupId>org.apache.hadoop</groupId>
92-
<artifactId>hadoop-hdds-server-framework</artifactId>
93-
<outputDirectory>${project.build.outputDirectory}
94-
</outputDirectory>
95-
<includes>webapps/static/**/*.*</includes>
96-
</artifactItem>
97-
</artifactItems>
98-
<overWriteSnapshots>true</overWriteSnapshots>
133+
<outputDirectory>${project.build.outputDirectory}/webapps/recon</outputDirectory>
134+
<resources>
135+
<resource>
136+
<directory>${basedir}/src/main/resources/webapps/recon/ozone-recon-web/build</directory>
137+
<filtering>true</filtering>
138+
</resource>
139+
</resources>
140+
</configuration>
141+
</execution>
142+
<execution>
143+
<id>Copy frontend static files to target</id>
144+
<phase>process-resources</phase>
145+
<goals>
146+
<goal>copy-resources</goal>
147+
</goals>
148+
<configuration>
149+
<outputDirectory>${project.build.outputDirectory}/webapps/static</outputDirectory>
150+
<resources>
151+
<resource>
152+
<directory>${basedir}/src/main/resources/webapps/recon/ozone-recon-web/build/static</directory>
153+
<filtering>true</filtering>
154+
</resource>
155+
</resources>
99156
</configuration>
100157
</execution>
101158
</executions>
@@ -261,5 +318,10 @@
261318
<artifactId>spring-jdbc</artifactId>
262319
<version>${spring.version}</version>
263320
</dependency>
321+
<dependency>
322+
<groupId>javax.activation</groupId>
323+
<artifactId>activation</artifactId>
324+
<version>1.1.1</version>
325+
</dependency>
264326
</dependencies>
265327
</project>

hadoop-ozone/ozone-recon/src/main/resources/webapps/recon/index.html

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# production
12+
/build
13+
14+
# misc
15+
.DS_Store
16+
.env.local
17+
.env.development.local
18+
.env.test.local
19+
.env.production.local
20+
21+
npm-debug.log*
22+
yarn-debug.log*
23+
yarn-error.log*
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!---
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
--->
17+
18+
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
19+
20+
## Available Scripts
21+
22+
In the project directory, you can run:
23+
24+
### `yarn start`
25+
26+
Runs the app in the development mode.<br>
27+
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
28+
29+
The page will reload if you make edits.<br>
30+
You will also see any lint errors in the console.
31+
32+
### `yarn test`
33+
34+
Launches the test runner in the interactive watch mode.<br>
35+
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
36+
37+
### `yarn run build`
38+
39+
Builds the app for production to the `build` folder.<br>
40+
It correctly bundles React in production mode and optimizes the build for the best performance.
41+
42+
The build is minified and the filenames include the hashes.<br>
43+
Your app is ready to be deployed!
44+
45+
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
const { override, fixBabelImports, addLessLoader} = require('customize-cra');
20+
21+
module.exports = override(
22+
fixBabelImports('import', {
23+
libraryName: 'antd',
24+
libraryDirectory: 'es',
25+
style: true
26+
}),
27+
addLessLoader({
28+
javascriptEnabled: true,
29+
modifyVars: {
30+
'@primary-color': '#1DA57A'
31+
}
32+
})
33+
);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"name": "ozone-recon",
3+
"version": "0.1.0",
4+
"private": true,
5+
"dependencies": {
6+
"@types/jest": "24.0.12",
7+
"@types/node": "11.13.9",
8+
"@types/react": "16.8.15",
9+
"@types/react-dom": "16.8.4",
10+
"@types/react-router-dom": "^4.3.3",
11+
"antd": "^3.16.6",
12+
"babel-plugin-import": "^1.11.0",
13+
"classnames": "^2.2.6",
14+
"customize-cra": "^0.2.12",
15+
"less": "^3.9.0",
16+
"less-loader": "^5.0.0",
17+
"react": "^16.8.6",
18+
"react-app-rewired": "^2.1.3",
19+
"react-dom": "^16.8.6",
20+
"react-router-dom": "^5.0.0",
21+
"react-scripts": "3.0.0",
22+
"typescript": "3.4.5"
23+
},
24+
"scripts": {
25+
"start": "react-app-rewired start",
26+
"build": "react-app-rewired build",
27+
"test": "react-app-rewired test",
28+
"eject": "react-scripts eject"
29+
},
30+
"eslintConfig": {
31+
"extends": "react-app"
32+
},
33+
"browserslist": {
34+
"production": [
35+
">0.2%",
36+
"not dead",
37+
"not op_mini all"
38+
],
39+
"development": [
40+
"last 1 chrome version",
41+
"last 1 firefox version",
42+
"last 1 safari version"
43+
]
44+
}
45+
}
Binary file not shown.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<!DOCTYPE html>
18+
<html lang="en">
19+
<head>
20+
<meta charset="utf-8" />
21+
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
22+
<meta name="viewport" content="width=device-width, initial-scale=1" />
23+
<meta name="theme-color" content="#000000" />
24+
<!--
25+
manifest.json provides metadata used when your web app is installed on a
26+
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
27+
-->
28+
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
29+
<!--
30+
Notice the use of %PUBLIC_URL% in the tags above.
31+
It will be replaced with the URL of the `public` folder during the build.
32+
Only files inside the `public` folder can be referenced from the HTML.
33+
34+
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
35+
work correctly both with client-side routing and a non-root public URL.
36+
Learn how to configure a non-root public URL by running `npm run build`.
37+
-->
38+
39+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" />
40+
<title>React App</title>
41+
</head>
42+
<body>
43+
<noscript>You need to enable JavaScript to run this app.</noscript>
44+
<div id="root"></div>
45+
<!--
46+
This HTML file is a template.
47+
If you open it directly in the browser, you will see an empty page.
48+
49+
You can add webfonts, meta tags, or analytics to this file.
50+
The build step will place the bundled scripts into the <body> tag.
51+
52+
To begin the development, run `npm start` or `yarn start`.
53+
To create a production bundle, use `npm run build` or `yarn build`.
54+
-->
55+
</body>
56+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"short_name": "React App",
3+
"name": "Create React App Sample",
4+
"icons": [
5+
{
6+
"src": "favicon.ico",
7+
"sizes": "64x64 32x32 24x24 16x16",
8+
"type": "image/x-icon"
9+
}
10+
],
11+
"start_url": ".",
12+
"display": "standalone",
13+
"theme_color": "#000000",
14+
"background_color": "#ffffff"
15+
}

0 commit comments

Comments
 (0)