such facepalm.

This commit is contained in:
cat 2015-11-27 15:38:29 +01:00 committed by Thulinma
parent 23800d6cbb
commit e5e36df045
2 changed files with 2 additions and 1 deletions

View file

@ -154,7 +154,7 @@ UI.elements.connection.user_and_host.text(mist.user.name+" @ "+mist.user.host);U
600)*1E3;d();k=mist.data.config.time*1E3;d()}d=e;stream=a?a.join(" "):"all_streams";protocol=b?b.join("_"):"all_protocols";stream in mist.data.totals||(mist.data.totals[stream]={});protocol in mist.data.totals[stream]||(mist.data.totals[stream][protocol]={});$.extend(mist.data.totals[stream][protocol],d)},mist.data.totals={},"fields"in d.totals)f(c.totals.streams,c.totals.protocols,d.totals);else for(p in d.totals)f(c.totals[p].streams,c.totals[p].protocols,d.totals[p]);a&&a(d,b);break;case "CHALL":d.authorize.challenge==
mist.user.authstring?(""!=mist.user.password&&UI.elements.connection.msg.text("The credentials you provided are incorrect.").addClass("red"),UI.navto("Login")):""==mist.user.password?UI.navto("Login"):(mist.user.authstring=d.authorize.challenge,mist.send(a,c,b));break;case "NOACC":UI.navto("Create a new account");break;case "ACC_MADE":delete c.authorize;mist.send(a,c,b);break;default:UI.navto("Login")}}};b.hide||UI.elements.connection.msg.removeClass("red").text("Data sent, waiting for a reply..").append($("<br>")).append($("<a>").text("Cancel request").click(function(){f.abort()}));
var f=$.ajax(d)},inputMatch:function(a,c){if("undefined"==typeof a)return!1;var b=a.replace(/[^\w\s]/g,"\\$&"),b=b.replace(/\\\?/g,".").replace(/\\\*/g,"(?:.)*");return RegExp("^"+b+"$","i").test(c)},convertBuildOptions:function(a,c){var b=[],d=["required","optional"];"desc"in a&&b.push({type:"help",help:a.desc});for(var f in d)if(a[d[f]]){b.push($("<h4>").text(UI.format.capital(d[f])+" parameters"));for(var k in a[d[f]]){var m=a[d[f]][k],e={label:UI.format.capital(m.name),pointer:{main:c,index:k},
validate:[]};"required"==d[f]&&!("default"in m)&&e.validate.push("required");"default"in m&&(e.placeholder=m["default"]);"help"in m&&(e.help=m.help);"unit"in m&&(e.unit=m.unit);switch(m.type){case "int":e.type="int";break;case "uint":e.type="int";e.min=0;break;case "debug":e.type="debug";break;case "select":e.type="select",e.select=m.select;default:e.type="str"}b.push(e)}}return b},stored:{get:function(){return mist.data.ui_settings||{}},set:function(a,c){var b=this.get();b[a]=c;mist.send(function(){},
validate:[]};"required"==d[f]&&!("default"in m)&&e.validate.push("required");"default"in m&&(e.placeholder=m["default"]);"help"in m&&(e.help=m.help);"unit"in m&&(e.unit=m.unit);switch(m.type){case "int":e.type="int";break;case "uint":e.type="int";e.min=0;break;case "debug":e.type="debug";break;case "select":e.type="select";e.select=m.select;break;default:e.type="str"}b.push(e)}}return b},stored:{get:function(){return mist.data.ui_settings||{}},set:function(a,c){var b=this.get();b[a]=c;mist.send(function(){},
{ui_settings:b})},del:function(a){delete mist.data.ui_settings[a];mist.send(function(){},{ui_settings:mist.data.ui_settings})}}};function log(){try{UI.debug&&[].push.call(arguments,Error().stack),[].unshift.call(arguments,"["+UI.format.time((new Date).getTime()/1E3)+"]"),console.log.apply(console,arguments)}catch(a){}}
$.fn.getval=function(){var a=$(this).data("opts"),c=$(this).val();if(a&&"type"in a)switch(a.type){case "span":c=$(this).html();break;case "checkbox":c=$(this).prop("checked");break;case "radioselect":a=$(this).find("label > input[type=radio]:checked").parent();a.length?(c=[],c.push(a.children("input[type=radio]").val()),a=a.children("select"),a.length&&c.push(a.val())):c="";break;case "checklist":c=[],$(this).find(".checklist input[type=checkbox]:checked").each(function(){c.push($(this).attr("name"))})}return c};
$.fn.setval=function(a){var c=$(this).data("opts");$(this).val(a);if(c&&"type"in c)switch(c.type){case "span":$(this).html(a);break;case "checkbox":$(this).prop("checked",a);break;case "geolimited":case "hostlimited":c=$(this).closest(".field_container").data("subUI");if("undefined"==typeof a||0==a.length)a="-";c.blackwhite.val(a.charAt(0));var a=a.substr(1).split(" "),b;for(b in a)c.values.append(c.prototype.clone(!0).val(a[b]));c.blackwhite.trigger("change");break;case "radioselect":if("undefined"==

View file

@ -4477,6 +4477,7 @@ var mist = {
case 'select':
obj.type = 'select';
obj.select = ele.select;
break;
case 'str':
default:
obj.type = 'str';