Skip to content

Commit dcc427d

Browse files
committedJan 21, 2020
fix 1666
fix #1666 fix sonar fix
1 parent fa67bbf commit dcc427d

29 files changed

+468
-232
lines changed
 

‎assets/css/components/_buttons.scss

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
.btn-box-tool {
9393
padding: 8px 5px;
9494
}
95-
.btn-action-bar {
95+
.btn-action-bar,
96+
.box-footer .btn {
9697
margin-bottom: 2px;
9798
margin-top: 2px;
9899
}

‎assets/css/containers/_containers.scss

+5
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@
117117
.form-control {
118118
width: auto;
119119
}
120+
legend {
121+
width: auto;
122+
margin-right: auto;
123+
padding-right: 20px;
124+
}
120125
}
121126
.form-group-light {
122127
margin-bottom: 4px;

‎assets/css/pages/_modals.scss

+9
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
min-height: 0;
4444
pre {
4545
margin: 0;
46+
overflow: scroll;
4647
}
4748
}
4849
.ui-dialog-content {
@@ -131,3 +132,11 @@
131132
.modal-padding {
132133
padding: 15px !important;
133134
}
135+
.modal-pre-full {
136+
height: calc(100% - 30px);
137+
width: calc(100% - 30px);
138+
position: absolute;
139+
bottom: 0;
140+
top: 0;
141+
margin: 15px 0 !important;
142+
}

‎assets/js/core/update.class.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,8 @@ nextdom.update.saves = function (queryParams) {
6363

6464
nextdom.update.number = function (queryParams) {
6565
nextdom.private.ajax('Update', 'nbUpdate', queryParams, false, false, false);
66-
};
66+
};
67+
68+
nextdom.update.numbers = function (queryParams) {
69+
nextdom.private.ajax('Update', 'nbUpdates', queryParams, false, false, false);
70+
};

‎assets/js/desktop/diagnostic/log.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ initEvents();
4343
*/
4444
function loadInformations() {
4545
$(document).ready(function () {
46-
$('pre').height($(window).height() - 339);
47-
$('#ul_object').height($(window).height() - 339);
46+
$('pre').height($(window).height() - 300);
47+
$('#ul_object').height($(window).height() - 279);
4848
$('#ul_object').css("overflow-y", "auto");
4949
$('#ul_object').css("padding-right", "5px");
5050
sortList("#ul_object", "timing");
@@ -122,6 +122,7 @@ function initEvents() {
122122
// Display log by alphabetic sort
123123
$("#bt_LogAlphabetic").on('click', function (event) {
124124
sortList("#ul_object", "log");
125+
$(".li_log").removeClass('active');
125126
$('.li_log').first().addClass('active');
126127
$('#bt_LogAlphabetic').removeClass('btn-action').addClass('btn-info');
127128
$('#bt_LogChronologic').removeClass('btn-info').addClass('btn-action');
@@ -131,6 +132,7 @@ function initEvents() {
131132
// Display log by timing sort
132133
$("#bt_LogChronologic").on('click', function (event) {
133134
sortList("#ul_object", "timing");
135+
$(".li_log").removeClass('active');
134136
$('.li_log').first().addClass('active');
135137
$('#bt_LogChronologic').removeClass('btn-action').addClass('btn-info');
136138
$('#bt_LogAlphabetic').removeClass('btn-info').addClass('btn-action');

‎assets/js/desktop/gui.js

+57-1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,51 @@ function refreshUpdateNumber() {
349349
}
350350
}
351351
});
352+
if($('#spanNbUpdates').length){
353+
nextdom.update.numbers({
354+
error: function (error) {
355+
notify("Erreur", error.message, 'error');
356+
},
357+
success: function (_numbers) {
358+
if (_numbers.all == 0 || _numbers.all == '0') {
359+
$('#spanNbUpdates').hide();
360+
} else {
361+
$('#spanNbUpdates').html(_numbers.all);
362+
$('#spanNbUpdates').show();
363+
}
364+
if (_numbers.core == 0 || _numbers.core == '0') {
365+
$('#spanNbUpdatesCore').hide();
366+
} else {
367+
$('#spanNbUpdatesCore').html(_numbers.core);
368+
$('#spanNbUpdatesCore').show();
369+
}
370+
if (_numbers.plugin == 0 || _numbers.plugin == '0') {
371+
$('#spanNbUpdatesPlugins').hide();
372+
} else {
373+
$('#spanNbUpdatesPlugins').html(_numbers.plugin);
374+
$('#spanNbUpdatesPlugins').show();
375+
}
376+
if (_numbers.widget == 0 || _numbers.widget == '0') {
377+
$('#spanNbUpdatesWidgets').hide();
378+
} else {
379+
$('#spanNbUpdatesWidgets').html(_numbers.widget);
380+
$('#spanNbUpdatesWidgets').show();
381+
}
382+
if (_numbers.script == 0 || _numbers.script == '0') {
383+
$('#spanNbUpdatesScripts').hide();
384+
} else {
385+
$('#spanNbUpdatesScripts').html(_numbers.script);
386+
$('#spanNbUpdatesScripts').show();
387+
}
388+
if (_numbers.others == 0 || _numbers.others == '0') {
389+
$('#spanNbUpdatesOthers').hide();
390+
} else {
391+
$('#spanNbUpdatesOthers').html(_numbers.others);
392+
$('#spanNbUpdatesOthers').show();
393+
}
394+
}
395+
});
396+
}
352397
}
353398

354399
/**
@@ -406,18 +451,29 @@ function displayClock() {
406451
* Adjust size and position of jquery modales
407452
*/
408453
function modalesAdjust() {
409-
var modals = [$('#md_modal'), $('#md_modal2')];
454+
var modals = [$('#md_modal'), $('#md_modal2'), $('#md_pageHelp')];
410455
modals.forEach(function (modal) {
411456
if (modal.is(':ui-dialog')) {
412457
modal.dialog('option', 'width', getModalWidth());
458+
modal.dialog('option', 'height', getModalHeight());
413459
modal.dialog('option', 'position', {my: 'center', at: 'center', of: window});
414460
}
415461
});
416462
}
417463

464+
/**
465+
* Calcul modal width depend of width screen
466+
*/
418467
function getModalWidth() {
419468
if (jQuery(window).width() < 1000) {
420469
return '96%';
421470
}
422471
return '80%';
423472
}
473+
474+
/**
475+
* Calcul modal width depend of width screen
476+
*/
477+
function getModalHeight() {
478+
return (jQuery(window).height() - 100);
479+
}

‎assets/js/desktop/inits.js

+68
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ function initPage(){
4949
initTextArea();
5050
initEventHandler();
5151
initFields();
52+
initModals();
5253

5354
// Trig page loaded
5455
$('body').trigger('nextdom_page_load');
@@ -179,3 +180,70 @@ function initTextArea(){
179180
}
180181
});
181182
}
183+
184+
/**
185+
* Init of modals pages
186+
*/
187+
function initModals(){
188+
// Help modal trigger declaration
189+
$("#md_pageHelp").dialog({
190+
autoOpen: false,
191+
modal: false,
192+
closeText: '',
193+
height: getModalHeight(),
194+
width: getModalWidth(),
195+
resizable: false,
196+
open: function () {
197+
$("body").css({overflow: 'hidden'});
198+
modalesAdjust();
199+
$(".wrapper").addClass("blur");
200+
},
201+
beforeClose: function (event, ui) {
202+
$("body").css({overflow: 'inherit'});
203+
$("#md_pageHelp").empty();
204+
$(".wrapper").removeClass("blur");
205+
}
206+
});
207+
208+
// modal trigger declaration
209+
$("#md_modal").dialog({
210+
autoOpen: false,
211+
modal: false,
212+
closeText: '',
213+
height: getModalHeight(),
214+
width: getModalWidth(),
215+
resizable: false,
216+
open: function () {
217+
$("body").css({overflow: 'hidden'});
218+
modalesAdjust();
219+
$(".wrapper").addClass("blur");
220+
},
221+
beforeClose: function (event, ui) {
222+
$("body").css({overflow: 'inherit'});
223+
$("#md_modal").empty();
224+
$("#md_modal").dialog('option', 'buttons', []);
225+
$(".wrapper").removeClass("blur");
226+
}
227+
});
228+
229+
// modal bis trigger declaration
230+
$("#md_modal2").dialog({
231+
autoOpen: false,
232+
modal: false,
233+
closeText: '',
234+
height: getModalHeight(),
235+
width: getModalWidth(),
236+
resizable: false,
237+
open: function () {
238+
$("body").css({overflow: 'hidden'});
239+
modalesAdjust();
240+
$(".wrapper").addClass("blur");
241+
},
242+
beforeClose: function (event, ui) {
243+
$("body").css({overflow: 'inherit'});
244+
$("#md_modal2").empty();
245+
$("#md_modal2").dialog('option', 'buttons', []);
246+
$(".wrapper").removeClass("blur");
247+
}
248+
});
249+
}

‎assets/js/desktop/loads.js

-57
Original file line numberDiff line numberDiff line change
@@ -310,63 +310,6 @@ $(function () {
310310
});
311311
});
312312

313-
// Help modal trigger declaration
314-
$("#md_pageHelp").dialog({
315-
autoOpen: false,
316-
modal: false,
317-
closeText: '',
318-
height: (jQuery(window).height() - 100),
319-
width: getModalWidth(),
320-
show: { effect: "blind", duration: 200 },
321-
resizable: false,
322-
open: function () {
323-
$("body").css({overflow: 'hidden'});
324-
$(this).dialog("option", "position", {my: "center", at: "center", of: window});
325-
},
326-
beforeClose: function (event, ui) {
327-
$("body").css({overflow: 'inherit'});
328-
$("#md_pageHelp").empty();
329-
}
330-
});
331-
332-
// modal trigger declaration
333-
$("#md_modal").dialog({
334-
autoOpen: false,
335-
modal: false,
336-
closeText: '',
337-
height: (jQuery(window).height() - 100),
338-
width: getModalWidth(),
339-
show: { effect: "blind", duration: 200 },
340-
resizable: false,
341-
open: function () {
342-
$("body").css({overflow: 'hidden'});
343-
$(this).dialog("option", "position", {my: "center", at: "center", of: window});
344-
},
345-
beforeClose: function (event, ui) {
346-
$("body").css({overflow: 'inherit'});
347-
$("#md_modal").empty();
348-
}
349-
});
350-
351-
// modal bis trigger declaration
352-
$("#md_modal2").dialog({
353-
autoOpen: false,
354-
modal: false,
355-
closeText: '',
356-
height: (jQuery(window).height() - 100),
357-
width: getModalWidth(),
358-
show: { effect: "blind", duration: 200 },
359-
resizable: false,
360-
open: function () {
361-
$("body").css({overflow: 'hidden'});
362-
$(this).dialog("option", "position", {my: "center", at: "center", of: window});
363-
},
364-
beforeClose: function (event, ui) {
365-
$("body").css({overflow: 'inherit'});
366-
$("#md_modal2").empty();
367-
}
368-
});
369-
370313
// Prevent close event handler declaration to advise user for exit without saving
371314
$(window).bind('beforeunload', function (e) {
372315
if (modifyWithoutSave) {

‎assets/js/desktop/pages/connection.js

+2
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,11 @@ function updateTwoFactorVisibility() {
135135
if (useTwoFactor === 1) {
136136
divLogin.hide();
137137
divTwoFactor.show();
138+
twoFactorInput.focus();
138139
} else {
139140
divLogin.show();
140141
divTwoFactor.hide();
142+
loginInput.focus();
141143
}
142144
}
143145

0 commit comments

Comments
 (0)