Add a package for the dashboard. and remove hardcoded IP address.

This commit is contained in:
jbnadal
2017-06-08 13:55:09 +02:00
parent acd61f82ba
commit 443f1d0269
4 changed files with 33 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
config BR2_PACKAGE_DASHBOARD
bool "dashboard"
default n
help
html control dashboard

View File

@@ -0,0 +1,24 @@
################################################################################
#
# DASHBOARD
#
################################################################################
DASHBOARD_VERSION:= 1.0.0
DASHBOARD_SITE = $(TOPDIR)/../../src/prog/dashboard
DASHBOARD_SITE_METHOD = local
DASHBOARD_INSTALL_STAGING = NO
define DASHBOARD_BUILD_CMDS
cd $(@D) && \
npm install && \
npm run build
endef
define DASHBOARD_INSTALL_TARGET_CMDS
mkdir -p $(TARGET_DIR)/usr/local/share/dashboard
cp -a $(@D)/dist/* $(TARGET_DIR)/usr/local/share/dashboard
endef
$(eval $(generic-package))

View File

@@ -31,7 +31,7 @@ export default {
methods: {
/* Get Lights */
getLights () {
this.$http.get('http://192.168.1.6:8081/v1/capabilities/lights')
this.$http.get('/v1/capabilities/lights')
.then(function (response) {
this.$set('lights', response.data.Lights)
console.log('Success!:', response.data)
@@ -45,7 +45,7 @@ export default {
console.log(data)
msg = '{"id": ' + data.id + ', "state": ' + data.state + '}'
console.log(msg)
this.$http.post('http://192.168.1.6:8081/v1/capabilities/lights', msg)
this.$http.post('/v1/capabilities/lights', msg)
.then(function (response) {
console.log('Success!:', response.data)
}, function (err) {

View File

@@ -32,7 +32,7 @@ export default {
methods: {
/* Get Sprinklers */
getSprinklers () {
this.$http.get('http://192.168.1.6:8081/v1/capabilities/sprinklers')
this.$http.get('/v1/capabilities/sprinklers')
.then(function (response) {
this.$set('sprinklers', response.data.Sprinklers)
console.log('Success!:', response.data)
@@ -46,7 +46,7 @@ export default {
console.log(data)
msg = '{"id": ' + data.id + ', "state": ' + data.state + '}'
console.log(msg)
this.$http.post('http://192.168.1.6:8081/v1/capabilities/sprinklers', msg)
this.$http.post('/v1/capabilities/sprinklers', msg)
.then(function (response) {
console.log('Success!:', response.data)
}, function (err) {