- replaced some old images on /login page with newer versions

- improved "route search" dialog. Added new "connection size" select field
- improved render time for clients. Reduced DCL (DOM Content Loaded) time
- improved CSV,Clipboard copy data for "task manager" table data
This commit is contained in:
Mark Friedrich
2019-06-20 17:00:07 +02:00
parent da02ae6a44
commit 176cd41a49
47 changed files with 524 additions and 269 deletions

View File

@@ -154,13 +154,13 @@ class Route extends Controller\AccessController {
$includeTypes[] = 'wh_critical';
}
if( $filterData['wormholesFrigate'] !== true ){
$excludeTypes[] = 'wh_jump_mass_s';
}
if( $filterData['wormholesEOL'] === false ){
$includeEOL = false;
}
if(!empty($filterData['excludeTypes'])){
$excludeTypes = $filterData['excludeTypes'];
}
}
if( $filterData['endpointsBubble'] !== true ){
@@ -733,8 +733,9 @@ class Route extends Controller\AccessController {
'wormholes' => (bool) $routeData['wormholes'],
'wormholesReduced' => (bool) $routeData['wormholesReduced'],
'wormholesCritical' => (bool) $routeData['wormholesCritical'],
'wormholesFrigate' => (bool) $routeData['wormholesFrigate'],
'wormholesEOL' => (bool) $routeData['wormholesEOL'],
'wormholesSizeMin' => (string) $routeData['wormholesSizeMin'],
'excludeTypes' => (array) $routeData['excludeTypes'],
'endpointsBubble' => (bool) $routeData['endpointsBubble'],
'flag' => $routeData['flag']
];

View File

@@ -162,6 +162,7 @@ class Controller {
'style' => $f3->get('BASE') . '/public/css/' . Config::getPathfinderData('version'),
'script' => $f3->get('BASE') . '/public/js/' . Config::getPathfinderData('version'),
'font' => $f3->get('BASE') . '/public/fonts',
'document' => $f3->get('BASE') . '/public/templates',
'image' => $f3->get('BASE') . '/public/img'
]);

View File

@@ -9,6 +9,7 @@
namespace Controller;
use lib\Config;
use lib\Resource;
class MapController extends AccessController {
@@ -18,6 +19,9 @@ class MapController extends AccessController {
* @throws \Exception
*/
public function init(\Base $f3) {
$resource = Resource::instance();
$resource->register('script', 'app/mappage');
$character = $this->getCharacter();
// characterId

View File

@@ -24,31 +24,31 @@ class Setup extends Controller {
* @var array
*/
protected $environmentVars = [
'ENVIRONMENT_CONFIG',
'BASE',
'URL',
'DEBUG',
'DB_PF_DNS',
'DB_PF_NAME',
'DB_PF_USER',
'DB_PF_PASS',
'DB_UNIVERSE_DNS',
'DB_UNIVERSE_NAME',
'DB_UNIVERSE_USER',
'DB_UNIVERSE_PASS',
'CCP_SSO_URL',
'CCP_SSO_CLIENT_ID',
'CCP_SSO_SECRET_KEY',
'CCP_SSO_DOWNTIME',
'CCP_ESI_URL',
'CCP_ESI_DATASOURCE',
'SMTP_HOST',
'SMTP_PORT',
'SMTP_SCHEME',
'SMTP_USER',
'SMTP_PASS',
'SMTP_FROM',
'SMTP_ERROR'
'ENVIRONMENT_CONFIG' => [],
'BASE' => ['missingOk' => true],
'URL' => [],
'DEBUG' => [],
'DB_PF_DNS' => [],
'DB_PF_NAME' => [],
'DB_PF_USER' => [],
'DB_PF_PASS' => [],
'DB_UNIVERSE_DNS' => [],
'DB_UNIVERSE_NAME' => [],
'DB_UNIVERSE_USER' => [],
'DB_UNIVERSE_PASS' => [],
'CCP_SSO_URL' => [],
'CCP_SSO_CLIENT_ID' => [],
'CCP_SSO_SECRET_KEY' => [],
'CCP_SSO_DOWNTIME' => [],
'CCP_ESI_URL' => [],
'CCP_ESI_DATASOURCE' => [],
'SMTP_HOST' => [],
'SMTP_PORT' => [],
'SMTP_SCHEME' => [],
'SMTP_USER' => [],
'SMTP_PASS' => [],
'SMTP_FROM' => [],
'SMTP_ERROR' => []
];
/**
@@ -313,12 +313,12 @@ class Setup extends Controller {
// obscure some values
$obscureVars = ['CCP_SSO_CLIENT_ID', 'CCP_SSO_SECRET_KEY', 'SMTP_PASS'];
foreach($this->environmentVars as $var){
foreach($this->environmentVars as $var => $options){
if( !in_array($var, $excludeVars) ){
$value = Config::getEnvironmentData($var);
$check = true;
if(is_null($value)){
if(is_null($value) && !array_key_exists('missingOk', $options)){
// variable missing
$check = false;
$value = '[missing]';

View File

@@ -24,6 +24,7 @@ class Resource extends \Prefab {
'style' => 'style',
'script' => 'script',
'font' => 'font',
'document' => 'document',
'image' => 'image'
];
@@ -49,6 +50,7 @@ class Resource extends \Prefab {
'style' => '',
'script' => '',
'font' => '',
'document' => '',
'image' => ''
];
@@ -60,6 +62,7 @@ class Resource extends \Prefab {
private $fileExt = [
'style' => 'css',
'script' => 'js',
'document' => 'html',
'font' => 'woff2'
];

View File

@@ -456,25 +456,29 @@ define(['jquery'], ($) => {
jumpMassMin: 1000000000,
type: 'wh_jump_mass_xl',
class: 'pf-jump-mass-xl',
label: 'XL'
label: 'XL',
text: 'capital ships'
},
wh_jump_mass_l: {
jumpMassMin: 300000000,
type: 'wh_jump_mass_l',
class: 'pf-jump-mass-l',
label: 'L'
label: 'L',
text: 'larger ships'
},
wh_jump_mass_m: {
jumpMassMin: 20000000,
type: 'wh_jump_mass_m',
class: 'pf-jump-mass-m',
label: 'M'
label: 'M',
text: 'medium ships'
},
wh_jump_mass_s: {
jumpMassMin: 1000,
type: 'wh_jump_mass_s',
class: 'pf-jump-mass-s',
label: 'S'
label: 'S',
text: 'smallest ships'
}
},
// signature groups

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'bootbox'
], function($, Init, Util, bootbox){
], ($, Init, Util, bootbox) => {
'use strict';
@@ -27,27 +27,16 @@ define([
moduleHeadlineIconClass: 'pf-module-icon-button' // class for toolbar icons in the head
};
/**
* get log time string
* @returns {string}
*/
let getLogTime = function(){
let serverTime = Util.getServerTime();
let logTime = serverTime.toLocaleTimeString('en-US', { hour12: false });
return logTime;
};
/**
* updated "sync status" dynamic dialog area
*/
let updateSyncStatus = function(){
let updateSyncStatus = () => {
// check if task manager dialog is open
let logDialog = $('#' + config.taskDialogId);
if(logDialog.length){
// dialog is open
requirejs(['text!templates/modules/sync_status.html', 'mustache'], function(templateSyncStatus, Mustache){
requirejs(['text!templates/modules/sync_status.html', 'mustache'], (templateSyncStatus, Mustache) => {
let data = {
timestampCounterClass: config.timestampCounterClass,
syncStatus: Init.syncStatus,
@@ -76,7 +65,7 @@ define([
/**
* shows the logging dialog
*/
let showDialog = function(){
let showDialog = () => {
// dialog content
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache){
@@ -110,19 +99,25 @@ define([
extend: 'copy',
tag: 'a',
className: config.moduleHeadlineIconClass,
text: '<i class="fas fa-fw fa-copy"></i> copy'
text: '<i class="fas fa-fw fa-copy"></i> copy',
exportOptions: {
orthogonal: 'export'
}
},
{
extend: 'csv',
tag: 'a',
className: config.moduleHeadlineIconClass,
text: '<i class="fas fa-fw fa-download"></i> csv'
text: '<i class="fas fa-fw fa-download"></i> csv',
exportOptions: {
orthogonal: 'export'
}
}
]
},
paging: true,
ordering: true,
order: [ 1, 'desc' ],
order: [1, 'desc'],
hover: false,
pageLength: 10,
lengthMenu: [[5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, 'All']],
@@ -136,42 +131,69 @@ define([
columnDefs: [
{
targets: 0,
name: 'status',
title: '<i class="fas fa-tag"></i>',
width: '18px',
width: 18,
searchable: false,
class: ['text-center'].join(' '),
data: 'status'
data: 'status',
render: {
display: (cellData, type, rowData, meta) => {
let statusClass = Util.getLogInfo(cellData, 'class');
return '<i class="fas fa-fw fa-circle txt-color ' + statusClass + '"></i>';
}
}
},{
targets: 1,
title: '<i class="far fa-fw fa-clock"></i>&nbsp;&nbsp;',
width: '50px',
name: 'time',
title: '<i class="far fa-fw fa-clock"></i>',
width: 50,
searchable: true,
class: 'text-right',
data: 'time'
data: 'timestamp',
render: {
display: (cellData, type, rowData, meta) => rowData.timestampFormatted
}
},{
targets: 2,
title: '<i class="fas fa-fw fa-history"></i>&nbsp;&nbsp;',
width: '35px',
name: 'duration',
title: '<i class="fas fa-fw fa-history"></i>',
width: 35,
searchable: false,
class: 'text-right',
sType: 'html',
data: 'duration'
data: 'duration',
render: {
display: (cellData, type, rowData, meta) => {
let logStatus = getLogStatusByDuration(rowData.key, cellData);
let statusClass = Util.getLogInfo(logStatus, 'class');
return '<span class="txt-color ' + statusClass + '">' + cellData + '<small>ms</small></span>';
}
}
},{
targets: 3,
name: 'description',
title: 'description',
searchable: true,
data: 'description'
},{
targets: 4,
name: 'logType',
title: 'type',
width: '40px',
width: 40,
searchable: true,
class: ['text-center'].join(' '),
data: 'type'
data: 'logType',
render: {
display: (cellData, type, rowData, meta) => {
let typeIconClass = getLogTypeIconClass(cellData);
return '<i class="fas ' + typeIconClass + '"></i>';
}
}
},{
targets: 5,
title: 'Prozess-ID&nbsp;&nbsp;&nbsp;',
width: '80px',
name: 'process',
title: 'Prozess-ID',
width: 80,
searchable: false,
class: 'text-right',
data: 'key'
@@ -199,10 +221,7 @@ define([
// show Morris graphs ----------------------------------------------------------
// function for chart label formation
let labelYFormat = function(y){
return Math.round(y) + 'ms';
};
let labelYFormat = val => Math.round(val) + 'ms';
for(let key in chartData){
if(chartData.hasOwnProperty(key)){
@@ -243,8 +262,8 @@ define([
});
headline.append(averageElement);
colElementGraph.append( headline );
colElementGraph.append( graphArea );
colElementGraph.append(headline);
colElementGraph.append(graphArea);
graphArea.showLoadingAnimation();
@@ -323,10 +342,10 @@ define([
* @param key
* @param duration (if undefined -> just update graph with current data)
*/
let updateLogGraph = function(key, duration){
let updateLogGraph = (key, duration) => {
// check if graph data already exist
if( !(chartData.hasOwnProperty(key))){
if(!(chartData.hasOwnProperty(key))){
chartData[key] = {};
chartData[key].data = [];
chartData[key].graph = null;
@@ -343,7 +362,7 @@ define([
chartData[key].data = chartData[key].data.slice(0, maxGraphDataCount);
}
function getGraphData(data){
let getGraphData = data => {
let tempChartData = {
data: [],
dataSum: 0,
@@ -354,7 +373,7 @@ define([
let value = 0;
if(data[x]){
value = data[x];
tempChartData.dataSum = Number( (tempChartData.dataSum + value).toFixed(2) );
tempChartData.dataSum = Number((tempChartData.dataSum + value).toFixed(2));
}
tempChartData.data.push({
@@ -364,10 +383,10 @@ define([
}
// calculate average
tempChartData.average = Number( ( tempChartData.dataSum / data.length ).toFixed(2) );
tempChartData.average = Number((tempChartData.dataSum / data.length).toFixed(2));
return tempChartData;
}
};
let tempChartData = getGraphData(chartData[key].data);
@@ -376,17 +395,17 @@ define([
let avgElement = chartData[key].averageElement;
let updateElement = chartData[key].updateElement;
let delay = Util.getCurrentTriggerDelay( key, 0 );
let delay = Util.getCurrentTriggerDelay(key, 0);
if(delay){
updateElement[0].textContent = ' delay: ' + delay + 'ms ';
updateElement[0].textContent = ' delay: ' + delay.toFixed(2) + ' ms';
}
// set/change average line
chartData[key].graph.options.goals = [tempChartData.average];
// change avg. display
avgElement[0].textContent = 'Avg. ' + tempChartData.average + 'ms';
avgElement[0].textContent = 'avg. ' + tempChartData.average.toFixed(2) + ' ms';
let avgStatus = getLogStatusByDuration(key, tempChartData.average);
let avgStatusClass = Util.getLogInfo( avgStatus, 'class');
@@ -419,9 +438,9 @@ define([
* @param logDuration
* @returns {string}
*/
let getLogStatusByDuration = function(logKey, logDuration){
let getLogStatusByDuration = (logKey, logDuration) => {
let logStatus = 'info';
if( logDuration > Init.timer[logKey].EXECUTION_LIMIT ){
if(logDuration > Init.timer[logKey].EXECUTION_LIMIT){
logStatus = 'warning';
}
return logStatus;
@@ -432,8 +451,7 @@ define([
* @param logType
* @returns {string}
*/
let getLogTypeIconClass = function(logType){
let getLogTypeIconClass = logType => {
let logIconClass = '';
switch(logType){
@@ -472,24 +490,23 @@ define([
let logDuration = options.duration;
let logType = options.type;
// check log status by duration
let logStatus = getLogStatusByDuration(logKey, logDuration);
let statusClass = Util.getLogInfo( logStatus, 'class');
let typeIconClass = getLogTypeIconClass(logType);
// update graph data
updateLogGraph(logKey, logDuration);
let time = Util.getServerTime();
let timestamp = time.getTime();
let timestampFormatted = time.toLocaleTimeString('en-US', { hour12: false });
let logRowData = {
status: '<i class="fas fa-fw fa-circle txt-color ' + statusClass + '"></i>',
time: getLogTime(),
duration: '<span class="txt-color ' + statusClass + '">' + logDuration + '<small>ms</small></span>',
status: getLogStatusByDuration(logKey, logDuration),
timestamp: timestamp,
timestampFormatted: timestampFormatted,
duration: logDuration,
description: logDescription,
type: '<i class="fas ' + typeIconClass + '"></i>',
logType: logType,
key: logKey
};
if(logDataTable){
// add row if dataTable is initialized before new log
logDataTable.row.add( logRowData ).draw(false);
@@ -502,7 +519,7 @@ define([
// delete old log entries from table ---------------------------------
let rowCount = logData.length;
if( rowCount >= maxEntries ){
if(rowCount >= maxEntries){
if(logDataTable){
logDataTable.rows(0, {order:'index'}).remove().draw(false);
@@ -522,7 +539,6 @@ define([
return {
init: init,
getLogTime: getLogTime,
showDialog: showDialog
};
});

View File

@@ -1214,13 +1214,21 @@ define([
});
};
/**
* get all available connection types for "jump mass size"
* @returns {string[]}
*/
let allConnectionJumpMassTypes = () => {
return ['wh_jump_mass_s', 'wh_jump_mass_m', 'wh_jump_mass_l', 'wh_jump_mass_xl'];
};
/**
* set/change connection jump mass of a wormhole
* @param connection
* @param mass
*/
let setConnectionJumpMassType = (connection, mass) => {
let allMassTypes = ['wh_jump_mass_s', 'wh_jump_mass_m', 'wh_jump_mass_l', 'wh_jump_mass_xl'];
let allMassTypes = allConnectionJumpMassTypes();
let addMassType = [];
let removeMassTypes = [];
@@ -2075,6 +2083,7 @@ define([
checkForConnection: checkForConnection,
getDefaultConnectionTypeByScope: getDefaultConnectionTypeByScope,
setConnectionWHStatus: setConnectionWHStatus,
allConnectionJumpMassTypes: allConnectionJumpMassTypes,
setConnectionJumpMassType: setConnectionJumpMassType,
getScopeInfoForConnection: getScopeInfoForConnection,
getDataByConnections: getDataByConnections,

View File

@@ -54,18 +54,16 @@ define([
moduleClass: 'pf-module', // class for a module
moduleSpacerClass: 'pf-module-spacer', // class for "spacer" module (preserves height during hide/show animation)
moduleClosedClass: 'pf-module-closed' // class for a closed module
};
let mapTabChangeBlocked = false; // flag for preventing map tab switch
/**
* get all maps for a maps module
* @returns {*}
* @param mapModule
* @returns {jQuery}
*/
$.fn.getMaps = function(){
return $(this).find('.' + config.mapClass);
};
let getMaps = mapModule => $(mapModule).find('.' + config.mapClass);
/**
* get the current active mapElement
@@ -1345,7 +1343,7 @@ define([
*/
let getMapModuleDataForUpdate = mapModule => {
// get all active map elements for module
let mapElements = mapModule.getMaps();
let mapElements = getMaps(mapModule);
let data = [];
for(let i = 0; i < mapElements.length; i++){

View File

@@ -211,6 +211,53 @@ define([
);
};
/**
* init a select element as "select2" for connection size types
* @param options
*/
$.fn.initConnectionSizeSelect = function(options){
let selectElement = $(this);
let defaultConfig = {
dropdownParent: selectElement.parents('.modal-body'),
minimumResultsForSearch: -1,
width: '100%',
maxSelectionLength: 1
};
options = $.extend({}, defaultConfig, options);
let formatConnectionSizeResultData = data => {
if(data.loading) return data.text;
if(data.placeholder) return data.placeholder;
let connectionClass = MapUtil.getConnectionInfo(data.text, 'cssClass');
let label = Util.getObjVal(Init.wormholeSizes, data.text + '.label') || '?';
let text = Util.getObjVal(Init.wormholeSizes, data.text + '.text') || 'all';
let markup = '<div class="clearfix">';
markup += '<div class="col-xs-1">';
markup += '<i class="fas fa-char fa-fw" data-char-content="' + label + '"></i>';
markup += '</div>';
markup += '<div class="col-xs-3">';
markup += '<div class="pf-fake-connection ' + connectionClass + '"></div>';
markup += '</div>';
markup += '<div class="col-xs-8">';
markup += text;
markup += '</div>';
markup += '</div>';
return $(markup);
};
options.templateSelection = formatConnectionSizeResultData;
options.templateResult = formatConnectionSizeResultData;
$.when(
selectElement.select2(options)
);
};
/**
* init a sselect element as "select2" for "status" selection
* @param options

View File

@@ -34,7 +34,9 @@ define([
routeDialogId: 'pf-route-dialog', // id for route "search" dialog
systemDialogSelectClass: 'pf-system-dialog-select', // class for system select Element
systemInfoRoutesTableClass: 'pf-system-route-table', // class for route tables
mapSelectId: 'pf-route-dialog-map-select', // id for "map" select
routeDialogMapSelectId: 'pf-route-dialog-map-select', // id for "map" select
routeDialogSizeSelectId: 'pf-route-dialog-size-select', // id for "wh size" select
dataTableActionCellClass: 'pf-table-action-cell', // class for "action" cells
dataTableRouteCellClass: 'pf-table-route-cell', // class for "route" cells
@@ -207,8 +209,8 @@ define([
};
let routeData = [];
dataTable.rows().every( function(){
routeData.push( getRouteRequestDataFromRowData(this.data()));
dataTable.rows().every(function(){
routeData.push(getRouteRequestDataFromRowData(this.data()));
});
getRouteData({routeData: routeData}, context, callbackAddRouteRows);
@@ -219,7 +221,7 @@ define([
* @param {Object} rowData
* @returns {Object}
*/
let getRouteRequestDataFromRowData = (rowData) => {
let getRouteRequestDataFromRowData = rowData => {
return {
mapIds: (rowData.hasOwnProperty('mapIds')) ? rowData.mapIds : [],
systemFromData: (rowData.hasOwnProperty('systemFromData')) ? rowData.systemFromData : {},
@@ -230,8 +232,9 @@ define([
wormholes: (rowData.hasOwnProperty('wormholes')) ? rowData.wormholes | 0 : 1,
wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced | 0 : 1,
wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical | 0 : 1,
wormholesFrigate: (rowData.hasOwnProperty('wormholesFrigate')) ? rowData.wormholesFrigate | 0 : 1,
wormholesEOL: (rowData.hasOwnProperty('wormholesEOL')) ? rowData.wormholesEOL | 0 : 1,
wormholesSizeMin: (rowData.hasOwnProperty('wormholesSizeMin')) ? rowData.wormholesSizeMin : '',
excludeTypes: (rowData.hasOwnProperty('excludeTypes')) ? rowData.excludeTypes : [],
endpointsBubble: (rowData.hasOwnProperty('endpointsBubble')) ? rowData.endpointsBubble | 0 : 1,
connections: (rowData.hasOwnProperty('connections')) ? rowData.connections.value | 0 : 0,
flag: (rowData.hasOwnProperty('flag')) ? rowData.flag.value : 'shortest'
@@ -255,13 +258,25 @@ define([
});
}
}
let sizeOptions = MapUtil.allConnectionJumpMassTypes().map(type => {
return {
id: type,
name: type,
selected: false
};
});
let data = {
id: config.routeDialogId,
select2Class: Util.config.select2Class,
selectClass: config.systemDialogSelectClass,
mapSelectId: config.mapSelectId,
routeDialogMapSelectId: config.routeDialogMapSelectId,
routeDialogSizeSelectId: config.routeDialogSizeSelectId,
systemFromData: dialogData.systemFromData,
systemToData: dialogData.systemToData,
mapSelectOptions: mapSelectOptions
mapSelectOptions: mapSelectOptions,
sizeOptions: sizeOptions
};
requirejs(['text!templates/dialog/route.html', 'mustache'], (template, Mustache) => {
@@ -300,6 +315,7 @@ define([
}
// get all system data from select2
// -> we could also get value from "routeDialogData" var, but we need systemName also
let systemSelectData = form.find('.' + config.systemDialogSelectClass).select2('data');
if(
@@ -324,8 +340,9 @@ define([
wormholes: routeDialogData.hasOwnProperty('wormholes') ? parseInt(routeDialogData.wormholes) : 0,
wormholesReduced: routeDialogData.hasOwnProperty('wormholesReduced') ? parseInt(routeDialogData.wormholesReduced) : 0,
wormholesCritical: routeDialogData.hasOwnProperty('wormholesCritical') ? parseInt(routeDialogData.wormholesCritical) : 0,
wormholesFrigate: routeDialogData.hasOwnProperty('wormholesFrigate') ? parseInt(routeDialogData.wormholesFrigate) : 0,
wormholesEOL: routeDialogData.hasOwnProperty('wormholesEOL') ? parseInt(routeDialogData.wormholesEOL) : 0,
wormholesSizeMin: routeDialogData.wormholesSizeMin || '',
excludeTypes: getLowerSizeConnectionTypes(routeDialogData.wormholesSizeMin),
endpointsBubble: routeDialogData.hasOwnProperty('endpointsBubble') ? parseInt(routeDialogData.endpointsBubble) : 0
}]
};
@@ -343,15 +360,18 @@ define([
// init some dialog/form observer
setDialogObserver( $(this) );
// init map select ----------------------------------------------------------------
let mapSelect = $(this).find('#' + config.mapSelectId);
// init map select ------------------------------------------------------------------------------------
let mapSelect = findRouteDialog.find('#' + config.routeDialogMapSelectId);
mapSelect.initMapSelect();
// init connection jump size select -------------------------------------------------------------------
findRouteDialog.find('#' + config.routeDialogSizeSelectId).initConnectionSizeSelect();
});
findRouteDialog.on('shown.bs.modal', function(e){
// init system select live search ------------------------------------------------
// init system select live search --------------------------------------------------------------------
// -> add some delay until modal transition has finished
let systemTargetSelect = $(this).find('.' + config.systemDialogSelectClass);
systemTargetSelect.delay(240).initSystemSelect({key: 'id'});
@@ -399,7 +419,7 @@ define([
skipSearch: requestRouteData.length >= defaultRoutesCount
};
requestRouteData.push( getRouteRequestDataFromRowData( searchData ));
requestRouteData.push(getRouteRequestDataFromRowData(searchData));
}
}
}
@@ -493,7 +513,7 @@ define([
settingsDialog.on('shown.bs.modal', function(e){
// init default system select -----------------------------------------------------
// init default system select ---------------------------------------------------------------------
// -> add some delay until modal transition has finished
let systemTargetSelect = $(this).find('.' + config.systemDialogSelectClass);
systemTargetSelect.delay(240).initSystemSelect({key: 'id', maxSelectionLength: maxSelectionLength});
@@ -532,14 +552,13 @@ define([
let wormholeCheckbox = routeDialog.find('input[type="checkbox"][name="wormholes"]');
let wormholeReducedCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesReduced"]');
let wormholeCriticalCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesCritical"]');
let wormholeFrigateCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesFrigate"]');
let wormholeEolCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesEOL"]');
let wormholeSizeSelect = routeDialog.find('#' + config.routeDialogSizeSelectId);
// store current "checked" state for each box ---------------------------------------------
let storeCheckboxStatus = function(){
wormholeReducedCheckbox.data('selectState', wormholeReducedCheckbox.prop('checked'));
wormholeCriticalCheckbox.data('selectState', wormholeCriticalCheckbox.prop('checked'));
wormholeFrigateCheckbox.data('selectState', wormholeFrigateCheckbox.prop('checked'));
wormholeEolCheckbox.data('selectState', wormholeEolCheckbox.prop('checked'));
};
@@ -547,24 +566,24 @@ define([
let onWormholeCheckboxChange = function(){
if( $(this).is(':checked') ){
wormholeSizeSelect.prop('disabled', false);
wormholeReducedCheckbox.prop('disabled', false);
wormholeCriticalCheckbox.prop('disabled', false);
wormholeFrigateCheckbox.prop('disabled', false);
wormholeEolCheckbox.prop('disabled', false);
wormholeReducedCheckbox.prop('checked', wormholeReducedCheckbox.data('selectState'));
wormholeCriticalCheckbox.prop('checked', wormholeCriticalCheckbox.data('selectState'));
wormholeFrigateCheckbox.prop('checked', wormholeFrigateCheckbox.data('selectState'));
wormholeEolCheckbox.prop('checked', wormholeEolCheckbox.data('selectState'));
}else{
wormholeSizeSelect.prop('disabled', true);
storeCheckboxStatus();
wormholeReducedCheckbox.prop('checked', false);
wormholeReducedCheckbox.prop('disabled', true);
wormholeCriticalCheckbox.prop('checked', false);
wormholeCriticalCheckbox.prop('disabled', true);
wormholeFrigateCheckbox.prop('checked', false);
wormholeFrigateCheckbox.prop('disabled', true);
wormholeEolCheckbox.prop('checked', false);
wormholeEolCheckbox.prop('disabled', true);
}
@@ -760,8 +779,9 @@ define([
wormholes: routeData.wormholes,
wormholesReduced: routeData.wormholesReduced,
wormholesCritical: routeData.wormholesCritical,
wormholesFrigate: routeData.wormholesFrigate,
wormholesEOL: routeData.wormholesEOL,
wormholesSizeMin: routeData.wormholesSizeMin,
excludeTypes: routeData.excludeTypes,
endpointsBubble: routeData.endpointsBubble,
connections: {
value: 0,
@@ -861,7 +881,7 @@ define([
tableRowData.route.value = routeJumpElements.join(' ');
}
// route status data ----------------------------------------------------------------------
// route status data ------------------------------------------------------------------------------------------
tableRowData.status = {
value: routeStatus,
formatted: getStatusIcon(routeStatus)
@@ -1300,12 +1320,12 @@ define([
let routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass);
let routesTable = routesTableElement.DataTable();
// init refresh routes --------------------------------------------------------------------
// init refresh routes ----------------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconRefreshClass).on('click', function(e){
updateRoutesTable(moduleElement, routesTable);
});
// init search routes dialog --------------------------------------------------------------
// init search routes dialog ----------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconSearchClass).on('click', function(e){
let maxRouteSearchLimit = this.Init.routeSearch.limit;
@@ -1326,7 +1346,7 @@ define([
Init: Init
}));
// init settings dialog -------------------------------------------------------------------
// init settings dialog ---------------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconSettingsClass).on('click', function(e){
let dialogData = {
mapId: mapId
@@ -1335,7 +1355,7 @@ define([
showSettingsDialog(dialogData, moduleElement, systemFromData, routesTable);
});
// fill routesTable with data -------------------------------------------------------------
// fill routesTable with data --------------------------------------------------------------------------------
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function(dataStore){
// selected systems (if already stored)
@@ -1369,6 +1389,26 @@ define([
tableApi.destroy();
};
/**
* get all jump mass related connection types that have a lower "jumpMassMin" than connectionType
* @param connectionType
* @returns {Array}
*/
let getLowerSizeConnectionTypes = connectionType => {
let lowerSizeTypes = [];
let jumpMassMin = Util.getObjVal(Init.wormholeSizes, connectionType + '.jumpMassMin') || 0;
if(jumpMassMin){
for(let [type, data] of Object.entries(Init.wormholeSizes)){
if(data.jumpMassMin < jumpMassMin){
lowerSizeTypes.push(type);
}
}
}
return lowerSizeTypes;
};
return {
config: config,
getModule: getModule,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -456,25 +456,29 @@ define(['jquery'], ($) => {
jumpMassMin: 1000000000,
type: 'wh_jump_mass_xl',
class: 'pf-jump-mass-xl',
label: 'XL'
label: 'XL',
text: 'capital ships'
},
wh_jump_mass_l: {
jumpMassMin: 300000000,
type: 'wh_jump_mass_l',
class: 'pf-jump-mass-l',
label: 'L'
label: 'L',
text: 'larger ships'
},
wh_jump_mass_m: {
jumpMassMin: 20000000,
type: 'wh_jump_mass_m',
class: 'pf-jump-mass-m',
label: 'M'
label: 'M',
text: 'medium ships'
},
wh_jump_mass_s: {
jumpMassMin: 1000,
type: 'wh_jump_mass_s',
class: 'pf-jump-mass-s',
label: 'S'
label: 'S',
text: 'smallest ships'
}
},
// signature groups

View File

@@ -7,7 +7,7 @@ define([
'app/init',
'app/util',
'bootbox'
], function($, Init, Util, bootbox){
], ($, Init, Util, bootbox) => {
'use strict';
@@ -27,27 +27,16 @@ define([
moduleHeadlineIconClass: 'pf-module-icon-button' // class for toolbar icons in the head
};
/**
* get log time string
* @returns {string}
*/
let getLogTime = function(){
let serverTime = Util.getServerTime();
let logTime = serverTime.toLocaleTimeString('en-US', { hour12: false });
return logTime;
};
/**
* updated "sync status" dynamic dialog area
*/
let updateSyncStatus = function(){
let updateSyncStatus = () => {
// check if task manager dialog is open
let logDialog = $('#' + config.taskDialogId);
if(logDialog.length){
// dialog is open
requirejs(['text!templates/modules/sync_status.html', 'mustache'], function(templateSyncStatus, Mustache){
requirejs(['text!templates/modules/sync_status.html', 'mustache'], (templateSyncStatus, Mustache) => {
let data = {
timestampCounterClass: config.timestampCounterClass,
syncStatus: Init.syncStatus,
@@ -76,7 +65,7 @@ define([
/**
* shows the logging dialog
*/
let showDialog = function(){
let showDialog = () => {
// dialog content
requirejs(['text!templates/dialog/task_manager.html', 'mustache', 'datatables.loader'], function(templateTaskManagerDialog, Mustache){
@@ -110,19 +99,25 @@ define([
extend: 'copy',
tag: 'a',
className: config.moduleHeadlineIconClass,
text: '<i class="fas fa-fw fa-copy"></i> copy'
text: '<i class="fas fa-fw fa-copy"></i> copy',
exportOptions: {
orthogonal: 'export'
}
},
{
extend: 'csv',
tag: 'a',
className: config.moduleHeadlineIconClass,
text: '<i class="fas fa-fw fa-download"></i> csv'
text: '<i class="fas fa-fw fa-download"></i> csv',
exportOptions: {
orthogonal: 'export'
}
}
]
},
paging: true,
ordering: true,
order: [ 1, 'desc' ],
order: [1, 'desc'],
hover: false,
pageLength: 10,
lengthMenu: [[5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, 'All']],
@@ -136,42 +131,69 @@ define([
columnDefs: [
{
targets: 0,
name: 'status',
title: '<i class="fas fa-tag"></i>',
width: '18px',
width: 18,
searchable: false,
class: ['text-center'].join(' '),
data: 'status'
data: 'status',
render: {
display: (cellData, type, rowData, meta) => {
let statusClass = Util.getLogInfo(cellData, 'class');
return '<i class="fas fa-fw fa-circle txt-color ' + statusClass + '"></i>';
}
}
},{
targets: 1,
title: '<i class="far fa-fw fa-clock"></i>&nbsp;&nbsp;',
width: '50px',
name: 'time',
title: '<i class="far fa-fw fa-clock"></i>',
width: 50,
searchable: true,
class: 'text-right',
data: 'time'
data: 'timestamp',
render: {
display: (cellData, type, rowData, meta) => rowData.timestampFormatted
}
},{
targets: 2,
title: '<i class="fas fa-fw fa-history"></i>&nbsp;&nbsp;',
width: '35px',
name: 'duration',
title: '<i class="fas fa-fw fa-history"></i>',
width: 35,
searchable: false,
class: 'text-right',
sType: 'html',
data: 'duration'
data: 'duration',
render: {
display: (cellData, type, rowData, meta) => {
let logStatus = getLogStatusByDuration(rowData.key, cellData);
let statusClass = Util.getLogInfo(logStatus, 'class');
return '<span class="txt-color ' + statusClass + '">' + cellData + '<small>ms</small></span>';
}
}
},{
targets: 3,
name: 'description',
title: 'description',
searchable: true,
data: 'description'
},{
targets: 4,
name: 'logType',
title: 'type',
width: '40px',
width: 40,
searchable: true,
class: ['text-center'].join(' '),
data: 'type'
data: 'logType',
render: {
display: (cellData, type, rowData, meta) => {
let typeIconClass = getLogTypeIconClass(cellData);
return '<i class="fas ' + typeIconClass + '"></i>';
}
}
},{
targets: 5,
title: 'Prozess-ID&nbsp;&nbsp;&nbsp;',
width: '80px',
name: 'process',
title: 'Prozess-ID',
width: 80,
searchable: false,
class: 'text-right',
data: 'key'
@@ -199,10 +221,7 @@ define([
// show Morris graphs ----------------------------------------------------------
// function for chart label formation
let labelYFormat = function(y){
return Math.round(y) + 'ms';
};
let labelYFormat = val => Math.round(val) + 'ms';
for(let key in chartData){
if(chartData.hasOwnProperty(key)){
@@ -243,8 +262,8 @@ define([
});
headline.append(averageElement);
colElementGraph.append( headline );
colElementGraph.append( graphArea );
colElementGraph.append(headline);
colElementGraph.append(graphArea);
graphArea.showLoadingAnimation();
@@ -323,10 +342,10 @@ define([
* @param key
* @param duration (if undefined -> just update graph with current data)
*/
let updateLogGraph = function(key, duration){
let updateLogGraph = (key, duration) => {
// check if graph data already exist
if( !(chartData.hasOwnProperty(key))){
if(!(chartData.hasOwnProperty(key))){
chartData[key] = {};
chartData[key].data = [];
chartData[key].graph = null;
@@ -343,7 +362,7 @@ define([
chartData[key].data = chartData[key].data.slice(0, maxGraphDataCount);
}
function getGraphData(data){
let getGraphData = data => {
let tempChartData = {
data: [],
dataSum: 0,
@@ -354,7 +373,7 @@ define([
let value = 0;
if(data[x]){
value = data[x];
tempChartData.dataSum = Number( (tempChartData.dataSum + value).toFixed(2) );
tempChartData.dataSum = Number((tempChartData.dataSum + value).toFixed(2));
}
tempChartData.data.push({
@@ -364,10 +383,10 @@ define([
}
// calculate average
tempChartData.average = Number( ( tempChartData.dataSum / data.length ).toFixed(2) );
tempChartData.average = Number((tempChartData.dataSum / data.length).toFixed(2));
return tempChartData;
}
};
let tempChartData = getGraphData(chartData[key].data);
@@ -376,17 +395,17 @@ define([
let avgElement = chartData[key].averageElement;
let updateElement = chartData[key].updateElement;
let delay = Util.getCurrentTriggerDelay( key, 0 );
let delay = Util.getCurrentTriggerDelay(key, 0);
if(delay){
updateElement[0].textContent = ' delay: ' + delay + 'ms ';
updateElement[0].textContent = ' delay: ' + delay.toFixed(2) + ' ms';
}
// set/change average line
chartData[key].graph.options.goals = [tempChartData.average];
// change avg. display
avgElement[0].textContent = 'Avg. ' + tempChartData.average + 'ms';
avgElement[0].textContent = 'avg. ' + tempChartData.average.toFixed(2) + ' ms';
let avgStatus = getLogStatusByDuration(key, tempChartData.average);
let avgStatusClass = Util.getLogInfo( avgStatus, 'class');
@@ -419,9 +438,9 @@ define([
* @param logDuration
* @returns {string}
*/
let getLogStatusByDuration = function(logKey, logDuration){
let getLogStatusByDuration = (logKey, logDuration) => {
let logStatus = 'info';
if( logDuration > Init.timer[logKey].EXECUTION_LIMIT ){
if(logDuration > Init.timer[logKey].EXECUTION_LIMIT){
logStatus = 'warning';
}
return logStatus;
@@ -432,8 +451,7 @@ define([
* @param logType
* @returns {string}
*/
let getLogTypeIconClass = function(logType){
let getLogTypeIconClass = logType => {
let logIconClass = '';
switch(logType){
@@ -472,24 +490,23 @@ define([
let logDuration = options.duration;
let logType = options.type;
// check log status by duration
let logStatus = getLogStatusByDuration(logKey, logDuration);
let statusClass = Util.getLogInfo( logStatus, 'class');
let typeIconClass = getLogTypeIconClass(logType);
// update graph data
updateLogGraph(logKey, logDuration);
let time = Util.getServerTime();
let timestamp = time.getTime();
let timestampFormatted = time.toLocaleTimeString('en-US', { hour12: false });
let logRowData = {
status: '<i class="fas fa-fw fa-circle txt-color ' + statusClass + '"></i>',
time: getLogTime(),
duration: '<span class="txt-color ' + statusClass + '">' + logDuration + '<small>ms</small></span>',
status: getLogStatusByDuration(logKey, logDuration),
timestamp: timestamp,
timestampFormatted: timestampFormatted,
duration: logDuration,
description: logDescription,
type: '<i class="fas ' + typeIconClass + '"></i>',
logType: logType,
key: logKey
};
if(logDataTable){
// add row if dataTable is initialized before new log
logDataTable.row.add( logRowData ).draw(false);
@@ -502,7 +519,7 @@ define([
// delete old log entries from table ---------------------------------
let rowCount = logData.length;
if( rowCount >= maxEntries ){
if(rowCount >= maxEntries){
if(logDataTable){
logDataTable.rows(0, {order:'index'}).remove().draw(false);
@@ -522,7 +539,6 @@ define([
return {
init: init,
getLogTime: getLogTime,
showDialog: showDialog
};
});

View File

@@ -1214,13 +1214,21 @@ define([
});
};
/**
* get all available connection types for "jump mass size"
* @returns {string[]}
*/
let allConnectionJumpMassTypes = () => {
return ['wh_jump_mass_s', 'wh_jump_mass_m', 'wh_jump_mass_l', 'wh_jump_mass_xl'];
};
/**
* set/change connection jump mass of a wormhole
* @param connection
* @param mass
*/
let setConnectionJumpMassType = (connection, mass) => {
let allMassTypes = ['wh_jump_mass_s', 'wh_jump_mass_m', 'wh_jump_mass_l', 'wh_jump_mass_xl'];
let allMassTypes = allConnectionJumpMassTypes();
let addMassType = [];
let removeMassTypes = [];
@@ -2075,6 +2083,7 @@ define([
checkForConnection: checkForConnection,
getDefaultConnectionTypeByScope: getDefaultConnectionTypeByScope,
setConnectionWHStatus: setConnectionWHStatus,
allConnectionJumpMassTypes: allConnectionJumpMassTypes,
setConnectionJumpMassType: setConnectionJumpMassType,
getScopeInfoForConnection: getScopeInfoForConnection,
getDataByConnections: getDataByConnections,

View File

@@ -54,18 +54,16 @@ define([
moduleClass: 'pf-module', // class for a module
moduleSpacerClass: 'pf-module-spacer', // class for "spacer" module (preserves height during hide/show animation)
moduleClosedClass: 'pf-module-closed' // class for a closed module
};
let mapTabChangeBlocked = false; // flag for preventing map tab switch
/**
* get all maps for a maps module
* @returns {*}
* @param mapModule
* @returns {jQuery}
*/
$.fn.getMaps = function(){
return $(this).find('.' + config.mapClass);
};
let getMaps = mapModule => $(mapModule).find('.' + config.mapClass);
/**
* get the current active mapElement
@@ -1345,7 +1343,7 @@ define([
*/
let getMapModuleDataForUpdate = mapModule => {
// get all active map elements for module
let mapElements = mapModule.getMaps();
let mapElements = getMaps(mapModule);
let data = [];
for(let i = 0; i < mapElements.length; i++){

View File

@@ -211,6 +211,53 @@ define([
);
};
/**
* init a select element as "select2" for connection size types
* @param options
*/
$.fn.initConnectionSizeSelect = function(options){
let selectElement = $(this);
let defaultConfig = {
dropdownParent: selectElement.parents('.modal-body'),
minimumResultsForSearch: -1,
width: '100%',
maxSelectionLength: 1
};
options = $.extend({}, defaultConfig, options);
let formatConnectionSizeResultData = data => {
if(data.loading) return data.text;
if(data.placeholder) return data.placeholder;
let connectionClass = MapUtil.getConnectionInfo(data.text, 'cssClass');
let label = Util.getObjVal(Init.wormholeSizes, data.text + '.label') || '?';
let text = Util.getObjVal(Init.wormholeSizes, data.text + '.text') || 'all';
let markup = '<div class="clearfix">';
markup += '<div class="col-xs-1">';
markup += '<i class="fas fa-char fa-fw" data-char-content="' + label + '"></i>';
markup += '</div>';
markup += '<div class="col-xs-3">';
markup += '<div class="pf-fake-connection ' + connectionClass + '"></div>';
markup += '</div>';
markup += '<div class="col-xs-8">';
markup += text;
markup += '</div>';
markup += '</div>';
return $(markup);
};
options.templateSelection = formatConnectionSizeResultData;
options.templateResult = formatConnectionSizeResultData;
$.when(
selectElement.select2(options)
);
};
/**
* init a sselect element as "select2" for "status" selection
* @param options

View File

@@ -34,7 +34,9 @@ define([
routeDialogId: 'pf-route-dialog', // id for route "search" dialog
systemDialogSelectClass: 'pf-system-dialog-select', // class for system select Element
systemInfoRoutesTableClass: 'pf-system-route-table', // class for route tables
mapSelectId: 'pf-route-dialog-map-select', // id for "map" select
routeDialogMapSelectId: 'pf-route-dialog-map-select', // id for "map" select
routeDialogSizeSelectId: 'pf-route-dialog-size-select', // id for "wh size" select
dataTableActionCellClass: 'pf-table-action-cell', // class for "action" cells
dataTableRouteCellClass: 'pf-table-route-cell', // class for "route" cells
@@ -207,8 +209,8 @@ define([
};
let routeData = [];
dataTable.rows().every( function(){
routeData.push( getRouteRequestDataFromRowData(this.data()));
dataTable.rows().every(function(){
routeData.push(getRouteRequestDataFromRowData(this.data()));
});
getRouteData({routeData: routeData}, context, callbackAddRouteRows);
@@ -219,7 +221,7 @@ define([
* @param {Object} rowData
* @returns {Object}
*/
let getRouteRequestDataFromRowData = (rowData) => {
let getRouteRequestDataFromRowData = rowData => {
return {
mapIds: (rowData.hasOwnProperty('mapIds')) ? rowData.mapIds : [],
systemFromData: (rowData.hasOwnProperty('systemFromData')) ? rowData.systemFromData : {},
@@ -230,8 +232,9 @@ define([
wormholes: (rowData.hasOwnProperty('wormholes')) ? rowData.wormholes | 0 : 1,
wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced | 0 : 1,
wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical | 0 : 1,
wormholesFrigate: (rowData.hasOwnProperty('wormholesFrigate')) ? rowData.wormholesFrigate | 0 : 1,
wormholesEOL: (rowData.hasOwnProperty('wormholesEOL')) ? rowData.wormholesEOL | 0 : 1,
wormholesSizeMin: (rowData.hasOwnProperty('wormholesSizeMin')) ? rowData.wormholesSizeMin : '',
excludeTypes: (rowData.hasOwnProperty('excludeTypes')) ? rowData.excludeTypes : [],
endpointsBubble: (rowData.hasOwnProperty('endpointsBubble')) ? rowData.endpointsBubble | 0 : 1,
connections: (rowData.hasOwnProperty('connections')) ? rowData.connections.value | 0 : 0,
flag: (rowData.hasOwnProperty('flag')) ? rowData.flag.value : 'shortest'
@@ -255,13 +258,25 @@ define([
});
}
}
let sizeOptions = MapUtil.allConnectionJumpMassTypes().map(type => {
return {
id: type,
name: type,
selected: false
};
});
let data = {
id: config.routeDialogId,
select2Class: Util.config.select2Class,
selectClass: config.systemDialogSelectClass,
mapSelectId: config.mapSelectId,
routeDialogMapSelectId: config.routeDialogMapSelectId,
routeDialogSizeSelectId: config.routeDialogSizeSelectId,
systemFromData: dialogData.systemFromData,
systemToData: dialogData.systemToData,
mapSelectOptions: mapSelectOptions
mapSelectOptions: mapSelectOptions,
sizeOptions: sizeOptions
};
requirejs(['text!templates/dialog/route.html', 'mustache'], (template, Mustache) => {
@@ -300,6 +315,7 @@ define([
}
// get all system data from select2
// -> we could also get value from "routeDialogData" var, but we need systemName also
let systemSelectData = form.find('.' + config.systemDialogSelectClass).select2('data');
if(
@@ -324,8 +340,9 @@ define([
wormholes: routeDialogData.hasOwnProperty('wormholes') ? parseInt(routeDialogData.wormholes) : 0,
wormholesReduced: routeDialogData.hasOwnProperty('wormholesReduced') ? parseInt(routeDialogData.wormholesReduced) : 0,
wormholesCritical: routeDialogData.hasOwnProperty('wormholesCritical') ? parseInt(routeDialogData.wormholesCritical) : 0,
wormholesFrigate: routeDialogData.hasOwnProperty('wormholesFrigate') ? parseInt(routeDialogData.wormholesFrigate) : 0,
wormholesEOL: routeDialogData.hasOwnProperty('wormholesEOL') ? parseInt(routeDialogData.wormholesEOL) : 0,
wormholesSizeMin: routeDialogData.wormholesSizeMin || '',
excludeTypes: getLowerSizeConnectionTypes(routeDialogData.wormholesSizeMin),
endpointsBubble: routeDialogData.hasOwnProperty('endpointsBubble') ? parseInt(routeDialogData.endpointsBubble) : 0
}]
};
@@ -343,15 +360,18 @@ define([
// init some dialog/form observer
setDialogObserver( $(this) );
// init map select ----------------------------------------------------------------
let mapSelect = $(this).find('#' + config.mapSelectId);
// init map select ------------------------------------------------------------------------------------
let mapSelect = findRouteDialog.find('#' + config.routeDialogMapSelectId);
mapSelect.initMapSelect();
// init connection jump size select -------------------------------------------------------------------
findRouteDialog.find('#' + config.routeDialogSizeSelectId).initConnectionSizeSelect();
});
findRouteDialog.on('shown.bs.modal', function(e){
// init system select live search ------------------------------------------------
// init system select live search --------------------------------------------------------------------
// -> add some delay until modal transition has finished
let systemTargetSelect = $(this).find('.' + config.systemDialogSelectClass);
systemTargetSelect.delay(240).initSystemSelect({key: 'id'});
@@ -399,7 +419,7 @@ define([
skipSearch: requestRouteData.length >= defaultRoutesCount
};
requestRouteData.push( getRouteRequestDataFromRowData( searchData ));
requestRouteData.push(getRouteRequestDataFromRowData(searchData));
}
}
}
@@ -493,7 +513,7 @@ define([
settingsDialog.on('shown.bs.modal', function(e){
// init default system select -----------------------------------------------------
// init default system select ---------------------------------------------------------------------
// -> add some delay until modal transition has finished
let systemTargetSelect = $(this).find('.' + config.systemDialogSelectClass);
systemTargetSelect.delay(240).initSystemSelect({key: 'id', maxSelectionLength: maxSelectionLength});
@@ -532,14 +552,13 @@ define([
let wormholeCheckbox = routeDialog.find('input[type="checkbox"][name="wormholes"]');
let wormholeReducedCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesReduced"]');
let wormholeCriticalCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesCritical"]');
let wormholeFrigateCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesFrigate"]');
let wormholeEolCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesEOL"]');
let wormholeSizeSelect = routeDialog.find('#' + config.routeDialogSizeSelectId);
// store current "checked" state for each box ---------------------------------------------
let storeCheckboxStatus = function(){
wormholeReducedCheckbox.data('selectState', wormholeReducedCheckbox.prop('checked'));
wormholeCriticalCheckbox.data('selectState', wormholeCriticalCheckbox.prop('checked'));
wormholeFrigateCheckbox.data('selectState', wormholeFrigateCheckbox.prop('checked'));
wormholeEolCheckbox.data('selectState', wormholeEolCheckbox.prop('checked'));
};
@@ -547,24 +566,24 @@ define([
let onWormholeCheckboxChange = function(){
if( $(this).is(':checked') ){
wormholeSizeSelect.prop('disabled', false);
wormholeReducedCheckbox.prop('disabled', false);
wormholeCriticalCheckbox.prop('disabled', false);
wormholeFrigateCheckbox.prop('disabled', false);
wormholeEolCheckbox.prop('disabled', false);
wormholeReducedCheckbox.prop('checked', wormholeReducedCheckbox.data('selectState'));
wormholeCriticalCheckbox.prop('checked', wormholeCriticalCheckbox.data('selectState'));
wormholeFrigateCheckbox.prop('checked', wormholeFrigateCheckbox.data('selectState'));
wormholeEolCheckbox.prop('checked', wormholeEolCheckbox.data('selectState'));
}else{
wormholeSizeSelect.prop('disabled', true);
storeCheckboxStatus();
wormholeReducedCheckbox.prop('checked', false);
wormholeReducedCheckbox.prop('disabled', true);
wormholeCriticalCheckbox.prop('checked', false);
wormholeCriticalCheckbox.prop('disabled', true);
wormholeFrigateCheckbox.prop('checked', false);
wormholeFrigateCheckbox.prop('disabled', true);
wormholeEolCheckbox.prop('checked', false);
wormholeEolCheckbox.prop('disabled', true);
}
@@ -760,8 +779,9 @@ define([
wormholes: routeData.wormholes,
wormholesReduced: routeData.wormholesReduced,
wormholesCritical: routeData.wormholesCritical,
wormholesFrigate: routeData.wormholesFrigate,
wormholesEOL: routeData.wormholesEOL,
wormholesSizeMin: routeData.wormholesSizeMin,
excludeTypes: routeData.excludeTypes,
endpointsBubble: routeData.endpointsBubble,
connections: {
value: 0,
@@ -861,7 +881,7 @@ define([
tableRowData.route.value = routeJumpElements.join(' ');
}
// route status data ----------------------------------------------------------------------
// route status data ------------------------------------------------------------------------------------------
tableRowData.status = {
value: routeStatus,
formatted: getStatusIcon(routeStatus)
@@ -1300,12 +1320,12 @@ define([
let routesTableElement = moduleElement.find('.' + config.systemInfoRoutesTableClass);
let routesTable = routesTableElement.DataTable();
// init refresh routes --------------------------------------------------------------------
// init refresh routes ----------------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconRefreshClass).on('click', function(e){
updateRoutesTable(moduleElement, routesTable);
});
// init search routes dialog --------------------------------------------------------------
// init search routes dialog ----------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconSearchClass).on('click', function(e){
let maxRouteSearchLimit = this.Init.routeSearch.limit;
@@ -1326,7 +1346,7 @@ define([
Init: Init
}));
// init settings dialog -------------------------------------------------------------------
// init settings dialog ---------------------------------------------------------------------------------------
moduleElement.find('.' + config.moduleHeadlineIconSettingsClass).on('click', function(e){
let dialogData = {
mapId: mapId
@@ -1335,7 +1355,7 @@ define([
showSettingsDialog(dialogData, moduleElement, systemFromData, routesTable);
});
// fill routesTable with data -------------------------------------------------------------
// fill routesTable with data --------------------------------------------------------------------------------
let promiseStore = MapUtil.getLocaleData('map', mapId);
promiseStore.then(function(dataStore){
// selected systems (if already stored)
@@ -1369,6 +1389,26 @@ define([
tableApi.destroy();
};
/**
* get all jump mass related connection types that have a lower "jumpMassMin" than connectionType
* @param connectionType
* @returns {Array}
*/
let getLowerSizeConnectionTypes = connectionType => {
let lowerSizeTypes = [];
let jumpMassMin = Util.getObjVal(Init.wormholeSizes, connectionType + '.jumpMassMin') || 0;
if(jumpMassMin){
for(let [type, data] of Object.entries(Init.wormholeSizes)){
if(data.jumpMassMin < jumpMassMin){
lowerSizeTypes.push(type);
}
}
}
return lowerSizeTypes;
};
return {
config: config,
getModule: getModule,

View File

@@ -2,7 +2,7 @@
<form role="form" class="form-horizontal">
<div class="row">
<div class="col-sm-5">
<div class="col-sm-4">
<div class="form-group">
<label class="col-sm-3 col-xs-2 control-label">From</label>
<div class="col-sm-9 col-xs-10">
@@ -16,7 +16,7 @@
</div>
</div>
<div class="col-sm-7">
<div class="col-sm-8">
<div class="form-group">
<label class="col-sm-2 col-xs-2 control-label" for="to_system">To</label>
<div class="col-sm-10 col-xs-10">
@@ -38,7 +38,7 @@
<h4 class="pf-dynamic-area">Search options</h4>
<div class="row">
<div class="col-sm-5">
<div class="col-sm-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 col-xs-6 checkbox checkbox-primary" title="include stargate connections">
@@ -54,12 +54,12 @@
</div>
</div>
<div class="col-sm-7">
<div class="col-sm-8">
<div class="form-group">
<label class="col-sm-2 control-label" for="{{mapSelectId}}">Maps</label>
<label class="col-sm-2 control-label" for="{{routeDialogMapSelectId}}">Maps</label>
<div class="col-sm-10">
<div class="input-group">
<select id="{{mapSelectId}}" name="mapIds[]" multiple="multiple">
<select id="{{routeDialogMapSelectId}}" name="mapIds[]" multiple="multiple">
{{#mapSelectOptions}}
<option value="{{id}}" {{#selected}}selected{{/selected}}>{{name}}</option>
{{/mapSelectOptions}}
@@ -76,7 +76,7 @@
{{! wormhole ----------------------------------------------------------------- }}
<div class="row">
<div class="col-xs-12 col-sm-4">
<div class="col-xs-6 col-sm-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 checkbox checkbox-primary" title="include wormhole connections">
@@ -87,10 +87,24 @@
</div>
</div>
<div class="col-xs-6 col-sm-4">
<div class="col-xs-6 col-sm-8">
<div class="form-group">
<label for="{{routeDialogSizeSelectId}}" class="col-sm-2 control-label">Size min</label>
<div class="col-sm-10">
<select name="wormholesSizeMin" id="{{routeDialogSizeSelectId}}" class="form-control {{select2Class}}">
<option value="">test</option>
{{#sizeOptions}}
<option value="{{id}}">{{name}}</option>
{{/sizeOptions}}
</select>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-4 col-sm-offset-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 checkbox checkbox-warning checkbox-circle" title="include reduced connections">
<div class="checkbox checkbox-warning checkbox-circle" title="include reduced connections">
<input id="form_wormholes_reduced" name="wormholesReduced" value="1" type="checkbox" checked>
<label for="form_wormholes_reduced">Stage 2 (reduced)</label>
</div>
@@ -101,7 +115,7 @@
<div class="col-xs-6 col-sm-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 checkbox checkbox-danger checkbox-circle" title="include critical connections">
<div class="checkbox checkbox-danger checkbox-circle" title="include critical connections">
<input id="form_wormholes_critical" name="wormholesCritical" value="1" type="checkbox" checked>
<label for="form_wormholes_critical">Stage 3 (critical)</label>
</div>
@@ -109,27 +123,17 @@
</div>
</div>
<div class="col-xs-6 col-sm-4 col-sm-offset-4">
<div class="col-xs-6 col-sm-4 col-xs-offset-6 col-sm-offset-8">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 checkbox checkbox checkbox-circle" title="include frigate connections">
<input id="form_wormholes_frigate" name="wormholesFrigate" value="1" type="checkbox" checked>
<label for="form_wormholes_frigate">Frigate</label>
</div>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 checkbox checkbox-danger checkbox-circle" title="include EOL connections">
<div class="checkbox checkbox-danger checkbox-circle" title="include EOL connections">
<input id="form_wormholes_eol" name="wormholesEOL" value="1" type="checkbox" checked>
<label for="form_wormholes_eol">End of life (EOL)</label>
</div>
</div>
</div>
</div>
</div>
<hr>
@@ -140,7 +144,7 @@
<div class="col-xs-6 col-sm-4">
<div class="form-group">
<div class="col-sm-offset-1 col-sm-11">
<div class="col-sm-12 checkbox checkbox-primary" title="include bubbled connections">
<div class="checkbox checkbox-primary" title="include bubbled connections">
<input id="form_endpoints_bubble" name="endpointsBubble" value="1" type="checkbox" checked>
<label for="form_endpoints_bubble">Bubbled&nbsp;&nbsp;<span class="pf-endpoint-bubble"></span></label>
</div>

View File

@@ -737,8 +737,8 @@
<div class="clearfix visible-sm"></div>
<div class="col-xs-12 col-sm-3 col-md-2 col-lg-2">
<a class="pf-animate-on-visible pf-animate disabled" href="javascript:void(0);" data-description="Database settings" data-gallery="#pf-gallery">
<img class="pf-landing-image-preview pf-landing-image-preview-small" data-original="public/img/landing/thumbs/wip.jpg" width="160" height="160" alt="WIP">
<a class="pf-animate-on-visible pf-animate" href="public/img/landing/admin_2.jpg" data-description="Map settings" data-gallery="#pf-gallery">
<img class="pf-landing-image-preview pf-landing-image-preview-small" data-original="public/img/landing/thumbs/admin_2.jpg" width="160" height="160" alt="Map settings">
</a>
</div>
@@ -998,10 +998,10 @@
Server requirements:
</p>
<ul class="fa-ul pf-landing-list">
<li><i></i> A webserver with a <em><a target="_blank" href="//en.wikipedia.org/wiki/LAMP_(software_bundle)" rel="noopener">LEMP</a></em> environment</li>
<li><i></i> PHP 7.0+</li>
<li><i></i> Webserver with a <em><a target="_blank" href="//en.wikipedia.org/wiki/LAMP_(software_bundle)" rel="noopener">LEMP</a></em> environment</li>
<li><i></i> PHP {{ @REQUIREMENTS.PHP.VERSION }}+</li>
<li><i></i> PHP framework <a target="_blank" href="http://fatfreeframework.com/system-requirements" rel="noopener">requirements</a></li>
<li><i></i> MySQL 5.7+ </li>
<li><i></i> MySQL {{ @REQUIREMENTS.MYSQL.VERSION }}+</li>
<li><i></i> Some kind of server side caching. <em><a target="_blank" href="//redis.io/" rel="noopener">Redis</a></em> is preferred, file cache will also work</li>
</ul>
</div>

View File

@@ -5,8 +5,7 @@
{* counter for DB warnings (all databases) *}
{{ @tplCounter('reset', 'database_warning_all') }}
<section id="pf-setup-server">
<section>
<div class="container">
<div class="row"></div>
@@ -22,12 +21,17 @@
{* Errors *}
<check if="{{ @errorData }}">
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><i class="fas fa-times"></i></button>
<span class="txt-color txt-color-danger">({{ @errorData->code }}) {{ @errorData->status }}</span>
<small> {{ @errorData->message }}</small>
</div>
<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><i class="fas fa-times"></i></button>
<span class="txt-color txt-color-danger">({{ @errorData->code }}) {{ @errorData->status }}</span>
<small> {{ @errorData->message }}</small>
</div>
</check>
</div>
</section>
<section id="pf-setup-server">
<div class="container">
<h4><i class="fas fa-fw fa-home"></i> Server</h4>

View File

@@ -207,6 +207,12 @@
.pf-task-dialog-status{
min-height: inherit;
}
h4>small.pull-right{
font-family: Arial, sans-serif;
font-weight: bold;
margin-top: -5px;
}
}
// map info dialog ============================================================

View File

@@ -6,7 +6,7 @@ $selection-color: #444 !default;
$border-color: $gray-light !default;
$border-radius: 0px !default;
$border-radius-choice: 4px !default;
$border-radius-choice: 2px !default;
$focus-border-color: $teal-lighter !default;

View File

@@ -37,7 +37,7 @@
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px;
margin-right: 4px;
&:hover {
color: $remove-hover-color;

View File

@@ -15,6 +15,10 @@
color: $gray-lighter;
line-height: 1.5;
padding: 0 10px 0 0;
div[class^='col-']:first-child{
padding-left: 0; // overwrite default padding for "selected" option(s) in custom Bootstrap col layout
}
}
.select2-selection__clear {