mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-10 02:25:56 +00:00
fix: resolve TypeScript errors in AISettings and UnifiedAgents
- Add control_level and protected_guests to AISettings interface - Add control_level and protected_guests to AISettingsUpdateRequest - Fix type error in filteredRows by casting filterType as UnifiedAgentType - Make formatRelativeTime and formatAbsoluteTime accept undefined
This commit is contained in:
@@ -658,7 +658,7 @@ export const UnifiedAgents: Component = () => {
|
||||
const filteredRows = createMemo(() => {
|
||||
const query = filterSearch().trim().toLowerCase();
|
||||
return unifiedRows().filter(row => {
|
||||
if (filterType() !== 'all' && !row.types.includes(filterType())) {
|
||||
if (filterType() !== 'all' && !row.types.includes(filterType() as UnifiedAgentType)) {
|
||||
return false;
|
||||
}
|
||||
if (filterStatus() !== 'all' && row.status !== filterStatus()) {
|
||||
|
||||
@@ -46,6 +46,10 @@ export interface AISettings {
|
||||
|
||||
// Request timeout (in seconds) - for slow Ollama hardware
|
||||
request_timeout_seconds?: number;
|
||||
|
||||
// Infrastructure control settings
|
||||
control_level?: 'read_only' | 'suggest' | 'controlled' | 'autonomous';
|
||||
protected_guests?: string[];
|
||||
}
|
||||
|
||||
export interface AISettingsUpdateRequest {
|
||||
@@ -85,6 +89,10 @@ export interface AISettingsUpdateRequest {
|
||||
|
||||
// Request timeout (in seconds) - for slow Ollama hardware
|
||||
request_timeout_seconds?: number;
|
||||
|
||||
// Infrastructure control settings
|
||||
control_level?: 'read_only' | 'suggest' | 'controlled' | 'autonomous';
|
||||
protected_guests?: string[];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ export function formatUptime(seconds: number, condensed = false): string {
|
||||
}
|
||||
}
|
||||
|
||||
export function formatAbsoluteTime(timestamp: number): string {
|
||||
export function formatAbsoluteTime(timestamp: number | undefined): string {
|
||||
if (!timestamp) return '';
|
||||
const date = new Date(timestamp);
|
||||
|
||||
@@ -73,7 +73,7 @@ export function formatAbsoluteTime(timestamp: number): string {
|
||||
return `${day} ${month} ${hours}:${minutes}`;
|
||||
}
|
||||
|
||||
export function formatRelativeTime(timestamp: number): string {
|
||||
export function formatRelativeTime(timestamp: number | undefined): string {
|
||||
if (!timestamp) return '';
|
||||
|
||||
const now = Date.now();
|
||||
|
||||
Reference in New Issue
Block a user