- added notification for "scheduled maintenance" panel to /map view
This commit is contained in:
@@ -188,6 +188,11 @@ class Map extends Controller\AccessController {
|
||||
'rallySet' => (bool)Config::getNotificationMail('RALLY_SET')
|
||||
];
|
||||
|
||||
// program mode (e.g. "maintenance") --------------------------------------------------------------------------
|
||||
$return->programMode = [
|
||||
'maintenance' => $this->getF3()->get('PATHFINDER.LOGIN.MODE_MAINTENANCE')
|
||||
];
|
||||
|
||||
// get SSO error messages that should be shown immediately ----------------------------------------------------
|
||||
// -> e.g. errors while character switch from previous HTTP requests
|
||||
if( $f3->exists(Controller\Ccp\Sso::SESSION_KEY_SSO_ERROR) ){
|
||||
|
||||
@@ -26,6 +26,9 @@ MSG_DISABLED = User registration is currently not allowed
|
||||
; expire time (in days) for login cookies
|
||||
COOKIE_EXPIRE = 30
|
||||
|
||||
; shows "scheduled maintenance" warning to users (default: 0)
|
||||
MODE_MAINTENANCE = 0
|
||||
|
||||
; restrict login to specific corporations/alliances by id (e.g. 1000166,1000080)
|
||||
CORPORATION =
|
||||
ALLIANCE =
|
||||
|
||||
@@ -29,6 +29,7 @@ define([
|
||||
Util.initDefaultBootboxConfig();
|
||||
|
||||
// load page
|
||||
// load info (maintenance) info panel (if scheduled)
|
||||
$('body').loadPageStructure();
|
||||
|
||||
// show app information in browser console
|
||||
@@ -63,6 +64,7 @@ define([
|
||||
Init.routes = initData.routes;
|
||||
Init.notificationStatus = initData.notificationStatus;
|
||||
Init.routeSearch = initData.routeSearch;
|
||||
Init.programMode = initData.programMode;
|
||||
|
||||
// init tab change observer, Once the timers are available
|
||||
Page.initTabChangeObserver();
|
||||
@@ -70,6 +72,11 @@ define([
|
||||
// init map module
|
||||
mapModule.initMapModule();
|
||||
|
||||
// load info (maintenance) info panel (if scheduled)
|
||||
if(Init.programMode.maintenance){
|
||||
$('body').showGlobalInfoPanel();
|
||||
}
|
||||
|
||||
}).fail(( jqXHR, status, error) => {
|
||||
let reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ define([
|
||||
// footer
|
||||
pageFooterId: 'pf-footer', // id for page footer
|
||||
footerLicenceLinkClass: 'pf-footer-licence', // class for "licence" link
|
||||
globalInfoPanelId: 'pf-global-info', // id for "global info panel"
|
||||
|
||||
// menu
|
||||
menuHeadMenuLogoClass: 'pf-head-menu-logo', // class for main menu logo
|
||||
@@ -70,25 +71,27 @@ define([
|
||||
|
||||
/**
|
||||
* load main page structure elements and navigation container into body
|
||||
* @returns {*|jQuery|HTMLElement}
|
||||
*/
|
||||
$.fn.loadPageStructure = function(){
|
||||
let body = $(this);
|
||||
|
||||
// menu left
|
||||
$(this).prepend(
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarLeftClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideLeftWidth)
|
||||
);
|
||||
|
||||
// menu right
|
||||
$(this).prepend(
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarRightClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideRightWidth)
|
||||
);
|
||||
|
||||
// main page
|
||||
$(this).prepend(
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
id: config.pageId,
|
||||
class: config.pageClass
|
||||
@@ -112,6 +115,8 @@ define([
|
||||
|
||||
// set document observer for global events
|
||||
setDocumentObserver();
|
||||
|
||||
return body;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1069,6 +1074,24 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* show information panel to active users (on bottom)
|
||||
* @returns {*|jQuery|HTMLElement}
|
||||
*/
|
||||
$.fn.showGlobalInfoPanel = function (){
|
||||
let body = $(this);
|
||||
let infoTemplate = 'text!templates/ui/info_panel.html';
|
||||
|
||||
requirejs([infoTemplate, 'mustache'], function(template, Mustache) {
|
||||
let data = {
|
||||
id: config.globalInfoPanelId
|
||||
};
|
||||
let content = $( Mustache.render(template, data) );
|
||||
content.insertBefore( '#' + config.pageFooterId );
|
||||
});
|
||||
|
||||
return body;
|
||||
};
|
||||
|
||||
return {
|
||||
initTabChangeObserver: initTabChangeObserver
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -29,8 +29,10 @@ define([
|
||||
Util.initDefaultBootboxConfig();
|
||||
|
||||
// load page
|
||||
// load info (maintenance) info panel (if scheduled)
|
||||
$('body').loadPageStructure();
|
||||
|
||||
|
||||
// show app information in browser console
|
||||
Util.showVersionInfo();
|
||||
|
||||
@@ -63,6 +65,7 @@ define([
|
||||
Init.routes = initData.routes;
|
||||
Init.notificationStatus = initData.notificationStatus;
|
||||
Init.routeSearch = initData.routeSearch;
|
||||
Init.programMode = initData.programMode;
|
||||
|
||||
// init tab change observer, Once the timers are available
|
||||
Page.initTabChangeObserver();
|
||||
@@ -70,6 +73,11 @@ define([
|
||||
// init map module
|
||||
mapModule.initMapModule();
|
||||
|
||||
// load info (maintenance) info panel (if scheduled)
|
||||
if(Init.programMode.maintenance){
|
||||
$('body').showGlobalInfoPanel();
|
||||
}
|
||||
|
||||
}).fail(( jqXHR, status, error) => {
|
||||
let reason = status + ' ' + jqXHR.status + ': ' + error;
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ define([
|
||||
// footer
|
||||
pageFooterId: 'pf-footer', // id for page footer
|
||||
footerLicenceLinkClass: 'pf-footer-licence', // class for "licence" link
|
||||
globalInfoPanelId: 'pf-global-info', // id for "global info panel"
|
||||
|
||||
// menu
|
||||
menuHeadMenuLogoClass: 'pf-head-menu-logo', // class for main menu logo
|
||||
@@ -70,25 +71,27 @@ define([
|
||||
|
||||
/**
|
||||
* load main page structure elements and navigation container into body
|
||||
* @returns {*|jQuery|HTMLElement}
|
||||
*/
|
||||
$.fn.loadPageStructure = function(){
|
||||
let body = $(this);
|
||||
|
||||
// menu left
|
||||
$(this).prepend(
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarLeftClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideLeftWidth)
|
||||
);
|
||||
|
||||
// menu right
|
||||
$(this).prepend(
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
class: [config.pageSlidebarClass, config.pageSlidebarRightClass, 'sb-style-push', 'sb-width-custom'].join(' ')
|
||||
}).attr('data-sb-width', config.pageSlideRightWidth)
|
||||
);
|
||||
|
||||
// main page
|
||||
$(this).prepend(
|
||||
body.prepend(
|
||||
$('<div>', {
|
||||
id: config.pageId,
|
||||
class: config.pageClass
|
||||
@@ -112,6 +115,8 @@ define([
|
||||
|
||||
// set document observer for global events
|
||||
setDocumentObserver();
|
||||
|
||||
return body;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1069,6 +1074,24 @@ define([
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* show information panel to active users (on bottom)
|
||||
* @returns {*|jQuery|HTMLElement}
|
||||
*/
|
||||
$.fn.showGlobalInfoPanel = function (){
|
||||
let body = $(this);
|
||||
let infoTemplate = 'text!templates/ui/info_panel.html';
|
||||
|
||||
requirejs([infoTemplate, 'mustache'], function(template, Mustache) {
|
||||
let data = {
|
||||
id: config.globalInfoPanelId
|
||||
};
|
||||
let content = $( Mustache.render(template, data) );
|
||||
content.insertBefore( '#' + config.pageFooterId );
|
||||
});
|
||||
|
||||
return body;
|
||||
};
|
||||
|
||||
return {
|
||||
initTabChangeObserver: initTabChangeObserver
|
||||
|
||||
4
public/templates/ui/info_panel.html
Normal file
4
public/templates/ui/info_panel.html
Normal file
@@ -0,0 +1,4 @@
|
||||
<div id="{{id}}" class="alert alert-warning">
|
||||
<div class="ui-pnotify-icon"><span class="fa fa-exclamation fa-fw fa-lg"></span></div>
|
||||
<h4 class="ui-pnotify-title">Scheduled maintenance: <small> Expect the server to shutdown 'soon'. ETA: ASAP ;) </small></h4>
|
||||
</div>
|
||||
@@ -1107,6 +1107,15 @@ td.pf-popover-trigger{
|
||||
.navbar-fixed-bottom{
|
||||
padding: 2px 0;
|
||||
}
|
||||
// global info panel ==============================================================================
|
||||
#pf-global-info{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 32px;
|
||||
width: 100%;
|
||||
height: 32px;
|
||||
margin-bottom: 0; // overwrite default "alert" style
|
||||
}
|
||||
|
||||
/*
|
||||
Animate the stripes
|
||||
|
||||
Reference in New Issue
Block a user