Commit 04963758 authored by Olav Kvittem's avatar Olav Kvittem

disable iperf button

parent 33506397
......@@ -49,6 +49,8 @@ function iperf(direction, host, nobs, interval, parallel, port){
var title='Bandwidth report ' + direction + ' ' + host + ' at ' + new Date().toLocaleTimeString();
// var UWAP = require("/_/js/require.js");
document.getElementById("test-button").disabled = true;
var request = $.ajax( { url: url, dataType: 'json', timeout: (nobs+2)*1000, // in ms need +2 sec for iperf
headers: { "X-TOKEN": "virre-virre-vapp" } } );
request.fail( function( jqXHR, status, error){
......@@ -56,6 +58,7 @@ function iperf(direction, host, nobs, interval, parallel, port){
$('#traces').tabs( "enable", 1);
$('#traces').tabs({ active:1});
$("#busy").hide();
document.getElementById("test-button").disabled = false;
});
request.done( function( iperfr){
......@@ -63,6 +66,7 @@ function iperf(direction, host, nobs, interval, parallel, port){
$("#busy").hide();
$('#traces').tabs( "enable", 0);
$('#traces').tabs( "enable", 1);
document.getElementById("test-button").disabled = false;
if (iperfr.error){
$("#tracetablecontainer").prepend( '<h3>'+title + ': ' + iperfr["error"] +'</h3>'); // error message
......@@ -238,7 +242,7 @@ function make_select( elm, url){
var html='<form name="iperf_form" id="iperf_form"';
html+= 'action="javascript:iperf( $(\'#direction\').val(), $(\'#tr_host\').val(), $(\'#tr_times\').val(), $(\'#tr_interval\').val(), $(\'#tr_parallel\').val(), $(\'#tr_port\').val() )">';
html+='<table><tr><td>';
html+='<input class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> ';
html+='<input id="test-button" class="btn btn-primary btn-lg" type="submit" value="Test" class=button/> ';
html+='<select id=direction style=width=6em><option value="to">to</option><option value="from">from</option></select>';
html+='<td><input id=tr_host value="" placeholder="my host" title="Automatic completion(try \'mp\')"></input>';
html+='<select id=tr_host_menu title="Choose host">host menu</select>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment