-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add iot2050 configration web application
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
1 parent
9ae0f67
commit 84e00bc
Showing
46 changed files
with
16,597 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.next | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
recipes-app/iot2050-conf-webui/files/iot2050-conf-webui.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"compilerOptions": { | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.