mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +08:00
admin add UserModifyLog
This commit is contained in:
@@ -12,8 +12,7 @@ RUN apk add --no-cache \
|
|||||||
libwebp-dev \
|
libwebp-dev \
|
||||||
gmp-dev \
|
gmp-dev \
|
||||||
oniguruma-dev \
|
oniguruma-dev \
|
||||||
linux-headers \
|
linux-headers
|
||||||
curl
|
|
||||||
|
|
||||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp
|
||||||
|
|
||||||
@@ -58,7 +57,8 @@ RUN apk add --no-cache \
|
|||||||
icu \
|
icu \
|
||||||
libxml2 \
|
libxml2 \
|
||||||
gmp \
|
gmp \
|
||||||
oniguruma
|
oniguruma \
|
||||||
|
git
|
||||||
|
|
||||||
# 配置 www.conf
|
# 配置 www.conf
|
||||||
RUN sed -i \
|
RUN sed -i \
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\User;
|
||||||
|
|
||||||
|
use App\Filament\Resources\User\UserModifyLogResource\Pages;
|
||||||
|
use App\Filament\Resources\User\UserModifyLogResource\RelationManagers;
|
||||||
|
use App\Models\UserModifyLog;
|
||||||
|
use Filament\Forms;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
|
|
||||||
|
class UserModifyLogResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = UserModifyLog::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
protected static ?string $navigationGroup = 'User';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 100;
|
||||||
|
|
||||||
|
public static function getNavigationLabel(): string
|
||||||
|
{
|
||||||
|
return __('admin.sidebar.user_modify_logs');
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getBreadcrumb(): string
|
||||||
|
{
|
||||||
|
return self::getNavigationLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
//
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
Tables\Columns\TextColumn::make('id'),
|
||||||
|
Tables\Columns\TextColumn::make('user_id')
|
||||||
|
->label(nexus_trans("label.username"))
|
||||||
|
->formatStateUsing(fn ($state) => username_for_admin($state))
|
||||||
|
,
|
||||||
|
Tables\Columns\TextColumn::make('content')->label(nexus_trans("user-modify-log.content")),
|
||||||
|
Tables\Columns\TextColumn::make('created_at')->label(nexus_trans("label.created_at")),
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->defaultSort('id', 'desc')
|
||||||
|
->actions([
|
||||||
|
// Tables\Actions\EditAction::make(),
|
||||||
|
// Tables\Actions\DeleteAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
// Tables\Actions\BulkActionGroup::make([
|
||||||
|
// Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
// ]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => Pages\ManageUserModifyLogs::route('/'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Filament\Resources\User\UserModifyLogResource\Pages;
|
||||||
|
|
||||||
|
use App\Filament\PageListSingle;
|
||||||
|
use App\Filament\Resources\User\UserModifyLogResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ManageRecords;
|
||||||
|
|
||||||
|
class ManageUserModifyLogs extends PageListSingle
|
||||||
|
{
|
||||||
|
protected static string $resource = UserModifyLogResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
// Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -9,4 +9,14 @@ class SiteLog extends NexusModel
|
|||||||
|
|
||||||
protected $fillable = ['added', 'txt', 'security_level', 'uid'];
|
protected $fillable = ['added', 'txt', 'security_level', 'uid'];
|
||||||
|
|
||||||
|
public static function add($uid, $content, $isMod = false): void
|
||||||
|
{
|
||||||
|
self::query()->insert([
|
||||||
|
'uid' => $uid,
|
||||||
|
'txt' => $content,
|
||||||
|
'security_level' => $isMod ? 'mod' : 'normal',
|
||||||
|
'added' => now(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use App\Models\LoginLog;
|
|||||||
use App\Models\Message;
|
use App\Models\Message;
|
||||||
use App\Models\OauthProvider;
|
use App\Models\OauthProvider;
|
||||||
use App\Models\Setting;
|
use App\Models\Setting;
|
||||||
|
use App\Models\SiteLog;
|
||||||
use App\Models\Snatch;
|
use App\Models\Snatch;
|
||||||
use App\Models\Torrent;
|
use App\Models\Torrent;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
|
|||||||
+1
-1
@@ -14,7 +14,7 @@ $Cache->add_whole_row();
|
|||||||
begin_main_frame();
|
begin_main_frame();
|
||||||
|
|
||||||
begin_frame($lang_faq['text_welcome_to'].$SITENAME." - ".$SLOGAN);
|
begin_frame($lang_faq['text_welcome_to'].$SITENAME." - ".$SLOGAN);
|
||||||
print($lang_faq['text_welcome_content_one'].sprintf($lang_faq['text_welcome_content_two'], \App\Models\Setting::getSiteName()));
|
echo sprintf($lang_faq['text_welcome_content_one'].sprintf($lang_faq['text_welcome_content_two'], \App\Models\Setting::getSiteName(), \App\Models\Setting::getSiteName()));
|
||||||
end_frame();
|
end_frame();
|
||||||
|
|
||||||
$lang_id = get_guest_lang_id();
|
$lang_id = get_guest_lang_id();
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ return [
|
|||||||
'token' => '访问令牌',
|
'token' => '访问令牌',
|
||||||
'oauth_provider' => '身份验证',
|
'oauth_provider' => '身份验证',
|
||||||
'queue_monitor' => '队列监控',
|
'queue_monitor' => '队列监控',
|
||||||
|
'user_modify_logs' => '修改记录',
|
||||||
],
|
],
|
||||||
'resources' => [
|
'resources' => [
|
||||||
'agent_allow' => [
|
'agent_allow' => [
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'content' => '修改内容',
|
||||||
|
];
|
||||||
Reference in New Issue
Block a user