merge branch '0.11-dev' of github.com:Froxlor/Froxlor into 0.11-dev

This commit is contained in:
envoyr
2022-04-23 16:11:51 +02:00
26 changed files with 254 additions and 116 deletions

View File

@@ -23,7 +23,11 @@
<input type="hidden" name="{{ id }}" value="{{ field }}"/>
{% endfor %}
<button class="btn btn-danger" type="submit" name="submitbutton">{{ lng('panel.yes') }}</button>&nbsp;
<a href="javascript:history.back(-1)" class="btn btn-secondary">{{ lng('panel.no') }}</a>
{% if back_link is defined and back_link is iterable %}
<a href="{{ linker(back_link) }}" class="btn btn-secondary">{{ lng('panel.no') }}</a>
{% else %}
<a href="javascript:history.back(-1)" class="btn btn-secondary">{{ lng('panel.no') }}</a>
{% endif %}
</p>
</div>

View File

@@ -0,0 +1,57 @@
$(function () {
var timer, delay = 500;
$('div[data-action="apikeys"] #allowed_from').on('keyup change', function () {
var _this = $(this);
clearTimeout(timer);
timer = setTimeout(function () {
var akid = $('div[data-action="apikeys"]').data('entry');
$.ajax({
url: "lib/ajax.php?action=editapikey",
type: "POST",
dataType: "json",
data: { id: akid, allowed_from: _this.val(), valid_until: $('div[data-action="apikeys"] #valid_until').val() },
success: function (data) {
if (data.message) {
_this.removeClass('is-valid');
_this.addClass('is-invalid');
} else {
_this.removeClass('is-invalid');
_this.addClass('is-valid');
_this.val(data.allowed_from);
}
},
error: function (request, status, error) {
console.log(request, status, error)
}
});
}, delay);
});
$('div[data-action="apikeys"] #valid_until').on('keyup change', function () {
var _this = $(this);
clearTimeout(timer);
timer = setTimeout(function () {
var akid = $('div[data-action="apikeys"]').data('entry');
$.ajax({
url: "lib/ajax.php?action=editapikey",
type: "POST",
dataType: "json",
data: { id: akid, valid_until: _this.val(), allowed_from: $('div[data-action="apikeys"] #allowed_from').val() },
success: function (data) {
if (data.message) {
_this.removeClass('is-valid');
_this.addClass('is-invalid');
} else {
_this.removeClass('is-invalid');
_this.addClass('is-valid');
_this.val(data.valid_until);
}
},
error: function (request, status, error) {
console.log(request, status, error)
}
});
}, delay);
});
});

View File

@@ -1,8 +1,8 @@
$(document).ready(function () {
$(function() {
/*
* config files - select all recommended
*/
$('#selectRecommendedConfig').click(function () {
$('#selectRecommendedConfig').on('click', function () {
$('input[data-recommended]').each(function () {
if ($(this).data('recommended') == 1) {
$(this).prop('checked', true);

View File

@@ -1,4 +1,4 @@
$(document).ready(function () {
$(function() {
// Make inputs with enabled unlimited checked disabled
$("input[name$='_ul']").each(function () {
@@ -9,7 +9,7 @@ $(document).ready(function () {
});
});
// change state when unlimited checkboxes are clicked
$("input[name$='_ul']").change(function () {
$("input[name$='_ul']").on('change', function () {
var fieldname = $(this).attr("name").substring(0, $(this).attr("name").length - 3);
$("input[name='" + fieldname + "']").prop({
readonly: $(this).is(":checked"),
@@ -21,7 +21,7 @@ $(document).ready(function () {
});
// set values from hosting plan when adding/editing a customer according to the plan's values
$('#use_plan').change(function () {
$('#use_plan').on('change', function () {
var pid = $(this).val();
if (pid > 0) {
$.ajax({

View File

@@ -1,7 +1,7 @@
$(document).ready(function () {
$(function() {
// disable unusable php-configuration by customer settings
$('#customerid').change(function () {
$('#customerid').on('change', function () {
var cid = $(this).val();
$.ajax({
url: "admin_domains.php?page=domains&action=jqGetCustomerPHPConfigs",
@@ -31,7 +31,7 @@ $(document).ready(function () {
// show warning if speciallogfile option is toggled
if ($('input[name=speciallogverified]')) {
$('input[name=speciallogfile]').click(function () {
$('input[name=speciallogfile]').on('click', function () {
$('#speciallogfilenote').remove();
$('#speciallogfile').removeClass('is-invalid');
$('#speciallogverified').val(0);
@@ -64,7 +64,7 @@ $(document).ready(function () {
$('#section_d').hide();
}
$('#email_only').click(function () {
$('#email_only').on('click', function () {
if ($(this).is(':checked')) {
// hide unnecessary sections
$('#section_b').hide();

View File

@@ -1,7 +1,7 @@
$(document).ready(function () {
$(function() {
// check for internal ip and output a notice if private-range ip is given
$('#ip').change(function () {
$('#ip').on('change', function () {
var ipval = $(this).val();
if (ipval.length > 0) {
$('#ipnote').remove();

View File

@@ -1,4 +1,4 @@
$(document).ready(function () {
$(function() {
/*
* newsfeed
*/

View File

@@ -1,7 +1,7 @@
$(document).ready(function () {
$(function() {
let search = $('#search')
search.submit(function (e) {
search.on('submit', function (e) {
e.preventDefault();
});

View File

@@ -1,4 +1,4 @@
$(document).ready(function () {
$(function() {
/*
* updatecheck
*/

View File

@@ -7,7 +7,7 @@ import 'chart.js/dist/chart';
global.$ = require('jquery');
global.bootstrap = require('bootstrap');
$(document).ready(function () {
$(function() {
window.$theme = 'Froxlor';
});
@@ -20,3 +20,4 @@ require('./components/tablecolumns')
require('./components/ipsandports')
require('./components/domains')
require('./components/configfiles')
require('./components/apikeys')

View File

@@ -53,7 +53,7 @@
{% endif %}
</a>
{% if data.modal is defined and data.modal is iterable %}
<div class="modal fade" id="{{ data.modal.id }}" aria-hidden="true" aria-labelledby="{{ data.modal.id }}Label" tabindex="-1">
<div class="modal fade" data-action="apikeys" data-entry="{{ data.modal.entry }}" id="{{ data.modal.id }}" aria-hidden="true" aria-labelledby="{{ data.modal.id }}Label" tabindex="-1">
<div class="modal-dialog {{ data.modal.size|default('modal-xl') }} modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">