|
@@ -23,7 +23,9 @@
|
|
|
<body>
|
|
|
<div id="app">
|
|
|
<textarea v-model="input" cols="80" rows="20"></textarea>
|
|
|
- <button v-on:click="send">send</button>
|
|
|
+ <button v-on:click="sendCommand">sendCommand</button>
|
|
|
+ <button v-on:click="sendFreeDrive">sendFreeDrive</button>
|
|
|
+
|
|
|
Running: {{ $data.running }}
|
|
|
<table border="1">
|
|
|
<tr v-for="x in cmdq">
|
|
@@ -95,7 +97,7 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- send: function (event) {
|
|
|
+ sendCommand: function (event) {
|
|
|
var params = new URLSearchParams();
|
|
|
params.append('script', this.input);
|
|
|
fetch('/cmd', {method: "POST", body: params})
|
|
@@ -103,6 +105,13 @@
|
|
|
return response;
|
|
|
});
|
|
|
},
|
|
|
+ sendFreeDrive: function (event) {
|
|
|
+ var params = new URLSearchParams();
|
|
|
+ fetch('/freedrive', {method: "POST"})
|
|
|
+ .then(function (response) {
|
|
|
+ return response;
|
|
|
+ });
|
|
|
+ },
|
|
|
ts2txt: function (ts) {
|
|
|
return moment(ts).format('YYYY-MM-DD hh:mm ss.SSS ')
|
|
|
},
|