- improved SQL performance for "route finder" (use mapId column indexes)
- improved pageSpeed (added "preload"/"prefetch" annotations to static resources) - improved "system delete" logic - fixed composer.json - fixed typos
This commit is contained in:
@@ -109,12 +109,14 @@ class Route extends Controller\AccessController {
|
||||
* @param array $filterData
|
||||
*/
|
||||
private function setDynamicJumpData($mapIds = [], $filterData = []){
|
||||
// make sure, mapIds are integers (protect against SQL injections)
|
||||
$mapIds = array_unique( array_map('intval', $mapIds), SORT_NUMERIC);
|
||||
|
||||
if( !empty($mapIds) ){
|
||||
// make sure, mapIds are integers (protect against SQL injections)
|
||||
$mapIds = array_map('intval', $mapIds);
|
||||
// map filter ---------------------------------------------------------------------------------------------
|
||||
$whereMapIdsQuery = (count($mapIds) == 1) ? " = " . reset($mapIds) : " IN (" . implode(', ', $mapIds) . ")";
|
||||
|
||||
// connection filter --------------------------------------------------------
|
||||
// connection filter --------------------------------------------------------------------------------------
|
||||
$whereQuery = "";
|
||||
$includeScopes = [];
|
||||
$includeTypes = [];
|
||||
@@ -157,7 +159,7 @@ class Route extends Controller\AccessController {
|
||||
}
|
||||
}
|
||||
|
||||
// search connections -------------------------------------------------------
|
||||
// search connections -------------------------------------------------------------------------------------
|
||||
|
||||
if( !empty($includeScopes) ){
|
||||
$whereQuery .= " `connection`.`scope` IN ('" . implode("', '", $includeScopes) . "') AND ";
|
||||
@@ -188,7 +190,7 @@ class Route extends Controller\AccessController {
|
||||
`system_tar`.`id` = `connection`.`source` OR
|
||||
`system_tar`.`id` = `connection`.`target`
|
||||
WHERE
|
||||
`connection`.`mapId` IN (" . implode(', ', $mapIds) . ") AND
|
||||
`connection`.`mapId` " . $whereMapIdsQuery . " AND
|
||||
`connection`.`active` = 1 AND
|
||||
(
|
||||
`connection`.`source` = `system_src`.`id` OR
|
||||
@@ -204,7 +206,7 @@ class Route extends Controller\AccessController {
|
||||
`map` ON
|
||||
`map`.`id` = `system_src`.`mapId`
|
||||
WHERE
|
||||
`system_src`.`mapId` IN (" . implode(', ', $mapIds) . ") AND
|
||||
`system_src`.`mapId` " . $whereMapIdsQuery . " AND
|
||||
`system_src`.`active` = 1 AND
|
||||
`map`.`active` = 1
|
||||
HAVING
|
||||
@@ -237,7 +239,7 @@ class Route extends Controller\AccessController {
|
||||
$systemId = (int)$row['systemId'];
|
||||
$secStatus = (float)$row['trueSec'];
|
||||
|
||||
// fill "nameArray" data ----------------------------------------------------
|
||||
// fill "nameArray" data ----------------------------------------------------------------------------------
|
||||
if( !isset($this->nameArray[$systemId]) ){
|
||||
$this->nameArray[$systemId][0] = $systemName;
|
||||
$this->nameArray[$systemId][1] = $regionId;
|
||||
@@ -245,12 +247,12 @@ class Route extends Controller\AccessController {
|
||||
$this->nameArray[$systemId][3] = $secStatus;
|
||||
}
|
||||
|
||||
// fill "idArray" data ------------------------------------------------------
|
||||
// fill "idArray" data ------------------------------------------------------------------------------------
|
||||
if( !isset($this->idArray[$systemName]) ){
|
||||
$this->idArray[$systemName] = $systemId;
|
||||
}
|
||||
|
||||
// fill "jumpArray" data ----------------------------------------------------
|
||||
// fill "jumpArray" data ----------------------------------------------------------------------------------
|
||||
if( !is_array($this->jumpArray[$systemName]) ){
|
||||
$this->jumpArray[$systemName] = [];
|
||||
}
|
||||
@@ -536,7 +538,7 @@ class Route extends Controller\AccessController {
|
||||
$mapData = (array)$routeData['mapIds'];
|
||||
$mapData = array_flip( array_map('intval', $mapData) );
|
||||
|
||||
// check map access (filter requested mapIDs and format) --------------------
|
||||
// check map access (filter requested mapIDs and format) ----------------------------------------------
|
||||
array_walk($mapData, function(&$item, &$key, $data){
|
||||
|
||||
if( isset($data[1][$key]) ){
|
||||
|
||||
@@ -429,14 +429,14 @@ class System extends Controller\AccessController {
|
||||
if( $system = $map->getSystemById($systemId) ){
|
||||
// check whether system should be deleted OR set "inactive"
|
||||
if(
|
||||
empty($system->alias) &&
|
||||
empty($system->description)
|
||||
!empty($system->description) ||
|
||||
( !empty($system->alias) && ($system->alias != $system->name) )
|
||||
){
|
||||
$system->erase();
|
||||
}else{
|
||||
// keep data -> set "inactive"
|
||||
$system->setActive(false);
|
||||
$system->save();
|
||||
}else{
|
||||
$system->erase();
|
||||
}
|
||||
|
||||
$system->reset();
|
||||
|
||||
@@ -283,6 +283,22 @@ class SystemModel extends BasicModel {
|
||||
return $systemData;
|
||||
}
|
||||
|
||||
/**
|
||||
* setter for system alias
|
||||
* @param string $alias
|
||||
* @return string
|
||||
*/
|
||||
public function set_alias($alias){
|
||||
$alias = trim($alias);
|
||||
|
||||
// we don´t need redundant data. "name" is always preferred if "alias" is empty
|
||||
if($alias === $this->name){
|
||||
$alias = '';
|
||||
}
|
||||
|
||||
return $alias;
|
||||
}
|
||||
|
||||
/**
|
||||
* setter for system security value
|
||||
* @param float $trueSec
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
"php-64bit": ">=7.0",
|
||||
"ext-zmq": "1.1.*",
|
||||
"react/zmq": "0.3.*",
|
||||
"exodus4d/pathfinder_esi": "dev-master"
|
||||
"exodus4d/pathfinder_esi": "dev-master#v1.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* map overlay functions for "Near by" table
|
||||
* map overlay functions for "Nearby" table
|
||||
* Created by Exodus on 13.04.2017.
|
||||
*/
|
||||
|
||||
@@ -329,7 +329,7 @@ define([
|
||||
class: config.overlayLocalHeadlineClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
html: 'Near by ',
|
||||
html: 'Nearby ',
|
||||
class: 'pull-left'
|
||||
}),
|
||||
$('<span>'),
|
||||
|
||||
@@ -2893,7 +2893,7 @@ define([
|
||||
// current user system is on this map
|
||||
currentSystemData = currentSystemData[0];
|
||||
|
||||
// check for active users "near by" (x jumps radius)
|
||||
// check for active users "nearby" (x jumps radius)
|
||||
let nearBySystemData = Util.getNearBySystemData(currentSystemData, currentMapData, MapUtil.config.defaultLocalJumpRadius);
|
||||
let nearByCharacterData = Util.getNearByCharacterData(nearBySystemData, userData.data.systems);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ define([
|
||||
|
||||
let config = {
|
||||
mapSnapToGridDimension: 20, // px for grid snapping (grid YxY)
|
||||
defaultLocalJumpRadius: 3, // default search radius (in jumps) for "near by" pilots
|
||||
defaultLocalJumpRadius: 3, // default search radius (in jumps) for "nearby" pilots
|
||||
|
||||
// local storage
|
||||
characterLocalStoragePrefix: 'character_', // prefix for character data local storage key
|
||||
|
||||
@@ -1872,7 +1872,7 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* get current character data from all characters who are "near by" the current user
|
||||
* get current character data from all characters who are "nearby" the current user
|
||||
* -> see getNearBySystemData()
|
||||
* @param nearBySystems
|
||||
* @param userData
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* map overlay functions for "Near by" table
|
||||
* map overlay functions for "Nearby" table
|
||||
* Created by Exodus on 13.04.2017.
|
||||
*/
|
||||
|
||||
@@ -329,7 +329,7 @@ define([
|
||||
class: config.overlayLocalHeadlineClass
|
||||
}).append(
|
||||
$('<span>', {
|
||||
html: 'Near by ',
|
||||
html: 'Nearby ',
|
||||
class: 'pull-left'
|
||||
}),
|
||||
$('<span>'),
|
||||
|
||||
@@ -2893,7 +2893,7 @@ define([
|
||||
// current user system is on this map
|
||||
currentSystemData = currentSystemData[0];
|
||||
|
||||
// check for active users "near by" (x jumps radius)
|
||||
// check for active users "nearby" (x jumps radius)
|
||||
let nearBySystemData = Util.getNearBySystemData(currentSystemData, currentMapData, MapUtil.config.defaultLocalJumpRadius);
|
||||
let nearByCharacterData = Util.getNearByCharacterData(nearBySystemData, userData.data.systems);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ define([
|
||||
|
||||
let config = {
|
||||
mapSnapToGridDimension: 20, // px for grid snapping (grid YxY)
|
||||
defaultLocalJumpRadius: 3, // default search radius (in jumps) for "near by" pilots
|
||||
defaultLocalJumpRadius: 3, // default search radius (in jumps) for "nearby" pilots
|
||||
|
||||
// local storage
|
||||
characterLocalStoragePrefix: 'character_', // prefix for character data local storage key
|
||||
|
||||
@@ -1872,7 +1872,7 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* get current character data from all characters who are "near by" the current user
|
||||
* get current character data from all characters who are "nearby" the current user
|
||||
* -> see getNearBySystemData()
|
||||
* @param nearBySystems
|
||||
* @param userData
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="panel-body no-padding text-align-center">
|
||||
<div class="price-features" style="min-height: inherit;">
|
||||
<ul class="list-unstyled text-left">
|
||||
<li><i class="fa fa-fw fa-angle-right"></i>New "<em><a target="_blank" href="https://github.com/exodus4d/pathfinder/issues/481#issue-223584078">Near by</a></em>" map overlay shows active pilots within 3 jumps around your current location</li>
|
||||
<li><i class="fa fa-fw fa-angle-right"></i>New "<em><a target="_blank" href="https://github.com/exodus4d/pathfinder/issues/481#issue-223584078">Nearby</a></em>" map overlay shows active pilots within 3 jumps around your current location</li>
|
||||
<li><i class="fa fa-fw fa-angle-right"></i>Switch to <em>CCPs</em> new <a target="_blank" href="https://community.eveonline.com/news/dev-blogs/introducing-esi/">ESI API</a>. Replaces CREST API.</li>
|
||||
<li><i class="fa fa-fw fa-angle-right"></i>New UI options added. E.g. Remote open inGame information windows</li>
|
||||
<li><i class="fa fa-fw fa-angle-right"></i>Added new filter option for "<em>Frigat wormholes</em>" to route finder</li>
|
||||
|
||||
@@ -53,7 +53,25 @@
|
||||
{* Youtube verification code *}
|
||||
<meta name="google-site-verification" content="sHoh0gfMw3x1wiwLTK5OsKsxt7kRgxi69hRgWEGh9DQ" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{ @BASE }}/public/css/pathfinder.css?{{ @PATHFINDER.VERSION }}">
|
||||
{* Resources *}
|
||||
<set pathCSS="{{ @BASE . '/public/css/pathfinder.css?' . @PATHFINDER.VERSION }}" />
|
||||
<set pathJSApp="{{ @BASE . '/' . @pathJs . '/app' }}" />
|
||||
<set pathJSRequire="{{ @BASE . '/' . @pathJs . '/lib/require.js' }}" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="{{@pathCSS}}">
|
||||
|
||||
{* Prefetch / Preload *}
|
||||
<link rel="preload" href="{{@pathCSS}}" as="style">
|
||||
<link rel="preload" href="{{@pathJSRequire}}" as="script">
|
||||
<link rel="preload" href="{{@pathJSApp}}.js" as="script">
|
||||
<link rel="preload" href="{{@pathJSApp}}/{{@jsView}}.js" as="script">
|
||||
<link rel="dns-prefetch" href="https://login.eveonline.com">
|
||||
<link rel="dns-prefetch" href="https://image.eveonline.com">
|
||||
<link rel="dns-prefetch" href="https://i.ytimg.com">
|
||||
|
||||
<check if="{{ @jsView != 'mappage' }}">
|
||||
<link rel="prefetch" href="{{@pathJSApp}}/mappage.js" as="script">
|
||||
</check>
|
||||
|
||||
</head>
|
||||
<body class="{{ @bodyClass }}" data-js-path="{{ @BASE }}/{{ @pathJs }}" data-script="{{ @jsView }}" data-version="{{ @PATHFINDER.VERSION }}">
|
||||
@@ -61,7 +79,7 @@
|
||||
|
||||
<!-- Hey dude! Where is all the magic? -->
|
||||
|
||||
<script data-main="{{ @BASE }}/{{ @pathJs }}/app" src="{{ @BASE }}/{{ @pathJs }}/lib/require.js" ></script>
|
||||
<script data-main="{{@pathJSApp}}" src="{{@pathJSRequire}}" ></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user