-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Add iot2050 configration Web UI
Fix the commit message The init use case is to config the PLC1200 modules. Signed-off-by: Baocheng Su <[email protected]>
- Loading branch information
1 parent
a709cd4
commit 3d597f6
Showing
46 changed files
with
16,609 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,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
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.