mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Standardize project directory structure, in line with gulp build
This commit is contained in:
92
app/js/bandwidthcharts.js
Normal file
92
app/js/bandwidthcharts.js
Normal file
@@ -0,0 +1,92 @@
|
||||
(function($, _t) {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Create a Morris.js barchart.
|
||||
*/
|
||||
function CreateBarChart(placeholder, datasizeunits) {
|
||||
var barchart = new Morris.Bar({
|
||||
element: placeholder,
|
||||
xkey: 'date',
|
||||
ykeys: ['rx', 'tx'],
|
||||
labels: [_t['receive']+' '+datasizeunits.toUpperCase(),
|
||||
_t['send']+' '+datasizeunits.toUpperCase()]
|
||||
});
|
||||
|
||||
return barchart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a jquery bootstrap datatable.
|
||||
*/
|
||||
function CreateDataTable(placeholder, timeunits) {
|
||||
$("#"+placeholder).append('<table id="tableBandwidth'+timeunits+
|
||||
'" class="table table-responsive table-striped container-fluid"><thead>'+
|
||||
'<tr><th>date</th><th>rx</th><th>tx</th></tr></thead><tbody></tbody></table>');
|
||||
}
|
||||
|
||||
/**
|
||||
* Figure out which tab is selected and remove all existing charts and then
|
||||
* construct the proper barchart.
|
||||
*/
|
||||
function ShowBandwidthChartHandler(e) {
|
||||
// Remove all morrisjs charts
|
||||
$('#divChartBandwidthhourly').empty();
|
||||
$('#divChartBandwidthdaily').empty();
|
||||
$('#divChartBandwidthmonthly').empty();
|
||||
// Remove all datatables
|
||||
$('#divTableBandwidthhourly').empty();
|
||||
$('#divTableBandwidthdaily').empty();
|
||||
$('#divTableBandwidthmonthly').empty();
|
||||
// Construct ajax uri for getting the proper data.
|
||||
var timeunit = $('ul#tabbarBandwidth li.active a').attr('href').substr(1);
|
||||
var uri = 'ajax/bandwidth/get_bandwidth.php?';
|
||||
uri += 'inet=';
|
||||
uri += encodeURIComponent($('#cbxInterface'+timeunit+' option:selected').text());
|
||||
uri += '&tu=';
|
||||
uri += encodeURIComponent(timeunit.substr(0, 1));
|
||||
var datasizeunits = 'mb';
|
||||
uri += '&dsu='+encodeURIComponent(datasizeunits);
|
||||
// Init. chart
|
||||
var barchart = CreateBarChart('divChartBandwidth'+timeunit, datasizeunits);
|
||||
// Init. datatable html
|
||||
var datatable = CreateDataTable('divTableBandwidth'+timeunit, timeunit);
|
||||
// Get data for chart
|
||||
$.ajax({
|
||||
url: uri,
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('#divLoaderBandwidth'+timeunit).removeClass('hidden');
|
||||
}
|
||||
}).done(function(jsondata) {
|
||||
$('#divLoaderBandwidth'+timeunit).addClass('hidden');
|
||||
barchart.setData(jsondata);
|
||||
$('#tableBandwidth'+timeunit).DataTable({
|
||||
'searching': false,
|
||||
'paging': false,
|
||||
'data': jsondata,
|
||||
'order': [[ 0, 'ASC' ]],
|
||||
'columns': [
|
||||
{ 'data': 'date' },
|
||||
{ 'data': 'rx', "title": _t['receive']+' '+datasizeunits.toUpperCase() },
|
||||
{ 'data': 'tx', "title": _t['send']+' '+datasizeunits.toUpperCase() }]
|
||||
});
|
||||
}).fail(function(xhr, textStatus) {
|
||||
if (window.console) {
|
||||
console.error('server error');
|
||||
} else {
|
||||
alert("server error");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#tabbarBandwidth a[data-toggle="tab"]').on('shown.bs.tab', ShowBandwidthChartHandler);
|
||||
$('#cbxInterfacehourly').on('change', ShowBandwidthChartHandler);
|
||||
$('#cbxInterfacedaily').on('change', ShowBandwidthChartHandler);
|
||||
$('#cbxInterfacemonthly').on('change', ShowBandwidthChartHandler);
|
||||
ShowBandwidthChartHandler();
|
||||
});
|
||||
|
||||
})(jQuery, t);
|
||||
|
||||
7
app/js/bandwidthcharts.min.js
vendored
Normal file
7
app/js/bandwidthcharts.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* RaspAP - RaspAP WiFi Configuration Portal v1.6.1 (https://github.com/billz/raspap-webgui)
|
||||
* Copyright 2013-2019 RaspAP Developers
|
||||
* Licensed under MIT (https://github.com/raspap-webgui/raspap-webgui/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
!function(r,i){"use strict";function t(t){r("#divChartBandwidthhourly").empty(),r("#divChartBandwidthdaily").empty(),r("#divChartBandwidthmonthly").empty(),r("#divTableBandwidthhourly").empty(),r("#divTableBandwidthdaily").empty(),r("#divTableBandwidthmonthly").empty();var e=r("ul#tabbarBandwidth li.active a").attr("href").substr(1),a="ajax/bandwidth/get_bandwidth.php?";a+="inet=",a+=encodeURIComponent(r("#cbxInterface"+e+" option:selected").text()),a+="&tu=",a+=encodeURIComponent(e.substr(0,1));var d="mb";a+="&dsu="+encodeURIComponent(d);var n=function(t,e){return new Morris.Bar({element:t,xkey:"date",ykeys:["rx","tx"],labels:[i.receive+" "+e.toUpperCase(),i.send+" "+e.toUpperCase()]})}("divChartBandwidth"+e,d);!function(t,e){r("#"+t).append('<table id="tableBandwidth'+e+'" class="table table-responsive table-striped container-fluid"><thead><tr><th>date</th><th>rx</th><th>tx</th></tr></thead><tbody></tbody></table>')}("divTableBandwidth"+e,e);r.ajax({url:a,dataType:"json",beforeSend:function(){r("#divLoaderBandwidth"+e).removeClass("hidden")}}).done(function(t){r("#divLoaderBandwidth"+e).addClass("hidden"),n.setData(t),r("#tableBandwidth"+e).DataTable({searching:!1,paging:!1,data:t,order:[[0,"ASC"]],columns:[{data:"date"},{data:"rx",title:i.receive+" "+d.toUpperCase()},{data:"tx",title:i.send+" "+d.toUpperCase()}]})}).fail(function(t,e){window.console?console.error("server error"):alert("server error")})}r(document).ready(function(){r('#tabbarBandwidth a[data-toggle="tab"]').on("shown.bs.tab",t),r("#cbxInterfacehourly").on("change",t),r("#cbxInterfacedaily").on("change",t),r("#cbxInterfacemonthly").on("change",t),t()})}(jQuery,t);
|
||||
291
app/js/custom.js
Normal file
291
app/js/custom.js
Normal file
@@ -0,0 +1,291 @@
|
||||
function msgShow(retcode,msg) {
|
||||
if(retcode == 0) {
|
||||
var alertType = 'success';
|
||||
} else if(retcode == 2 || retcode == 1) {
|
||||
var alertType = 'danger';
|
||||
}
|
||||
var htmlMsg = '<div class="alert alert-'+alertType+' alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+msg+'</div>';
|
||||
return htmlMsg;
|
||||
}
|
||||
|
||||
function createNetmaskAddr(bitCount) {
|
||||
var mask=[];
|
||||
for(i=0;i<4;i++) {
|
||||
var n = Math.min(bitCount, 8);
|
||||
mask.push(256 - Math.pow(2, 8-n));
|
||||
bitCount -= n;
|
||||
}
|
||||
return mask.join('.');
|
||||
}
|
||||
|
||||
function loadSummary(strInterface) {
|
||||
$.post('/ajax/networking/get_ip_summary.php',{interface:strInterface},function(data){
|
||||
jsonData = JSON.parse(data);
|
||||
console.log(jsonData);
|
||||
if(jsonData['return'] == 0) {
|
||||
$('#'+strInterface+'-summary').html(jsonData['output'].join('<br />'));
|
||||
} else if(jsonData['return'] == 2) {
|
||||
$('#'+strInterface+'-summary').append('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+jsonData['output'].join('<br />')+'</div>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getAllInterfaces() {
|
||||
$.get('/ajax/networking/get_all_interfaces.php',function(data){
|
||||
jsonData = JSON.parse(data);
|
||||
$.each(jsonData,function(ind,value){
|
||||
loadSummary(value)
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function setupTabs() {
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab',function(e){
|
||||
var target = $(e.target).attr('href');
|
||||
if(!target.match('summary')) {
|
||||
var int = target.replace("#","");
|
||||
loadCurrentSettings(int);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadCurrentSettings(strInterface) {
|
||||
$.post('/ajax/networking/get_int_config.php',{interface:strInterface},function(data){
|
||||
jsonData = JSON.parse(data);
|
||||
$.each(jsonData['output'],function(i,v) {
|
||||
var int = v['interface'];
|
||||
$.each(v,function(i2,v2) {
|
||||
switch(i2) {
|
||||
case "static":
|
||||
if(v2 == 'true') {
|
||||
$('#'+int+'-static').click();
|
||||
$('#'+int+'-nofailover').click();
|
||||
} else {
|
||||
$('#'+int+'-dhcp').click();
|
||||
}
|
||||
break;
|
||||
case "failover":
|
||||
if(v2 === 'true') {
|
||||
$('#'+int+'-failover').click();
|
||||
} else {
|
||||
$('#'+int+'-nofailover').click();
|
||||
}
|
||||
break;
|
||||
case "ip_address":
|
||||
var arrIPNetmask = v2.split('/');
|
||||
$('#'+int+'-ipaddress').val(arrIPNetmask[0]);
|
||||
$('#'+int+'-netmask').val(createNetmaskAddr(arrIPNetmask[1]));
|
||||
break;
|
||||
case "routers":
|
||||
$('#'+int+'-gateway').val(v2);
|
||||
break;
|
||||
case "domain_name_server":
|
||||
svrsDNS = v2.split(" ");
|
||||
$('#'+int+'-dnssvr').val(svrsDNS[0]);
|
||||
$('#'+int+'-dnssvralt').val(svrsDNS[1]);
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function saveNetworkSettings(int) {
|
||||
|
||||
var frmInt = $('#frm-'+int).find(':input');
|
||||
var arrFormData = {};
|
||||
$.each(frmInt,function(i3,v3){
|
||||
if($(v3).attr('type') == 'radio') {
|
||||
arrFormData[$(v3).attr('id')] = $(v3).prop('checked');
|
||||
} else {
|
||||
arrFormData[$(v3).attr('id')] = $(v3).val();
|
||||
}
|
||||
});
|
||||
arrFormData['interface'] = int;
|
||||
$.post('/ajax/networking/save_int_config.php',arrFormData,function(data){
|
||||
//console.log(data);
|
||||
var jsonData = JSON.parse(data);
|
||||
$('#msgNetworking').html(msgShow(jsonData['return'],jsonData['output']));
|
||||
});
|
||||
}
|
||||
|
||||
function applyNetworkSettings() {
|
||||
var int = $(this).data('int');
|
||||
arrFormData = {};
|
||||
arrFormData['generate'] = '';
|
||||
$.post('/ajax/networking/gen_int_config.php',arrFormData,function(data){
|
||||
console.log(data);
|
||||
var jsonData = JSON.parse(data);
|
||||
$('#msgNetworking').html(msgShow(jsonData['return'],jsonData['output']));
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on("click", ".js-add-dhcp-static-lease", function(e) {
|
||||
e.preventDefault();
|
||||
var container = $(".js-new-dhcp-static-lease");
|
||||
var mac = $("input[name=mac]", container).val().trim();
|
||||
var ip = $("input[name=ip]", container).val().trim();
|
||||
if (mac == "" || ip == "") {
|
||||
return;
|
||||
}
|
||||
|
||||
var row = $("#js-dhcp-static-lease-row").html()
|
||||
.replace("{{ mac }}", mac)
|
||||
.replace("{{ ip }}", ip);
|
||||
$(".js-dhcp-static-lease-container").append(row);
|
||||
|
||||
$("input[name=mac]", container).val("");
|
||||
$("input[name=ip]", container).val("");
|
||||
});
|
||||
|
||||
$(document).on("click", ".js-remove-dhcp-static-lease", function(e) {
|
||||
e.preventDefault();
|
||||
$(this).parents(".js-dhcp-static-lease-row").remove();
|
||||
});
|
||||
|
||||
$(document).on("submit", ".js-dhcp-settings-form", function(e) {
|
||||
$(".js-add-dhcp-static-lease").trigger("click");
|
||||
});
|
||||
|
||||
function setupBtns() {
|
||||
$('#btnSummaryRefresh').click(function(){getAllInterfaces();});
|
||||
|
||||
$('.intsave').click(function(){
|
||||
var int = $(this).data('int');
|
||||
saveNetworkSettings(int);
|
||||
});
|
||||
|
||||
$('.intapply').click(function(){
|
||||
applyNetworkSettings();
|
||||
});
|
||||
}
|
||||
|
||||
function setCSRFTokenHeader(event, xhr, settings) {
|
||||
var csrfToken = $('meta[name=csrf_token]').attr('content');
|
||||
if (/^(POST|PATCH|PUT|DELETE)$/i.test(settings.type)) {
|
||||
xhr.setRequestHeader("X-CSRF-Token", csrfToken);
|
||||
}
|
||||
}
|
||||
|
||||
function contentLoaded() {
|
||||
pageCurrent = window.location.href.split("?")[1].split("=")[1];
|
||||
pageCurrent = pageCurrent.replace("#","");
|
||||
$('#side-menu').metisMenu();
|
||||
switch(pageCurrent) {
|
||||
case "network_conf":
|
||||
getAllInterfaces();
|
||||
setupTabs();
|
||||
setupBtns();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function loadWifiStations(refresh) {
|
||||
return function() {
|
||||
var complete = function() { $(this).removeClass('loading-spinner'); }
|
||||
var qs = refresh === true ? '?refresh' : '';
|
||||
$('.js-wifi-stations')
|
||||
.addClass('loading-spinner')
|
||||
.empty()
|
||||
.load('/ajax/networking/wifi_stations.php'+qs, complete);
|
||||
};
|
||||
}
|
||||
|
||||
$(".js-reload-wifi-stations").on("click", loadWifiStations(true));
|
||||
|
||||
$(document).on("click", ".js-toggle-password", function(e) {
|
||||
var button = $(e.target)
|
||||
var field = $(button.data("target"));
|
||||
if (field.is(":input")) {
|
||||
e.preventDefault();
|
||||
|
||||
if (!button.data("__toggle-with-initial")) {
|
||||
button.data("__toggle-with-initial", button.text())
|
||||
}
|
||||
|
||||
if (field.attr("type") === "password") {
|
||||
button.text(button.data("toggle-with"));
|
||||
field.attr("type", "text");
|
||||
} else {
|
||||
button.text(button.data("__toggle-with-initial"));
|
||||
field.attr("type", "password");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("keyup", ".js-validate-psk", function(e) {
|
||||
var field = $(e.target);
|
||||
var colors = field.data("colors").split(",");
|
||||
var target = $(field.data("target"));
|
||||
if (field.val().length < 8 || field.val().length > 63) {
|
||||
field.css("backgroundColor", colors[0]);
|
||||
target.attr("disabled", true);
|
||||
} else {
|
||||
field.css("backgroundColor", colors[1]);
|
||||
target.attr("disabled", false);
|
||||
}
|
||||
});
|
||||
|
||||
$(function() {
|
||||
$('#theme-select').change(function() {
|
||||
var theme = themes[$( "#theme-select" ).val() ];
|
||||
set_theme(theme);
|
||||
});
|
||||
});
|
||||
|
||||
function set_theme(theme) {
|
||||
$('link[title="main"]').attr('href', 'app/css/' + theme);
|
||||
|
||||
// persist selected theme in cookie
|
||||
setCookie('theme',theme,90);
|
||||
}
|
||||
|
||||
function setCookie(cname, cvalue, exdays) {
|
||||
var d = new Date();
|
||||
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||
var expires = "expires="+ d.toUTCString();
|
||||
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
|
||||
}
|
||||
|
||||
var themes = {
|
||||
"default": "custom.css",
|
||||
"hackernews" : "hackernews.css",
|
||||
"terminal" : "terminal.css",
|
||||
}
|
||||
|
||||
//Loads the correct sidebar on window load,
|
||||
//collapses the sidebar on window resize.
|
||||
// Sets the min-height of #page-wrapper to window size
|
||||
$(function() {
|
||||
$(window).bind("load resize", function() {
|
||||
topOffset = 50;
|
||||
width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
|
||||
if (width < 768) {
|
||||
$('div.navbar-collapse').addClass('collapse');
|
||||
topOffset = 100; // 2-row-menu
|
||||
} else {
|
||||
$('div.navbar-collapse').removeClass('collapse');
|
||||
}
|
||||
|
||||
height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
|
||||
height = height - topOffset;
|
||||
if (height < 1) height = 1;
|
||||
if (height > topOffset) {
|
||||
$("#page-wrapper").css("min-height", (height) + "px");
|
||||
}
|
||||
});
|
||||
|
||||
var url = window.location;
|
||||
var element = $('ul.nav a').filter(function() {
|
||||
return this.href == url || url.href.indexOf(this.href) == 0;
|
||||
}).addClass('active').parent().parent().addClass('in').parent();
|
||||
if (element.is('li')) {
|
||||
element.addClass('active');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(document)
|
||||
.ajaxSend(setCSRFTokenHeader)
|
||||
.ready(contentLoaded)
|
||||
.ready(loadWifiStations());
|
||||
7
app/js/custom.min.js
vendored
Normal file
7
app/js/custom.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/*!
|
||||
* RaspAP - RaspAP WiFi Configuration Portal v1.6.1 (https://github.com/billz/raspap-webgui)
|
||||
* Copyright 2013-2019 RaspAP Developers
|
||||
* Licensed under MIT (https://github.com/raspap-webgui/raspap-webgui/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
function msgShow(t,a){if(0==t)var e="success";else if(2==t||1==t)e="danger";return'<div class="alert alert-'+e+' alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+a+"</div>"}function createNetmaskAddr(t){var a=[];for(i=0;i<4;i++){var e=Math.min(t,8);a.push(256-Math.pow(2,8-e)),t-=e}return a.join(".")}function loadSummary(a){$.post("/ajax/networking/get_ip_summary.php",{interface:a},function(t){jsonData=JSON.parse(t),console.log(jsonData),0==jsonData.return?$("#"+a+"-summary").html(jsonData.output.join("<br />")):2==jsonData.return&&$("#"+a+"-summary").append('<div class="alert alert-danger alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>'+jsonData.output.join("<br />")+"</div>")})}function getAllInterfaces(){$.get("/ajax/networking/get_all_interfaces.php",function(t){jsonData=JSON.parse(t),$.each(jsonData,function(t,a){loadSummary(a)})})}function setupTabs(){$('a[data-toggle="tab"]').on("shown.bs.tab",function(t){var a=$(t.target).attr("href");a.match("summary")||loadCurrentSettings(a.replace("#",""))})}function loadCurrentSettings(t){$.post("/ajax/networking/get_int_config.php",{interface:t},function(t){jsonData=JSON.parse(t),$.each(jsonData.output,function(t,a){var n=a.interface;$.each(a,function(t,a){switch(t){case"static":"true"==a?($("#"+n+"-static").click(),$("#"+n+"-nofailover").click()):$("#"+n+"-dhcp").click();break;case"failover":"true"===a?$("#"+n+"-failover").click():$("#"+n+"-nofailover").click();break;case"ip_address":var e=a.split("/");$("#"+n+"-ipaddress").val(e[0]),$("#"+n+"-netmask").val(createNetmaskAddr(e[1]));break;case"routers":$("#"+n+"-gateway").val(a);break;case"domain_name_server":svrsDNS=a.split(" "),$("#"+n+"-dnssvr").val(svrsDNS[0]),$("#"+n+"-dnssvralt").val(svrsDNS[1])}})})})}function saveNetworkSettings(t){var a=$("#frm-"+t).find(":input"),e={};$.each(a,function(t,a){"radio"==$(a).attr("type")?e[$(a).attr("id")]=$(a).prop("checked"):e[$(a).attr("id")]=$(a).val()}),e.interface=t,$.post("/ajax/networking/save_int_config.php",e,function(t){var a=JSON.parse(t);$("#msgNetworking").html(msgShow(a.return,a.output))})}function applyNetworkSettings(){$(this).data("int");arrFormData={generate:""},$.post("/ajax/networking/gen_int_config.php",arrFormData,function(t){console.log(t);var a=JSON.parse(t);$("#msgNetworking").html(msgShow(a.return,a.output))})}function setupBtns(){$("#btnSummaryRefresh").click(function(){getAllInterfaces()}),$(".intsave").click(function(){saveNetworkSettings($(this).data("int"))}),$(".intapply").click(function(){applyNetworkSettings()})}function setCSRFTokenHeader(t,a,e){var n=$("meta[name=csrf_token]").attr("content");/^(POST|PATCH|PUT|DELETE)$/i.test(e.type)&&a.setRequestHeader("X-CSRF-Token",n)}function contentLoaded(){switch(pageCurrent=window.location.href.split("?")[1].split("=")[1],pageCurrent=pageCurrent.replace("#",""),$("#side-menu").metisMenu(),pageCurrent){case"network_conf":getAllInterfaces(),setupTabs(),setupBtns()}}function loadWifiStations(a){return function(){var t=!0===a?"?refresh":"";$(".js-wifi-stations").addClass("loading-spinner").empty().load("/ajax/networking/wifi_stations.php"+t,function(){$(this).removeClass("loading-spinner")})}}$(document).on("click",".js-add-dhcp-static-lease",function(t){t.preventDefault();var a=$(".js-new-dhcp-static-lease"),e=$("input[name=mac]",a).val().trim(),n=$("input[name=ip]",a).val().trim();if(""!=e&&""!=n){var i=$("#js-dhcp-static-lease-row").html().replace("{{ mac }}",e).replace("{{ ip }}",n);$(".js-dhcp-static-lease-container").append(i),$("input[name=mac]",a).val(""),$("input[name=ip]",a).val("")}}),$(document).on("click",".js-remove-dhcp-static-lease",function(t){t.preventDefault(),$(this).parents(".js-dhcp-static-lease-row").remove()}),$(document).on("submit",".js-dhcp-settings-form",function(t){$(".js-add-dhcp-static-lease").trigger("click")}),$(".js-reload-wifi-stations").on("click",loadWifiStations(!0)),$(document).on("click",".js-toggle-password",function(t){var a=$(t.target),e=$(a.data("target"));e.is(":input")&&(t.preventDefault(),a.data("__toggle-with-initial")||a.data("__toggle-with-initial",a.text()),"password"===e.attr("type")?(a.text(a.data("toggle-with")),e.attr("type","text")):(a.text(a.data("__toggle-with-initial")),e.attr("type","password")))}),$(document).on("keyup",".js-validate-psk",function(t){var a=$(t.target),e=a.data("colors").split(","),n=$(a.data("target"));a.val().length<8||63<a.val().length?(a.css("backgroundColor",e[0]),n.attr("disabled",!0)):(a.css("backgroundColor",e[1]),n.attr("disabled",!1))}),$(document).ajaxSend(setCSRFTokenHeader).ready(contentLoaded).ready(loadWifiStations());
|
||||
Reference in New Issue
Block a user