feat: password rotation, PPSK management, VLAN/AP groups
- Add password rotation: RotatePasswords console command + migration + service updates - Add PPSK management: UnifiPpsk model, migration, SyncPpskSchedules console - Add VLAN groups and AP groups: VlanGroupController, ApGroupController, model, migration - Add RebootAllAps console command - Add in_alert column to device states - Wire new features through service provider, routes, and existing controllers/services Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
30
src/Models/UnifiPpsk.php
Normal file
30
src/Models/UnifiPpsk.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Dashboard\Unifi\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class UnifiPpsk extends Model
|
||||
{
|
||||
protected $table = 'unifi_ppsks';
|
||||
protected $fillable = [
|
||||
'wlan_id', 'unifi_id', 'name', 'x_passphrase', 'vlan',
|
||||
'state', 'rotate_password', 'schedule',
|
||||
];
|
||||
protected $casts = [
|
||||
'vlan' => 'integer',
|
||||
'rotate_password' => 'boolean',
|
||||
'schedule' => 'array',
|
||||
];
|
||||
|
||||
/**
|
||||
* Returns true if this PPSK should be active at the given day (0=Sun…6=Sat)
|
||||
* and half-hour slot (0=00:00, 47=23:30).
|
||||
* A null schedule means always-on.
|
||||
*/
|
||||
public function isScheduledOnAt(int $day, int $slot): bool
|
||||
{
|
||||
if (! $this->schedule) return true;
|
||||
return (bool) ($this->schedule[$day * 48 + $slot] ?? true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user