Skip to content

Commit

Permalink
[WIP] Add iot2050 configration Web UI
Browse files Browse the repository at this point in the history
Fix the commit message

The init use case is to config the PLC1200 modules.

Signed-off-by: Baocheng Su <[email protected]>
  • Loading branch information
BaochengSu committed Nov 26, 2023
1 parent a709cd4 commit 3d597f6
Show file tree
Hide file tree
Showing 46 changed files with 16,609 additions and 0 deletions.
15 changes: 15 additions & 0 deletions recipes-app/iot2050-conf-webui/files/.eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
env:
browser: true
es2021: true
node: true
extends:
- standard
- plugin:react/recommended
parserOptions:
ecmaVersion: latest
sourceType: module
plugins:
- react
rules: {
semi: [2, "always"]
}
2 changes: 2 additions & 0 deletions recipes-app/iot2050-conf-webui/files/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.next
node_modules
37 changes: 37 additions & 0 deletions recipes-app/iot2050-conf-webui/files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# IOT2050 Conf WEBUI

This is the IOT2050 configuration webUI, it is used to setup the device and it's
extension modules.

## Development

This application is using Next.JS + Material UI.

Install dependencies and run via `npm`:

```shell
# install dependencies
npm install

# run for development
npm run dev -- -p 2050

# run for production
npm run build
npm run start -- -p 2050
```

Open [http://localhost:2050](http://localhost:2050) with your browser to see the
result.

### Reference

To learn more about this example:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js
features and API.
- [Customizing Material UI](https://mui.com/material-ui/customization/how-to-customize/) - approaches to customizing Material UI.

## Integrate to meta-iot2050

Due to some issue in debian npm package, with `devDependencies` in the ....
12 changes: 12 additions & 0 deletions recipes-app/iot2050-conf-webui/files/iot2050-conf-webui.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Unit]
Description=IOT2050 Configuration Web UI
After=syslog.target network.target

[Service]
Type=idle
User=root
WorkingDirectory=/srv/iot2050-conf-webui
ExecStart=/usr/bin/npm run start --prefix=/srv/iot2050-conf-webui -- -p 2050

[Install]
WantedBy=multi-user.target
7 changes: 7 additions & 0 deletions recipes-app/iot2050-conf-webui/files/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
}
}
35 changes: 35 additions & 0 deletions recipes-app/iot2050-conf-webui/files/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/** @type {import('next').NextConfig} */

const CopyPlugin = require('copy-webpack-plugin');

const nextConfig = {
reactStrictMode: true,
swcMinify: true,
modularizeImports: {
'@mui/icons-material': {
transform: '@mui/icons-material/{{member}}',
},
},
webpack: (config, { isServer }) => {
// Only run in server mode
if (isServer) {
config.plugins.push(
new CopyPlugin({
patterns: [
{
from: 'src/lib/gRPC',
to: 'gRPC'
},
{
from: 'src/lib/gRPC',
to: 'app/gRPC'
}
],
})
);
}
return config;
},
};

module.exports = nextConfig;
Loading

0 comments on commit 3d597f6

Please sign in to comment.