Add a package for the dashboard. and remove hardcoded IP address.
This commit is contained in:
5
bsp/buildroot_external/package/dashboard/Config.in
Normal file
5
bsp/buildroot_external/package/dashboard/Config.in
Normal file
@@ -0,0 +1,5 @@
|
||||
config BR2_PACKAGE_DASHBOARD
|
||||
bool "dashboard"
|
||||
default n
|
||||
help
|
||||
html control dashboard
|
||||
24
bsp/buildroot_external/package/dashboard/dashboard.mk
Normal file
24
bsp/buildroot_external/package/dashboard/dashboard.mk
Normal 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))
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user