Skip to content

Commit

Permalink
get_user_passkey()
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaomlove committed Oct 9, 2024
1 parent 9fec1a7 commit 2493627
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
13 changes: 2 additions & 11 deletions app/Console/Commands/Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,8 @@ public function __construct()
*/
public function handle()
{
$url = "http://127.0.0.1:7777/list-seeder-leecher-count";
$idArr = [8, 12];
$client = new Client();
$response = $client->post($url, ['json' => ['torrent_ids' => $idArr]]);
$result = json_decode((string)$response->getBody(), true);
dump($result);
if (!isset($result['ret']) || $result['ret'] != 0) {
echo "Bad";
} else {
echo "OK";
}
$ip = "116.77.75.254";
$this->info(inet_pton($ip));
}

}
25 changes: 25 additions & 0 deletions app/Filament/Pages/Dashboard.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,32 @@
<?php
namespace App\Filament\Pages;

use App\Filament\Widgets\AccountInfo;
use App\Filament\Widgets\LatestTorrents;
use App\Filament\Widgets\LatestUsers;
use App\Filament\Widgets\SystemInfo;
use App\Filament\Widgets\TorrentStat;
use App\Filament\Widgets\TorrentTrend;
use App\Filament\Widgets\UserClassStat;
use App\Filament\Widgets\UserStat;
use App\Filament\Widgets\UserTrend;

class Dashboard extends \Filament\Pages\Dashboard
{
protected ?string $maxContentWidth = 'full';

protected function getWidgets(): array
{
return [
AccountInfo::class,
LatestUsers::class,
LatestTorrents::class,
UserTrend::class,
TorrentTrend::class,
UserStat::class,
UserClassStat::class,
TorrentStat::class,
SystemInfo::class,
];
}
}
9 changes: 9 additions & 0 deletions include/globalfunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,15 @@ function get_user_id()
return auth()->user()->id ?? 0;
}

function get_user_passkey()
{
if (IN_NEXUS) {
global $CURUSER;
return $CURUSER["passkey"] ?? "";
}
return auth()->user()->passkey ?? "";
}

function get_pure_username()
{
if (IN_NEXUS) {
Expand Down

0 comments on commit 2493627

Please sign in to comment.