Skip to content

Commit

Permalink
fix 1666
Browse files Browse the repository at this point in the history
fix #1666


fix sonar


fix
  • Loading branch information
cyrilphoenix71 committed Jan 21, 2020
1 parent fa67bbf commit dcc427d
Show file tree
Hide file tree
Showing 29 changed files with 468 additions and 232 deletions.
3 changes: 2 additions & 1 deletion assets/css/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
.btn-box-tool {
padding: 8px 5px;
}
.btn-action-bar {
.btn-action-bar,
.box-footer .btn {
margin-bottom: 2px;
margin-top: 2px;
}
Expand Down
5 changes: 5 additions & 0 deletions assets/css/containers/_containers.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@
.form-control {
width: auto;
}
legend {
width: auto;
margin-right: auto;
padding-right: 20px;
}
}
.form-group-light {
margin-bottom: 4px;
Expand Down
9 changes: 9 additions & 0 deletions assets/css/pages/_modals.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
min-height: 0;
pre {
margin: 0;
overflow: scroll;
}
}
.ui-dialog-content {
Expand Down Expand Up @@ -131,3 +132,11 @@
.modal-padding {
padding: 15px !important;
}
.modal-pre-full {
height: calc(100% - 30px);
width: calc(100% - 30px);
position: absolute;
bottom: 0;
top: 0;
margin: 15px 0 !important;
}
6 changes: 5 additions & 1 deletion assets/js/core/update.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,8 @@ nextdom.update.saves = function (queryParams) {

nextdom.update.number = function (queryParams) {
nextdom.private.ajax('Update', 'nbUpdate', queryParams, false, false, false);
};
};

nextdom.update.numbers = function (queryParams) {
nextdom.private.ajax('Update', 'nbUpdates', queryParams, false, false, false);
};
6 changes: 4 additions & 2 deletions assets/js/desktop/diagnostic/log.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ initEvents();
*/
function loadInformations() {
$(document).ready(function () {
$('pre').height($(window).height() - 339);
$('#ul_object').height($(window).height() - 339);
$('pre').height($(window).height() - 300);
$('#ul_object').height($(window).height() - 279);
$('#ul_object').css("overflow-y", "auto");
$('#ul_object').css("padding-right", "5px");
sortList("#ul_object", "timing");
Expand Down Expand Up @@ -122,6 +122,7 @@ function initEvents() {
// Display log by alphabetic sort
$("#bt_LogAlphabetic").on('click', function (event) {
sortList("#ul_object", "log");
$(".li_log").removeClass('active');
$('.li_log').first().addClass('active');
$('#bt_LogAlphabetic').removeClass('btn-action').addClass('btn-info');
$('#bt_LogChronologic').removeClass('btn-info').addClass('btn-action');
Expand All @@ -131,6 +132,7 @@ function initEvents() {
// Display log by timing sort
$("#bt_LogChronologic").on('click', function (event) {
sortList("#ul_object", "timing");
$(".li_log").removeClass('active');
$('.li_log').first().addClass('active');
$('#bt_LogChronologic').removeClass('btn-action').addClass('btn-info');
$('#bt_LogAlphabetic').removeClass('btn-info').addClass('btn-action');
Expand Down
58 changes: 57 additions & 1 deletion assets/js/desktop/gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,51 @@ function refreshUpdateNumber() {
}
}
});
if($('#spanNbUpdates').length){
nextdom.update.numbers({
error: function (error) {
notify("Erreur", error.message, 'error');
},
success: function (_numbers) {
if (_numbers.all == 0 || _numbers.all == '0') {
$('#spanNbUpdates').hide();
} else {
$('#spanNbUpdates').html(_numbers.all);
$('#spanNbUpdates').show();
}
if (_numbers.core == 0 || _numbers.core == '0') {
$('#spanNbUpdatesCore').hide();
} else {
$('#spanNbUpdatesCore').html(_numbers.core);
$('#spanNbUpdatesCore').show();
}
if (_numbers.plugin == 0 || _numbers.plugin == '0') {
$('#spanNbUpdatesPlugins').hide();
} else {
$('#spanNbUpdatesPlugins').html(_numbers.plugin);
$('#spanNbUpdatesPlugins').show();
}
if (_numbers.widget == 0 || _numbers.widget == '0') {
$('#spanNbUpdatesWidgets').hide();
} else {
$('#spanNbUpdatesWidgets').html(_numbers.widget);
$('#spanNbUpdatesWidgets').show();
}
if (_numbers.script == 0 || _numbers.script == '0') {
$('#spanNbUpdatesScripts').hide();
} else {
$('#spanNbUpdatesScripts').html(_numbers.script);
$('#spanNbUpdatesScripts').show();
}
if (_numbers.others == 0 || _numbers.others == '0') {
$('#spanNbUpdatesOthers').hide();
} else {
$('#spanNbUpdatesOthers').html(_numbers.others);
$('#spanNbUpdatesOthers').show();
}
}
});
}
}

/**
Expand Down Expand Up @@ -406,18 +451,29 @@ function displayClock() {
* Adjust size and position of jquery modales
*/
function modalesAdjust() {
var modals = [$('#md_modal'), $('#md_modal2')];
var modals = [$('#md_modal'), $('#md_modal2'), $('#md_pageHelp')];
modals.forEach(function (modal) {
if (modal.is(':ui-dialog')) {
modal.dialog('option', 'width', getModalWidth());
modal.dialog('option', 'height', getModalHeight());
modal.dialog('option', 'position', {my: 'center', at: 'center', of: window});
}
});
}

/**
* Calcul modal width depend of width screen
*/
function getModalWidth() {
if (jQuery(window).width() < 1000) {
return '96%';
}
return '80%';
}

/**
* Calcul modal width depend of width screen
*/
function getModalHeight() {
return (jQuery(window).height() - 100);
}
68 changes: 68 additions & 0 deletions assets/js/desktop/inits.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function initPage(){
initTextArea();
initEventHandler();
initFields();
initModals();

// Trig page loaded
$('body').trigger('nextdom_page_load');
Expand Down Expand Up @@ -179,3 +180,70 @@ function initTextArea(){
}
});
}

/**
* Init of modals pages
*/
function initModals(){
// Help modal trigger declaration
$("#md_pageHelp").dialog({
autoOpen: false,
modal: false,
closeText: '',
height: getModalHeight(),
width: getModalWidth(),
resizable: false,
open: function () {
$("body").css({overflow: 'hidden'});
modalesAdjust();
$(".wrapper").addClass("blur");
},
beforeClose: function (event, ui) {
$("body").css({overflow: 'inherit'});
$("#md_pageHelp").empty();
$(".wrapper").removeClass("blur");
}
});

// modal trigger declaration
$("#md_modal").dialog({
autoOpen: false,
modal: false,
closeText: '',
height: getModalHeight(),
width: getModalWidth(),
resizable: false,
open: function () {
$("body").css({overflow: 'hidden'});
modalesAdjust();
$(".wrapper").addClass("blur");
},
beforeClose: function (event, ui) {
$("body").css({overflow: 'inherit'});
$("#md_modal").empty();
$("#md_modal").dialog('option', 'buttons', []);
$(".wrapper").removeClass("blur");
}
});

// modal bis trigger declaration
$("#md_modal2").dialog({
autoOpen: false,
modal: false,
closeText: '',
height: getModalHeight(),
width: getModalWidth(),
resizable: false,
open: function () {
$("body").css({overflow: 'hidden'});
modalesAdjust();
$(".wrapper").addClass("blur");
},
beforeClose: function (event, ui) {
$("body").css({overflow: 'inherit'});
$("#md_modal2").empty();
$("#md_modal2").dialog('option', 'buttons', []);
$(".wrapper").removeClass("blur");
}
});
}
57 changes: 0 additions & 57 deletions assets/js/desktop/loads.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,63 +310,6 @@ $(function () {
});
});

// Help modal trigger declaration
$("#md_pageHelp").dialog({
autoOpen: false,
modal: false,
closeText: '',
height: (jQuery(window).height() - 100),
width: getModalWidth(),
show: { effect: "blind", duration: 200 },
resizable: false,
open: function () {
$("body").css({overflow: 'hidden'});
$(this).dialog("option", "position", {my: "center", at: "center", of: window});
},
beforeClose: function (event, ui) {
$("body").css({overflow: 'inherit'});
$("#md_pageHelp").empty();
}
});

// modal trigger declaration
$("#md_modal").dialog({
autoOpen: false,
modal: false,
closeText: '',
height: (jQuery(window).height() - 100),
width: getModalWidth(),
show: { effect: "blind", duration: 200 },
resizable: false,
open: function () {
$("body").css({overflow: 'hidden'});
$(this).dialog("option", "position", {my: "center", at: "center", of: window});
},
beforeClose: function (event, ui) {
$("body").css({overflow: 'inherit'});
$("#md_modal").empty();
}
});

// modal bis trigger declaration
$("#md_modal2").dialog({
autoOpen: false,
modal: false,
closeText: '',
height: (jQuery(window).height() - 100),
width: getModalWidth(),
show: { effect: "blind", duration: 200 },
resizable: false,
open: function () {
$("body").css({overflow: 'hidden'});
$(this).dialog("option", "position", {my: "center", at: "center", of: window});
},
beforeClose: function (event, ui) {
$("body").css({overflow: 'inherit'});
$("#md_modal2").empty();
}
});

// Prevent close event handler declaration to advise user for exit without saving
$(window).bind('beforeunload', function (e) {
if (modifyWithoutSave) {
Expand Down
2 changes: 2 additions & 0 deletions assets/js/desktop/pages/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,11 @@ function updateTwoFactorVisibility() {
if (useTwoFactor === 1) {
divLogin.hide();
divTwoFactor.show();
twoFactorInput.focus();
} else {
divLogin.show();
divTwoFactor.hide();
loginInput.focus();
}
}

Expand Down
Loading

0 comments on commit dcc427d

Please sign in to comment.