track-any-device/admin 问题修复 & 功能扩展

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

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

track-any-device/admin

Composer 安装命令:

composer require track-any-device/admin

包简介

Filament admin panel, resources, and pages for the Track Any Device platform.

README 文档

README

Filament v4 admin panel for the Track Any Device platform. Provides the central admin surface — resources, pages, auth middleware, and domain gating — as a standalone Composer package consumed by the host Laravel application.

Requirements

Dependency Version
PHP ^8.3
Laravel ^13.7
Filament ^4.0
track-any-device/core ^0.0.2

Installation

composer require track-any-device/admin

The package is auto-discovered by Laravel. No manual provider registration is needed.

Configuration

Environment variables

Variable Required Description
ADMIN_DOMAIN No Full hostname for the admin panel (e.g. admin.yourdomain.com). When set the panel is served at the root of that host. When unset the panel falls back to the /admin path on any host listed in tenancy.central_domains.

Routes the host app must register

The package redirects unauthenticated requests and the SSO login page to a named route that the host application is responsible for registering:

// In your host app's routes/web.php or a dedicated routes file:
Route::get('/auth/sso/redirect', SsoRedirectController::class)->name('admin.sso.redirect');

The route must be named admin.sso.redirect. The package will throw a RouteNotFoundException at runtime if it is missing.

How it works

Domain gating

The EnsureAdminDomain middleware runs on every panel request.

  • When ADMIN_DOMAIN is set: only requests whose Host header matches exactly are allowed through. All other hosts — including tenant subdomains — receive a 404.
  • When ADMIN_DOMAIN is unset: any host listed in tenancy.central_domains is accepted. This covers local development and CI where a dedicated admin domain is not yet configured.

Authentication

The panel uses its own session-based auth rather than the tenant OAuth pipeline, making it usable as a break-glass surface if the identity provider is misconfigured.

  1. An unauthenticated request hits the panel.
  2. AdminAuthenticate redirects to route('admin.sso.redirect').
  3. The host app's SSO controller exchanges the callback for a session and redirects back to the panel.
  4. AdminUser::canAccessPanel() confirms the authenticated user holds a central-staff role. Non-staff users are rejected at this point regardless of session state.

AdminUser

AdminUser extends the core User model and implements Filament's FilamentUser contract. It reads from the same users table but restricts panel access to users whose role returns true from role->isCentralStaff().

// Defined in src/Models/AdminUser.php
public function canAccessPanel(Panel $panel): bool
{
    return $this->role?->isCentralStaff() ?? false;
}

To use this model as the Filament auth guard, configure the admin panel guard in the host app's config/auth.php to point at AdminUser.

Included resources

Administration

Resource Model Notes
Organisations Tenant Slug organisations avoids Filament's reserved tenants keyword. Badge shows pending-approval count. Approve / reject actions inline.
Users User Role filter, resend-invite action (sends password-reset link).
Policy Versions PolicyVersion
Countries Country

Devices

Resource Model Notes
Devices Device Onboard action dispatches OnboardDeviceJob. Filters: status, type, approval, visibility, stock.
Device Types DeviceType
Device Commands DeviceCommand Read-only list and view.
Chips Chip
Compute Boards ComputeBoard
Connecting Cables ConnectingCable
Sensors Sensor
GSM Networks GsmNetwork
Signals Signal List only.
Incoming Messages IncomingMessage List and view only.

Operations

Resource Model Notes
Beats Beat Beat-assignment relation manager.
Beat Templates BeatTemplate
Drivers Driver
Assignees Assignee
Assignee Types AssigneeType
Incidents Incident
Device Orders DeviceOrder
Charging Sets ChargingSet
Domains Domain
Subscribers Subscriber List only.
Contact Submissions ContactSubmission List and edit only.

CMS

Resource Model Notes
Pages Page Sections relation manager.
Blog Blog Sections relation manager, featured flag, scheduled publish.
Solutions Solution
Industries Industry
Testimonials Testimonial List only.
Nav Links NavLink List only.

Pages

Page Path Description
Device Logs /device-logs Real-time log viewer subscribed to the private-admin.device-logs broadcast channel. Ring buffer — no persistence.

Release workflow

Releases are automated via GitHub Actions (.github/workflows/release.yml). On every push to main the workflow reads conventional commit messages since the last tag and bumps the version accordingly:

Commit prefix Bump
Any type with ! (e.g. feat!:, fix!:) Major
feat: Minor
fix:, chore:, ci:, docs:, etc. Patch
No new commits Skipped

You can also trigger a release manually from the GitHub Actions tab and choose the bump type explicitly.

Licence

MIT

track-any-device/admin 适用场景与选型建议

track-any-device/admin 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 225 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 05 月 23 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 track-any-device/admin 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 track-any-device/admin 我们能提供哪些服务?
定制开发 / 二次开发

基于 track-any-device/admin 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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