creacoon / laravel-dashboard-gitlab-user-counts-tile
GitLab 标签
1.0.2
2024-09-09 11:21 UTC
Requires
- php: ^8.3
- spatie/laravel-dashboard: ^3.0
Requires (Dev)
- phpunit/phpunit: ^10.5.32
- squizlabs/php_codesniffer: ^3.6.2
This package is auto-updated.
Last update: 2024-09-09 11:21:54 UTC
README
GitLab 用户计数标签
此标签显示来自 GitLab 的用户计数,包括分配的合并请求、请求审查的合并请求和待办事项。
安装
您可以通过 composer 安装此标签
composer require creacoon/laravel-dashboard-gitlab-user-counts-tile
在 dashboard
配置文件中,您必须将此配置添加到 tiles
键。
在您的 GitLab
实例上注册以获取 GITLAB_API_TOKEN
// in config/dashboard.php return [ // ... 'tiles' => [ 'gitlab' => [ 'api_token' => env('GITLAB_API_TOKEN'), 'api_url' => env('GITLAB_API_URL', 'https://gitlab.com'), 'specific_users' => explode(',', env('GITLAB_SPECIFIC_USERS')), ], ], ];
在 app\Console\Kernel.php 中,您应该安排 Creacoon\GitLabTile\FetchDataFromGitLabUserCountsCommand 以您希望的时间间隔运行。
// in app/console/Kernel.php protected function schedule(Schedule $schedule) { // ... $schedule->command(\Creacoon\GitLabTile\FetchDataFromGitLabUserCountsCommand::class)->everyMinute(); }
用法
在您的仪表板视图中,您使用 livewire:gitlab-user-counts-tile
组件。
<x-dashboard> <livewire:gitlab-user-counts-tile position="a1" /> </x-dashboard>
自定义视图
如果您想自定义用于渲染此标签的视图,请运行此命令
php artisan vendor:publish --provider="Creacoon\GitLabTile\GitLabUserCountsTileServiceProvider" --tag="dashboard-gitlab-user-counts-tile-views"```