|
|
@ -257,7 +257,7 @@ Last LoRaWAN Packet:
|
|
|
|
this.refreshMessages()
|
|
|
|
this.refreshMessages()
|
|
|
|
setInterval(this.refreshMessages, 1e3)
|
|
|
|
setInterval(this.refreshMessages, 1e3)
|
|
|
|
|
|
|
|
|
|
|
|
this.$http.get('api/deliveryPresets')
|
|
|
|
this.$http.get(window.location.pathname + 'api/deliveryPresets')
|
|
|
|
.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 {
|
|
|
@ -270,7 +270,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(':')
|
|
|
@ -286,7 +286,7 @@ Last LoRaWAN Packet:
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
refreshMessages() {
|
|
|
|
refreshMessages() {
|
|
|
|
this.$http.get('api/message/recent').then(response => {
|
|
|
|
this.$http.get(window.location.pathname + 'api/message/recent').then(response => {
|
|
|
|
this.recentMessageListData = response.body.map(msg => {
|
|
|
|
this.recentMessageListData = response.body.map(msg => {
|
|
|
|
const stateArray = [msg._routerData.recvAck, msg._routerData.readAck, msg._routerData.response]
|
|
|
|
const stateArray = [msg._routerData.recvAck, msg._routerData.readAck, msg._routerData.response]
|
|
|
|
// msg.state = [ msg.type, stateArray.filter(x=>x!==false).length, ...stateArray ]
|
|
|
|
// msg.state = [ msg.type, stateArray.filter(x=>x!==false).length, ...stateArray ]
|
|
|
@ -309,7 +309,7 @@ Last LoRaWAN Packet:
|
|
|
|
},
|
|
|
|
},
|
|
|
|
apiACKMessage(id, ackType) {
|
|
|
|
apiACKMessage(id, ackType) {
|
|
|
|
this.$http.get(
|
|
|
|
this.$http.get(
|
|
|
|
'api/message/ack/'+[ackType, id].join('/')
|
|
|
|
window.location.pathname + 'api/message/ack/'+[ackType, id].join('/')
|
|
|
|
).then(x=>{})
|
|
|
|
).then(x=>{})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
testMsg_addDeliveryTarget() {
|
|
|
|
testMsg_addDeliveryTarget() {
|
|
|
@ -317,14 +317,14 @@ Last LoRaWAN Packet:
|
|
|
|
},
|
|
|
|
},
|
|
|
|
testMsg_send() {
|
|
|
|
testMsg_send() {
|
|
|
|
if (this.EXPERTMODE) {
|
|
|
|
if (this.EXPERTMODE) {
|
|
|
|
this.$http.post('api/message/advanced/',
|
|
|
|
this.$http.post(window.location.pathname + 'api/message/advanced/',
|
|
|
|
Object.assign({ ...this.newMSGData.pager.params }, { payload: this.newMSGData.pager.payload })
|
|
|
|
Object.assign({ ...this.newMSGData.pager.params }, { payload: this.newMSGData.pager.payload })
|
|
|
|
).then(x=>{
|
|
|
|
).then(x=>{
|
|
|
|
this.dialogNewMessage = false
|
|
|
|
this.dialogNewMessage = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
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.pager.payload })
|
|
|
|
Object.assign({ preset: this.newMSGData.preset }, { payload: this.newMSGData.pager.payload })
|
|
|
|
).then(x=>{
|
|
|
|
).then(x=>{
|
|
|
|
this.dialogNewMessage = false
|
|
|
|
this.dialogNewMessage = false
|
|
|
|