50 lines
1.3 KiB
Markdown
50 lines
1.3 KiB
Markdown
# PiSwitch_frontend
|
|
A Frontend for the [PiSwitch](https://git.dennisvandermeulen.nl/dennis/PiSwitch) and [PiSwitch_Reporting](https://git.dennisvandermeulen.nl/dennis/PiSwitch_reporting)
|
|
|
|
## Installation Process
|
|
|
|
Clone the repository
|
|
```shell
|
|
git clone https://git.dennisvandermeulen.nl/dennis/PiSwitch_frontend.git
|
|
```
|
|
|
|
## Setup
|
|
Go to the js asset file folder
|
|
````shell
|
|
cd PiSwitch_frontend/assets/js/
|
|
````
|
|
Set the values in pagefunctions.js
|
|
```shell
|
|
nano pagefunctions.js
|
|
```
|
|
Set the key and the url of the [PiSwitch reporting server](https://git.dennisvandermeulen.nl/dennis/PiSwitch_reporting)
|
|
````javascript
|
|
var apiurl = ''
|
|
var srvkey = ''
|
|
````
|
|
Set the key and the url of the [PiSwitch](https://git.dennisvandermeulen.nl/dennis/PiSwitch) for this dashboard instance
|
|
```javascript
|
|
var deviceurl = ''
|
|
var deviceid =
|
|
```
|
|
Set de mapquest api key in locationpicker.js
|
|
```shell
|
|
nano locationpicker.js
|
|
```
|
|
Set your mapquest key
|
|
```javascript
|
|
L.mapquest.key = '';
|
|
```
|
|
|
|
## Docker
|
|
Ensure you built the [PiSwitch reporting server](https://git.dennisvandermeulen.nl/dennis/PiSwitch_reporting) dockerfile
|
|
|
|
Use the included Docker-Compose files to start the nginx server
|
|
````shell
|
|
docker-compose . -up -d
|
|
````
|
|
|
|
Visit your dashboard at:
|
|
````shell
|
|
http://your-ip-or-hostname:81/index.html
|
|
```` |