@@ -100,6 +100,10 @@ Vue.component('inject-form', {
100
100
<label for="inject-interval">Interval in milliseconds</label>\
101
101
<input id="inject-interval" type="number" class="form-control input-sm" v-model.number="interval" min="0" />\
102
102
</div>\
103
+ <div class="form-group">\
104
+ <label for="ttl">Time To Live (TTL)</label>\
105
+ <input id="ttl" type="number" class="form-control input-sm" v-model.number="ttl" min="0" max="255" />\
106
+ </div>\
103
107
<button type="submit" id="inject" class="btn btn-primary">Inject</button>\
104
108
<button type="button" class="btn btn-danger" @click="reset">Reset</button>\
105
109
</form>\
@@ -127,6 +131,7 @@ Vue.component('inject-form', {
127
131
mode : "random" ,
128
132
payload : "" ,
129
133
incrementPayload : 0 ,
134
+ ttl : 64 ,
130
135
} ;
131
136
} ,
132
137
@@ -242,6 +247,7 @@ Vue.component('inject-form', {
242
247
this . srcMAC = this . dstMAC = "" ;
243
248
this . mode = "random" ;
244
249
this . payload = "" ;
250
+ this . ttl = 64 ;
245
251
} ,
246
252
247
253
inject : function ( ) {
@@ -253,8 +259,8 @@ Vue.component('inject-form', {
253
259
if ( this . mode == "random" ) {
254
260
this . payload = "x" . repeat ( this . payloadlength ) ;
255
261
}
256
- var ttl = this . interval * this . count ;
257
- var headers = { "X-Resource-TTL" : ttl + 5000 + "ms" } ;
262
+ var requestTTL = this . interval * this . count ;
263
+ var headers = { "X-Resource-TTL" : requestTTL + 5000 + "ms" } ;
258
264
$ . ajax ( {
259
265
dataType : "json" ,
260
266
url : '/api/injectpacket' ,
@@ -274,6 +280,7 @@ Vue.component('inject-form', {
274
280
"Interval" : this . interval ,
275
281
"Payload" : this . payload ,
276
282
"IncrementPayload" : this . incrementPayload ,
283
+ "TTL" : this . ttl ,
277
284
} ) ,
278
285
headers : headers ,
279
286
contentType : "application/json; charset=utf-8" ,
0 commit comments