|
|
@ -191,7 +191,7 @@ Last LoRaWAN Packet:
|
|
|
|
this.refreshMessages()
|
|
|
|
this.refreshMessages()
|
|
|
|
setInterval(this.refreshMessages, 1e3)
|
|
|
|
setInterval(this.refreshMessages, 1e3)
|
|
|
|
|
|
|
|
|
|
|
|
this.$http.get('/api/modes')
|
|
|
|
this.$http.get(window.location.pathname + 'api/modes')
|
|
|
|
.then(response => {
|
|
|
|
.then(response => {
|
|
|
|
console.log(response.body)
|
|
|
|
console.log(response.body)
|
|
|
|
this.presetSearchItems = response.body.map(x => { return {
|
|
|
|
this.presetSearchItems = response.body.map(x => { return {
|
|
|
@ -204,7 +204,7 @@ Last LoRaWAN Packet:
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
refreshDevices() {
|
|
|
|
refreshDevices() {
|
|
|
|
this.$http.get('/api/devices').then(response => {
|
|
|
|
this.$http.get(window.location.pathname + 'api/devices').then(response => {
|
|
|
|
this.deviceListData = Object.keys(response.body).map(key => {
|
|
|
|
this.deviceListData = Object.keys(response.body).map(key => {
|
|
|
|
const item = response.body[ key ]
|
|
|
|
const item = response.body[ key ]
|
|
|
|
const keyData = key.split(':')
|
|
|
|
const keyData = key.split(':')
|
|
|
@ -221,7 +221,7 @@ Last LoRaWAN Packet:
|
|
|
|
},
|
|
|
|
},
|
|
|
|
refreshMessages() {
|
|
|
|
refreshMessages() {
|
|
|
|
if (this.messagesCheckList.length == 0) return
|
|
|
|
if (this.messagesCheckList.length == 0) return
|
|
|
|
this.$http.get('/api/message/status', { params: {
|
|
|
|
this.$http.get(window.location.pathname + 'api/message/status', { params: {
|
|
|
|
ids: this.messagesCheckList
|
|
|
|
ids: this.messagesCheckList
|
|
|
|
} }).then(response => {
|
|
|
|
} }).then(response => {
|
|
|
|
this.recentMessageListData = response.body.map(msg => {
|
|
|
|
this.recentMessageListData = response.body.map(msg => {
|
|
|
@ -236,6 +236,7 @@ Last LoRaWAN Packet:
|
|
|
|
case 3: msg.state = '💬 Responded'; break;
|
|
|
|
case 3: msg.state = '💬 Responded'; break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (msg._routerData.failed === true) msg.state = '❌ Failed'
|
|
|
|
msg.date = new Date(msg.date).toLocaleString()
|
|
|
|
msg.date = new Date(msg.date).toLocaleString()
|
|
|
|
return msg
|
|
|
|
return msg
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -245,7 +246,7 @@ Last LoRaWAN Packet:
|
|
|
|
},
|
|
|
|
},
|
|
|
|
testMsg_send() {
|
|
|
|
testMsg_send() {
|
|
|
|
console.log(this.newMSGData.preset)
|
|
|
|
console.log(this.newMSGData.preset)
|
|
|
|
this.$http.post('/api/message/preset/',
|
|
|
|
this.$http.post(window.location.pathname + 'api/message/preset/',
|
|
|
|
Object.assign({ preset: this.newMSGData.preset }, { payload: this.newMSGData.payload })
|
|
|
|
Object.assign({ preset: this.newMSGData.preset }, { payload: this.newMSGData.payload })
|
|
|
|
).then(x=>{
|
|
|
|
).then(x=>{
|
|
|
|
console.log('response', x)
|
|
|
|
console.log('response', x)
|
|
|
|