1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-09 23:00:57 -05:00

make the version name match the actual name for FTP deployment

fix rare issue with summing session scores
copy font to expected wwwroot dir in debug mode so we get pretty icons when developing
upgrade some packages

pretty much reworked the entire server web config to support better validation and stuff.. not really a small fix

finish web configuration changes (I think)

finish up configuration changes and update shared library nuget
This commit is contained in:
RaidMax
2020-01-17 17:31:53 -06:00
parent 59066a751f
commit f09a45503a
38 changed files with 531 additions and 200 deletions

View File

@ -1,23 +1,76 @@
$(document).ready(function() {
$.each($('.has-related-content'), function (key, value) {
$.each($('.has-related-content'), function(key, value) {
value = $(value);
if (value.attr('checked') !== undefined && value.attr('checked').length > 0) {
$(value.data('related-content')).slideDown();
}
});
$('input:checkbox').change(function () {
$('input:checkbox').change(function() {
var isChecked = $(this).is(':checked');
isChecked ? $($(this).data('related-content')).slideDown() : $($(this).data('related-content')).slideUp();
});
$('.configuration-add-new').click(function (e) {
// this is used for regular simple form adds
$(document).on('click', '.configuration-add-new', function(e) {
e.preventDefault();
let parentElement = $(this).parent();
$.get($(this).attr('href') + '&itemCount=' + $(this).siblings().length, function (response) {
let parentElement = $(this).parent();
let label = $(this).siblings('label');
let forAttr = $(label).attr('for');
let match = /Servers_+([0-9+])_+.*/g.exec(forAttr);
let additionalData = '';
if (match !== null && match.length === 2) {
additionalData = '&serverIndex=' + match[1].toString();
}
$.get($(this).attr('href') + '&itemCount=' + $(this).siblings('input').length.toString() + additionalData, function (response) {
$(response).insertBefore(parentElement.children().last());
});
});
// this is used for server adds which are little more complex
$(document).on('click', '.configuration-server-add-new', function (e) {
e.preventDefault();
let parentElement = $(this).parent();
$.get($(this).attr('href') + '&itemCount=' + $('.server-configuration-header').length.toString(), function (response) {
$(response).insertBefore(parentElement.children().last());
});
});
// removes the server when clicking the delete button
$(document).on('click', '.delete-server-button', function (e) {
$(this).parents('.server-configuration-header').remove();
});
$('#configurationForm').submit(function (e) {
$.ajax({
data: $(this).serialize(),
type: $(this).attr('method'),
url: $(this).attr('action'),
complete: function(response) {
if (response.status === 200) {
$('#actionModal .modal-message').removeClass('text-danger');
$('#actionModal').data('should-refresh', true);
}
else {
$('#actionModal .modal-message').addClass('text-danger');
}
$('#actionModal .modal-body-content').html('');
let errors = '';
if (response.responseJSON.errors !== undefined) {
errors = response.responseJSON.errors[0].join('<br/>');
}
message = response.responseJSON.message;
$('#actionModal .modal-message').html(message + '<br/>' + errors);
$('#actionModal').modal();
$('#actionModal .modal-message').fadeIn('fast');
}
});
return false;
});
});