Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0.x #599

Merged
merged 6 commits into from
Feb 23, 2022
Merged

5.0.x #599

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/Http/DataTables/Alliance/Intel/TrackingDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function ajax()
})
->editColumn('member_count', function ($row) {
if ($row->member_limit->limit < 1)
return sprintf('%d/%d (100.00%%)', $row->member_count, $row->member_count);
return sprintf('%d', $row->member_count);

return sprintf('%d/%d (%s%%)',
$row->member_count, $row->member_limit->limit, number($row->member_count / $row->member_limit->limit * 100));
Expand All @@ -58,8 +58,6 @@ public function ajax()
return view('web::partials.character', ['character' => $row->ceo])->render();
})
->editColumn('tracking', function ($row) {
// <dd>{{ $trackings }} / {{ $sheet->member_count }} ({{ number_format($trackings/$sheet->member_count * 100, 2) }}%) {{ trans_choice('web::seat.valid_token', $sheet->member_count) }}</dd>

$trackings = $row->characters->reject(function ($char) {
return is_null($char->refresh_token);
})->count();
Expand Down Expand Up @@ -93,7 +91,8 @@ public function html()
*/
public function query()
{
return CorporationInfo::player()->with('member_limit', 'ceo', 'alliance')
return CorporationInfo::player()
->with('member_limit', 'ceo', 'alliance', 'characters')
->select('corporation_infos.*');
}

Expand All @@ -108,7 +107,7 @@ public function getColumns()
['data' => 'ceo.name', 'title' => trans('web::seat.ceo')],
['data' => 'tax_rate', 'title' => trans('web::seat.tax_rate')],
['data' => 'member_count', 'title' => trans('web::seat.member_count')],
['data' => 'tracking', 'title' => trans_choice('web::seat.valid_token', 2)],
['data' => 'tracking', 'title' => trans_choice('web::seat.valid_token', 2), 'orderable' => false],
];
}
}
3 changes: 3 additions & 0 deletions src/Http/DataTables/Character/CharacterDataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public function ajax()

return '';
})
->editColumn('security_status', function ($row) {
return number_format($row->security_status, 2,);
})
->editColumn('refresh_token.expires_on', function ($row) {
return view('web::character.partials.token_status', ['refresh_token' => $row->refresh_token])->render();
})
Expand Down
20 changes: 12 additions & 8 deletions src/Traits/Stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function getTotalCharacterMiningIsk(array $character_ids): ?float
public function getTotalCharacterRattingIsk(array $character_ids): ?float
{
return CharacterWalletJournal::whereIn('second_party_id', $character_ids)
->whereIn('ref_type', ['bounty_prizes', 'ess_escrow_transfer'])
->whereIn('ref_type', ['bounty_prizes', 'ess_escrow_transfer', 'corporate_reward_payout'])
->whereYear('date', carbon()->year)
->whereMonth('date', carbon()->month)
->sum('amount');
Expand Down Expand Up @@ -125,9 +125,11 @@ public function getCharacterSkillCoverage(int $character_id): Collection
$in_game_skills = DB::table('invTypes')
->join(
'invMarketGroups',
'invMarketGroups.marketGroupID', '=', 'invTypes.marketGroupID'
'invMarketGroups.marketGroupID',
'=',
'invTypes.marketGroupID'
)
->where('parentGroupID', '?')// binding at [1]
->where('parentGroupID', '?') // binding at [1]
->select(
'marketGroupName',
DB::raw('COUNT(*) * 5 as amount')
Expand All @@ -137,15 +139,17 @@ public function getCharacterSkillCoverage(int $character_id): Collection

$character_skills = CharacterSkill::join(
'invTypes',
'invTypes.typeID', '=',
'invTypes.typeID',
'=',
'character_skills.skill_id'
)
->join(
'invMarketGroups',
'invMarketGroups.marketGroupID', '=',
'invMarketGroups.marketGroupID',
'=',
'invTypes.marketGroupID'
)
->where('character_id', '?')// binding at [2]
->where('character_id', '?') // binding at [2]
->select(
'marketGroupName',
DB::raw('COUNT(*) * character_skills.trained_skill_level as amount')
Expand All @@ -167,8 +171,8 @@ public function getCharacterSkillCoverage(int $character_id): Collection
DB::raw('SUM(b.amount) AS character_amount')
)
->groupBy(['a.marketGroupName', 'a.amount'])
->addBinding(150, 'select')// binding [1]
->addBinding($character_id, 'select')// binding [2]
->addBinding(150, 'select') // binding [1]
->addBinding($character_id, 'select') // binding [2]
->get();

return $skills;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/af/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@

// Dashboard
'home_page' => 'Die Tuisblad',
'online_layers' => 'Spelers Aanlyn',
'online_players' => 'Spelers Aanlyn',
'owned_api_keys' => 'Besitte API Sleutels',
'concurrent_player_count' => 'Gelyktydige speler telling',
'esi_response_time' => 'ESI Response Times',
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/de/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@

// Dashboard
'home_page' => 'Home',
'online_layers' => 'Spieler Online',
'online_players' => 'Spieler Online',
'owned_api_keys' => 'Eigene API Keys',
'concurrent_player_count' => 'Anzahl gleichzeitiger Spieler',
'esi_response_time' => 'ESI Reaktionszeiten',
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/en/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
// Dashboard
'home_page' => 'The Home Page',
'dashboard' => 'Dashboard',
'online_layers' => 'Online Players',
'online_players' => 'Online Players',
'owned_api_keys' => 'Owned API Keys',
'total_character_isk' => 'Total Character ISK',
'total_character_skillpoints' => 'Total Character Skillpoints',
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/fr/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@

// Dashboard
'home_page' => 'Page d\'accueil',
'online_layers' => 'Joueurs connectés',
'online_players' => 'Joueurs connectés',
'owned_api_keys' => 'Clés API possédées',
'concurrent_player_count' => 'Nombre de joueurs simultanés',
'esi_response_time' => 'Temps de réponse d\'ESI',
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/ru/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
// Dashboard
'home_page' => 'Стартовая страница',
'dashboard' => 'Аналитика',
'online_layers' => 'Игроки онлайн',
'online_players' => 'Игроки онлайн',
'owned_api_keys' => 'Введеные API ключи',
'total_character_isk' => 'Итого (ISK)',
'total_character_skillpoints' => 'Итого очков умения (SP)',
Expand Down
2 changes: 1 addition & 1 deletion src/resources/lang/zh-CN/seat.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
// Dashboard
'home_page' => '首页',
'dashboard' => '仪表盘',
'online_layers' => '在线玩家',
'online_players' => '在线玩家',
'owned_api_keys' => '拥有的API数量',
'total_character_isk' => '总角色ISK',
'total_character_skillpoints' => '总角色技能点',
Expand Down
2 changes: 1 addition & 1 deletion src/resources/views/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="info-box">
<span class="info-box-icon bg-aqua elevation-1"><i class="fa fa-server"></i></span>
<div class="info-box-content">
<span class="info-box-text">{{ trans('web::seat.online_layers') }}</span>
<span class="info-box-text">{{ trans('web::seat.online_players') }}</span>
<span class="info-box-number">
{{ $server_status['players'] ?? trans('web::seat.unknown') }}
</span>
Expand Down
2 changes: 2 additions & 0 deletions src/resources/views/includes/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
@endcan
<!-- ./job-queue -->
<!-- impersonation -->
@if(session('impersonation_origin', false))
<div class="nav-item d-md-flex me-3">
<a href="{{ route('seatcore::configuration.users.impersonate.stop') }}" class="nav-link px-0" tabindex="-1" aria-label="{{ trans('web::seat.stop_impersonation') }}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{ trans('web::seat.stop_impersonation') }}">
<i class="fas fa-user-secret fa-lg"></i>
</a>
</div>
@endif
<!-- ./impersonation -->
<!-- user-card -->
<div class="nav-item dropdown">
Expand Down