Merge remote-tracking branch 'upstream/develop' into feature/groundwork
# Conflicts: # public/css/pathfinder.css # public/css/v1.3.4/pathfinder.css.map
This commit is contained in:
@@ -24,39 +24,17 @@ class Map extends Controller\AccessController {
|
||||
// cache keys
|
||||
const CACHE_KEY_INIT = 'CACHED_INIT';
|
||||
const CACHE_KEY_MAP_DATA = 'CACHED.MAP_DATA.%s';
|
||||
const CACHE_KEY_USER_DATA = 'CACHED.USER_DATA.%s_%s';
|
||||
const CACHE_KEY_USER_DATA = 'CACHED.USER_DATA.%s';
|
||||
const CACHE_KEY_HISTORY = 'CACHED_MAP_HISTORY_%s';
|
||||
|
||||
|
||||
/**
|
||||
* get map data cache key
|
||||
* @param Model\CharacterModel $character
|
||||
* @return string
|
||||
*/
|
||||
protected function getMapDataCacheKey(Model\CharacterModel $character): string {
|
||||
return sprintf(self::CACHE_KEY_MAP_DATA, 'CHAR_' . $character->_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* clear map data caching
|
||||
* -> cache timings are short, this will just increase update performance on map changes
|
||||
* @param Model\CharacterModel $character
|
||||
*/
|
||||
protected function clearMapDataCache(Model\CharacterModel $character){
|
||||
$cacheKey = $this->getMapDataCacheKey($character);
|
||||
if($this->getF3()->exists($cacheKey)){
|
||||
$this->getF3()->clear($cacheKey);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* get user data cache key
|
||||
* @param int $mapId
|
||||
* @param int $systemId
|
||||
* @return string
|
||||
*/
|
||||
protected function getUserDataCacheKey($mapId, $systemId = 0): string {
|
||||
return sprintf(self::CACHE_KEY_USER_DATA, 'MAP_' . $mapId, 'SYS_' . $systemId);
|
||||
protected function getUserDataCacheKey(int $mapId): string {
|
||||
return sprintf(self::CACHE_KEY_USER_DATA, 'MAP_' . $mapId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -652,11 +630,18 @@ class Map extends Controller\AccessController {
|
||||
$return = (object) [];
|
||||
|
||||
$activeCharacter = $this->getCharacter();
|
||||
$characterData = $activeCharacter->getData(true);
|
||||
$maps = $activeCharacter->getMaps();
|
||||
|
||||
// some character data is not required (in WebSocket) -> unset() and keep return small
|
||||
if(isset($characterData->corporation->rights)){
|
||||
unset($characterData->corporation->rights);
|
||||
}
|
||||
|
||||
$return->data = [
|
||||
'id' => $activeCharacter->_id,
|
||||
'token' => bin2hex(random_bytes(16)), // token for character access
|
||||
'characterData' => $characterData,
|
||||
'mapData' => []
|
||||
];
|
||||
|
||||
@@ -684,18 +669,18 @@ class Map extends Controller\AccessController {
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
public function updateData(\Base $f3){
|
||||
$mapData = (array)$f3->get('POST.mapData');
|
||||
$userDataRequired = (bool)$f3->get('POST.getUserData');
|
||||
$postData = (array)$f3->get('POST');
|
||||
|
||||
$forceUpdate = (bool)$postData['forceUpdate'];
|
||||
$mapData = (array)$postData['mapData'];
|
||||
$userDataRequired = (bool)$postData['getUserData'];
|
||||
|
||||
$return = (object) [];
|
||||
|
||||
$activeCharacter = $this->getCharacter();
|
||||
|
||||
$cacheKey = $this->getMapDataCacheKey($activeCharacter);
|
||||
|
||||
// if there is any system/connection change data submitted -> save new data
|
||||
if(
|
||||
!empty($mapData) ||
|
||||
!$f3->exists($cacheKey, $return)
|
||||
){
|
||||
if( $forceUpdate || !empty($mapData) ){
|
||||
$return = (object) [];
|
||||
$return->error = [];
|
||||
|
||||
@@ -810,17 +795,11 @@ class Map extends Controller\AccessController {
|
||||
|
||||
// format map Data for return
|
||||
$return->mapData = $this->getFormattedMapsData($maps);
|
||||
|
||||
// cache time(s) per user should be equal or less than this function is called
|
||||
// prevent request flooding
|
||||
$responseTTL = (int)Config::getPathfinderData('timer.update_server_map.delay') / 1000;
|
||||
|
||||
$f3->set($cacheKey, $return, $responseTTL);
|
||||
}
|
||||
|
||||
// if userData is requested -> add it as well
|
||||
// -> Only first trigger call should request this data!
|
||||
if($userDataRequired){
|
||||
if($userDataRequired) {
|
||||
$return->userData = $activeCharacter->getUser()->getData();
|
||||
}
|
||||
|
||||
@@ -851,61 +830,51 @@ class Map extends Controller\AccessController {
|
||||
* @throws Exception\PathfinderException
|
||||
*/
|
||||
public function updateUserData(\Base $f3){
|
||||
$return = (object) [];
|
||||
|
||||
$postData = (array)$f3->get('POST');
|
||||
$mapIds = (array)$postData['mapIds'];
|
||||
$getMapUserData = (bool)$postData['getMapUserData'];
|
||||
$mapTracking = (bool)$postData['mapTracking'];
|
||||
$systemData = (array)$postData['systemData'];
|
||||
$activeCharacter = $this->getCharacter(0);
|
||||
|
||||
$postData = $f3->get('POST');
|
||||
if( !empty($mapIds = (array)$postData['mapIds']) ){
|
||||
$return = (object)[];
|
||||
|
||||
// update current location
|
||||
// -> suppress temporary timeout errors
|
||||
$activeCharacter = $activeCharacter->updateLog(['suppressHTTPErrors' => true]);
|
||||
|
||||
if( !empty($mapIds) ){
|
||||
// IMPORTANT for now -> just update a single map (save performance)
|
||||
$mapId = (int)reset($mapIds);
|
||||
// get map and check map access
|
||||
$map = $activeCharacter->getMap( (int)$mapId);
|
||||
|
||||
if( !is_null($map) ){
|
||||
$characterMapData = (array)$postData['characterMapData'];
|
||||
|
||||
// check if data for specific system is requested
|
||||
$systemData = (array)$postData['systemData'];
|
||||
// if data is requested extend the cache key in order to get new data
|
||||
$requestSystemData = (object) [];
|
||||
$requestSystemData->mapId = isset($systemData['mapId']) ? (int) $systemData['mapId'] : 0;
|
||||
$requestSystemData->systemId = isset($systemData['systemData']['id']) ? (int) $systemData['systemData']['id'] : 0;
|
||||
|
||||
// update current location
|
||||
// -> suppress temporary timeout errors
|
||||
$activeCharacter = $activeCharacter->updateLog(['suppressHTTPErrors' => true]);
|
||||
|
||||
if( !is_null($map = $activeCharacter->getMap($mapId)) ){
|
||||
// check character log (current system) and manipulate map (e.g. add new system)
|
||||
if( (bool)$characterMapData['mapTracking'] ){
|
||||
if($mapTracking){
|
||||
$map = $this->updateMapData($activeCharacter, $map);
|
||||
}
|
||||
|
||||
// get from cache
|
||||
// this should happen if a user has multiple program instances running
|
||||
// with the same main char
|
||||
$cacheKey = $this->getUserDataCacheKey($mapId, $requestSystemData->systemId);
|
||||
if( !$f3->exists($cacheKey, $return) ){
|
||||
$return = (object) [];
|
||||
$return->mapUserData[] = $map->getUserData();
|
||||
// mapUserData ----------------------------------------------------------------------------------------
|
||||
if($getMapUserData){
|
||||
$cacheKey = $this->getUserDataCacheKey($mapId);
|
||||
if( !$f3->exists($cacheKey, $mapUserData) ){
|
||||
$mapUserData = $map->getUserData();
|
||||
|
||||
// request signature data for a system if user has map access!
|
||||
if( $mapId === $requestSystemData->mapId ){
|
||||
$system = $map->getSystemById( $requestSystemData->systemId );
|
||||
|
||||
if( !is_null($system) ){
|
||||
// data for currently selected system
|
||||
$return->system = $system->getData();
|
||||
$return->system->signatures = $system->getSignaturesData();
|
||||
}
|
||||
// cache time (seconds) should be equal or less than request trigger time
|
||||
// prevent request flooding
|
||||
$responseTTL = (int)Config::getPathfinderData('timer.update_server_user_data.delay') / 1000;
|
||||
$f3->set($cacheKey, $mapUserData, $responseTTL);
|
||||
}
|
||||
$return->mapUserData[] = $mapUserData;
|
||||
}
|
||||
|
||||
// cache time (seconds) should be equal or less than request trigger time
|
||||
// prevent request flooding
|
||||
$responseTTL = (int)Config::getPathfinderData('timer.update_server_user_data.delay') / 1000;
|
||||
|
||||
// cache response
|
||||
$f3->set($cacheKey, $return, $responseTTL);
|
||||
// systemData -----------------------------------------------------------------------------------------
|
||||
if(
|
||||
$mapId === (int)$systemData['mapId'] &&
|
||||
!is_null($system = $map->getSystemById((int)$systemData['systemData']['id']))
|
||||
){
|
||||
// data for currently selected system
|
||||
$return->system = $system->getData();
|
||||
$return->system->signatures = $system->getSignaturesData();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1120,7 +1089,6 @@ class Map extends Controller\AccessController {
|
||||
}
|
||||
|
||||
if($mapDataChanged){
|
||||
$this->clearMapDataCache($character);
|
||||
$this->broadcastMapData($map);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,6 +187,7 @@ class CharacterLogModel extends BasicModel {
|
||||
* @param $pkeys
|
||||
*/
|
||||
public function afterInsertEvent($self, $pkeys){
|
||||
self::log('afterInsertEvent ' . $self->_id);
|
||||
$self->clearCacheData();
|
||||
}
|
||||
|
||||
@@ -199,6 +200,8 @@ class CharacterLogModel extends BasicModel {
|
||||
public function afterUpdateEvent($self, $pkeys){
|
||||
// check if any "relevant" column has changed
|
||||
if( !empty($this->fieldChanges) ){
|
||||
self::log('afterUpdate ' . $self->_id);
|
||||
|
||||
$self->clearCacheData();
|
||||
}
|
||||
}
|
||||
@@ -210,6 +213,7 @@ class CharacterLogModel extends BasicModel {
|
||||
* @param $pkeys
|
||||
*/
|
||||
public function afterEraseEvent($self, $pkeys){
|
||||
self::log('afterEraseEvent ' . $self->_id);
|
||||
$self->clearCacheData();
|
||||
}
|
||||
|
||||
@@ -222,6 +226,9 @@ class CharacterLogModel extends BasicModel {
|
||||
if($this->characterId){
|
||||
// characterId relation could be deleted by cron therefore check again first...
|
||||
$this->characterId->clearCacheDataWithPrefix(CharacterModel::DATA_CACHE_KEY_LOG);
|
||||
|
||||
// broadcast updated character data (with changed log data)
|
||||
$this->characterId->broadcastCharacterUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ use Controller\Api\User as User;
|
||||
use DB\SQL\Schema;
|
||||
use lib\Util;
|
||||
use lib\Config;
|
||||
use lib\Socket;
|
||||
use Model\Universe;
|
||||
|
||||
class CharacterModel extends BasicModel {
|
||||
@@ -904,6 +905,15 @@ class CharacterModel extends BasicModel {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* broadcast characterData
|
||||
* @throws \ZMQSocketException
|
||||
*/
|
||||
public function broadcastCharacterUpdate(){
|
||||
$characterData = $this->getData(true);
|
||||
(new Socket( Config::getSocketUri() ))->sendData('characterUpdate', $characterData);
|
||||
}
|
||||
|
||||
/**
|
||||
* update character data from CCPs ESI API
|
||||
* @return array (some status messages)
|
||||
|
||||
@@ -844,8 +844,9 @@ class MapModel extends AbstractMapTrackingModel {
|
||||
/**
|
||||
* get data for ALL characters with map access
|
||||
* -> The result of this function is cached!
|
||||
* @param array $options filter options
|
||||
* @return \stdClass
|
||||
* @param array $options
|
||||
* @return array|null|\stdClass
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function getCharactersData($options = []){
|
||||
// check if there is cached data
|
||||
|
||||
@@ -3144,7 +3144,9 @@ define([
|
||||
// data for header update
|
||||
let headerUpdateData = {
|
||||
mapId: userData.config.id,
|
||||
userCount: 0 // active user on a map
|
||||
userCountInside: 0, // active user on a map
|
||||
userCountOutside: 0, // active user NOT on map
|
||||
userCountInactive: 0 // inactive users (no location)
|
||||
};
|
||||
|
||||
if(
|
||||
@@ -3184,7 +3186,7 @@ define([
|
||||
tempUserData = systemData;
|
||||
|
||||
// add "user count" to "total map user count"
|
||||
headerUpdateData.userCount += tempUserData.user.length;
|
||||
headerUpdateData.userCountInside += tempUserData.user.length;
|
||||
|
||||
// remove system from "search" array -> speed up loop
|
||||
userData.data.systems.splice(j, 1);
|
||||
@@ -3209,6 +3211,16 @@ define([
|
||||
system.updateSystemUserData(map, tempUserData, currentUserIsHere);
|
||||
}
|
||||
|
||||
// users who are not in any map system --------------------------------------------------------------------
|
||||
for(let i = 0; i < userData.data.systems.length; i++){
|
||||
// users without location are grouped in systemid: 0
|
||||
if(userData.data.systems[i].id){
|
||||
headerUpdateData.userCountOutside += userData.data.systems[i].user.length;
|
||||
}else{
|
||||
headerUpdateData.userCountInactive += userData.data.systems[i].user.length;
|
||||
}
|
||||
}
|
||||
|
||||
// trigger document event -> update header
|
||||
$(document).trigger('pf:updateHeaderMapData', headerUpdateData);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,10 @@ define([
|
||||
Util.deleteCurrentMapData( MsgWorkerMessage.data() );
|
||||
ModuleMap.updateMapModule(mapModule);
|
||||
break;
|
||||
case 'mapSubscriptions':
|
||||
Util.updateCurrentMapUserData(MsgWorkerMessage.data());
|
||||
ModuleMap.updateActiveMapUserData(mapModule);
|
||||
break;
|
||||
}
|
||||
|
||||
Util.setSyncStatus('ws:get');
|
||||
@@ -189,18 +193,6 @@ define([
|
||||
$(document).trigger('pf:shutdown', {status: jqXHR.status, reason: reason, error: errorData});
|
||||
};
|
||||
|
||||
/**
|
||||
* init (schedule) next MapUpdate Ping
|
||||
*/
|
||||
let initMapUpdatePing = (forceUpdateMapData) => {
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let delay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
|
||||
|
||||
updateTimeouts.mapUpdate = setTimeout((forceUpdateMapData) => {
|
||||
triggerMapUpdatePing(forceUpdateMapData);
|
||||
}, delay, forceUpdateMapData);
|
||||
};
|
||||
|
||||
// ping for main map update ========================================================
|
||||
/**
|
||||
* @param forceUpdateMapData // force request to be send
|
||||
@@ -217,8 +209,9 @@ define([
|
||||
|
||||
// get updated map data
|
||||
let updatedMapData = {
|
||||
forceUpdate: forceUpdateMapData ? 1 : 0,
|
||||
mapData: mapModule.getMapModuleDataForUpdate(),
|
||||
getUserData: ( Util.getCurrentUserData() ) ? 0 : 1
|
||||
getUserData: Util.getCurrentUserData() ? 0 : 1
|
||||
};
|
||||
|
||||
// check if mapUpdate trigger should be send
|
||||
@@ -267,7 +260,7 @@ define([
|
||||
|
||||
// load/update main map module
|
||||
ModuleMap.updateMapModule(mapModule).then(() => {
|
||||
// map update done, init new trigger
|
||||
// map update done, init new trigger
|
||||
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let mapUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
|
||||
@@ -307,10 +300,9 @@ define([
|
||||
|
||||
let updatedUserData = {
|
||||
mapIds: mapIds,
|
||||
systemData: Util.getCurrentSystemData(),
|
||||
characterMapData: {
|
||||
mapTracking: (locationToggle.is(':checked') ? 1 : 0) // location tracking
|
||||
}
|
||||
getMapUserData: Util.getSyncType() === 'webSocket' ? 0 : 1,
|
||||
mapTracking: locationToggle.is(':checked') ? 1 : 0, // location tracking
|
||||
systemData: Util.getCurrentSystemData()
|
||||
};
|
||||
|
||||
Util.timeStart(logKeyServerUserData);
|
||||
@@ -321,43 +313,38 @@ define([
|
||||
data: updatedUserData,
|
||||
dataType: 'json'
|
||||
}).done((data) => {
|
||||
|
||||
// log request time
|
||||
let duration = Util.timeStop(logKeyServerUserData);
|
||||
Util.log(logKeyServerUserData, {duration: duration, type: 'server', description:'request user data'});
|
||||
|
||||
if(data.error.length > 0){
|
||||
if(
|
||||
data.error &&
|
||||
data.error.length > 0
|
||||
){
|
||||
// any error in the main trigger functions result in a user log-off
|
||||
$(document).trigger('pf:menuLogout');
|
||||
}else{
|
||||
|
||||
$(document).setProgramStatus('online');
|
||||
|
||||
if(data.userData !== undefined){
|
||||
// store current user data global (cache)
|
||||
let userData = Util.setCurrentUserData(data.userData);
|
||||
|
||||
// store current map user data (cache)
|
||||
if(data.mapUserData !== undefined){
|
||||
Util.setCurrentMapUserData(data.mapUserData);
|
||||
}
|
||||
|
||||
// active character data found
|
||||
mapModule.updateMapModuleData();
|
||||
|
||||
// update system info panels
|
||||
if(data.system){
|
||||
mapModule.updateSystemModuleData(data.system);
|
||||
}
|
||||
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let mapUserUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerUserData, 0 );
|
||||
|
||||
// init new trigger
|
||||
updateTimeouts.userUpdate = setTimeout(() => {
|
||||
triggerUserUpdatePing();
|
||||
}, mapUserUpdateDelay);
|
||||
// store current map user data (cache)
|
||||
if(data.mapUserData !== undefined){
|
||||
Util.setCurrentMapUserData(data.mapUserData);
|
||||
}
|
||||
|
||||
// update map module character data
|
||||
ModuleMap.updateActiveMapUserData(mapModule).then(() => {
|
||||
// map module update done, init new trigger
|
||||
initMapUserUpdatePing();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,6 +352,29 @@ define([
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* init (schedule) next MapUpdate Ping
|
||||
*/
|
||||
let initMapUpdatePing = (forceUpdateMapData) => {
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let delay = Util.getCurrentTriggerDelay(logKeyServerMapData, 0);
|
||||
|
||||
updateTimeouts.mapUpdate = setTimeout((forceUpdateMapData) => {
|
||||
triggerMapUpdatePing(forceUpdateMapData);
|
||||
}, delay, forceUpdateMapData);
|
||||
};
|
||||
|
||||
/**
|
||||
* init (schedule) next MapUserUpdate Ping
|
||||
*/
|
||||
let initMapUserUpdatePing = () => {
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let delay = Util.getCurrentTriggerDelay(logKeyServerUserData, 0);
|
||||
|
||||
updateTimeouts.userUpdate = setTimeout(() => {
|
||||
triggerUserUpdatePing();
|
||||
}, delay);
|
||||
};
|
||||
|
||||
/**
|
||||
* clear both main update timeouts
|
||||
|
||||
@@ -298,39 +298,55 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* updates only visible/active map module
|
||||
* @returns {boolean}
|
||||
* updates current visible/active mapElement in mapModuleElement with user data
|
||||
* @param mapModuleElement
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
$.fn.updateMapModuleData = function(){
|
||||
let mapModule = $(this);
|
||||
let updateActiveMapUserData = (mapModuleElement) => {
|
||||
|
||||
let updateActiveMapModuleExecutor = (resolve, reject) => {
|
||||
// get all active map elements for module
|
||||
let mapElement = mapModuleElement.getActiveMap();
|
||||
|
||||
updateMapUserData(mapElement).then(payload => resolve());
|
||||
};
|
||||
|
||||
return new Promise(updateActiveMapModuleExecutor);
|
||||
};
|
||||
|
||||
/**
|
||||
* updates mapElement with user data
|
||||
* update
|
||||
* @param mapElement
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let updateMapUserData = (mapElement) => {
|
||||
// performance logging (time measurement)
|
||||
let logKeyClientUserData = Init.performanceLogging.keyClientUserData;
|
||||
Util.timeStart(logKeyClientUserData);
|
||||
|
||||
// get all active map elements for module
|
||||
let mapElement = mapModule.getActiveMap();
|
||||
let updateMapUserDataExecutor = (resolve, reject) => {
|
||||
if(mapElement !== false){
|
||||
let mapId = mapElement.data('id');
|
||||
let currentMapUserData = Util.getCurrentMapUserData(mapId);
|
||||
|
||||
if(mapElement !== false){
|
||||
let mapId = mapElement.data('id');
|
||||
if(currentMapUserData){
|
||||
// trigger "update local" for this map => async
|
||||
mapElement.trigger('pf:updateLocal', currentMapUserData);
|
||||
|
||||
let currentMapUserData = Util.getCurrentMapUserData(mapId);
|
||||
|
||||
|
||||
if(currentMapUserData){
|
||||
// trigger "update local" for this map => async
|
||||
mapElement.trigger('pf:updateLocal', currentMapUserData);
|
||||
|
||||
// update map with current user data
|
||||
mapElement.updateUserData(currentMapUserData);
|
||||
// update map with current user data
|
||||
mapElement.updateUserData(currentMapUserData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// log client user data update time
|
||||
let duration = Util.timeStop(logKeyClientUserData);
|
||||
Util.log(logKeyClientUserData, {duration: duration, type: 'client', description:'update users'});
|
||||
resolve();
|
||||
};
|
||||
|
||||
return true;
|
||||
return new Promise(updateMapUserDataExecutor).then(payload => {
|
||||
// log client map update time
|
||||
let duration = Util.timeStop(logKeyClientUserData);
|
||||
Util.log(logKeyClientUserData, {duration: duration, type: 'client', description: 'update users'});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -634,6 +650,9 @@ define([
|
||||
let mapUrl = MapUtil.getMapDeeplinkUrl(mapConfig.config.id);
|
||||
history.pushState({}, '', mapUrl);
|
||||
}
|
||||
|
||||
// update map user data (do not wait until next update is triggered)
|
||||
updateMapUserData(mapElement);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1189,6 +1208,7 @@ define([
|
||||
|
||||
return {
|
||||
updateTabData: updateTabData,
|
||||
updateMapModule: updateMapModule
|
||||
updateMapModule: updateMapModule,
|
||||
updateActiveMapUserData: updateActiveMapUserData
|
||||
};
|
||||
});
|
||||
@@ -482,7 +482,7 @@ define([
|
||||
});
|
||||
|
||||
// active pilots
|
||||
$('.' + config.headActiveUserClass).find('a').on('click', function(){
|
||||
$('.' + config.headActiveUserClass).on('click', function(){
|
||||
$(document).triggerMenuEvent('ShowMapInfo', {tab: 'activity'});
|
||||
});
|
||||
|
||||
@@ -718,7 +718,9 @@ define([
|
||||
documentElement.on('pf:updateHeaderMapData', function(e, data){
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
|
||||
let userCount = 0;
|
||||
let userCountInside = 0;
|
||||
let userCountOutside = 0;
|
||||
let userCountInactive = 0;
|
||||
let currentLocationData = {};
|
||||
|
||||
// show active user just for the current active map
|
||||
@@ -726,10 +728,12 @@ define([
|
||||
activeMap &&
|
||||
activeMap.data('id') === data.mapId
|
||||
){
|
||||
userCount = data.userCount;
|
||||
userCountInside = data.userCountInside;
|
||||
userCountOutside = data.userCountOutside;
|
||||
userCountInactive = data.userCountInactive;
|
||||
currentLocationData = data;
|
||||
}
|
||||
updateHeaderActiveUserCount(userCount);
|
||||
updateHeaderActiveUserCount(userCountInside, userCountOutside, userCountInactive);
|
||||
updateHeaderCurrentLocation(currentLocationData);
|
||||
});
|
||||
|
||||
@@ -981,23 +985,35 @@ define([
|
||||
|
||||
/**
|
||||
* update the "active user" badge in header
|
||||
* @param userCount
|
||||
* @param userCountInside
|
||||
* @param userCountOutside
|
||||
* @param userCountInactive
|
||||
*/
|
||||
let updateHeaderActiveUserCount = function(userCount){
|
||||
let updateHeaderActiveUserCount = (userCountInside, userCountOutside, userCountInactive) => {
|
||||
let activeUserElement = $('.' + config.headActiveUserClass);
|
||||
let badge = activeUserElement.find('.badge');
|
||||
|
||||
if(badge.data('userCount') !== userCount){
|
||||
badge.data('userCount', userCount);
|
||||
let updateCount = (badge, count) => {
|
||||
let changed = false;
|
||||
if(badge.data('userCount') !== count){
|
||||
changed = true;
|
||||
badge.data('userCount', count);
|
||||
badge.text(count);
|
||||
|
||||
badge.text(userCount);
|
||||
|
||||
badge.toggleClass('txt-color-greenLight', (userCount > 0) );
|
||||
badge.toggleClass('txt-color-red', (userCount === 0) );
|
||||
|
||||
if(! activeUserElement.is(':visible')){
|
||||
activeUserElement.velocity('fadeIn', {duration: Init.animationSpeed.headerLink});
|
||||
badge.toggleClass(badge.attr('data-on'), (count > 0) );
|
||||
badge.toggleClass(badge.attr('data-off'), (count === 0) );
|
||||
}
|
||||
return changed;
|
||||
};
|
||||
|
||||
let changedInside = updateCount(activeUserElement.find('.badge[data-type="inside"]'), userCountInside);
|
||||
let changedOutside = updateCount(activeUserElement.find('.badge[data-type="outside"]'), userCountOutside);
|
||||
let changedInactive = updateCount(activeUserElement.find('.badge[data-type="inactive"]'), userCountInactive);
|
||||
|
||||
if(
|
||||
(changedInactive || changedOutside || changedInactive) &&
|
||||
!activeUserElement.is(':visible')
|
||||
){
|
||||
activeUserElement.velocity('fadeIn', {duration: Init.animationSpeed.headerLink});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ define([
|
||||
tableCellCounterClass: 'pf-table-counter-cell', // class for table "counter" cells
|
||||
tableCellEllipsisClass: 'pf-table-cell-ellipses-auto', // class for table "ellipsis" cells
|
||||
tableCellActionIconClass: 'pf-table-action-icon-cell', // class for table "action" icon (icon is part of cell content)
|
||||
tableCellUnknownDataClass: 'pf-table-unknown-cell', // class for table "unknown" cells
|
||||
|
||||
textActionIconClass: 'pf-module-icon-button', // class for text action
|
||||
textActionIconCopyClass: 'pf-module-icon-button-copy', // class for text action "copy"
|
||||
@@ -82,6 +83,14 @@ define([
|
||||
return icon.length ? '<i class="fas fa-fw ' + icon + ' ' + config.tableCellActionIconClass + '" title="' + type + '" data-toggle="tooltip"></i>' : '';
|
||||
};
|
||||
|
||||
/**
|
||||
* get label for "unknown" label
|
||||
* @returns {string}
|
||||
*/
|
||||
let getLabelForUnknownData = () => {
|
||||
return '<span class="' + config.tableCellUnknownDataClass + '">unknown</span>';
|
||||
};
|
||||
|
||||
/**
|
||||
* write clipboard text
|
||||
* @param text
|
||||
@@ -849,10 +858,11 @@ define([
|
||||
searchable: false,
|
||||
className: ['pf-help-default', 'text-center', config.tableCellImageClass].join(' '),
|
||||
data: 'log.ship',
|
||||
defaultContent: '',
|
||||
render: {
|
||||
_: function(data, type, row, meta){
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
if(data && type === 'display'){
|
||||
value = '<img src="' + Init.url.ccpImageServer + '/Render/' + value.typeId + '_32.png" title="' + value.typeName + '" data-toggle="tooltip" />';
|
||||
}
|
||||
return value;
|
||||
@@ -865,12 +875,17 @@ define([
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'log.ship',
|
||||
defaultContent: getLabelForUnknownData(),
|
||||
render: {
|
||||
_: function(data, type, row){
|
||||
let value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis100Class + '">' + data.name + '</div>';
|
||||
let value = data;
|
||||
if(data){
|
||||
value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis100Class + '">' + data.name + '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -960,9 +975,15 @@ define([
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'log.system',
|
||||
defaultContent: getLabelForUnknownData(),
|
||||
render: {
|
||||
_: 'name',
|
||||
sort: 'name'
|
||||
_: function(data, type, row, meta){
|
||||
let value = data;
|
||||
if(data && type === 'display'){
|
||||
value = data.name;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 7,
|
||||
@@ -971,13 +992,18 @@ define([
|
||||
searchable: true,
|
||||
className: [config.tableCellActionClass].join(' '),
|
||||
data: 'log',
|
||||
defaultContent: getLabelForUnknownData(),
|
||||
render: {
|
||||
_: function (data, type, row, meta) {
|
||||
let value = '';
|
||||
if(data.station && data.station.id > 0){
|
||||
value = data.station.name + ' ' + getIconForDockedStatus('station');
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = data.structure.name + ' ' + getIconForDockedStatus('structure');
|
||||
let value = data;
|
||||
if(data){
|
||||
if(data.station && data.station.id > 0){
|
||||
value = data.station.name + ' ' + getIconForDockedStatus('station');
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = data.structure.name + ' ' + getIconForDockedStatus('structure');
|
||||
}else{
|
||||
value = '';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
197
js/app/util.js
197
js/app/util.js
@@ -72,9 +72,9 @@ define([
|
||||
let localStorage; // cache for "localForage" singleton
|
||||
|
||||
/*
|
||||
* ===========================================================================================================
|
||||
* ===============================================================================================================
|
||||
* Global jQuery plugins for some common and frequently used functions
|
||||
* ==========================================================================================================
|
||||
* ==============================================================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -820,9 +820,9 @@ define([
|
||||
};
|
||||
|
||||
/*
|
||||
* ===========================================================================================================
|
||||
* ===============================================================================================================
|
||||
* Util functions that are global available for all modules
|
||||
* ==========================================================================================================
|
||||
* ==============================================================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1149,11 +1149,29 @@ define([
|
||||
return logInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* set currentUserData as "global" variable
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param userData
|
||||
*/
|
||||
let setCurrentUserData = (userData) => {
|
||||
Init.currentUserData = userData;
|
||||
|
||||
// check if function is available
|
||||
// this is not the case in "login" page
|
||||
if( $.fn.updateHeaderUserData ){
|
||||
$.fn.updateHeaderUserData();
|
||||
}
|
||||
|
||||
return getCurrentUserData();
|
||||
};
|
||||
|
||||
/**
|
||||
* get currentUserData from "global" variable
|
||||
* @returns {*}
|
||||
*/
|
||||
let getCurrentUserData = function(){
|
||||
let getCurrentUserData = () => {
|
||||
return Init.currentUserData;
|
||||
};
|
||||
|
||||
@@ -1196,7 +1214,7 @@ define([
|
||||
/**
|
||||
* set default jQuery AJAX configuration
|
||||
*/
|
||||
let ajaxSetup = function(){
|
||||
let ajaxSetup = () => {
|
||||
$.ajaxSetup({
|
||||
beforeSend: function(xhr, settings) {
|
||||
// Add custom application headers on "same origin" requests only!
|
||||
@@ -1702,13 +1720,34 @@ define([
|
||||
return signatureTypeId;
|
||||
};
|
||||
|
||||
/**
|
||||
* get array key that points to map data catching mapId
|
||||
* @param data
|
||||
* @param mapId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let getDataIndexByMapId = (data, mapId) => {
|
||||
let index = false;
|
||||
if( Array.isArray(data) && mapId === parseInt(mapId, 10) ){
|
||||
for(let i = 0; i < data.length; i++){
|
||||
if(data[i].config.id === mapId){
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return index;
|
||||
};
|
||||
|
||||
// CurrentMapUserData =============================================================================================
|
||||
|
||||
/**
|
||||
* set currentMapUserData as "global" variable (count of active pilots)
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param mapUserData
|
||||
*/
|
||||
let setCurrentMapUserData = function(mapUserData){
|
||||
let setCurrentMapUserData = (mapUserData) => {
|
||||
Init.currentMapUserData = mapUserData;
|
||||
|
||||
return getCurrentMapUserData();
|
||||
@@ -1719,23 +1758,26 @@ define([
|
||||
* @param mapId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let getCurrentMapUserData = function(mapId){
|
||||
let getCurrentMapUserData = (mapId) => {
|
||||
let currentMapUserData = false;
|
||||
|
||||
if(
|
||||
mapId === parseInt(mapId, 10) &&
|
||||
Init.currentMapUserData
|
||||
){
|
||||
// search for a specific map
|
||||
for(let i = 0; i < Init.currentMapUserData.length; i++){
|
||||
if(Init.currentMapUserData[i].config.id === mapId){
|
||||
currentMapUserData = Init.currentMapUserData[i];
|
||||
break;
|
||||
if(Init.currentMapUserData){
|
||||
if(mapId === parseInt(mapId, 10)){
|
||||
|
||||
// search for a specific map
|
||||
for(let i = 0; i < Init.currentMapUserData.length; i++){
|
||||
if(
|
||||
Init.currentMapUserData[i].config &&
|
||||
Init.currentMapUserData[i].config.id === mapId
|
||||
){
|
||||
currentMapUserData = Init.currentMapUserData[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// get data for all maps
|
||||
currentMapUserData = Init.currentMapUserData;
|
||||
}
|
||||
}else{
|
||||
// get data for all maps
|
||||
currentMapUserData = Init.currentMapUserData;
|
||||
}
|
||||
|
||||
if(currentMapUserData !== false){
|
||||
@@ -1746,60 +1788,54 @@ define([
|
||||
return currentMapUserData;
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapDataUser array index by mapId
|
||||
* @param mapId
|
||||
* @returns {boolean|int}
|
||||
*/
|
||||
let getCurrentMapUserDataIndex = (mapId) => {
|
||||
return getDataIndexByMapId(Init.currentMapUserData, mapId);
|
||||
};
|
||||
|
||||
/**
|
||||
* update cached mapUserData for a single map
|
||||
* @param mapUserData
|
||||
*/
|
||||
let updateCurrentMapUserData = (mapUserData) => {
|
||||
let mapUserDataIndex = getCurrentMapUserDataIndex( mapUserData.config.id );
|
||||
|
||||
if( !Array.isArray(Init.currentMapUserData) ){
|
||||
Init.currentMapUserData = [];
|
||||
}
|
||||
|
||||
if(mapUserDataIndex !== false){
|
||||
Init.currentMapUserData[mapUserDataIndex] = mapUserData;
|
||||
}else{
|
||||
// new map data
|
||||
Init.currentMapUserData.push(mapUserData);
|
||||
}
|
||||
};
|
||||
|
||||
// CurrentMapData =================================================================================================
|
||||
|
||||
/**
|
||||
* set currentMapData as "global" variable
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param mapData
|
||||
*/
|
||||
let setCurrentMapData = function(mapData){
|
||||
let setCurrentMapData = (mapData) => {
|
||||
Init.currentMapData = mapData;
|
||||
|
||||
return getCurrentMapData();
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapData array index by mapId
|
||||
* @param mapId
|
||||
* @returns {boolean|int}
|
||||
*/
|
||||
let getCurrentMapDataIndex = function(mapId){
|
||||
let mapDataIndex = false;
|
||||
|
||||
if( mapId === parseInt(mapId, 10) ){
|
||||
for(let i = 0; i < Init.currentMapData.length; i++){
|
||||
if(Init.currentMapData[i].config.id === mapId){
|
||||
mapDataIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mapDataIndex;
|
||||
};
|
||||
|
||||
/**
|
||||
* update cached mapData for a single map
|
||||
* @param mapData
|
||||
*/
|
||||
let updateCurrentMapData = function(mapData){
|
||||
let mapDataIndex = getCurrentMapDataIndex( mapData.config.id );
|
||||
|
||||
if(mapDataIndex !== false){
|
||||
Init.currentMapData[mapDataIndex].config = mapData.config;
|
||||
Init.currentMapData[mapDataIndex].data = mapData.data;
|
||||
}else{
|
||||
// new map data
|
||||
Init.currentMapData.push(mapData);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get currentMapData from "global" variable for a specific map or all maps
|
||||
* @param mapId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let getCurrentMapData = function(mapId){
|
||||
let getCurrentMapData = (mapId) => {
|
||||
let currentMapData = false;
|
||||
|
||||
if( mapId === parseInt(mapId, 10) ){
|
||||
@@ -1818,6 +1854,31 @@ define([
|
||||
return currentMapData;
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapData array index by mapId
|
||||
* @param mapId
|
||||
* @returns {boolean|int}
|
||||
*/
|
||||
let getCurrentMapDataIndex = (mapId) => {
|
||||
return getDataIndexByMapId(Init.currentMapData, mapId);
|
||||
};
|
||||
|
||||
/**
|
||||
* update cached mapData for a single map
|
||||
* @param mapData
|
||||
*/
|
||||
let updateCurrentMapData = (mapData) => {
|
||||
let mapDataIndex = getCurrentMapDataIndex( mapData.config.id );
|
||||
|
||||
if(mapDataIndex !== false){
|
||||
Init.currentMapData[mapDataIndex].config = mapData.config;
|
||||
Init.currentMapData[mapDataIndex].data = mapData.data;
|
||||
}else{
|
||||
// new map data
|
||||
Init.currentMapData.push(mapData);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param path
|
||||
* @param value
|
||||
@@ -1843,24 +1904,6 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* set currentUserData as "global" variable
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param userData
|
||||
*/
|
||||
let setCurrentUserData = function(userData){
|
||||
Init.currentUserData = userData;
|
||||
|
||||
// check if function is available
|
||||
// this is not the case in "login" page
|
||||
if( $.fn.updateHeaderUserData ){
|
||||
$.fn.updateHeaderUserData();
|
||||
}
|
||||
|
||||
return getCurrentUserData();
|
||||
};
|
||||
|
||||
/**
|
||||
* get the current log data for the current user character
|
||||
* @returns {boolean}
|
||||
@@ -2397,10 +2440,10 @@ define([
|
||||
getAreaIdBySecurity: getAreaIdBySecurity,
|
||||
setCurrentMapUserData: setCurrentMapUserData,
|
||||
getCurrentMapUserData: getCurrentMapUserData,
|
||||
updateCurrentMapUserData: updateCurrentMapUserData,
|
||||
setCurrentMapData: setCurrentMapData,
|
||||
getCurrentMapData: getCurrentMapData,
|
||||
filterCurrentMapData: filterCurrentMapData,
|
||||
getCurrentMapDataIndex: getCurrentMapDataIndex,
|
||||
updateCurrentMapData: updateCurrentMapData,
|
||||
deleteCurrentMapData: deleteCurrentMapData,
|
||||
setCurrentUserData: setCurrentUserData,
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3144,7 +3144,9 @@ define([
|
||||
// data for header update
|
||||
let headerUpdateData = {
|
||||
mapId: userData.config.id,
|
||||
userCount: 0 // active user on a map
|
||||
userCountInside: 0, // active user on a map
|
||||
userCountOutside: 0, // active user NOT on map
|
||||
userCountInactive: 0 // inactive users (no location)
|
||||
};
|
||||
|
||||
if(
|
||||
@@ -3184,7 +3186,7 @@ define([
|
||||
tempUserData = systemData;
|
||||
|
||||
// add "user count" to "total map user count"
|
||||
headerUpdateData.userCount += tempUserData.user.length;
|
||||
headerUpdateData.userCountInside += tempUserData.user.length;
|
||||
|
||||
// remove system from "search" array -> speed up loop
|
||||
userData.data.systems.splice(j, 1);
|
||||
@@ -3209,6 +3211,16 @@ define([
|
||||
system.updateSystemUserData(map, tempUserData, currentUserIsHere);
|
||||
}
|
||||
|
||||
// users who are not in any map system --------------------------------------------------------------------
|
||||
for(let i = 0; i < userData.data.systems.length; i++){
|
||||
// users without location are grouped in systemid: 0
|
||||
if(userData.data.systems[i].id){
|
||||
headerUpdateData.userCountOutside += userData.data.systems[i].user.length;
|
||||
}else{
|
||||
headerUpdateData.userCountInactive += userData.data.systems[i].user.length;
|
||||
}
|
||||
}
|
||||
|
||||
// trigger document event -> update header
|
||||
$(document).trigger('pf:updateHeaderMapData', headerUpdateData);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,10 @@ define([
|
||||
Util.deleteCurrentMapData( MsgWorkerMessage.data() );
|
||||
ModuleMap.updateMapModule(mapModule);
|
||||
break;
|
||||
case 'mapSubscriptions':
|
||||
Util.updateCurrentMapUserData(MsgWorkerMessage.data());
|
||||
ModuleMap.updateActiveMapUserData(mapModule);
|
||||
break;
|
||||
}
|
||||
|
||||
Util.setSyncStatus('ws:get');
|
||||
@@ -189,18 +193,6 @@ define([
|
||||
$(document).trigger('pf:shutdown', {status: jqXHR.status, reason: reason, error: errorData});
|
||||
};
|
||||
|
||||
/**
|
||||
* init (schedule) next MapUpdate Ping
|
||||
*/
|
||||
let initMapUpdatePing = (forceUpdateMapData) => {
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let delay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
|
||||
|
||||
updateTimeouts.mapUpdate = setTimeout((forceUpdateMapData) => {
|
||||
triggerMapUpdatePing(forceUpdateMapData);
|
||||
}, delay, forceUpdateMapData);
|
||||
};
|
||||
|
||||
// ping for main map update ========================================================
|
||||
/**
|
||||
* @param forceUpdateMapData // force request to be send
|
||||
@@ -217,8 +209,9 @@ define([
|
||||
|
||||
// get updated map data
|
||||
let updatedMapData = {
|
||||
forceUpdate: forceUpdateMapData ? 1 : 0,
|
||||
mapData: mapModule.getMapModuleDataForUpdate(),
|
||||
getUserData: ( Util.getCurrentUserData() ) ? 0 : 1
|
||||
getUserData: Util.getCurrentUserData() ? 0 : 1
|
||||
};
|
||||
|
||||
// check if mapUpdate trigger should be send
|
||||
@@ -267,7 +260,7 @@ define([
|
||||
|
||||
// load/update main map module
|
||||
ModuleMap.updateMapModule(mapModule).then(() => {
|
||||
// map update done, init new trigger
|
||||
// map update done, init new trigger
|
||||
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let mapUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
|
||||
@@ -307,10 +300,9 @@ define([
|
||||
|
||||
let updatedUserData = {
|
||||
mapIds: mapIds,
|
||||
systemData: Util.getCurrentSystemData(),
|
||||
characterMapData: {
|
||||
mapTracking: (locationToggle.is(':checked') ? 1 : 0) // location tracking
|
||||
}
|
||||
getMapUserData: Util.getSyncType() === 'webSocket' ? 0 : 1,
|
||||
mapTracking: locationToggle.is(':checked') ? 1 : 0, // location tracking
|
||||
systemData: Util.getCurrentSystemData()
|
||||
};
|
||||
|
||||
Util.timeStart(logKeyServerUserData);
|
||||
@@ -321,43 +313,38 @@ define([
|
||||
data: updatedUserData,
|
||||
dataType: 'json'
|
||||
}).done((data) => {
|
||||
|
||||
// log request time
|
||||
let duration = Util.timeStop(logKeyServerUserData);
|
||||
Util.log(logKeyServerUserData, {duration: duration, type: 'server', description:'request user data'});
|
||||
|
||||
if(data.error.length > 0){
|
||||
if(
|
||||
data.error &&
|
||||
data.error.length > 0
|
||||
){
|
||||
// any error in the main trigger functions result in a user log-off
|
||||
$(document).trigger('pf:menuLogout');
|
||||
}else{
|
||||
|
||||
$(document).setProgramStatus('online');
|
||||
|
||||
if(data.userData !== undefined){
|
||||
// store current user data global (cache)
|
||||
let userData = Util.setCurrentUserData(data.userData);
|
||||
|
||||
// store current map user data (cache)
|
||||
if(data.mapUserData !== undefined){
|
||||
Util.setCurrentMapUserData(data.mapUserData);
|
||||
}
|
||||
|
||||
// active character data found
|
||||
mapModule.updateMapModuleData();
|
||||
|
||||
// update system info panels
|
||||
if(data.system){
|
||||
mapModule.updateSystemModuleData(data.system);
|
||||
}
|
||||
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let mapUserUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerUserData, 0 );
|
||||
|
||||
// init new trigger
|
||||
updateTimeouts.userUpdate = setTimeout(() => {
|
||||
triggerUserUpdatePing();
|
||||
}, mapUserUpdateDelay);
|
||||
// store current map user data (cache)
|
||||
if(data.mapUserData !== undefined){
|
||||
Util.setCurrentMapUserData(data.mapUserData);
|
||||
}
|
||||
|
||||
// update map module character data
|
||||
ModuleMap.updateActiveMapUserData(mapModule).then(() => {
|
||||
// map module update done, init new trigger
|
||||
initMapUserUpdatePing();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,6 +352,29 @@ define([
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* init (schedule) next MapUpdate Ping
|
||||
*/
|
||||
let initMapUpdatePing = (forceUpdateMapData) => {
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let delay = Util.getCurrentTriggerDelay(logKeyServerMapData, 0);
|
||||
|
||||
updateTimeouts.mapUpdate = setTimeout((forceUpdateMapData) => {
|
||||
triggerMapUpdatePing(forceUpdateMapData);
|
||||
}, delay, forceUpdateMapData);
|
||||
};
|
||||
|
||||
/**
|
||||
* init (schedule) next MapUserUpdate Ping
|
||||
*/
|
||||
let initMapUserUpdatePing = () => {
|
||||
// get the current update delay (this can change if a user is inactive)
|
||||
let delay = Util.getCurrentTriggerDelay(logKeyServerUserData, 0);
|
||||
|
||||
updateTimeouts.userUpdate = setTimeout(() => {
|
||||
triggerUserUpdatePing();
|
||||
}, delay);
|
||||
};
|
||||
|
||||
/**
|
||||
* clear both main update timeouts
|
||||
|
||||
@@ -298,39 +298,55 @@ define([
|
||||
};
|
||||
|
||||
/**
|
||||
* updates only visible/active map module
|
||||
* @returns {boolean}
|
||||
* updates current visible/active mapElement in mapModuleElement with user data
|
||||
* @param mapModuleElement
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
$.fn.updateMapModuleData = function(){
|
||||
let mapModule = $(this);
|
||||
let updateActiveMapUserData = (mapModuleElement) => {
|
||||
|
||||
let updateActiveMapModuleExecutor = (resolve, reject) => {
|
||||
// get all active map elements for module
|
||||
let mapElement = mapModuleElement.getActiveMap();
|
||||
|
||||
updateMapUserData(mapElement).then(payload => resolve());
|
||||
};
|
||||
|
||||
return new Promise(updateActiveMapModuleExecutor);
|
||||
};
|
||||
|
||||
/**
|
||||
* updates mapElement with user data
|
||||
* update
|
||||
* @param mapElement
|
||||
* @returns {Promise<any>}
|
||||
*/
|
||||
let updateMapUserData = (mapElement) => {
|
||||
// performance logging (time measurement)
|
||||
let logKeyClientUserData = Init.performanceLogging.keyClientUserData;
|
||||
Util.timeStart(logKeyClientUserData);
|
||||
|
||||
// get all active map elements for module
|
||||
let mapElement = mapModule.getActiveMap();
|
||||
let updateMapUserDataExecutor = (resolve, reject) => {
|
||||
if(mapElement !== false){
|
||||
let mapId = mapElement.data('id');
|
||||
let currentMapUserData = Util.getCurrentMapUserData(mapId);
|
||||
|
||||
if(mapElement !== false){
|
||||
let mapId = mapElement.data('id');
|
||||
if(currentMapUserData){
|
||||
// trigger "update local" for this map => async
|
||||
mapElement.trigger('pf:updateLocal', currentMapUserData);
|
||||
|
||||
let currentMapUserData = Util.getCurrentMapUserData(mapId);
|
||||
|
||||
|
||||
if(currentMapUserData){
|
||||
// trigger "update local" for this map => async
|
||||
mapElement.trigger('pf:updateLocal', currentMapUserData);
|
||||
|
||||
// update map with current user data
|
||||
mapElement.updateUserData(currentMapUserData);
|
||||
// update map with current user data
|
||||
mapElement.updateUserData(currentMapUserData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// log client user data update time
|
||||
let duration = Util.timeStop(logKeyClientUserData);
|
||||
Util.log(logKeyClientUserData, {duration: duration, type: 'client', description:'update users'});
|
||||
resolve();
|
||||
};
|
||||
|
||||
return true;
|
||||
return new Promise(updateMapUserDataExecutor).then(payload => {
|
||||
// log client map update time
|
||||
let duration = Util.timeStop(logKeyClientUserData);
|
||||
Util.log(logKeyClientUserData, {duration: duration, type: 'client', description: 'update users'});
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -634,6 +650,9 @@ define([
|
||||
let mapUrl = MapUtil.getMapDeeplinkUrl(mapConfig.config.id);
|
||||
history.pushState({}, '', mapUrl);
|
||||
}
|
||||
|
||||
// update map user data (do not wait until next update is triggered)
|
||||
updateMapUserData(mapElement);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1189,6 +1208,7 @@ define([
|
||||
|
||||
return {
|
||||
updateTabData: updateTabData,
|
||||
updateMapModule: updateMapModule
|
||||
updateMapModule: updateMapModule,
|
||||
updateActiveMapUserData: updateActiveMapUserData
|
||||
};
|
||||
});
|
||||
@@ -482,7 +482,7 @@ define([
|
||||
});
|
||||
|
||||
// active pilots
|
||||
$('.' + config.headActiveUserClass).find('a').on('click', function(){
|
||||
$('.' + config.headActiveUserClass).on('click', function(){
|
||||
$(document).triggerMenuEvent('ShowMapInfo', {tab: 'activity'});
|
||||
});
|
||||
|
||||
@@ -718,7 +718,9 @@ define([
|
||||
documentElement.on('pf:updateHeaderMapData', function(e, data){
|
||||
let activeMap = Util.getMapModule().getActiveMap();
|
||||
|
||||
let userCount = 0;
|
||||
let userCountInside = 0;
|
||||
let userCountOutside = 0;
|
||||
let userCountInactive = 0;
|
||||
let currentLocationData = {};
|
||||
|
||||
// show active user just for the current active map
|
||||
@@ -726,10 +728,12 @@ define([
|
||||
activeMap &&
|
||||
activeMap.data('id') === data.mapId
|
||||
){
|
||||
userCount = data.userCount;
|
||||
userCountInside = data.userCountInside;
|
||||
userCountOutside = data.userCountOutside;
|
||||
userCountInactive = data.userCountInactive;
|
||||
currentLocationData = data;
|
||||
}
|
||||
updateHeaderActiveUserCount(userCount);
|
||||
updateHeaderActiveUserCount(userCountInside, userCountOutside, userCountInactive);
|
||||
updateHeaderCurrentLocation(currentLocationData);
|
||||
});
|
||||
|
||||
@@ -981,23 +985,35 @@ define([
|
||||
|
||||
/**
|
||||
* update the "active user" badge in header
|
||||
* @param userCount
|
||||
* @param userCountInside
|
||||
* @param userCountOutside
|
||||
* @param userCountInactive
|
||||
*/
|
||||
let updateHeaderActiveUserCount = function(userCount){
|
||||
let updateHeaderActiveUserCount = (userCountInside, userCountOutside, userCountInactive) => {
|
||||
let activeUserElement = $('.' + config.headActiveUserClass);
|
||||
let badge = activeUserElement.find('.badge');
|
||||
|
||||
if(badge.data('userCount') !== userCount){
|
||||
badge.data('userCount', userCount);
|
||||
let updateCount = (badge, count) => {
|
||||
let changed = false;
|
||||
if(badge.data('userCount') !== count){
|
||||
changed = true;
|
||||
badge.data('userCount', count);
|
||||
badge.text(count);
|
||||
|
||||
badge.text(userCount);
|
||||
|
||||
badge.toggleClass('txt-color-greenLight', (userCount > 0) );
|
||||
badge.toggleClass('txt-color-red', (userCount === 0) );
|
||||
|
||||
if(! activeUserElement.is(':visible')){
|
||||
activeUserElement.velocity('fadeIn', {duration: Init.animationSpeed.headerLink});
|
||||
badge.toggleClass(badge.attr('data-on'), (count > 0) );
|
||||
badge.toggleClass(badge.attr('data-off'), (count === 0) );
|
||||
}
|
||||
return changed;
|
||||
};
|
||||
|
||||
let changedInside = updateCount(activeUserElement.find('.badge[data-type="inside"]'), userCountInside);
|
||||
let changedOutside = updateCount(activeUserElement.find('.badge[data-type="outside"]'), userCountOutside);
|
||||
let changedInactive = updateCount(activeUserElement.find('.badge[data-type="inactive"]'), userCountInactive);
|
||||
|
||||
if(
|
||||
(changedInactive || changedOutside || changedInactive) &&
|
||||
!activeUserElement.is(':visible')
|
||||
){
|
||||
activeUserElement.velocity('fadeIn', {duration: Init.animationSpeed.headerLink});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ define([
|
||||
tableCellCounterClass: 'pf-table-counter-cell', // class for table "counter" cells
|
||||
tableCellEllipsisClass: 'pf-table-cell-ellipses-auto', // class for table "ellipsis" cells
|
||||
tableCellActionIconClass: 'pf-table-action-icon-cell', // class for table "action" icon (icon is part of cell content)
|
||||
tableCellUnknownDataClass: 'pf-table-unknown-cell', // class for table "unknown" cells
|
||||
|
||||
textActionIconClass: 'pf-module-icon-button', // class for text action
|
||||
textActionIconCopyClass: 'pf-module-icon-button-copy', // class for text action "copy"
|
||||
@@ -82,6 +83,14 @@ define([
|
||||
return icon.length ? '<i class="fas fa-fw ' + icon + ' ' + config.tableCellActionIconClass + '" title="' + type + '" data-toggle="tooltip"></i>' : '';
|
||||
};
|
||||
|
||||
/**
|
||||
* get label for "unknown" label
|
||||
* @returns {string}
|
||||
*/
|
||||
let getLabelForUnknownData = () => {
|
||||
return '<span class="' + config.tableCellUnknownDataClass + '">unknown</span>';
|
||||
};
|
||||
|
||||
/**
|
||||
* write clipboard text
|
||||
* @param text
|
||||
@@ -849,10 +858,11 @@ define([
|
||||
searchable: false,
|
||||
className: ['pf-help-default', 'text-center', config.tableCellImageClass].join(' '),
|
||||
data: 'log.ship',
|
||||
defaultContent: '',
|
||||
render: {
|
||||
_: function(data, type, row, meta){
|
||||
let value = data;
|
||||
if(type === 'display'){
|
||||
if(data && type === 'display'){
|
||||
value = '<img src="' + Init.url.ccpImageServer + '/Render/' + value.typeId + '_32.png" title="' + value.typeName + '" data-toggle="tooltip" />';
|
||||
}
|
||||
return value;
|
||||
@@ -865,12 +875,17 @@ define([
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'log.ship',
|
||||
defaultContent: getLabelForUnknownData(),
|
||||
render: {
|
||||
_: function(data, type, row){
|
||||
let value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis100Class + '">' + data.name + '</div>';
|
||||
let value = data;
|
||||
if(data){
|
||||
value = data.name;
|
||||
if(type === 'display'){
|
||||
value = '<div class="' + MapUtil.config.tableCellEllipsisClass + ' ' + MapUtil.config.tableCellEllipsis100Class + '">' + data.name + '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -960,9 +975,15 @@ define([
|
||||
orderable: true,
|
||||
searchable: true,
|
||||
data: 'log.system',
|
||||
defaultContent: getLabelForUnknownData(),
|
||||
render: {
|
||||
_: 'name',
|
||||
sort: 'name'
|
||||
_: function(data, type, row, meta){
|
||||
let value = data;
|
||||
if(data && type === 'display'){
|
||||
value = data.name;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},{
|
||||
targets: 7,
|
||||
@@ -971,13 +992,18 @@ define([
|
||||
searchable: true,
|
||||
className: [config.tableCellActionClass].join(' '),
|
||||
data: 'log',
|
||||
defaultContent: getLabelForUnknownData(),
|
||||
render: {
|
||||
_: function (data, type, row, meta) {
|
||||
let value = '';
|
||||
if(data.station && data.station.id > 0){
|
||||
value = data.station.name + ' ' + getIconForDockedStatus('station');
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = data.structure.name + ' ' + getIconForDockedStatus('structure');
|
||||
let value = data;
|
||||
if(data){
|
||||
if(data.station && data.station.id > 0){
|
||||
value = data.station.name + ' ' + getIconForDockedStatus('station');
|
||||
}else if(data.structure && data.structure.id > 0){
|
||||
value = data.structure.name + ' ' + getIconForDockedStatus('structure');
|
||||
}else{
|
||||
value = '';
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -72,9 +72,9 @@ define([
|
||||
let localStorage; // cache for "localForage" singleton
|
||||
|
||||
/*
|
||||
* ===========================================================================================================
|
||||
* ===============================================================================================================
|
||||
* Global jQuery plugins for some common and frequently used functions
|
||||
* ==========================================================================================================
|
||||
* ==============================================================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -820,9 +820,9 @@ define([
|
||||
};
|
||||
|
||||
/*
|
||||
* ===========================================================================================================
|
||||
* ===============================================================================================================
|
||||
* Util functions that are global available for all modules
|
||||
* ==========================================================================================================
|
||||
* ==============================================================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -1149,11 +1149,29 @@ define([
|
||||
return logInfo;
|
||||
};
|
||||
|
||||
/**
|
||||
* set currentUserData as "global" variable
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param userData
|
||||
*/
|
||||
let setCurrentUserData = (userData) => {
|
||||
Init.currentUserData = userData;
|
||||
|
||||
// check if function is available
|
||||
// this is not the case in "login" page
|
||||
if( $.fn.updateHeaderUserData ){
|
||||
$.fn.updateHeaderUserData();
|
||||
}
|
||||
|
||||
return getCurrentUserData();
|
||||
};
|
||||
|
||||
/**
|
||||
* get currentUserData from "global" variable
|
||||
* @returns {*}
|
||||
*/
|
||||
let getCurrentUserData = function(){
|
||||
let getCurrentUserData = () => {
|
||||
return Init.currentUserData;
|
||||
};
|
||||
|
||||
@@ -1196,7 +1214,7 @@ define([
|
||||
/**
|
||||
* set default jQuery AJAX configuration
|
||||
*/
|
||||
let ajaxSetup = function(){
|
||||
let ajaxSetup = () => {
|
||||
$.ajaxSetup({
|
||||
beforeSend: function(xhr, settings) {
|
||||
// Add custom application headers on "same origin" requests only!
|
||||
@@ -1702,13 +1720,34 @@ define([
|
||||
return signatureTypeId;
|
||||
};
|
||||
|
||||
/**
|
||||
* get array key that points to map data catching mapId
|
||||
* @param data
|
||||
* @param mapId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let getDataIndexByMapId = (data, mapId) => {
|
||||
let index = false;
|
||||
if( Array.isArray(data) && mapId === parseInt(mapId, 10) ){
|
||||
for(let i = 0; i < data.length; i++){
|
||||
if(data[i].config.id === mapId){
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return index;
|
||||
};
|
||||
|
||||
// CurrentMapUserData =============================================================================================
|
||||
|
||||
/**
|
||||
* set currentMapUserData as "global" variable (count of active pilots)
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param mapUserData
|
||||
*/
|
||||
let setCurrentMapUserData = function(mapUserData){
|
||||
let setCurrentMapUserData = (mapUserData) => {
|
||||
Init.currentMapUserData = mapUserData;
|
||||
|
||||
return getCurrentMapUserData();
|
||||
@@ -1719,23 +1758,26 @@ define([
|
||||
* @param mapId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let getCurrentMapUserData = function(mapId){
|
||||
let getCurrentMapUserData = (mapId) => {
|
||||
let currentMapUserData = false;
|
||||
|
||||
if(
|
||||
mapId === parseInt(mapId, 10) &&
|
||||
Init.currentMapUserData
|
||||
){
|
||||
// search for a specific map
|
||||
for(let i = 0; i < Init.currentMapUserData.length; i++){
|
||||
if(Init.currentMapUserData[i].config.id === mapId){
|
||||
currentMapUserData = Init.currentMapUserData[i];
|
||||
break;
|
||||
if(Init.currentMapUserData){
|
||||
if(mapId === parseInt(mapId, 10)){
|
||||
|
||||
// search for a specific map
|
||||
for(let i = 0; i < Init.currentMapUserData.length; i++){
|
||||
if(
|
||||
Init.currentMapUserData[i].config &&
|
||||
Init.currentMapUserData[i].config.id === mapId
|
||||
){
|
||||
currentMapUserData = Init.currentMapUserData[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
// get data for all maps
|
||||
currentMapUserData = Init.currentMapUserData;
|
||||
}
|
||||
}else{
|
||||
// get data for all maps
|
||||
currentMapUserData = Init.currentMapUserData;
|
||||
}
|
||||
|
||||
if(currentMapUserData !== false){
|
||||
@@ -1746,60 +1788,54 @@ define([
|
||||
return currentMapUserData;
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapDataUser array index by mapId
|
||||
* @param mapId
|
||||
* @returns {boolean|int}
|
||||
*/
|
||||
let getCurrentMapUserDataIndex = (mapId) => {
|
||||
return getDataIndexByMapId(Init.currentMapUserData, mapId);
|
||||
};
|
||||
|
||||
/**
|
||||
* update cached mapUserData for a single map
|
||||
* @param mapUserData
|
||||
*/
|
||||
let updateCurrentMapUserData = (mapUserData) => {
|
||||
let mapUserDataIndex = getCurrentMapUserDataIndex( mapUserData.config.id );
|
||||
|
||||
if( !Array.isArray(Init.currentMapUserData) ){
|
||||
Init.currentMapUserData = [];
|
||||
}
|
||||
|
||||
if(mapUserDataIndex !== false){
|
||||
Init.currentMapUserData[mapUserDataIndex] = mapUserData;
|
||||
}else{
|
||||
// new map data
|
||||
Init.currentMapUserData.push(mapUserData);
|
||||
}
|
||||
};
|
||||
|
||||
// CurrentMapData =================================================================================================
|
||||
|
||||
/**
|
||||
* set currentMapData as "global" variable
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param mapData
|
||||
*/
|
||||
let setCurrentMapData = function(mapData){
|
||||
let setCurrentMapData = (mapData) => {
|
||||
Init.currentMapData = mapData;
|
||||
|
||||
return getCurrentMapData();
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapData array index by mapId
|
||||
* @param mapId
|
||||
* @returns {boolean|int}
|
||||
*/
|
||||
let getCurrentMapDataIndex = function(mapId){
|
||||
let mapDataIndex = false;
|
||||
|
||||
if( mapId === parseInt(mapId, 10) ){
|
||||
for(let i = 0; i < Init.currentMapData.length; i++){
|
||||
if(Init.currentMapData[i].config.id === mapId){
|
||||
mapDataIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return mapDataIndex;
|
||||
};
|
||||
|
||||
/**
|
||||
* update cached mapData for a single map
|
||||
* @param mapData
|
||||
*/
|
||||
let updateCurrentMapData = function(mapData){
|
||||
let mapDataIndex = getCurrentMapDataIndex( mapData.config.id );
|
||||
|
||||
if(mapDataIndex !== false){
|
||||
Init.currentMapData[mapDataIndex].config = mapData.config;
|
||||
Init.currentMapData[mapDataIndex].data = mapData.data;
|
||||
}else{
|
||||
// new map data
|
||||
Init.currentMapData.push(mapData);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* get currentMapData from "global" variable for a specific map or all maps
|
||||
* @param mapId
|
||||
* @returns {boolean}
|
||||
*/
|
||||
let getCurrentMapData = function(mapId){
|
||||
let getCurrentMapData = (mapId) => {
|
||||
let currentMapData = false;
|
||||
|
||||
if( mapId === parseInt(mapId, 10) ){
|
||||
@@ -1818,6 +1854,31 @@ define([
|
||||
return currentMapData;
|
||||
};
|
||||
|
||||
/**
|
||||
* get mapData array index by mapId
|
||||
* @param mapId
|
||||
* @returns {boolean|int}
|
||||
*/
|
||||
let getCurrentMapDataIndex = (mapId) => {
|
||||
return getDataIndexByMapId(Init.currentMapData, mapId);
|
||||
};
|
||||
|
||||
/**
|
||||
* update cached mapData for a single map
|
||||
* @param mapData
|
||||
*/
|
||||
let updateCurrentMapData = (mapData) => {
|
||||
let mapDataIndex = getCurrentMapDataIndex( mapData.config.id );
|
||||
|
||||
if(mapDataIndex !== false){
|
||||
Init.currentMapData[mapDataIndex].config = mapData.config;
|
||||
Init.currentMapData[mapDataIndex].data = mapData.data;
|
||||
}else{
|
||||
// new map data
|
||||
Init.currentMapData.push(mapData);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @param path
|
||||
* @param value
|
||||
@@ -1843,24 +1904,6 @@ define([
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* set currentUserData as "global" variable
|
||||
* this function should be called continuously after data change
|
||||
* to keep the data always up2data
|
||||
* @param userData
|
||||
*/
|
||||
let setCurrentUserData = function(userData){
|
||||
Init.currentUserData = userData;
|
||||
|
||||
// check if function is available
|
||||
// this is not the case in "login" page
|
||||
if( $.fn.updateHeaderUserData ){
|
||||
$.fn.updateHeaderUserData();
|
||||
}
|
||||
|
||||
return getCurrentUserData();
|
||||
};
|
||||
|
||||
/**
|
||||
* get the current log data for the current user character
|
||||
* @returns {boolean}
|
||||
@@ -2397,10 +2440,10 @@ define([
|
||||
getAreaIdBySecurity: getAreaIdBySecurity,
|
||||
setCurrentMapUserData: setCurrentMapUserData,
|
||||
getCurrentMapUserData: getCurrentMapUserData,
|
||||
updateCurrentMapUserData: updateCurrentMapUserData,
|
||||
setCurrentMapData: setCurrentMapData,
|
||||
getCurrentMapData: getCurrentMapData,
|
||||
filterCurrentMapData: filterCurrentMapData,
|
||||
getCurrentMapDataIndex: getCurrentMapDataIndex,
|
||||
updateCurrentMapData: updateCurrentMapData,
|
||||
deleteCurrentMapData: deleteCurrentMapData,
|
||||
setCurrentUserData: setCurrentUserData,
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<nav id="{{id}}" class="navbar navbar-default pf-head" role="navigation">
|
||||
<div class="container-fluid">
|
||||
<div class="navbar-header pull-left">
|
||||
|
||||
<a class="navbar-brand pf-head-menu" href="">
|
||||
<svg class="{{brandLogo}}" width="24px" height="24px">
|
||||
<use xlink:href="#pf-logo"/>
|
||||
@@ -22,12 +21,12 @@
|
||||
<img class="{{userShipImageClass}}" src=""/>
|
||||
<span>{{! will be filled with current user ship name }}</span>
|
||||
</p>
|
||||
<p class="navbar-text pf-head-active-user" title="active pilots">
|
||||
<a href="javascript:void(0);">
|
||||
<i class="fas fa-fighter-jet fa-fw"></i>active <span class="badge txt-color"></span>
|
||||
</a>
|
||||
<p class="navbar-text pf-head-active-user">
|
||||
<i class="fas fa-fighter-jet fa-fw"></i>
|
||||
<span class="badge txt-color" data-type="inside" data-on="txt-color-greenLight" data-off="txt-color-red" title="pilots on map"></span>
|
||||
<span class="badge txt-color" data-type="outside" data-on="txt-color-grayLighter" data-off="txt-color-grayLighter" title="pilots beyond map"></span>
|
||||
<span class="badge txt-color" data-type="inactive" data-on="txt-color-grayLighter" data-off="txt-color-grayLighter" title="pilots not ingame / no location"></span>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="navbar-header pull-right">
|
||||
|
||||
@@ -295,6 +295,10 @@ select:active, select:hover {
|
||||
}
|
||||
}
|
||||
|
||||
.pf-table-unknown-cell{
|
||||
color: $red;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.pf-table-cell-ellipsis{
|
||||
overflow: hidden;
|
||||
@@ -1225,6 +1229,10 @@ code {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.pf-head-active-user{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pf-head-active-user, #pf-head-current-location{
|
||||
display: none; // triggered by js
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ $mapWrapperMaxWidth: $mapWidth + 35px;
|
||||
&:hover{
|
||||
// makes the systems "flying" :)
|
||||
@include box-shadow(0 6px 12px rgba(0,0,0, 0.3));
|
||||
@include transform( translate3d(0, -2px, 0) );
|
||||
@include transform( translate3d(0, -2px, 0) !important);
|
||||
}
|
||||
|
||||
.pf-system-head{
|
||||
|
||||
Reference in New Issue
Block a user