diff --git a/help/.tmpmarker b/help/.tmpmarker new file mode 100644 index 000000000..e69de29bb diff --git a/iguana/app/coin_mgmt.js b/iguana/app/coin_mgmt.js index fdeef78aa..a7077faf1 100644 --- a/iguana/app/coin_mgmt.js +++ b/iguana/app/coin_mgmt.js @@ -369,7 +369,7 @@ var startCoin = function (id) { var addExistingCoin = function (id) { var isactive=0; - var maxpeers=16; + var maxpeers=SPNAPI.settings.maxpeers; var services=128; var index = coinManagement.GetCoinIndex(id); console.log('# coin add called '+index); diff --git a/iguana/app/startup.js b/iguana/app/startup.js index fe252ba32..05ed53e51 100644 --- a/iguana/app/startup.js +++ b/iguana/app/startup.js @@ -20,15 +20,15 @@ $(function () { pauseCoin(e.getAttribute('data-id')); } else if (e.className && e.className.indexOf('addPeerToFav') != -1) { - addPeerToFav(e.getAttribute('data-id'),e.getAttribute('data-coin')); + update_favourite(e.getAttribute('data-coin'),e.getAttribute('data-ip'),e.getAttribute('data-id'),true); } else if (e.className && e.className.indexOf('removePeerFromFav') != -1) { - removePeerFromFav(e.getAttribute('data-id'),e.getAttribute('data-coin')); + update_favourite(e.getAttribute('data-coin'),e.getAttribute('data-ip'),e.getAttribute('data-id'),false); }else if(e.className && e.className.indexOf('disconnectPeer') != -1){ - disconnectPeer(e.getAttribute('data-ip'),e.getAttribute('data-coin')); + disconnectPeer(e.getAttribute('data-ip'),e.getAttribute('data-coin'),e.getAttribute('data-id')); }else if(e.className && e.className.indexOf('connectPeer') != -1){ - connectPeer(e.getAttribute('data-ip'),e.getAttribute('data-coin')); + connectPeer(e.getAttribute('data-ip'),e.getAttribute('data-coin'),e.getAttribute('data-id')); }else if(e.className && e.className.indexOf('coinRPCactive') != -1){ callBlockEXPRPC(e.getAttribute('data-value')); @@ -137,14 +137,32 @@ $(function () { InstantDEX_allpairs(); } - // + + else if(e.className && e.className.indexOf('saveConfFiles_onclick') != -1){ + reset_conf_files(); + + } + else if(e.className && e.className.indexOf('connect_to_peers_from_conf') != -1){ + load_peers_from_conf(); + + } + else if(e.className && e.className.indexOf('update_allpeer_status') != -1){ + update_allpeer_status(); + + } + else if(e.className && e.className.indexOf('save_peersdata_to_conf') != -1){ + save_peersdata_to_conf(); + + } + }; $("div .btn-primary").on("click",function(){ $("div .btn-primary").each(function(){ $(this).removeClass('btn-raised'); }); - $(this).addClass("btn-raised"); + if(! $(this).hasClass( "_not_pressed" )){ + $(this).addClass("btn-raised");} }); }); \ No newline at end of file diff --git a/iguana/example.js b/iguana/example.js index 1556f9cc5..753696be6 100755 --- a/iguana/example.js +++ b/iguana/example.js @@ -25,7 +25,8 @@ function errorHandler(e,callback,name) { break; case FileError.NOT_FOUND_ERR: msg = 'NOT_FOUND_ERR'; - callback(name); + if(callback){ + callback(name);} break; case FileError.SECURITY_ERR: msg = 'SECURITY_ERR'; @@ -74,7 +75,7 @@ var check_files=function(){ for(var j=0;j-1 && string.indexOf("bind sock")>-1 ){ APPLICATION.port7778="successfully binded"; + + setTimeout(initialization_commands,3000); if_changed=1; }else if(string.indexOf("finished DidCreate iguana")>-1){ APPLICATION.pexe="Loaded"; if_changed=1; + setTimeout(initialization_commands,3000); }else if(string.indexOf("ERROR BINDING PORT.7778")>-1){ //APPLICATION.state="Loading.."; APPLICATION.port7778="Retrying"; @@ -324,3 +353,8 @@ var change_app_status=function(){ html=html+"Port 7778 state:"+APPLICATION.port7778+""; $("#appstatus").html(html); }; + +var initialization_commands=function(){ + addInitCoins(); + +}; diff --git a/iguana/index.html b/iguana/index.html index 58fe10620..8df685670 100644 --- a/iguana/index.html +++ b/iguana/index.html @@ -54,7 +54,7 @@ data-path="{tc}/{config}"> @@ -260,6 +260,10 @@ data-path="{tc}/{config}">
+ + + +
@@ -270,8 +274,10 @@ data-path="{tc}/{config}"> Coin Type Height Rank + Block Favourite Actions + @@ -329,7 +335,7 @@ data-path="{tc}/{config}">
-
+
@@ -354,7 +360,7 @@ data-path="{tc}/{config}">
- +
@@ -538,6 +544,7 @@ data-path="{tc}/{config}"> + diff --git a/iguana/js/api.js b/iguana/js/api.js index 78bbf3bee..cde87995f 100755 --- a/iguana/js/api.js +++ b/iguana/js/api.js @@ -34,8 +34,8 @@ var SPNAPI = (function(SPNAPI, $, undefined) { SPNAPI.loadSite(page); console.log(page); if(page==="Peers"){ - peer_resonse=[]; - getPeerList(); +// /peer_resonse=[]; + load_peers_to_pool(); }else if(page==="Settings"){ check_files(); //SPNAPI.check_coin_conf_files_present(); diff --git a/iguana/js/jquery.tablesorter.min.js b/iguana/js/jquery.tablesorter.min.js new file mode 100644 index 000000000..730df634e --- /dev/null +++ b/iguana/js/jquery.tablesorter.min.js @@ -0,0 +1,5 @@ +/*! +* TableSorter 2.9.1 min - Client-side table sorting with ease! +* Copyright (c) 2007 Christian Bach +*/ +!function(f){f.extend({tablesorter:new function(){function d(c){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(c):alert(c)}function w(c,b){d(c+" ("+((new Date).getTime()-b.getTime())+"ms)")}function r(c,b,a){if(!b)return"";var e=c.config,d=e.textExtraction,m="",m="simple"===d?e.supportsTextContent?b.textContent:f(b).text():"function"===typeof d?d(b,c,a):"object"===typeof d&&d.hasOwnProperty(a)?d[a](b,c,a):e.supportsTextContent?b.textContent:f(b).text();return f.trim(m)} function j(c){var b=c.config,a=b.$tbodies=b.$table.children("tbody:not(."+b.cssInfoBlock+")"),e,t,m,p,k,n,h="";if(0===a.length)return b.debug?d("*Empty table!* Not building a parser cache"):"";a=a[0].rows;if(a[0]){e=[];t=a[0].cells.length;for(m=0;m':"";x.$headers=f(c).find(x.selectorHeaders).each(function(c){u=f(this);v=x.headers[c];x.headerContent[c]=this.innerHTML;A=x.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,B);x.onRenderTemplate&&(z=x.onRenderTemplate.apply(u,[c,A]))&&"string"===typeof z&&(A=z);this.innerHTML='
'+A+"
";x.onRenderHeader&&x.onRenderHeader.apply(u,[c]);this.column=a[this.parentNode.rowIndex+"-"+ this.cellIndex];var b=g.getData(u,v,"sortInitialOrder")||x.sortInitialOrder;this.order=/^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;y=g.getData(u,v,"lockedOrder")||!1;"undefined"!==typeof y&&!1!==y&&(this.order=this.lockedOrder=/^d/i.test(y)||1===y?[1,1,1]:[0,0,0]);u.addClass(x.cssHeader);x.headerList[c]=this;u.parent().addClass(x.cssHeaderRow)});E(c);x.debug&&(w("Built headers:",D),d(x.$headers))}function A(c,b,a){var e=f(c);e.find(c.config.selectorRemove).remove();j(c); s(c);D(e,b,a)}function E(c){var b,a=c.config;a.$headers.each(function(c,d){b="false"===g.getData(d,a.headers[c],"sorter");d.sortDisabled=b;f(d)[b?"addClass":"removeClass"]("sorter-false")})}function y(c){var b,a,e,d=c.config,m=d.sortList,p=[d.cssAsc,d.cssDesc],k=f(c).find("tfoot tr").children().removeClass(p.join(" "));d.$headers.removeClass(p.join(" "));e=m.length;for(b=0;bn&&(l.sortList.push([h,n]),1n&&(l.sortList.push([h,n]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.benchmark=w;g.construct=function(c){return this.each(function(){if(!this.tHead|| 0===this.tBodies.length||!0===this.hasInitialized)return this.config&&this.config.debug?d("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var b=f(this),a=this,e,t="",m=f.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config={};e=f.extend(!0,a.config,g.defaults,c);f.data(a,"tablesorter",e);e.debug&&f.data(a,"startoveralltimer",new Date);e.supportsTextContent="x"===f("x")[0].textContent;e.supportsDataObject=1.4<=parseFloat(f.fn.jquery);e.string= {max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(b.attr("class"))||(t=""!==e.theme?" tablesorter-"+e.theme:"");e.$table=b.addClass(e.tableClass+t);e.$tbodies=b.children("tbody:not(."+e.cssInfoBlock+")");z(a);if(a.config.widthFixed&&0===f(a).find("colgroup").length){var p=f(""),k=f(a).width();f(a.tBodies[0]).find("tr:first").children("td").each(function(){p.append(f("").css("width",parseInt(1E3*(f(this).width()/k),10)/10+"%"))});f(a).prepend(p)}j(a); e.delayInit||s(a);I(a);e.supportsDataObject&&"undefined"!==typeof b.data().sortlist?e.sortList=b.data().sortlist:m&&(b.metadata()&&b.metadata().sortlist)&&(e.sortList=b.metadata().sortlist);g.applyWidget(a,!0);0'),a=f.fn.detach?b.detach():b.remove();a=f(c).find("span.tablesorter-savemyplace");b.insertAfter(a);a.remove();c.isProcessing=!1};g.clearTableBody=function(c){f(c)[0].config.$tbodies.empty()};g.restoreHeaders=function(c){var b=c.config;b.$headers.each(function(a){f(this).find(".tablesorter-header-inner").length&&f(this).html(b.headerContent[a])})};g.destroy=function(c,b,a){c=f(c)[0];if(c.hasInitialized){g.refreshWidgets(c, !0,!0);var e=f(c),d=c.config,m=e.find("thead:first"),p=m.find("tr."+d.cssHeaderRow).removeClass(d.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");m.find("tr").not(p).remove();e.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave sortBegin sortEnd ".split(" ").join(".tablesorter "));d.$headers.add(k).removeClass(d.cssHeader+" "+d.cssAsc+" "+d.cssDesc).removeAttr("data-column"); p.find(d.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter");g.restoreHeaders(c);!1!==b&&e.removeClass(d.tableClass+" tablesorter-"+d.theme);c.hasInitialized=!1;"function"===typeof a&&a(c)}};g.regex=[/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];g.sortText=function(c,b,a,e){if(b===a)return 0;var d=c.config,m=d.string[d.empties[e]|| d.emptyTo],f=g.regex;if(""===b&&0!==m)return"boolean"===typeof m?m?-1:1:-m||-1;if(""===a&&0!==m)return"boolean"===typeof m?m?1:-1:m||1;if("function"===typeof d.textSorter)return d.textSorter(b,a,c,e);c=b.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");e=a.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=parseInt(b.match(f[2]),16)||1!==c.length&&b.match(f[1])&&Date.parse(b);if(a=parseInt(a.match(f[2]),16)||b&&a.match(f[1])&&Date.parse(a)||null){if(b< a)return-1;if(b>a)return 1}d=Math.max(c.length,e.length);for(b=0;bf)return 1}return 0};g.sortTextDesc=function(c,b,a,e){if(b===a)return 0;var d=c.config,f=d.string[d.empties[e]||d.emptyTo];return""===b&&0!==f?"boolean"===typeof f?f?-1:1:f||1:""===a&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof d.textSorter? d.textSorter(a,b,c,e):g.sortText(c,a,b)};g.getTextValue=function(c,b,a){if(b){var e=c?c.length:0,d=b+a;for(b=0;bf.inArray(p[e].id,m)))j.debug&&d("Refeshing widgets: Removing "+p[e].id),p[e].hasOwnProperty("remove")&&p[e].remove(c,j,j.widgetOptions);!0!==a&&g.applyWidget(c,b)};g.getData=function(c,b,a){var d="";c=f(c);var g,m;if(!c.length)return"";g=f.metadata?c.metadata():!1;m=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?d+=c.data(a)||c.data(a.toLowerCase()):g&&"undefined"!==typeof g[a]?d+=g[a]:b&&"undefined"!==typeof b[a]?d+=b[a]:" "!==m&&m.match(" "+ a+"-")&&(d=m.match(RegExp("\\s"+a+"-([\\w-]+)"))[1]||"");return f.trim(d)};g.formatFloat=function(c,b){if("string"!==typeof c||""===c)return c;var a;c=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));a=parseFloat(c);return isNaN(a)?f.trim(c):a};g.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g,"")):!0}}}); var j=f.tablesorter;f.fn.extend({tablesorter:j.construct});j.addParser({id:"text",is:function(){return!0},format:function(d,w){var r=w.config;d&&(d=f.trim(r.ignoreCase?d.toLocaleLowerCase():d),d=r.sortLocaleCompare?j.replaceAccents(d):d);return d},type:"text"});j.addParser({id:"digit",is:function(d){return j.isDigit(d)},format:function(d,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d|| "").replace(/[,. ]/g,""))},format:function(d,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,f){var r,u=d?d.split("."):"",s="",v=u.length;for(r=0;r'; row += '' + peer.ipaddr + ''; - row += '' + peer.cointype + ''; - row += '' + peer.height + ''; - row += '' + peer.rank + ''; - if ($.inArray(data, favPeers) === -1) { - row += ''; + row += '' + peer.coin + ''; + row += '' + peer.nodestatus.height + ''; + row += '' + peer.nodestatus.rank + ''; + row += '' + peer.nodestatus.msgcounts.block + ''; + + if (!peer.favourite) { + row += ''; // row += 'bookmark_border'; } else { - row += ''; + row += ''; // row += 'bookmark' } - if ($.inArray(peer.ipaddr.toString()+" "+peer.cointype.toString(), connectedPeers) === -1) { - row += ''; + if (!peer.connected) { + row += ''; row +=''; }else{ - row += ''; + row += ''; row +=''; } row += ''; @@ -189,46 +194,190 @@ var renderPeersGrid = function () { console.log('@ peer print grid'); var peersTableAllHtml = ''; - for(var j=0; j
Use pexe or URL requests for communications
'+ '
'+ '
'; - $("#agent_settings").html(config); + config += '' + + '
'+ + '
'+ + '
Save default conf files
'+ + '
' + + '
'+ + ''+ + '
' + + '
' + + '
Save configuration files to chrome APP
'+ + '
'+ + '
'; + config += '' + + '
'+ + '
'+ + '
Maximum peers
'+ + '
' + + '
'+ + ''+ + '
' + + '
' + + '
Set number of nodes connected directly per coin type
'+ + '
'+ + '
'; + + + $("#advanced_settings").html(config); + + var pexe_checkbox = $('.pexe_checkbox'); @@ -177,6 +209,13 @@ var SPNAPI = (function(SPNAPI, $,errorHandler,undefined) { }); $("#save_settings").on("click", function () { + + //saving max peer setting + var peers=$('#max_peers_setting').val(); + if(SPNAPI.settings.maxpeers!==peers){ + SPNAPI.settings.maxpeers=peers; + console.log("maxpeers set to "+SPNAPI.settings.maxpeers); + } /*var agent_checkbox = $('.agent_checkbox'); var settings = []; diff --git a/iguana/js/util.js b/iguana/js/util.js index 2ae322155..bcb3e1969 100755 --- a/iguana/js/util.js +++ b/iguana/js/util.js @@ -131,7 +131,7 @@ function DateTime() { }; }; -document.getElementById('files').addEventListener('change', handleFileSelect, false); +//document.getElementById('files').addEventListener('change', handleFileSelect, false); function handleFileSelect(evt) { var startByte = evt.target.getAttribute('data-startbyte');