Skip to content

Commit

Permalink
Add iot2050 configration web application
Browse files Browse the repository at this point in the history
Currently the only supported feature is to config the PLC1200 modules.
Web application is easier to use and less error-prone compared to the
YAML configuration, but less efficient for mass deployment.

This also provides a base when new requirement of web application comes.

For the sake of familiarity, react + material UI is used, however in the
future, siemens/ix should be used to get a more pretty and unified UI
style.

This web app should also be possible to pack for the Host PC or server
to be a standalone version, the use case is to manipulate the
configuration but not deploy/retrieve.

Signed-off-by: Baocheng Su <[email protected]>
  • Loading branch information
BaochengSu committed Dec 2, 2023
1 parent d0a97d3 commit 62ec1d9
Show file tree
Hide file tree
Showing 46 changed files with 16,597 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
25 changes: 25 additions & 0 deletions recipes-app/iot2050-conf-webui/files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.
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 62ec1d9

Please sign in to comment.