|
|
|
@ -191,7 +191,7 @@ Last LoRaWAN Packet:
|
|
|
|
|
this.refreshMessages()
|
|
|
|
|
setInterval(this.refreshMessages, 1e3)
|
|
|
|
|
|
|
|
|
|
this.$http.get('/api/modes')
|
|
|
|
|
this.$http.get(window.location.pathname + 'api/modes')
|
|
|
|
|
.then(response => {
|
|
|
|
|
console.log(response.body)
|
|
|
|
|
this.presetSearchItems = response.body.map(x => { return {
|
|
|
|
@ -204,7 +204,7 @@ Last LoRaWAN Packet:
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
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 => {
|
|
|
|
|
const item = response.body[ key ]
|
|
|
|
|
const keyData = key.split(':')
|
|
|
|
@ -221,7 +221,7 @@ Last LoRaWAN Packet:
|
|
|
|
|
},
|
|
|
|
|
refreshMessages() {
|
|
|
|
|
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
|
|
|
|
|
} }).then(response => {
|
|
|
|
|
this.recentMessageListData = response.body.map(msg => {
|
|
|
|
@ -236,6 +236,7 @@ Last LoRaWAN Packet:
|
|
|
|
|
case 3: msg.state = '💬 Responded'; break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (msg._routerData.failed === true) msg.state = '❌ Failed'
|
|
|
|
|
msg.date = new Date(msg.date).toLocaleString()
|
|
|
|
|
return msg
|
|
|
|
|
})
|
|
|
|
@ -245,7 +246,7 @@ Last LoRaWAN Packet:
|
|
|
|
|
},
|
|
|
|
|
testMsg_send() {
|
|
|
|
|
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 })
|
|
|
|
|
).then(x=>{
|
|
|
|
|
console.log('response', x)
|
|
|
|
|