feat: Added Nodename to server card -> info icon popover

This commit is contained in:
IceToast 2021-12-23 14:48:04 +01:00
parent 840da10a38
commit c715479fa2
3 changed files with 8 additions and 4 deletions

View file

@ -17,7 +17,7 @@ class Pterodactyl
/** /**
* @description per_page option to pull more than the default 50 from pterodactyl * @description per_page option to pull more than the default 50 from pterodactyl
*/ */
public CONST PER_PAGE = 200; public const PER_PAGE = 200;
//TODO: Extend error handling (maybe logger for more errors when debugging) //TODO: Extend error handling (maybe logger for more errors when debugging)
@ -193,7 +193,6 @@ class Pterodactyl
"default" => $allocationId "default" => $allocationId
] ]
]); ]);
} }
public static function suspendServer(Server $server) public static function suspendServer(Server $server)
@ -245,7 +244,7 @@ class Pterodactyl
public static function getServerAttributes(string $pterodactylId) public static function getServerAttributes(string $pterodactylId)
{ {
try { try {
$response = self::client()->get("/application/servers/{$pterodactylId}?include=egg,nest,location"); $response = self::client()->get("/application/servers/{$pterodactylId}?include=egg,node,nest,location");
} catch (Exception $e) { } catch (Exception $e) {
throw self::getException(); throw self::getException();
} }

View file

@ -43,6 +43,8 @@ class ServerController extends Controller
$server->egg = $serverRelationships['egg']['attributes']['name']; $server->egg = $serverRelationships['egg']['attributes']['name'];
$server->nest = $serverRelationships['nest']['attributes']['name']; $server->nest = $serverRelationships['nest']['attributes']['name'];
$server->node = $serverRelationships['node']['attributes']['name'];
//get productname by product_id for server //get productname by product_id for server
$product = Product::find($server->product_id); $product = Product::find($server->product_id);

View file

@ -81,8 +81,11 @@
<div class="col-5"> <div class="col-5">
{{ __('Location') }}: {{ __('Location') }}:
</div> </div>
<div class="col-7"> <div class="col-7 d-flex justify-content-between align-items-center">
<span class="">{{ $server->location }}</span> <span class="">{{ $server->location }}</span>
<i data-toggle="popover" data-trigger="hover"
data-content="{{ __('Node') }}: {{ $server->node }}"
class="fas fa-info-circle"></i>
</div> </div>
</div> </div>