master
cheetah 2 years ago
parent bd67a7f15e
commit 5fb58b6928

@ -13,9 +13,9 @@
<div id="app"> <div id="app">
<v-app> <v-app>
<v-app-bar app> <v-app-bar app>
<v-toolbar-title> <v-toolbar-title>Dispatcher</v-toolbar-title>
Dispatcher API Test <v-spacer></v-spacer>
</v-toolbar-title> <v-checkbox label="Expert Mode" v-model="EXPERTMODE"></v-checkbox>
</v-app-bar> </v-app-bar>
<v-content> <v-content>
<v-container> <!-- Device List--> <v-container> <!-- Device List-->
@ -64,7 +64,62 @@ Last LoRaWAN Packet:
class="elevation-1"> class="elevation-1">
<template v-slot:top> <template v-slot:top>
<v-toolbar flat> <v-toolbar flat>
<v-toolbar-title>Recent Messages</v-toolbar-title> <v-toolbar-title>Message History</v-toolbar-title>
<v-spacer></v-spacer>
<v-dialog v-model="dialogNewMessage" fullscreen hide-overlay transition="dialog-bottom-transition">
<template v-slot:activator="{ on, attrs }">
<v-btn color="primary" v-bind="attrs" v-on="on">
<v-icon>mdi-email</v-icon>
New Message
</v-btn>
</template>
<v-card>
<v-toolbar dark color="primary">
<v-btn icon dark @click="dialogNewMessage = false">
<v-icon>mdi-close</v-icon>
</v-btn>
<v-toolbar-title>New Message</v-toolbar-title>
<v-spacer></v-spacer>
</v-toolbar>
<v-container>
<b>Routing Paramters:</b>
<v-row>
<v-col cols="12" sm="12" md="6">
<v-select :items="pagerTypes" v-model="newMSGData.pager.params.type" item-text="k" item-value="v" label="Delivery Type"></v-select>
</v-col>
</v-row>
<v-row>
<v-col cols="12" sm="12" md="6">
<v-select :items="deviceType" v-model="newMSGData.pager.params.routing.device" item-text="k" item-value="v" label="Device"></v-select>
</v-col>
</v-row>
<b>Delivery Targets:</b>
<v-btn color="primary" @click="testMsg_addDeliveryTarget()">Add</v-btn>
<v-row v-for="(connector, index) in newMSGData.pager.params.routing.connectors" :key="index">
<v-col cols="6" sm="4" md="4">
<v-select :items="connectorTypes" v-model="connector[0]" item-text="k" item-value="v" label="Gateway"></v-select>
</v-col>
<v-col cols="6" sm="4" md="4">
<v-text-field v-model="connector[1]" label="Call ID"></v-text-field>
</v-col>
<v-col cols="6" sm="4" md="4">
<v-btn color="error" @click="newMSGData.pager.params.routing.connectors.splice(index, 1)" icon><v-icon>mdi-delete</v-icon></v-btn>
</v-col>
</v-row>
<v-row>
<v-col cols="12" sm="12" md="6">
<v-textarea v-model="newMSGData.pager.payload" label="Message"></v-select>
</v-col>
</v-row>
<v-row>
<v-col cols="12" sm="12" md="6">
<v-btn color="success" dark text @click="testMsg_send()">Send</v-btn>
</v-col>
</v-row>
</v-container>
</v-card>
</v-dialog>
</v-toolbar> </v-toolbar>
</template> </template>
<template v-slot:no-data> <template v-slot:no-data>
@ -93,6 +148,11 @@ Last LoRaWAN Packet:
http: { root: '/' }, http: { root: '/' },
data() { data() {
return { return {
EXPERTMODE:false,
dialogNewMessage: false,
loadingD: true, loadingD: true,
loadingM: true, loadingM: true,
search: '', search: '',
@ -118,10 +178,48 @@ Last LoRaWAN Packet:
{ text: 'ID', align: 'start', groupable: false, sortable: false, value: 'id', }, { text: 'ID', align: 'start', groupable: false, sortable: false, value: 'id', },
{ text: 'Type', value: 'type', groupable: true, sortable: false }, { text: 'Type', value: 'type', groupable: true, sortable: false },
{ text: 'State', value: 'state', groupable: false, sortable: false }, { text: 'State', value: 'state', groupable: false, sortable: false },
{ text: 'Sent Date', value: 'date', groupable: false, sortable: false }, { text: 'Date', value: 'date', groupable: false, sortable: false },
{ text: 'Sent Payload', value: '_payload', groupable: false, sortable: false }, { text: 'Message', value: '_payload', groupable: false, sortable: false },
],
pagerTypes: [
{k: 'Simple', v: 'simple'},
{k: 'Duplex', v: 'duplex'},
],
deviceType: [
{k: 'Generic', v: 'generic'},
{k: 'Birdy Slim (IoT)', v: 'birdyslim'},
], ],
bulkImportText: '', connectorTypes: [
{k: 'Dummy', v: 'dummy'},
{k: 'POCSAG GW', v: 'pocsag'},
{k: 'DAPNET', v: 'dapnet'},
{k: 'e*Cityruf inetgw', v: 'ecityruf'},
{k: 'e*Cityruf Puppeteer', v: 'em-p-cityruf'},
{k: 'e*Cityruf alertManager', v: 'em-a-cityruf'},
{k: 'e*2wayS Puppeteer', v: 'em-p-twoways'},
{k: 'e*2wayS alertManager', v: 'em-a-twoways'},
{k: 'LoRaWAN TTNv3', v: 'lorawan'},
],
newMSGData: {
"pager": {
"params": {
"type": "simple",
"routing": {
"device": "generic",
"connectors": [
["dummy","1234"]
]
}
},
"payload": "Test Message",
},
}
} }
}, },
created() { created() {
@ -171,6 +269,16 @@ Last LoRaWAN Packet:
this.$http.get( this.$http.get(
'/api/message/ack/'+[ackType, id].join('/') '/api/message/ack/'+[ackType, id].join('/')
).then(x=>{}) ).then(x=>{})
},
testMsg_addDeliveryTarget() {
this.newMSGData.pager.params.routing.connectors.push(["dummy","1234"])
},
testMsg_send() {
this.$http.post('/api/message/advanced/',
Object.assign({ ...this.newMSGData.pager.params }, { payload: this.newMSGData.pager.payload })
).then(x=>{
this.dialogNewMessage = false
})
} }
} }

Loading…
Cancel
Save