- WIP: "Thera" wormhole connections from eve-scout.com integration, #829
This commit is contained in:
@@ -36,8 +36,6 @@ class GitHub extends Controller\Controller {
|
||||
$return->version->delta = null;
|
||||
$return->version->dev = false;
|
||||
|
||||
$md = \Markdown::instance();
|
||||
|
||||
$releases = $f3->gitHubClient()->getProjectReleases('exodus4d/pathfinder', $releaseCount);
|
||||
|
||||
foreach($releases as $key => &$release){
|
||||
@@ -75,7 +73,7 @@ class GitHub extends Controller\Controller {
|
||||
if(!empty($html)){
|
||||
$body = $html;
|
||||
}else{
|
||||
$body = $md->convert(trim($body));
|
||||
$body = \Markdown::instance()->convert(trim($body));
|
||||
}
|
||||
|
||||
$release['body'] = $body;
|
||||
|
||||
@@ -20,6 +20,11 @@ use Model\Pathfinder;
|
||||
*/
|
||||
class Route extends Controller\AccessController {
|
||||
|
||||
/**
|
||||
* cache key for current Thera connections from eve-scout.com
|
||||
*/
|
||||
const CACHE_KEY_THERA_CONNECTIONS = 'CACHED_THERA_CONNECTIONS';
|
||||
|
||||
/**
|
||||
* route search depth
|
||||
*/
|
||||
@@ -43,6 +48,12 @@ class Route extends Controller\AccessController {
|
||||
*/
|
||||
private $dynamicJumpDataCacheTime = 10;
|
||||
|
||||
/**
|
||||
* cache time for Thera connections from eve-scout.com
|
||||
* @var int
|
||||
*/
|
||||
private $theraJumpDataCacheTime = 60;
|
||||
|
||||
/**
|
||||
* array system information grouped by systemId
|
||||
* @var array
|
||||
@@ -229,11 +240,11 @@ class Route extends Controller\AccessController {
|
||||
!is_null($staticData = $universe->getSystemData($row[$systemSourceKey]))
|
||||
){
|
||||
$jumpData[$row[$systemSourceKey]] = [
|
||||
'systemId' => (int)$row[$systemSourceKey],
|
||||
'systemName' => $staticData->name,
|
||||
'constellationId' => $staticData->constellation->id,
|
||||
'regionId' => $staticData->constellation->region->id,
|
||||
'trueSec' => $staticData->trueSec,
|
||||
'systemId' => (int)$row[$systemSourceKey],
|
||||
'systemName' => $staticData->name,
|
||||
'constellationId' => $staticData->constellation->id,
|
||||
'regionId' => $staticData->constellation->region->id,
|
||||
'trueSec' => $staticData->trueSec,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -247,20 +258,70 @@ class Route extends Controller\AccessController {
|
||||
$enrichJumpData($rows[$i], 'systemTargetId', 'systemSourceId');
|
||||
}
|
||||
|
||||
// update jump data for this instance
|
||||
$this->updateJumpData($jumpData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* set current Thera connections jump data for this instance
|
||||
* -> Connected wormholes pulled from eve-scout.com
|
||||
*/
|
||||
private function setTheraJumpData(){
|
||||
if(!$this->getF3()->exists(self::CACHE_KEY_THERA_CONNECTIONS, $jumpData)){
|
||||
$jumpData = [];
|
||||
$connectionsData = $this->getF3()->eveScoutClient()->getTheraConnections();
|
||||
|
||||
if(!empty($connectionsData) && !isset($connectionsData['error'])){
|
||||
/**
|
||||
* map Thera jump data to Pathfinder format
|
||||
* @param array $row
|
||||
* @param string $systemSourceKey
|
||||
* @param string $systemTargetKey
|
||||
*/
|
||||
$enrichJumpData = function(array &$row, string $systemSourceKey, string $systemTargetKey) use (&$jumpData) {
|
||||
// check if response data is valid
|
||||
if(
|
||||
is_object($systemSource = $row[$systemSourceKey]) && !empty((array)$systemSource) &&
|
||||
is_object($systemTarget = $row[$systemTargetKey]) && !empty((array)$systemTarget)
|
||||
){
|
||||
if(!array_key_exists($systemSource->id, $jumpData)){
|
||||
$jumpData[$systemSource->id] = [
|
||||
'systemId' => (int)$systemSource->id,
|
||||
'systemName' => $systemSource->name,
|
||||
'constellationId' => (int)$systemSource->constellationID,
|
||||
'regionId' => (int)$systemSource->regionId,
|
||||
'trueSec' => $systemSource->security,
|
||||
];
|
||||
}
|
||||
|
||||
if( !in_array((int)$systemTarget->id, (array)$jumpData[$systemSource->id]['jumpNodes']) ){
|
||||
$jumpData[$systemSource->id]['jumpNodes'][] = (int)$systemTarget->id;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
foreach((array)$connectionsData['connections'] as $connectionData){
|
||||
$enrichJumpData($connectionData, 'source', 'target');
|
||||
$enrichJumpData($connectionData, 'target', 'source');
|
||||
}
|
||||
|
||||
if(!empty($jumpData)){
|
||||
$this->getF3()->set(self::CACHE_KEY_THERA_CONNECTIONS, $jumpData, $this->theraJumpDataCacheTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->updateJumpData($jumpData);
|
||||
}
|
||||
|
||||
/**
|
||||
* update jump data for this instance
|
||||
* -> data is either coming from CCPs [SDE] OR from map specific data
|
||||
* @param array $rows
|
||||
*/
|
||||
private function updateJumpData(&$rows = []){
|
||||
|
||||
foreach($rows as &$row){
|
||||
$regionId = (int)$row['regionId'];
|
||||
$constId = (int)$row['constellationId'];
|
||||
@@ -448,7 +509,7 @@ class Route extends Controller\AccessController {
|
||||
|
||||
// Endpoint return http:404 in case no route find (e.g. from inside a wh)
|
||||
// we thread that error "no route found" as a valid response! -> no fallback to custom search
|
||||
if( !empty($routeData['error']) && strtolower($routeData['error']) !== 'no route found' ){
|
||||
if(!empty($routeData['error']) && strtolower($routeData['error']) !== 'no route found'){
|
||||
// ESI route search has errors -> fallback to custom search implementation
|
||||
$routeData = $this->searchRouteCustom($systemFromId, $systemToId, $searchDepth, $mapIds, $filterData);
|
||||
}
|
||||
@@ -484,6 +545,11 @@ class Route extends Controller\AccessController {
|
||||
// add map specific data
|
||||
$this->setDynamicJumpData($mapIds, $filterData);
|
||||
|
||||
// add current Thera connections data
|
||||
if($filterData['wormholesThera']){
|
||||
$this->setTheraJumpData();
|
||||
}
|
||||
|
||||
// filter jump data (e.g. remove some systems (0.0, LS)
|
||||
// --> don´t filter some systems (e.g. systemFrom, systemTo) even if they are are WH,LS,0.0
|
||||
$this->filterJumpData($filterData, [$systemFromId, $systemToId]);
|
||||
@@ -494,10 +560,10 @@ class Route extends Controller\AccessController {
|
||||
$jumpNum = 0;
|
||||
$depthSearched = 0;
|
||||
|
||||
if( isset($this->jumpArray[$systemFromId]) ){
|
||||
if(isset($this->jumpArray[$systemFromId])){
|
||||
// check if the system we are looking for is a direct neighbour
|
||||
foreach( $this->jumpArray[$systemFromId] as $n ) {
|
||||
if ($n == $systemToId) {
|
||||
foreach($this->jumpArray[$systemFromId] as $n){
|
||||
if($n == $systemToId){
|
||||
$jumpNum = 2;
|
||||
$routeData['route'][] = $this->getJumpNodeData($n);
|
||||
break;
|
||||
@@ -505,23 +571,23 @@ class Route extends Controller\AccessController {
|
||||
}
|
||||
|
||||
// system is not a direct neighbour -> search recursive its neighbours
|
||||
if ($jumpNum == 0) {
|
||||
if($jumpNum == 0){
|
||||
$searchResult = $this->graph_find_path( $this->jumpArray, $systemFromId, $systemToId, $searchDepth );
|
||||
$depthSearched = $searchResult['depth'];
|
||||
foreach( $searchResult['path'] as $systemId ) {
|
||||
if ($jumpNum > 0) {
|
||||
foreach($searchResult['path'] as $systemId){
|
||||
if($jumpNum > 0){
|
||||
$routeData['route'][] = $this->getJumpNodeData($systemId);
|
||||
}
|
||||
$jumpNum++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($jumpNum > 0) {
|
||||
if($jumpNum > 0){
|
||||
// route found
|
||||
$routeData['routePossible'] = true;
|
||||
// insert "from" system on top
|
||||
array_unshift($routeData['route'], $this->getJumpNodeData($systemFromId));
|
||||
} else {
|
||||
}else{
|
||||
// route not found
|
||||
$routeData['routePossible'] = false;
|
||||
}
|
||||
@@ -566,6 +632,11 @@ class Route extends Controller\AccessController {
|
||||
// add map specific data
|
||||
$this->setDynamicJumpData($mapIds, $filterData);
|
||||
|
||||
// add current Thera connections data
|
||||
if($filterData['wormholesThera']){
|
||||
$this->setTheraJumpData();
|
||||
}
|
||||
|
||||
// filter jump data (e.g. remove some systems (0.0, LS)
|
||||
// --> don´t filter some systems (e.g. systemFrom, systemTo) even if they are are WH,LS,0.0
|
||||
$this->filterJumpData($filterData, [$systemFromId, $systemToId]);
|
||||
@@ -576,7 +647,7 @@ class Route extends Controller\AccessController {
|
||||
if($count > 1){
|
||||
// ... should always > 1
|
||||
// loop all connections for current source system
|
||||
foreach($jumpData as $systemTargetId) {
|
||||
foreach($jumpData as $systemTargetId){
|
||||
// skip last entry
|
||||
if(--$count <= 0){
|
||||
break;
|
||||
@@ -736,6 +807,7 @@ class Route extends Controller\AccessController {
|
||||
'wormholesReduced' => (bool) $routeData['wormholesReduced'],
|
||||
'wormholesCritical' => (bool) $routeData['wormholesCritical'],
|
||||
'wormholesEOL' => (bool) $routeData['wormholesEOL'],
|
||||
'wormholesThera' => (bool) $routeData['wormholesThera'],
|
||||
'wormholesSizeMin' => (string) $routeData['wormholesSizeMin'],
|
||||
'excludeTypes' => (array) $routeData['excludeTypes'],
|
||||
'endpointsBubble' => (bool) $routeData['endpointsBubble'],
|
||||
|
||||
@@ -9,17 +9,16 @@
|
||||
namespace lib\api;
|
||||
|
||||
use lib\Config;
|
||||
use Exodus4D\ESI\Client\ESI as Client;
|
||||
use Exodus4D\ESI\Client\ApiInterface;
|
||||
use Exodus4D\ESI\Client\EsiInterface;
|
||||
|
||||
use Exodus4D\ESI\Client\Ccp\Esi\Esi as Client;
|
||||
use Exodus4D\ESI\Client\Ccp\Esi\EsiInterface as ClientInterface;
|
||||
|
||||
/**
|
||||
* Class CcpClient
|
||||
* @package lib\api
|
||||
*
|
||||
* @method EsiInterface getServerStatus()
|
||||
* @method EsiInterface getStatusForRoutes(string $version)
|
||||
* @method ClientInterface getServerStatus()
|
||||
* @method ClientInterface getStatusForRoutes(string $version)
|
||||
*/
|
||||
class CcpClient extends AbstractClient {
|
||||
|
||||
|
||||
38
app/main/lib/api/EveScoutClient.php
Normal file
38
app/main/lib/api/EveScoutClient.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace lib\api;
|
||||
|
||||
use lib\Config;
|
||||
use Exodus4D\ESI\Client\ApiInterface;
|
||||
use Exodus4D\ESI\Client\EveScout\EveScout as Client;
|
||||
use Exodus4D\ESI\Client\EveScout\EveScoutInterface as ClientInterface;
|
||||
|
||||
/**
|
||||
* Class EveScoutClient
|
||||
* @package lib\api
|
||||
*
|
||||
* @method ClientInterface getTheraConnections()
|
||||
*/
|
||||
class EveScoutClient extends AbstractClient {
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const CLIENT_NAME = 'eveScoutClient';
|
||||
|
||||
/**
|
||||
* @param \Base $f3
|
||||
* @return ApiInterface|null
|
||||
*/
|
||||
protected function getClient(\Base $f3) : ?ApiInterface {
|
||||
$client = null;
|
||||
if(class_exists(Client::class)){
|
||||
$client = new Client(Config::getPathfinderData('api.eve_scout'));
|
||||
}else{
|
||||
$this->getLogger()->write($this->getMissingClassError(Client::class));
|
||||
}
|
||||
|
||||
return $client;
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,17 @@
|
||||
namespace lib\api;
|
||||
|
||||
use lib\Config;
|
||||
use Exodus4D\ESI\Client\Github as Client;
|
||||
use Exodus4D\ESI\Client\ApiInterface;
|
||||
use Exodus4D\ESI\Client\GitHub\GitHub as Client;
|
||||
use Exodus4D\ESI\Client\GitHub\GitHubInterface as ClientInterface;
|
||||
|
||||
/**
|
||||
* Class GitHubClient
|
||||
* @package lib\api
|
||||
*
|
||||
* @method ClientInterface getProjectReleases(string $projectName, int $count) : array
|
||||
* @method ClientInterface markdownToHtml(string $context, string $markdown) : string
|
||||
*/
|
||||
class GitHubClient extends AbstractClient {
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,9 +9,13 @@
|
||||
namespace lib\api;
|
||||
|
||||
use lib\Config;
|
||||
use Exodus4D\ESI\Client\SSO as Client;
|
||||
use Exodus4D\ESI\Client\ApiInterface;
|
||||
use Exodus4D\ESI\Client\Ccp\Sso\Sso as Client;
|
||||
|
||||
/**
|
||||
* Class SsoClient
|
||||
* @package lib\api
|
||||
*/
|
||||
class SsoClient extends AbstractClient {
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ use lib\db\Pool;
|
||||
use lib\api\CcpClient;
|
||||
use lib\api\GitHubClient;
|
||||
use lib\api\SsoClient;
|
||||
use lib\api\EveScoutClient;
|
||||
use lib\socket\AbstractSocket;
|
||||
use lib\socket\SocketInterface;
|
||||
use lib\socket\TcpSocket;
|
||||
@@ -177,6 +178,7 @@ class Config extends \Prefab {
|
||||
$f3->set(SsoClient::CLIENT_NAME, SsoClient::instance());
|
||||
$f3->set(CcpClient::CLIENT_NAME, CcpClient::instance());
|
||||
$f3->set(GitHubClient::CLIENT_NAME, GitHubClient::instance());
|
||||
$f3->set(EveScoutClient::CLIENT_NAME, EveScoutClient::instance());
|
||||
|
||||
// Socket connectors ------------------------------------------------------------------------------------------
|
||||
$f3->set(TcpSocket::SOCKET_NAME, function(array $options = ['timeout' => 1]) : SocketInterface {
|
||||
|
||||
@@ -380,6 +380,7 @@ Z_KILLBOARD = https://zkillboard.com/api
|
||||
EVEEYE = https://eveeye.com
|
||||
DOTLAN = http://evemaps.dotlan.net
|
||||
ANOIK = http://anoik.is
|
||||
EVE_SCOUT = https://www.eve-scout.com/api
|
||||
; GitHub Developer API
|
||||
GIT_HUB = https://api.github.com
|
||||
|
||||
|
||||
@@ -239,6 +239,7 @@ define([
|
||||
wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced | 0 : 1,
|
||||
wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical | 0 : 1,
|
||||
wormholesEOL: (rowData.hasOwnProperty('wormholesEOL')) ? rowData.wormholesEOL | 0 : 1,
|
||||
wormholesThera: (rowData.hasOwnProperty('wormholesThera')) ? rowData.wormholesThera | 0 : 1,
|
||||
wormholesSizeMin: (rowData.hasOwnProperty('wormholesSizeMin')) ? rowData.wormholesSizeMin : '',
|
||||
excludeTypes: (rowData.hasOwnProperty('excludeTypes')) ? rowData.excludeTypes : [],
|
||||
endpointsBubble: (rowData.hasOwnProperty('endpointsBubble')) ? rowData.endpointsBubble | 0 : 1,
|
||||
@@ -346,6 +347,7 @@ define([
|
||||
wormholesReduced: routeDialogData.hasOwnProperty('wormholesReduced') ? parseInt(routeDialogData.wormholesReduced) : 0,
|
||||
wormholesCritical: routeDialogData.hasOwnProperty('wormholesCritical') ? parseInt(routeDialogData.wormholesCritical) : 0,
|
||||
wormholesEOL: routeDialogData.hasOwnProperty('wormholesEOL') ? parseInt(routeDialogData.wormholesEOL) : 0,
|
||||
wormholesThera: routeDialogData.hasOwnProperty('wormholesThera') ? parseInt(routeDialogData.wormholesThera) : 0,
|
||||
wormholesSizeMin: routeDialogData.wormholesSizeMin || '',
|
||||
excludeTypes: getLowerSizeConnectionTypes(routeDialogData.wormholesSizeMin),
|
||||
endpointsBubble: routeDialogData.hasOwnProperty('endpointsBubble') ? parseInt(routeDialogData.endpointsBubble) : 0
|
||||
@@ -558,6 +560,7 @@ define([
|
||||
let wormholeReducedCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesReduced"]');
|
||||
let wormholeCriticalCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesCritical"]');
|
||||
let wormholeEolCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesEOL"]');
|
||||
let wormholeTheraCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesThera"]');
|
||||
let wormholeSizeSelect = routeDialog.find('#' + config.routeDialogSizeSelectId);
|
||||
|
||||
// store current "checked" state for each box ---------------------------------------------
|
||||
@@ -565,6 +568,7 @@ define([
|
||||
wormholeReducedCheckbox.data('selectState', wormholeReducedCheckbox.prop('checked'));
|
||||
wormholeCriticalCheckbox.data('selectState', wormholeCriticalCheckbox.prop('checked'));
|
||||
wormholeEolCheckbox.data('selectState', wormholeEolCheckbox.prop('checked'));
|
||||
wormholeTheraCheckbox.data('selectState', wormholeTheraCheckbox.prop('checked'));
|
||||
};
|
||||
|
||||
// on wormhole checkbox change ------------------------------------------------------------
|
||||
@@ -576,10 +580,12 @@ define([
|
||||
wormholeReducedCheckbox.prop('disabled', false);
|
||||
wormholeCriticalCheckbox.prop('disabled', false);
|
||||
wormholeEolCheckbox.prop('disabled', false);
|
||||
wormholeTheraCheckbox.prop('disabled', false);
|
||||
|
||||
wormholeReducedCheckbox.prop('checked', wormholeReducedCheckbox.data('selectState'));
|
||||
wormholeCriticalCheckbox.prop('checked', wormholeCriticalCheckbox.data('selectState'));
|
||||
wormholeEolCheckbox.prop('checked', wormholeEolCheckbox.data('selectState'));
|
||||
wormholeTheraCheckbox.prop('checked', wormholeTheraCheckbox.data('selectState'));
|
||||
}else{
|
||||
wormholeSizeSelect.prop('disabled', true);
|
||||
|
||||
@@ -591,6 +597,8 @@ define([
|
||||
wormholeCriticalCheckbox.prop('disabled', true);
|
||||
wormholeEolCheckbox.prop('checked', false);
|
||||
wormholeEolCheckbox.prop('disabled', true);
|
||||
wormholeTheraCheckbox.prop('checked', false);
|
||||
wormholeTheraCheckbox.prop('disabled', true);
|
||||
}
|
||||
}.bind(wormholeCheckbox);
|
||||
|
||||
@@ -675,17 +683,18 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* get stargate connection data (default connection type in case connection was not found on a map)
|
||||
* get fake connection data (default connection type in case connection was not found on a map)
|
||||
* @param sourceRouteNodeData
|
||||
* @param targetRouteNodeData
|
||||
* @param scope
|
||||
* @returns {{connection: {id: number, type: string[], scope: string}, source: {id: number, name, alias}, target: {id: number, name, alias}}}
|
||||
*/
|
||||
let getStargateConnectionData = (sourceRouteNodeData, targetRouteNodeData) => {
|
||||
let getFakeConnectionData = (sourceRouteNodeData, targetRouteNodeData, scope = 'stargate') => {
|
||||
return {
|
||||
connection: {
|
||||
id: 0,
|
||||
type: ['stargate'],
|
||||
scope: 'stargate'
|
||||
type: [MapUtil.getDefaultConnectionTypeByScope(scope)],
|
||||
scope: scope
|
||||
},
|
||||
source: {
|
||||
id: 0,
|
||||
@@ -731,7 +740,7 @@ define([
|
||||
* @param status
|
||||
* @returns {string}
|
||||
*/
|
||||
let getStatusIcon= (status) => {
|
||||
let getStatusIcon = status => {
|
||||
let color = 'txt-color-danger';
|
||||
let title = 'route not found';
|
||||
switch(status){
|
||||
@@ -748,6 +757,13 @@ define([
|
||||
return '<i class="fas fa-fw fa-circle txt-color ' + color + '" title="' + title + '"></i>';
|
||||
};
|
||||
|
||||
/**
|
||||
* check systemName if it "might" be a wormhole
|
||||
* @param systemName
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let isWormholeSystemName = systemName => /^J\d+$/.test(systemName) || systemName === 'Thera';
|
||||
|
||||
// route status:
|
||||
// 0: not found
|
||||
// 1: round (OK)
|
||||
@@ -785,6 +801,7 @@ define([
|
||||
wormholesReduced: routeData.wormholesReduced,
|
||||
wormholesCritical: routeData.wormholesCritical,
|
||||
wormholesEOL: routeData.wormholesEOL,
|
||||
wormholesThera: routeData.wormholesThera,
|
||||
wormholesSizeMin: routeData.wormholesSizeMin,
|
||||
excludeTypes: routeData.excludeTypes,
|
||||
endpointsBubble: routeData.endpointsBubble,
|
||||
@@ -828,11 +845,11 @@ define([
|
||||
if(prevRouteNodeData){
|
||||
let connectionData = findConnectionsData(connectionsData, prevRouteNodeData.system, systemName);
|
||||
if(!connectionData.hasOwnProperty('connection')){
|
||||
connectionData = getStargateConnectionData(prevRouteNodeData, routeNodeData);
|
||||
connectionData = getFakeConnectionData(prevRouteNodeData, routeNodeData, isWormholeSystemName(systemName) ? 'wh' : 'stargate');
|
||||
}
|
||||
let connectionElement = getFakeConnectionElement(connectionData);
|
||||
|
||||
routeJumpElements.push( connectionElement );
|
||||
routeJumpElements.push(connectionElement);
|
||||
}
|
||||
|
||||
// system elements ------------------------------------------------------------------------------------
|
||||
@@ -847,7 +864,7 @@ define([
|
||||
|
||||
// check for wormhole
|
||||
let icon = 'fas fa-square';
|
||||
if( /^J\d+$/.test(systemName) ){
|
||||
if(isWormholeSystemName(systemName)){
|
||||
icon = 'fas fa-dot-circle';
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -239,6 +239,7 @@ define([
|
||||
wormholesReduced: (rowData.hasOwnProperty('wormholesReduced')) ? rowData.wormholesReduced | 0 : 1,
|
||||
wormholesCritical: (rowData.hasOwnProperty('wormholesCritical')) ? rowData.wormholesCritical | 0 : 1,
|
||||
wormholesEOL: (rowData.hasOwnProperty('wormholesEOL')) ? rowData.wormholesEOL | 0 : 1,
|
||||
wormholesThera: (rowData.hasOwnProperty('wormholesThera')) ? rowData.wormholesThera | 0 : 1,
|
||||
wormholesSizeMin: (rowData.hasOwnProperty('wormholesSizeMin')) ? rowData.wormholesSizeMin : '',
|
||||
excludeTypes: (rowData.hasOwnProperty('excludeTypes')) ? rowData.excludeTypes : [],
|
||||
endpointsBubble: (rowData.hasOwnProperty('endpointsBubble')) ? rowData.endpointsBubble | 0 : 1,
|
||||
@@ -346,6 +347,7 @@ define([
|
||||
wormholesReduced: routeDialogData.hasOwnProperty('wormholesReduced') ? parseInt(routeDialogData.wormholesReduced) : 0,
|
||||
wormholesCritical: routeDialogData.hasOwnProperty('wormholesCritical') ? parseInt(routeDialogData.wormholesCritical) : 0,
|
||||
wormholesEOL: routeDialogData.hasOwnProperty('wormholesEOL') ? parseInt(routeDialogData.wormholesEOL) : 0,
|
||||
wormholesThera: routeDialogData.hasOwnProperty('wormholesThera') ? parseInt(routeDialogData.wormholesThera) : 0,
|
||||
wormholesSizeMin: routeDialogData.wormholesSizeMin || '',
|
||||
excludeTypes: getLowerSizeConnectionTypes(routeDialogData.wormholesSizeMin),
|
||||
endpointsBubble: routeDialogData.hasOwnProperty('endpointsBubble') ? parseInt(routeDialogData.endpointsBubble) : 0
|
||||
@@ -558,6 +560,7 @@ define([
|
||||
let wormholeReducedCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesReduced"]');
|
||||
let wormholeCriticalCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesCritical"]');
|
||||
let wormholeEolCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesEOL"]');
|
||||
let wormholeTheraCheckbox = routeDialog.find('input[type="checkbox"][name="wormholesThera"]');
|
||||
let wormholeSizeSelect = routeDialog.find('#' + config.routeDialogSizeSelectId);
|
||||
|
||||
// store current "checked" state for each box ---------------------------------------------
|
||||
@@ -565,6 +568,7 @@ define([
|
||||
wormholeReducedCheckbox.data('selectState', wormholeReducedCheckbox.prop('checked'));
|
||||
wormholeCriticalCheckbox.data('selectState', wormholeCriticalCheckbox.prop('checked'));
|
||||
wormholeEolCheckbox.data('selectState', wormholeEolCheckbox.prop('checked'));
|
||||
wormholeTheraCheckbox.data('selectState', wormholeTheraCheckbox.prop('checked'));
|
||||
};
|
||||
|
||||
// on wormhole checkbox change ------------------------------------------------------------
|
||||
@@ -576,10 +580,12 @@ define([
|
||||
wormholeReducedCheckbox.prop('disabled', false);
|
||||
wormholeCriticalCheckbox.prop('disabled', false);
|
||||
wormholeEolCheckbox.prop('disabled', false);
|
||||
wormholeTheraCheckbox.prop('disabled', false);
|
||||
|
||||
wormholeReducedCheckbox.prop('checked', wormholeReducedCheckbox.data('selectState'));
|
||||
wormholeCriticalCheckbox.prop('checked', wormholeCriticalCheckbox.data('selectState'));
|
||||
wormholeEolCheckbox.prop('checked', wormholeEolCheckbox.data('selectState'));
|
||||
wormholeTheraCheckbox.prop('checked', wormholeTheraCheckbox.data('selectState'));
|
||||
}else{
|
||||
wormholeSizeSelect.prop('disabled', true);
|
||||
|
||||
@@ -591,6 +597,8 @@ define([
|
||||
wormholeCriticalCheckbox.prop('disabled', true);
|
||||
wormholeEolCheckbox.prop('checked', false);
|
||||
wormholeEolCheckbox.prop('disabled', true);
|
||||
wormholeTheraCheckbox.prop('checked', false);
|
||||
wormholeTheraCheckbox.prop('disabled', true);
|
||||
}
|
||||
}.bind(wormholeCheckbox);
|
||||
|
||||
@@ -675,17 +683,18 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* get stargate connection data (default connection type in case connection was not found on a map)
|
||||
* get fake connection data (default connection type in case connection was not found on a map)
|
||||
* @param sourceRouteNodeData
|
||||
* @param targetRouteNodeData
|
||||
* @param scope
|
||||
* @returns {{connection: {id: number, type: string[], scope: string}, source: {id: number, name, alias}, target: {id: number, name, alias}}}
|
||||
*/
|
||||
let getStargateConnectionData = (sourceRouteNodeData, targetRouteNodeData) => {
|
||||
let getFakeConnectionData = (sourceRouteNodeData, targetRouteNodeData, scope = 'stargate') => {
|
||||
return {
|
||||
connection: {
|
||||
id: 0,
|
||||
type: ['stargate'],
|
||||
scope: 'stargate'
|
||||
type: [MapUtil.getDefaultConnectionTypeByScope(scope)],
|
||||
scope: scope
|
||||
},
|
||||
source: {
|
||||
id: 0,
|
||||
@@ -731,7 +740,7 @@ define([
|
||||
* @param status
|
||||
* @returns {string}
|
||||
*/
|
||||
let getStatusIcon= (status) => {
|
||||
let getStatusIcon = status => {
|
||||
let color = 'txt-color-danger';
|
||||
let title = 'route not found';
|
||||
switch(status){
|
||||
@@ -748,6 +757,13 @@ define([
|
||||
return '<i class="fas fa-fw fa-circle txt-color ' + color + '" title="' + title + '"></i>';
|
||||
};
|
||||
|
||||
/**
|
||||
* check systemName if it "might" be a wormhole
|
||||
* @param systemName
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let isWormholeSystemName = systemName => /^J\d+$/.test(systemName) || systemName === 'Thera';
|
||||
|
||||
// route status:
|
||||
// 0: not found
|
||||
// 1: round (OK)
|
||||
@@ -785,6 +801,7 @@ define([
|
||||
wormholesReduced: routeData.wormholesReduced,
|
||||
wormholesCritical: routeData.wormholesCritical,
|
||||
wormholesEOL: routeData.wormholesEOL,
|
||||
wormholesThera: routeData.wormholesThera,
|
||||
wormholesSizeMin: routeData.wormholesSizeMin,
|
||||
excludeTypes: routeData.excludeTypes,
|
||||
endpointsBubble: routeData.endpointsBubble,
|
||||
@@ -828,11 +845,11 @@ define([
|
||||
if(prevRouteNodeData){
|
||||
let connectionData = findConnectionsData(connectionsData, prevRouteNodeData.system, systemName);
|
||||
if(!connectionData.hasOwnProperty('connection')){
|
||||
connectionData = getStargateConnectionData(prevRouteNodeData, routeNodeData);
|
||||
connectionData = getFakeConnectionData(prevRouteNodeData, routeNodeData, isWormholeSystemName(systemName) ? 'wh' : 'stargate');
|
||||
}
|
||||
let connectionElement = getFakeConnectionElement(connectionData);
|
||||
|
||||
routeJumpElements.push( connectionElement );
|
||||
routeJumpElements.push(connectionElement);
|
||||
}
|
||||
|
||||
// system elements ------------------------------------------------------------------------------------
|
||||
@@ -847,7 +864,7 @@ define([
|
||||
|
||||
// check for wormhole
|
||||
let icon = 'fas fa-square';
|
||||
if( /^J\d+$/.test(systemName) ){
|
||||
if(isWormholeSystemName(systemName)){
|
||||
icon = 'fas fa-dot-circle';
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<form role="form" class="form-horizontal">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-5">
|
||||
<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-8">
|
||||
<div class="col-sm-7">
|
||||
<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">
|
||||
@@ -35,26 +35,30 @@
|
||||
|
||||
{{! search options ----------------------------------------------------------- }}
|
||||
|
||||
<h4 class="pf-dynamic-area">Search options</h4>
|
||||
<h4 class="pf-dynamic-area"><i class="fas fa-search"></i> Options</h4>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div class="col-sm-5">
|
||||
<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">
|
||||
<input id="form_stargates" name="stargates" value="1" type="checkbox" checked>
|
||||
<label for="form_stargates">Stargates</label>
|
||||
<div class="col-sm-12 col-xs-6 radio radio-primary">
|
||||
<input id="form_flag_shortest" name="flag" value="shortest" type="radio" checked>
|
||||
<label for="form_flag_shortest">Shortest
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="Prefer shortest"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-xs-6 checkbox checkbox-primary" title="include jump bridge connections">
|
||||
<input id="form_rally" name="jumpbridges" value="1" type="checkbox" checked>
|
||||
<label for="form_rally">Jump Bridges</label>
|
||||
<div class="col-sm-12 col-xs-6 radio radio-success">
|
||||
<input id="form_flag_secure" name="flag" value="secure" type="radio">
|
||||
<label for="form_flag_secure">Secure
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="Prefer higher security"></i>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-8">
|
||||
<div class="col-sm-7">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="{{routeDialogMapSelectId}}">Maps</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -64,35 +68,79 @@
|
||||
<option value="{{id}}" {{#selected}}selected{{/selected}}>{{name}}</option>
|
||||
{{/mapSelectOptions}}
|
||||
</select>
|
||||
<span class="help-block with-errors">Set maps for search</span>
|
||||
<span class="help-block with-errors">Add maps to search</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h4 class="pf-dynamic-area"><i class="fas fa-filter"></i> Filter</h4>
|
||||
|
||||
{{! wormhole ----------------------------------------------------------------- }}
|
||||
{{! Filter ------------------------------------------------------------------- }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
|
||||
<div class="col-xs-12 col-sm-5">
|
||||
<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">
|
||||
<input id="form_wormholes" name="wormholes" value="1" type="checkbox" checked>
|
||||
<label for="form_wormholes">Wormholes</label>
|
||||
</div>
|
||||
<label class="col-sm-3 col-xs-2 control-label">Type</label>
|
||||
|
||||
<div class="col-sm-offset-1 col-xs-3 col-sm-8 checkbox checkbox-primary">
|
||||
<input id="form_wormholes" name="wormholes" value="1" type="checkbox" checked>
|
||||
<label for="form_wormholes">Wormholes
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include wormhole connections"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<i class="fas fa-tree-child col-sm-offset-4 hidden-xs"></i>
|
||||
|
||||
<div class="checkbox checkbox-warning checkbox-circle">
|
||||
<input id="form_wormholes_reduced" name="wormholesReduced" value="1" type="checkbox" checked>
|
||||
<label for="form_wormholes_reduced">Stage 2 (reduced)
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include reduced connections"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<i class="fas fa-tree-child col-sm-offset-4 hidden-xs"></i>
|
||||
|
||||
<div class="checkbox checkbox-danger checkbox-circle">
|
||||
<input id="form_wormholes_critical" name="wormholesCritical" value="1" type="checkbox" checked>
|
||||
<label for="form_wormholes_critical">Stage 3 (critical)
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include critical connections"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<i class="fas fa-tree-child col-sm-offset-4 hidden-xs"></i>
|
||||
|
||||
<div class="checkbox checkbox-danger">
|
||||
<input id="form_wormholes_eol" name="wormholesEOL" value="1" type="checkbox" checked>
|
||||
<label for="form_wormholes_eol">End of life (EOL)
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include EOL connections"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-offset-4 checkbox checkbox-primary">
|
||||
<input id="form_stargates" name="stargates" value="1" type="checkbox" checked>
|
||||
<label for="form_stargates">Stargates
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include stargate connections"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-offset-4 checkbox checkbox-primary">
|
||||
<input id="form_jumpbridges" name="jumpbridges" value="1" type="checkbox" checked>
|
||||
<label for="form_jumpbridges">Jump Bridges
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include jump bridge connections"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6 col-sm-8">
|
||||
<div class="col-xs-12 col-sm-7">
|
||||
<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}}
|
||||
@@ -101,56 +149,28 @@
|
||||
</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="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 class="col-sm-offset-3 col-xs-12 col-sm-4">
|
||||
<div class="pf-dynamic-area">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 checkbox checkbox-default">
|
||||
<input id="form_connections_thera" name="wormholesThera" value="1" type="checkbox" checked>
|
||||
<label for="form_connections_thera">Thera
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include known Thera connections"></i>
|
||||
<a target="_blank" href="//www.eve-scout.com" rel="noopener"><em>eve-scout.com</em></a>
|
||||
</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="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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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="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>
|
||||
|
||||
{{! endpoint ----------------------------------------------------------------- }}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-sm-4">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-1 col-sm-11">
|
||||
<div class="checkbox checkbox-primary" title="include bubbled connections">
|
||||
<div class="col-sm-offset-1 checkbox checkbox-default">
|
||||
<input id="form_endpoints_bubble" name="endpointsBubble" value="1" type="checkbox" checked>
|
||||
<label for="form_endpoints_bubble">Bubbled <span class="pf-endpoint-bubble"></span></label>
|
||||
<label for="form_endpoints_bubble">Bubbled
|
||||
<i class="fas fa-fw fa-question-circle pf-help-light" title="include bubbled source/destination endpoints"></i>
|
||||
<span class="pf-endpoint-bubble"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<form role="form" class="form-horizontal">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-8">
|
||||
<div class="col-xs-7">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="form_system">Systems</label>
|
||||
<div class="col-sm-10">
|
||||
@@ -18,6 +18,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-5">
|
||||
<blockquote class="pull-right">
|
||||
<p>Select <em>"Thera"</em> also works.</p>
|
||||
<small>Connections from <em><a target="_blank" href="//www.eve-scout.com" rel="noopener">eve-scout.com</a></em> API</small>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -757,8 +757,8 @@ $text-muted: $gray-light;
|
||||
$abbr-border-color: $gray-light;
|
||||
$headings-small-color: $gray-light;
|
||||
$blockquote-small-color: $gray-light;
|
||||
$blockquote-font-size: ($font-size-base * 1.25);
|
||||
$blockquote-border-color: $green;
|
||||
$blockquote-font-size: ($font-size-base * 1.20);
|
||||
$blockquote-border-color: $brand-info;
|
||||
$page-header-border-color: $gray-lighter;
|
||||
|
||||
|
||||
|
||||
@@ -219,10 +219,10 @@ abbr[data-original-title] {
|
||||
|
||||
// Blockquotes
|
||||
blockquote {
|
||||
padding: ($line-height-computed / 2) $line-height-computed;
|
||||
margin: 0 0 $line-height-computed;
|
||||
padding: ($line-height-computed / 3) ($line-height-computed / 3 * 2);
|
||||
margin: 0 0 ($line-height-computed / 3 * 2);
|
||||
font-size: $blockquote-font-size;
|
||||
border-left: 5px solid $blockquote-border-color;
|
||||
border-left: 3px solid $blockquote-border-color;
|
||||
|
||||
p,
|
||||
ul,
|
||||
@@ -253,9 +253,9 @@ blockquote {
|
||||
// Heads up: `blockquote.pull-right` has been deprecated as of v3.1.0.
|
||||
.blockquote-reverse,
|
||||
blockquote.pull-right {
|
||||
padding-right: 15px;
|
||||
padding-right: ($line-height-computed / 3 * 2);
|
||||
padding-left: 0;
|
||||
border-right: 5px solid $blockquote-border-color;
|
||||
border-right: 3px solid $blockquote-border-color;
|
||||
border-left: 0;
|
||||
text-align: right;
|
||||
|
||||
|
||||
@@ -86,6 +86,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// checkbox list ============================================================
|
||||
.fa-tree-child + .checkbox{
|
||||
margin-left: 5px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
// form wizard ==============================================================
|
||||
.pf-wizard-navigation{
|
||||
margin: 0;
|
||||
@@ -269,11 +275,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.fa-tree-child + .checkbox{
|
||||
margin-left: 5px; // "delete connections" checkbox
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#pf-sig-info{
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -1456,6 +1456,7 @@ table{
|
||||
display: inline-block;
|
||||
width: 70px;
|
||||
height: 4px;
|
||||
max-width: 100%;
|
||||
border-top: 2px solid $gray-light;
|
||||
border-bottom: 2px solid $gray-light;
|
||||
background-color: $gray;
|
||||
|
||||
Reference in New Issue
Block a user