Skip to content

Commit 3da05a7

Browse files
author
Till Brehm
committed
Merge branch 'datalognotification-modifications' into 'stable-3.1'
Datalognotification modifications fixes for all but chrome, added stability when losing connection See merge request !418
2 parents 198271a + 4adec2e commit 3da05a7

File tree

5 files changed

+55
-40
lines changed

5 files changed

+55
-40
lines changed

interface/web/themes/default/assets/javascripts/ispconfig.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ var ISPConfig = {
88
indicatorCompleted: false,
99
registeredHooks: new Array(),
1010
new_tpl_add_id: 0,
11+
dataLogTimer: 0,
1112

1213
options: {
1314
useLoadIndicator: false,
@@ -175,6 +176,8 @@ var ISPConfig = {
175176
ISPConfig.onAfterContentLoad(target, $('#'+formname).serialize());
176177
ISPConfig.pageFormChanged = false;
177178
}
179+
clearTimeout(dataLogTimer);
180+
ISPConfig.dataLogNotification();
178181
ISPConfig.hideLoadIndicator();
179182
},
180183
error: function(jqXHR, textStatus, errorThrown) {
@@ -282,6 +285,8 @@ var ISPConfig = {
282285
ISPConfig.onAfterContentLoad(pagename, (params ? params : null));
283286
ISPConfig.pageFormChanged = false;
284287
}
288+
clearTimeout(dataLogTimer); // clear running dataLogTimer
289+
ISPConfig.dataLogNotification();
285290
ISPConfig.hideLoadIndicator();
286291
},
287292
error: function() {
@@ -346,7 +351,7 @@ var ISPConfig = {
346351

347352
ISPConfig.loadMenus();
348353
ISPConfig.keepalive();
349-
ISPConfig.datalognotification();
354+
ISPConfig.dataLogNotification();
350355
setTimeout(function() {
351356
try {
352357
$('form#pageForm').find('input[name="username"]').focus();
@@ -494,25 +499,27 @@ var ISPConfig = {
494499
}
495500
});
496501
},
497-
datalognotification: function() {
502+
dataLogNotification: function() {
503+
console.log(ISPConfig.options);
498504
var notificationContent = $.ajax({
499505
type: "GET",
500506
url: "datalogstatus.php",
501507
dataType: "json",
502508
success: function(data, textStatus, jqXHR) {
503509
var dataLogItems = [];
504510
$.each( data['entries'], function( key, val ) {
505-
dataLogItems.push('<li><strong>' + val['text'] + ':</strong> ' + val['count'] + '</li>');
511+
dataLogItems.push('<li><strong>' + val['text'] + ':</strong> ' + val['count'] + '</li>');
506512
});
507513
if(data['count'] > 0) {
508514
$('.modal-body').html(dataLogItems.join(""));
509515
$('.notification_text').text(data['count']);
510516
$('.notification').css('display','');
511-
setTimeout( function() { ISPConfig.datalognotification(); }, 2000 );
517+
dataLogTimer = setTimeout( function() { ISPConfig.dataLogNotification(); }, 2000 );
512518
} else {
513519
$('.notification').css('display','none');
514520
$('.modal-body').html('');
515-
setTimeout( function() { ISPConfig.datalognotification(); }, 5000 );
521+
$('#datalogModal').modal('hide');
522+
dataLogTimer = setTimeout( function() { ISPConfig.dataLogNotification(); }, 5000 );
516523
}
517524
},
518525
error: function() {

interface/web/themes/default/assets/javascripts/ispconfig.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

interface/web/themes/default/assets/stylesheets/ispconfig.css

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -724,18 +724,26 @@ input[type="password"].form-control[readonly] {
724724
max-width: 100%;
725725
}
726726
.notification {
727-
width: 35px;
728-
height: 35px;
729-
background: #c70f19;
730-
border-radius: 50%;
731-
display: inline-flex;
732-
margin-right: 15px;
733-
margin-top: 15px;
734-
cursor: pointer;
727+
width: 35px;
728+
height: 35px;
729+
background: #c70f19;
730+
border-radius: 50%;
731+
display: flex;
732+
position: absolute;
733+
margin-top: 15px;
734+
cursor: pointer;
735+
margin-right: 15px;
735736
}
736737
.notification {
737738
animation: pulse 2s infinite;
738739
}
740+
@media (max-width: 600px) {
741+
.notification {
742+
margin-top: 0px;
743+
margin-right: 0px;
744+
margin-left: 230px;
745+
}
746+
}
739747
@keyframes pulse {
740748
0% {
741749
background: #ff000e;

0 commit comments

Comments
 (0)