Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devices searching #207

Merged
merged 13 commits into from
Jan 30, 2024
Merged
22 changes: 20 additions & 2 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"savePassword": "Save password",
"showPassword": "Show password",
"hidePassword": "Hide password",
"hide": "Hide",
"show": "Show",
"useDefault": "Use Default",
"connect": "Connect",
"connectAutomaticallyAtStartup": "Connect automatically at startup",
"connectAutomaticallyAtStartupDescription": "If enabled, the server will be automatically connected when the app starts.",
"checkingServerCredentials": "Checking server credentials",
"skip": "Skip",
"cancel": "Cancel",
"disabled": "Disabled",
Expand Down Expand Up @@ -89,6 +92,7 @@
"reloadCamera": "Reload Camera",
"selectACamera": "Select a camera",
"switchCamera": "Switch camera",
"status": "Status",
"online": "Online",
"offline": "Offline",
"live": "LIVE",
Expand All @@ -104,10 +108,12 @@
"streamURL": "Stream URL",
"streamURLRequired": "The stream URL is required",
"streamURLNotValid": "The stream URL is not valid",
"uri": "URI",
"eventBrowser": "Events History",
"eventsTimeline": "Timeline of Events",
"server": "Server",
"device": "Device",
"deviceInfo": "Device info",
"event": "Event",
"duration": "Duration",
"priority": "Priority",
Expand Down Expand Up @@ -165,7 +171,7 @@
"no": "No",
"about": "About",
"versionText": "Copyright © 2022, Bluecherry LLC.\nAll rights reserved.",
"gettingDevices": "Getting devices...",
"gettingDevices": "Getting devices",
"noDevices": "No devices",
"noEventsLoaded": "NO EVENTS LOADED",
"noEventsLoadedTips": "• Select the cameras you want to see the events\n• Use the calendar to select a specific date or a date range \n• Use the \"Filter\" button to perform the search",
Expand All @@ -183,6 +189,15 @@
"configureServer": "Configure server",
"refreshDevices": "Refresh devices",
"refreshServer": "Refresh server",
"viewDevices": "View devices",
"serverDevices": "{server} devices",
"@serverDevices": {
"placeholders": {
"server": {
"type": "String"
}
}
},
"refresh": "Refresh",
"view": "View",
"cameraRefreshPeriod": "Camera refresh period",
Expand Down Expand Up @@ -344,6 +359,7 @@
"expand": "Expand",
"more": "More",
"@PTZ": {},
"isPtzSupported": "Supports PTZ?",
"ptzSupported": "PTZ is supported",
"enabledPTZ": "PTZ is enabled",
"disabledPTZ": "PTZ is disabled",
Expand Down Expand Up @@ -508,5 +524,7 @@
"serverHostnameExample": "https://my-server.bluecherry.app:7001",
"rackName": "Rack name",
"rackNameExample": "Lab 1",
"openServer": "Open server"
"openServer": "Open server",
"@SEARCH": {},
"disableSearch": "Disable search"
}
20 changes: 19 additions & 1 deletion lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"savePassword": "Sauvegarder mot de passe",
"showPassword": "Afficher mot de passe",
"hidePassword": "Masquer mot de passe",
"hide": "Hide",
"show": "Show",
"useDefault": "Par défaut",
"connect": "Connecter",
"connectAutomaticallyAtStartup": "Connecter automatiquement au démarrage",
"connectAutomaticallyAtStartupDescription": "If enabled, the app will automatically connect to the server when it starts.",
"checkingServerCredentials": "Checking server credentials",
"skip": "Sauter",
"cancel": "Annuler",
"disabled": "Disabled",
Expand Down Expand Up @@ -85,6 +88,7 @@
"reloadCamera": "Recharger caméra",
"selectACamera": "Sélectionner une caméra",
"switchCamera": "Switch camera",
"status": "Status",
"online": "En ligne",
"offline": "Hors ligne",
"live": "EN DIRECT",
Expand All @@ -100,10 +104,12 @@
"streamURL": "Stream URL",
"streamURLRequired": "The stream URL is required",
"streamURLNotValid": "The stream URL is not valid",
"uri": "URI",
"eventBrowser": "Navigateur d'événements",
"eventsTimeline": "Ligne du temps",
"server": "Serveur",
"device": "Appareil",
"deviceInfo": "Device info",
"event": "Évènement",
"duration": "Durée",
"priority": "Priorité",
Expand Down Expand Up @@ -173,6 +179,15 @@
"configureServer": "Configurer le serveur",
"refreshDevices": "Actualiser les appareils",
"refreshServer": "Actualiser le serveur",
"viewDevices": "View devices",
"serverDevices": "{server} devices",
"@serverDevices": {
"placeholders": {
"server": {
"type": "String"
}
}
},
"refresh": "Actualiser",
"view": "Vue",
"cameraRefreshPeriod": "Camera refresh period",
Expand Down Expand Up @@ -322,6 +337,7 @@
"expand": "Développer",
"more": "More",
"@PTZ": {},
"isPtzSupported": "Supports PTZ?",
"ptzSupported": "Support PTZ",
"enabledPTZ": "PTZ est activé",
"disabledPTZ": "PTZ est désactivé",
Expand Down Expand Up @@ -482,5 +498,7 @@
"serverHostnameExample": "https://my-server.bluecherry.app:7001",
"rackName": "Rack name",
"rackNameExample": "Lab 1",
"openServer": "Open server"
"openServer": "Open server",
"@SEARCH": {},
"disableSearch": "Disable search"
}
20 changes: 19 additions & 1 deletion lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"savePassword": "Zapisz hasło",
"showPassword": "Show password",
"hidePassword": "Hide password",
"hide": "Hide",
"show": "Show",
"useDefault": "Użyj wartości domyślnych",
"connect": "Połącz",
"connectAutomaticallyAtStartup": "Połącz automatycznie przy uruchomieniu",
"connectAutomaticallyAtStartupDescription": "If enabled, the app will automatically connect to the server when it starts.",
"checkingServerCredentials": "Checking server credentials",
"skip": "Pomiń",
"cancel": "Anuluj",
"disabled": "Disabled",
Expand Down Expand Up @@ -89,6 +92,7 @@
"reloadCamera": "Odśwież kamerę",
"selectACamera": "Wybierz kamerę",
"switchCamera": "Przełącz kamerę",
"status": "Status",
"online": "Online",
"offline": "Offline",
"live": "NA ŻYWO",
Expand All @@ -104,10 +108,12 @@
"streamURL": "Stream URL",
"streamURLRequired": "The stream URL is required",
"streamURLNotValid": "The stream URL is not valid",
"uri": "URI",
"eventBrowser": "Historia zdarzeń",
"eventsTimeline": "Oś czasu zdarzeń",
"server": "Serwer",
"device": "Urządzenie",
"deviceInfo": "Device info",
"event": "Zdarzenie",
"duration": "Czas trwania",
"priority": "Priorytet",
Expand Down Expand Up @@ -183,6 +189,15 @@
"configureServer": "Konfiguracja serwera",
"refreshDevices": "Odśwież urządzenia",
"refreshServer": "Odśwież serwer",
"viewDevices": "View devices",
"serverDevices": "{server} devices",
"@serverDevices": {
"placeholders": {
"server": {
"type": "String"
}
}
},
"refresh": "Odśwież",
"view": "Widok",
"cameraRefreshPeriod": "Camera refresh period",
Expand Down Expand Up @@ -344,6 +359,7 @@
"expand": "Rozwiń",
"more": "More",
"@PTZ": {},
"isPtzSupported": "Supports PTZ?",
"ptzSupported": "PTZ jest wspierane",
"enabledPTZ": "PTZ jest włączone",
"disabledPTZ": "PTZ jest wyłączone",
Expand Down Expand Up @@ -508,5 +524,7 @@
"serverHostnameExample": "https://my-server.bluecherry.app:7001",
"rackName": "Rack name",
"rackNameExample": "Lab 1",
"openServer": "Open server"
"openServer": "Open server",
"@SEARCH": {},
"disableSearch": "Disable search"
}
22 changes: 20 additions & 2 deletions lib/l10n/app_pt.arb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@
"savePassword": "Salvar senha",
"showPassword": "Mostrar senha",
"hidePassword": "Ocultar senha",
"hide": "Esconder",
"show": "Mostrar",
"useDefault": "Usar Padrão",
"connect": "Conectar",
"connectAutomaticallyAtStartup": "Conectar automaticamente ao iniciar",
"connectAutomaticallyAtStartupDescription": "Se ativado, o servidor será conectado automaticamente quando o aplicativo for iniciado.",
"checkingServerCredentials": "Verificando credenciais",
"skip": "Pular",
"cancel": "Cancelar",
"disabled": "Desativado",
Expand Down Expand Up @@ -89,6 +92,7 @@
"reloadCamera": "Recarregar Câmera",
"selectACamera": "Selecione uma câmera",
"switchCamera": "Trocar câmera",
"status": "Status",
"online": "Online",
"offline": "Offline",
"live": "AO VIVO",
Expand All @@ -104,10 +108,12 @@
"streamURL": "URL da Transmissão",
"streamURLRequired": "A URL da transmissão é obrigatória",
"streamURLNotValid": "A url não é válida",
"uri": "URI",
"eventBrowser": "Histórico de eventos",
"eventsTimeline": "Linha do tempo de eventos",
"server": "Servidor",
"device": "Dispositivo",
"deviceInfo": "Informações do dispositivo",
"event": "Evento",
"duration": "Duração",
"priority": "Prioridade",
Expand Down Expand Up @@ -183,6 +189,15 @@
"configureServer": "Configurar servidor",
"refreshDevices": "Recarregar dispositivos",
"refreshServer": "Recarregar servidor",
"viewDevices": "Ver dispositivos",
"serverDevices": "Dispositivos de {server}",
"@serverDevices": {
"placeholders": {
"server": {
"type": "String"
}
}
},
"refresh": "Recarregar",
"view": "Layouts",
"cameraRefreshPeriod": "Intervalo para recarregar cameras",
Expand Down Expand Up @@ -344,7 +359,8 @@
"expand": "Expandir",
"more": "Mais",
"@PTZ": {},
"ptzSupported": "PTZ é suportado",
"isPtzSupported": "Possui PTZ?",
"ptzSupported": "Possui PTZ",
"enabledPTZ": "PTZ está ativado",
"disabledPTZ": "PTZ está desativado",
"move": "Movimento",
Expand Down Expand Up @@ -508,5 +524,7 @@
"serverHostnameExample": "https://servidor.bluecherry.app:7001",
"rackName": "Nome do rack",
"rackNameExample": "Lab 1",
"openServer": "Abrir servidor"
"openServer": "Abrir servidor",
"@SEARCH": {},
"disableSearch": "Desativar pesquisa"
}
2 changes: 1 addition & 1 deletion lib/providers/server_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ServersProvider extends UnityProvider {

servers.add(server);
await save();
refreshDevices();
await refreshDevices(ids: [server.id]);

if (isMobilePlatform) {
// Register notification token.
Expand Down
9 changes: 7 additions & 2 deletions lib/utils/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,13 @@ extension DateTimeExtension on DateTime {

extension DeviceListExtension on Iterable<Device> {
/// Returns this device list sorted properly
List<Device> sorted([Iterable? available]) {
final list = [...this]..sort((a, b) => a.name.compareTo(b.name));
List<Device> sorted({
Iterable? available,
String searchQuery = '',
}) {
final list = where((device) =>
device.name.toLowerCase().contains(searchQuery.toLowerCase())).toList()
..sort((a, b) => a.name.compareTo(b.name));

if (available != null) list.sort((a, b) => available.contains(a) ? 0 : 1);
list.sort((a, b) => a.status ? 0 : 1);
Expand Down
6 changes: 3 additions & 3 deletions lib/utils/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ Future<void> configureWindow() async {
windowButtonVisibility: true,
),
() async {
// if ((isDesktopPlatform && Platform.isMacOS) || kDebugMode) {
// await windowManager.setSize(kInitialWindowSize);
// }
if (kDebugMode) {
await windowManager.setSize(kInitialWindowSize);
}
await windowManager.show();
},
);
Expand Down
4 changes: 1 addition & 3 deletions lib/widgets/collapsable_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ class _CollapsableSidebarState extends State<CollapsableSidebar>
: AlignmentDirectional.topCenter,
padding: collapsed
? EdgeInsetsDirectional.zero
: widget.left
? const EdgeInsetsDirectional.symmetric(horizontal: 5.0)
: const EdgeInsetsDirectional.only(end: 5.0),
: const EdgeInsetsDirectional.symmetric(horizontal: 5.0),
child: SquaredIconButton(
key: collapseButtonKey,
tooltip: collapsed ? loc.expand : loc.collapse,
Expand Down
4 changes: 1 addition & 3 deletions lib/widgets/device_grid/desktop/desktop_device_grid.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,7 @@ class _DesktopDeviceGridState extends State<DesktopDeviceGrid> {
),
child: Text(
'${view.currentLayout.devices.length}',
style: TextStyle(
color: theme.colorScheme.onPrimaryContainer,
),
style: TextStyle(color: theme.colorScheme.onPrimaryContainer),
),
),
]);
Expand Down
Loading
Loading