ziming/filament-oh-dear 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ziming/filament-oh-dear

Composer 安装命令:

composer require ziming/filament-oh-dear

包简介

A read-only Filament 4/5 panel plugin for Oh Dear monitor insights.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Read-only Oh Dear insights for Filament 4 and 5 panels. The plugin renders remote Oh Dear monitor data directly from the API, caches responses through Laravel, and avoids local sync tables or CRUD flows.

This package is still very much in progress, when it is ready I will tag a 1.0

Support Us

You can donate to my github sponsor or use my referral link for Oh Dear so I get a small reward if you become a paid customer in the future. This comes at no extra cost to you and helps support my open source work.

https://ohdear.app/?via=filament-oh-dear

Features

  • Overview page composed of pluggable widgets — stats, needs-attention list, monitors-by-group breakdown
  • Monitors page powered by Filament custom table data
  • Hidden Monitor details page composed of pluggable per-monitor widgets: summary, check summaries, latency chart, certificate health, broken links, downtime, mixed content, latest Lighthouse report, application health checks, maintenance periods, domain info
  • Add, remove, or replace any widget on either page via the plugin fluent API or package config
  • Package config defaults with per-panel plugin overrides
  • php artisan filament-oh-dear:verify for connection checks

Installation

composer require ziming/filament-oh-dear

Publish the config if you want to customize defaults:

php artisan vendor:publish --tag="filament-oh-dear-config"

Environment

OH_DEAR_API_TOKEN=
OH_DEAR_TEAM_ID=
OH_DEAR_MONITOR_IDS=1,2,3
OH_DEAR_CACHE_STORE=
OH_DEAR_CACHE_TTL=300
  • OH_DEAR_API_TOKEN is required.
  • OH_DEAR_TEAM_ID is optional. When omitted, the token default scope is used.
  • OH_DEAR_MONITOR_IDS is optional. When set, only those monitors are shown and their order is preserved.
  • OH_DEAR_CACHE_TTL=0 disables caching.

Register The Plugin

use Ziming\FilamentOhDear\FilamentOhDearPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->id('admin')
        ->path('admin')
        ->plugin(FilamentOhDearPlugin::make());
}

Per-Panel Overrides

use Ziming\FilamentOhDear\FilamentOhDearPlugin;

FilamentOhDearPlugin::make()
    ->apiToken(fn (): string => decrypt(config('services.oh_dear.token')))
    ->teamId(10)
    ->monitorIds([12, 55, 89])
    ->cacheStore('redis')
    ->cacheTtl(120)
    ->navigationGroup('Observability')
    ->navigationIcon('heroicon-o-signal')
    ->navigationSort(40);

Precedence is always plugin override > package config.

Configuring widgets

Both the Overview and Monitor details pages render a list of Filament widgets that you can freely mix and match. Defaults come from Ziming\FilamentOhDear\Support\OhDearSettings::defaultOverviewWidgets() and defaultMonitorWidgets().

use Ziming\FilamentOhDear\FilamentOhDearPlugin;
use Ziming\FilamentOhDear\Widgets\Monitor\ApplicationHealthChecksWidget;
use Ziming\FilamentOhDear\Widgets\Monitor\BrokenLinksWidget;
use Ziming\FilamentOhDear\Widgets\Monitor\DomainInfoWidget;
use Ziming\FilamentOhDear\Widgets\Monitor\LighthouseReportWidget;
use Ziming\FilamentOhDear\Widgets\Monitor\MaintenancePeriodsWidget;
use Ziming\FilamentOhDear\Widgets\Monitor\MixedContentWidget;
use Ziming\FilamentOhDear\Widgets\Overview\MonitorsByGroupWidget;
use Ziming\FilamentOhDear\Widgets\Overview\MonitorsByTypeWidget;

FilamentOhDearPlugin::make()
    // Append additional widgets to the defaults
    ->addOverviewWidgets([
        MonitorsByTypeWidget::class,
        MonitorsByGroupWidget::class,
    ])
    ->addMonitorWidgets([
        MixedContentWidget::class,
        LighthouseReportWidget::class,
        ApplicationHealthChecksWidget::class,
        MaintenancePeriodsWidget::class,
        DomainInfoWidget::class,
    ])
    // Or drop one you don't want
    ->removeMonitorWidgets(BrokenLinksWidget::class)
    // Or replace the entire list outright
    // ->overviewWidgets([OverviewStatsWidget::class])
    // ->monitorWidgets([MonitorSummaryWidget::class])
;

You can also point the package at your own widget classes — anything that extends BaseMonitorWidget (with a public int $monitorId property) or any Filament widget accepting an overview array prop will work.

Available widgets

Overview (Ziming\FilamentOhDear\Widgets\Overview\… and Ziming\FilamentOhDear\Widgets\OverviewStatsWidget):

  • OverviewStatsWidget – totals and active issue counts
  • NeedsAttentionWidget – list of monitors needing attention
  • MonitorsByGroupWidget – healthy / issue breakdown per group
  • MonitorsByTypeWidget – stat tiles per monitor type

Monitor (Ziming\FilamentOhDear\Widgets\Monitor\…):

  • MonitorSummaryWidget – basic monitor info and status
  • CheckSummariesWidget – per-check summaries
  • LatencyChartWidget – 24-hour latency sparkline
  • CertificateHealthWidget – TLS certificate details and checks
  • BrokenLinksWidget – broken link findings
  • DowntimeWidget – recent downtime periods
  • MixedContentWidget – mixed-content findings (HTTPS pages loading HTTP assets)
  • LighthouseReportWidget – latest Lighthouse scores and web vitals
  • ApplicationHealthChecksWidget – application-reported health checks
  • MaintenancePeriodsWidget – configured maintenance windows
  • DomainInfoWidget – WHOIS / RDAP snapshot for the domain

Verify Command

php artisan filament-oh-dear:verify

The command checks:

  • an API token is configured
  • me() succeeds
  • the configured team scope is accessible when team_id is set
  • each configured monitor is accessible when monitor_ids is set

Support Matrix

  • PHP: ^8.4
  • Filament: ^4 | ^5
  • Laravel / illuminate contracts: ^12 | ^13
  • Oh Dear SDK: ^4

Screenshots

  • Overview page: placeholder
  • Monitors table: placeholder
  • Monitor detail page: placeholder

Local Development

The repository ships with a Testbench workbench panel:

composer install
composer build
php vendor/bin/testbench serve

Then open /admin/oh-dear.

Testing

composer test
composer analyse
composer format

Changelog

Please see CHANGELOG for recent changes.

License

The MIT License (MIT). Please see LICENSE.md for more information.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固