From f2d011deec4785e6844d87d87bb3baf7247b1bce Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Mon, 12 Jun 2023 13:05:20 +0200 Subject: [PATCH 001/255] added conduct_test var to skip lengthy tests --- documentation/installer/install-advanced.md | 9 +++++++++ inventory/group_vars/all.yml | 1 + roles/test/tasks/main.yml | 6 +++--- site.yml | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/documentation/installer/install-advanced.md b/documentation/installer/install-advanced.md index 475701aaf..2a9e61278 100644 --- a/documentation/installer/install-advanced.md +++ b/documentation/installer/install-advanced.md @@ -24,6 +24,15 @@ installation_mode options: - uninstall - uninstalls the product including any data (database, ldap, files)! - upgrade - installs on top of an existing system preserving any existing data in ldap, database, api; removes all files from target and copies latest sources instead +### Installation with automatic testing in the end + +If you would like to conduct all automatic tests at the end of your installation pass the following variable + +```console +ansible-playbook -e "conduct_test=true" site.yml -K +``` + +The default behavior is to skip time intensive tests ### Installation behind a proxy (no direct Internet connection) diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index f5856a8e2..361cb41ca 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -26,6 +26,7 @@ run_on_github: false add_demo_data: true api_docu: false force_install: false +conduct_test: ""{{ run_on_github }}"" ### operating system settings user_id: 60320 diff --git a/roles/test/tasks/main.yml b/roles/test/tasks/main.yml index 61c01d7e6..440a82f7b 100644 --- a/roles/test/tasks/main.yml +++ b/roles/test/tasks/main.yml @@ -42,7 +42,7 @@ sample_checkpoint_name: "{{ test_checkpoint_name }}" sample_config_user: fworchtest sample_config_user_home: "/home/{{ sample_config_user }}" - when: "'sampleserver' in group_names" + when: "'sampleserver' in group_names and conduct_test|bool" - name: include test auth data include_role: @@ -52,7 +52,7 @@ sample_role_purpose: test sample_user1_pw: "{{ test_user1_pw }}" sample_user2_pw: "{{ test_user2_pw }}" - when: "'middlewareserver' in group_names" + when: "'middlewareserver' in group_names and conduct_test|bool" - name: database testing import_tasks: test-database.yml @@ -71,7 +71,7 @@ - name: imorter testing import_tasks: test-importer.yml - when: "'sampleserver' in group_names" + when: "'sampleserver' in group_names and conduct_test|bool" - name: testing all exposed web services import_tasks: test-web.yml diff --git a/site.yml b/site.yml index 81d21b178..cc4866bda 100644 --- a/site.yml +++ b/site.yml @@ -119,7 +119,7 @@ - hosts: all roles: - - { role: test, when: "not installation_mode == 'uninstall'" } + - { role: test, when: not installation_mode == 'uninstall' } tags: - test From c044a4bbe218e517db36bb39d3c2c9ff4fed9ca5 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Mon, 12 Jun 2023 13:07:58 +0200 Subject: [PATCH 002/255] syntax --- inventory/group_vars/all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 361cb41ca..cf588a758 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -26,7 +26,7 @@ run_on_github: false add_demo_data: true api_docu: false force_install: false -conduct_test: ""{{ run_on_github }}"" +conduct_test: "{{ run_on_github }}" ### operating system settings user_id: 60320 From 59f449b9ea43e3be5613e8b980faab692987d5b0 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Mon, 12 Jun 2023 13:29:39 +0200 Subject: [PATCH 003/255] test on github --- .github/workflows/test-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 6027c87aa..f434acf5a 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -36,7 +36,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: do test install in case of merged pull request - run: cd /home/runner/work/firewall-orchestrator/firewall-orchestrator && ansible-playbook -e run_on_github=yes --skip-tags test site.yml -K + run: cd /home/runner/work/firewall-orchestrator/firewall-orchestrator && ansible-playbook -e run_on_github=yes site.yml -K # test_ubuntu_22: # name: test build on ubuntu_22 From a9e83ea2eeb7edf054ee77febe3dfccf941940d6 Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 16 Jun 2023 14:35:09 +0200 Subject: [PATCH 004/255] fix test bug --- roles/test/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/test/tasks/main.yml b/roles/test/tasks/main.yml index 440a82f7b..d77cea0fc 100644 --- a/roles/test/tasks/main.yml +++ b/roles/test/tasks/main.yml @@ -42,7 +42,7 @@ sample_checkpoint_name: "{{ test_checkpoint_name }}" sample_config_user: fworchtest sample_config_user_home: "/home/{{ sample_config_user }}" - when: "'sampleserver' in group_names and conduct_test|bool" + when: "'sampleserver' in group_names" - name: include test auth data include_role: @@ -52,7 +52,7 @@ sample_role_purpose: test sample_user1_pw: "{{ test_user1_pw }}" sample_user2_pw: "{{ test_user2_pw }}" - when: "'middlewareserver' in group_names and conduct_test|bool" + when: "'middlewareserver' in group_names" - name: database testing import_tasks: test-database.yml From 3e2d137d260877a1436756ef2c31e6170310177a Mon Sep 17 00:00:00 2001 From: alf-cactus Date: Fri, 16 Jun 2023 15:26:50 +0200 Subject: [PATCH 005/255] wait for middleware on github --- roles/test/tasks/test-auth.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/test/tasks/test-auth.yml b/roles/test/tasks/test-auth.yml index 7e0f662e2..ffc3f2618 100644 --- a/roles/test/tasks/test-auth.yml +++ b/roles/test/tasks/test-auth.yml @@ -7,7 +7,6 @@ connect_timeout: 1 delay: 10 timeout: 25 - when: "not run_on_github|bool" - name: middleware test get jwt valid creds uri: From 8160f705e08a92439365beaf9f79ae9fa3cdd487 Mon Sep 17 00:00:00 2001 From: abarz722 Date: Fri, 13 Oct 2023 11:09:04 +0200 Subject: [PATCH 006/255] NemoUi Mock 1. Version --- .../files/sql/idempotent/fworch-texts.sql | 73 ++- .../lib/files/FWO.Api.Client/Data/AppRole.cs | 22 + .../files/FWO.Api.Client/Data/Connection.cs | 78 +++ .../files/FWO.Api.Client/Data/DnDContainer.cs | 16 + .../files/FWO.Api.Client/Data/NetworkArea.cs | 24 + .../FWO.Api.Client/Data/NetworkProtocol.cs | 10 + .../files/FWO.Config.Api/Data/ConfigData.cs | 3 + .../FWO.Report/Display/RuleDisplayBase.cs | 10 +- .../Pages/NetworkModelling/EditAppRole.razor | 208 +++++++ .../EditAppRoleLeftSide.razor | 90 +++ .../Pages/NetworkModelling/EditConn.razor | 517 ++++++++++++++++++ .../NetworkModelling/EditConnLeftSide.razor | 235 ++++++++ .../Pages/NetworkModelling/EditService.razor | 140 +++++ .../NetworkModelling/NetworkModelling.razor | 251 +++++++++ .../Pages/Settings/SettingsModelling.razor | 87 +++ roles/ui/files/FWO.UI/Pages/Start.razor | 6 + roles/ui/files/FWO.UI/Services/DefaultInit.cs | 6 + .../files/FWO.UI/Shared/ConfirmDelete.razor | 4 +- .../files/FWO.UI/Shared/NavigationMenu.razor | 7 + .../files/FWO.UI/Shared/SettingsLayout.razor | 5 + roles/ui/files/FWO.UI/wwwroot/css/site.css | 4 + 21 files changed, 1786 insertions(+), 10 deletions(-) create mode 100644 roles/lib/files/FWO.Api.Client/Data/AppRole.cs create mode 100644 roles/lib/files/FWO.Api.Client/Data/Connection.cs create mode 100644 roles/lib/files/FWO.Api.Client/Data/DnDContainer.cs create mode 100644 roles/lib/files/FWO.Api.Client/Data/NetworkArea.cs create mode 100644 roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRole.razor create mode 100644 roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor create mode 100644 roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor create mode 100644 roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConnLeftSide.razor create mode 100644 roles/ui/files/FWO.UI/Pages/NetworkModelling/EditService.razor create mode 100644 roles/ui/files/FWO.UI/Pages/NetworkModelling/NetworkModelling.razor create mode 100644 roles/ui/files/FWO.UI/Pages/Settings/SettingsModelling.razor diff --git a/roles/database/files/sql/idempotent/fworch-texts.sql b/roles/database/files/sql/idempotent/fworch-texts.sql index 0395d24da..2faf4b3d0 100644 --- a/roles/database/files/sql/idempotent/fworch-texts.sql +++ b/roles/database/files/sql/idempotent/fworch-texts.sql @@ -936,6 +936,63 @@ INSERT INTO txt VALUES ('at_startup', 'German', 'Beim Hochfahren'); INSERT INTO txt VALUES ('at_startup', 'English', 'At startup'); INSERT INTO txt VALUES ('daily', 'German', 'Täglich'); INSERT INTO txt VALUES ('daily', 'English', 'Daily'); + +-- network modelling +INSERT INTO txt VALUES ('network_modelling', 'German', 'Netzwerkmodellierung'); +INSERT INTO txt VALUES ('network_modelling', 'English', 'Network Modelling'); +INSERT INTO txt VALUES ('modelling', 'German', 'Modellierung'); +INSERT INTO txt VALUES ('modelling', 'English', 'Modelling'); +INSERT INTO txt VALUES ('application', 'German', 'Applikation'); +INSERT INTO txt VALUES ('application', 'English', 'Application'); +INSERT INTO txt VALUES ('library', 'German', 'Bibliothek'); +INSERT INTO txt VALUES ('library', 'English', 'Library'); +INSERT INTO txt VALUES ('app_server', 'German', 'App Server'); +INSERT INTO txt VALUES ('app_server', 'English', 'App Server'); +INSERT INTO txt VALUES ('app_role', 'German', 'App Rolle'); +INSERT INTO txt VALUES ('app_role', 'English', 'App Role'); +INSERT INTO txt VALUES ('app_roles', 'German', 'App Rollen'); +INSERT INTO txt VALUES ('app_roles', 'English', 'App Roles'); +INSERT INTO txt VALUES ('preview', 'German', 'Vorschau'); +INSERT INTO txt VALUES ('preview', 'English', 'Preview'); +INSERT INTO txt VALUES ('comm_profile', 'German', 'Kommunikationsprofil'); +INSERT INTO txt VALUES ('comm_profile', 'English', 'Communication Profile'); +INSERT INTO txt VALUES ('connection', 'German', 'Verbindung'); +INSERT INTO txt VALUES ('connection', 'English', 'Connection'); +INSERT INTO txt VALUES ('add_connection', 'German', 'Verbindung hinzufügen'); +INSERT INTO txt VALUES ('add_connection', 'English', 'Add Connection'); +INSERT INTO txt VALUES ('edit_connection', 'German', 'Verbindung editieren'); +INSERT INTO txt VALUES ('edit_connection', 'English', 'Edit Connection'); +INSERT INTO txt VALUES ('delete_connection', 'German', 'Verbindung löschen'); +INSERT INTO txt VALUES ('delete_connection', 'English', 'Delete Connection'); +INSERT INTO txt VALUES ('func_reason', 'German', 'Fachliche Begründung'); +INSERT INTO txt VALUES ('func_reason', 'English', 'Functional Reason'); +INSERT INTO txt VALUES ('to_source', 'German', 'Zu Quelle'); +INSERT INTO txt VALUES ('to_source', 'English', 'To Source'); +INSERT INTO txt VALUES ('to_dest', 'German', 'Zu Ziel'); +INSERT INTO txt VALUES ('to_dest', 'English', 'To Destination'); +INSERT INTO txt VALUES ('to_service', 'German', 'Zu Dienst'); +INSERT INTO txt VALUES ('to_service', 'English', 'To Service'); +INSERT INTO txt VALUES ('add_service', 'German', 'Dienst hinzufügen'); +INSERT INTO txt VALUES ('add_service', 'English', 'Add Service'); +INSERT INTO txt VALUES ('data_inconsistent', 'German', 'Daten inkonsistent'); +INSERT INTO txt VALUES ('data_inconsistent', 'English', 'Data inconsistent'); +INSERT INTO txt VALUES ('def_app_role', 'German', 'Neue App Rolle definieren'); +INSERT INTO txt VALUES ('def_app_role', 'English', 'Define new App Role'); +INSERT INTO txt VALUES ('edit_app_role', 'German', 'App Rolle bearbeiten'); +INSERT INTO txt VALUES ('edit_app_role', 'English', 'Edit App Role'); +INSERT INTO txt VALUES ('delete_app_role', 'German', 'App Rolle löschen'); +INSERT INTO txt VALUES ('delete_app_role', 'English', 'Delete App Role'); +INSERT INTO txt VALUES ('to_app_role', 'German', 'Zu App Rolle'); +INSERT INTO txt VALUES ('to_app_role', 'English', 'To App Role'); +INSERT INTO txt VALUES ('edit_service', 'German', 'Dienst bearbeiten'); +INSERT INTO txt VALUES ('edit_service', 'English', 'Edit Service'); +INSERT INTO txt VALUES ('delete_service', 'German', 'Dienst löschen'); +INSERT INTO txt VALUES ('delete_service', 'English', 'Delete Service'); +INSERT INTO txt VALUES ('ext_request', 'German', 'Externer Antrag'); +INSERT INTO txt VALUES ('ext_request', 'English', 'External Request'); +INSERT INTO txt VALUES ('area', 'German', 'Area'); +INSERT INTO txt VALUES ('area', 'English', 'Area'); + -- settings INSERT INTO txt VALUES ('devices', 'German', 'Geräte'); INSERT INTO txt VALUES ('devices', 'English', 'Devices'); @@ -1479,6 +1536,8 @@ INSERT INTO txt VALUES ('text', 'German', 'Text'); INSERT INTO txt VALUES ('text', 'English', 'Text'); INSERT INTO txt VALUES ('custom_text', 'German', 'Angepasster Text'); INSERT INTO txt VALUES ('custom_text', 'English', 'Custom Text'); +INSERT INTO txt VALUES ('allowServerInConn', 'German', 'Server in Verbindung erlauben'); +INSERT INTO txt VALUES ('allowServerInConn', 'English', 'Allow Servers in Connection'); -- monitoring INSERT INTO txt VALUES ('open_alerts', 'German', 'Offene Alarme'); @@ -1750,6 +1809,7 @@ INSERT INTO txt VALUES ('no_network_zones', 'English', 'No network zones ex -- 6000-6999: API -- 7000-7999: Monitoring -- 8000-8999: Workflow +-- 9000-9999: Modelling -- generic success messages INSERT INTO txt VALUES ('S_add_title', 'German', 'Erstellen erfolgreich'); @@ -1891,6 +1951,8 @@ INSERT INTO txt VALUES ('U5320', 'German', 'Mehrere Email-Adressen mit Komma tr INSERT INTO txt VALUES ('U5320', 'English', 'Multiple email addresses can be separated by using commas'); INSERT INTO txt VALUES ('U5321', 'German', 'Anzeige und Überschreiben aller dargestellten Texte'); INSERT INTO txt VALUES ('U5321', 'English', 'Show and overwrite all shown texts'); +INSERT INTO txt VALUES ('U5322', 'German', 'Verwaltung der Voreinstellungen für die Netzwerk-Modellierung'); +INSERT INTO txt VALUES ('U5322', 'English', 'Administration of default settings for network modelling'); INSERT INTO txt VALUES ('U5401', 'German', 'Passwort geändert.'); INSERT INTO txt VALUES ('U5401', 'English', 'Password changed.'); @@ -1934,6 +1996,12 @@ INSERT INTO txt VALUES ('U8002', 'English', 'New approval added to task.'); INSERT INTO txt VALUES ('U8003', 'German', 'Sind sie sicher, dass sie abbrechen wollen? Bereits erzeugte Aufträge gehen verloren.'); INSERT INTO txt VALUES ('U8003', 'English', 'Are you sure you want to cancel? Already Created tasks will be lost.'); +INSERT INTO txt VALUES ('U9001', 'German', 'Sind sie sicher, dass sie folgende Verbindung löschen wollen: '); +INSERT INTO txt VALUES ('U9001', 'English', 'Are you sure you want to delete connection: '); +INSERT INTO txt VALUES ('U9002', 'German', 'Sind sie sicher, dass sie folgende App Rolle löschen wollen: '); +INSERT INTO txt VALUES ('U9002', 'English', 'Are you sure you want to delete App Role: '); +INSERT INTO txt VALUES ('U9003', 'German', 'Sind sie sicher, dass sie folgenden Dienst löschen wollen: '); +INSERT INTO txt VALUES ('U9003', 'English', 'Are you sure you want to delete service: '); -- generic error messages -- INSERT INTO txt VALUES ('E_load_title', 'German', 'Fehler beim Laden'); @@ -1956,7 +2024,6 @@ INSERT INTO txt VALUES ('E_delete_title', 'English', 'Deletion error'); INSERT INTO txt VALUES ('E_delete_message', 'German', 'Bei der Löschung des Elements ist ein unerwarteter Fehler aufgetreten. Bitte melden Sie den Fehler, wenn er nicht erklärbar ist.'); INSERT INTO txt VALUES ('E_delete_message', 'English', 'An unexpected error occurred while deleting the item. Please report the error if it cannot be resolved.'); - -- error messages INSERT INTO txt VALUES ('E0001', 'German', 'Nicht klassifizierter Fehler: '); INSERT INTO txt VALUES ('E0001', 'English', 'Unclassified error: '); @@ -2220,8 +2287,8 @@ INSERT INTO txt VALUES ('E8014', 'English', 'The handling of this Task Type is n INSERT INTO txt VALUES ('E8101', 'German', 'Email-Versand kann nicht getestet werden, da der aktuell angemeldete Nutzer keine Email-Adresse hinterlegt hat.'); INSERT INTO txt VALUES ('E8101', 'English', 'Sending of emails cannot be tested because the logged-in user does not have an email address.'); - - +INSERT INTO txt VALUES ('E9001', 'German', 'Sie haben Modellier-Rechte für keine Applikation.'); +INSERT INTO txt VALUES ('E9001', 'English', 'You have no modeller rights for any application.'); -- errors from Api INSERT INTO txt VALUES ('A0001', 'German', 'Ungültige Anmeldedaten. Nutzername darf nicht leer sein'); diff --git a/roles/lib/files/FWO.Api.Client/Data/AppRole.cs b/roles/lib/files/FWO.Api.Client/Data/AppRole.cs new file mode 100644 index 000000000..cd280d6d2 --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/AppRole.cs @@ -0,0 +1,22 @@ +using System.Text.Json.Serialization; +using Newtonsoft.Json; +using NetTools; + +namespace FWO.Api.Data +{ + public class AppRole + { + [JsonProperty("id"), JsonPropertyName("id")] + public long Id { get; set; } + + [JsonProperty("area"), JsonPropertyName("area")] + public NetworkArea Area { get; set; } + + [JsonProperty("name"), JsonPropertyName("name")] + public string? Name { get; set; } + + + public List NetworkObjects { get; set; } = new List{}; + + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/Connection.cs b/roles/lib/files/FWO.Api.Client/Data/Connection.cs new file mode 100644 index 000000000..405280b61 --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/Connection.cs @@ -0,0 +1,78 @@ +using System.Text.Json.Serialization; +using Newtonsoft.Json; + +namespace FWO.Api.Data +{ + public class Connection + { + [JsonProperty("id"), JsonPropertyName("id")] + public long Id { get; set; } + + // [JsonProperty("uid"), JsonPropertyName("uid")] + // public string? Uid { get; set; } = ""; + + // [JsonProperty("num_numeric"), JsonPropertyName("num_numeric")] + // public double OrderNumber { get; set; } + + [JsonProperty("rule_name"), JsonPropertyName("rule_name")] + public string? Name { get; set; } = ""; + + [JsonProperty("rule_comment"), JsonPropertyName("rule_comment")] + public string? Comment { get; set; } = ""; + + [JsonProperty("froms"), JsonPropertyName("froms")] + public List Sources { get; set; } = new List{}; + + public List SrcAppRoles { get; set; } = new List{}; + + [JsonProperty("tos"), JsonPropertyName("tos")] + public List Destinations { get; set; } = new List{}; + + public List DstAppRoles { get; set; } = new List{}; + + [JsonProperty("services"), JsonPropertyName("services")] + public List Services { get; set; } = new List{}; + + // [JsonProperty("svc_neg"), JsonPropertyName("svc_neg")] + // public bool ServiceNegated { get; set; } + + // [JsonProperty("svc"), JsonPropertyName("svc")] + // public string Service { get; set; } = ""; + + // [JsonProperty("src_neg"), JsonPropertyName("src_neg")] + // public bool SourceNegated { get; set; } + + // [JsonProperty("src"), JsonPropertyName("src")] + // public string Source { get; set; } = ""; + + // [JsonProperty("src_zone"), JsonPropertyName("src_zone")] + // public NetworkZone? SourceZone { get; set; } = new NetworkZone(); + + // [JsonProperty("dst_neg"), JsonPropertyName("dst_neg")] + // public bool DestinationNegated { get; set; } + + // [JsonProperty("dst"), JsonPropertyName("dst")] + // public string Destination { get; set; } = ""; + + // [JsonProperty("dst_zone"), JsonPropertyName("dst_zone")] + // public NetworkZone? DestinationZone { get; set; } = new NetworkZone(); + + // [JsonProperty("action"), JsonPropertyName("action")] + // public string Action { get; set; } = ""; + + // [JsonProperty("track"), JsonPropertyName("track")] + // public string Track { get; set; } = ""; + + // [JsonProperty("translate"), JsonPropertyName("translate")] + // public NatData NatData {get; set;} = new NatData(); + + // [JsonProperty("disabled"), JsonPropertyName("disabled")] + // public bool Disabled { get; set; } + + // [JsonProperty("owner_name"), JsonPropertyName("owner_name")] + // public string OwnerName {get; set;} = ""; + + // [JsonProperty("owner_id"), JsonPropertyName("owner_id")] + // public int? OwnerId {get; set;} + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/DnDContainer.cs b/roles/lib/files/FWO.Api.Client/Data/DnDContainer.cs new file mode 100644 index 000000000..54a80be3e --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/DnDContainer.cs @@ -0,0 +1,16 @@ +namespace FWO.Api.Data +{ + public class DnDContainer + { + public List IpElements { get; set; } = new(); + public List GrpElements { get; set; } = new(); + public List SvcElements { get; set; } = new(); + + public void Clear() + { + IpElements = new(); + GrpElements = new(); + SvcElements = new(); + } + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/NetworkArea.cs b/roles/lib/files/FWO.Api.Client/Data/NetworkArea.cs new file mode 100644 index 000000000..c63abc742 --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/NetworkArea.cs @@ -0,0 +1,24 @@ +using System.Text.Json.Serialization; +using Newtonsoft.Json; +using System.Net; + +namespace FWO.Api.Data +{ + public class NetworkSubnet + { + public IPAddress Address { get; set; } + + public IPAddress Mask { get; set; } + } + + public class NetworkArea + { + [JsonProperty("id"), JsonPropertyName("id")] + public int Id { get; set; } + + [JsonProperty("name"), JsonPropertyName("name")] + public string Name { get; set; } = ""; + + public List Subnets { get; set; } + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/NetworkProtocol.cs b/roles/lib/files/FWO.Api.Client/Data/NetworkProtocol.cs index ac8e1a3e7..d15924da2 100644 --- a/roles/lib/files/FWO.Api.Client/Data/NetworkProtocol.cs +++ b/roles/lib/files/FWO.Api.Client/Data/NetworkProtocol.cs @@ -10,5 +10,15 @@ public class NetworkProtocol [JsonProperty("name"), JsonPropertyName("name")] public string Name { get; set; } = ""; + + + public NetworkProtocol() + {} + + public NetworkProtocol(IpProtocol i) + { + Id = i.Id; + Name = i.Name; + } } } diff --git a/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs b/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs index 2dbb86139..69a1f2dd3 100644 --- a/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs +++ b/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs @@ -200,6 +200,9 @@ public class ConfigData : ICloneable [JsonProperty("ruleOwnershipMode"), JsonPropertyName("ruleOwnershipMode")] public RuleOwnershipMode RuleOwnershipMode { get; set; } = RuleOwnershipMode.mixed; + [JsonProperty("allowServerInConn"), JsonPropertyName("allowServerInConn")] + public bool AllowServerInConn { get; set; } = true; + public ConfigData(bool editable = false) { diff --git a/roles/lib/files/FWO.Report/Display/RuleDisplayBase.cs b/roles/lib/files/FWO.Report/Display/RuleDisplayBase.cs index ad950cbdc..c3e7cd72e 100644 --- a/roles/lib/files/FWO.Report/Display/RuleDisplayBase.cs +++ b/roles/lib/files/FWO.Report/Display/RuleDisplayBase.cs @@ -83,9 +83,11 @@ public StringBuilder DisplayNetworkLocation(NetworkLocation userNetworkObject, R return result; } - public StringBuilder DisplayService(NetworkService service, ReportType reportType, string? serviceName = null) + public static StringBuilder DisplayService(NetworkService service, ReportType reportType, string? serviceName = null) { StringBuilder result = new StringBuilder(); + string ports = service.DestinationPortEnd == null || service.DestinationPortEnd == 0 || service.DestinationPort == service.DestinationPortEnd ? + $"{service.DestinationPort}" : $"{service.DestinationPort}-{service.DestinationPortEnd}"; if (reportType.IsTechReport()) { if (service.DestinationPort == null) @@ -94,8 +96,7 @@ public StringBuilder DisplayService(NetworkService service, ReportType reportTyp } else { - result.Append(service.DestinationPort == service.DestinationPortEnd ? $"{service.DestinationPort}/{service.Protocol?.Name}" - : $"{service.DestinationPort}-{service.DestinationPortEnd}/{service.Protocol?.Name}"); + result.Append($"{ports}/{service.Protocol?.Name}"); } } else @@ -103,8 +104,7 @@ public StringBuilder DisplayService(NetworkService service, ReportType reportTyp result.Append($"{serviceName ?? service.Name}"); if (service.DestinationPort != null) { - result.Append(service.DestinationPort == service.DestinationPortEnd ? $" ({service.DestinationPort}/{service.Protocol?.Name})" - : $" ({service.DestinationPort}-{service.DestinationPortEnd}/{service.Protocol?.Name})"); + result.Append($" ({ports}/{service.Protocol?.Name})"); } } return result; diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRole.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRole.razor new file mode 100644 index 000000000..8f7bb9a65 --- /dev/null +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRole.razor @@ -0,0 +1,208 @@ +@using FWO.Config.Api + +@inject ApiConnection apiConnection +@inject UserConfig userConfig + +@if (Display) +{ + + +
+
+ +
+
+

@(userConfig.GetText("app_role"))

+
+
+ +
+ + + @area.Name + + +
+
+
+ + +
+
+
@(userConfig.GetText("app_server"))
+
+ + +
+
@DisplayIp(context)
+
+
+
+
+
+
+
+
+ +
+
+ + + + + + + + + +
+
+
+} + +@code +{ + [CascadingParameter] + Action DisplayMessageInUi { get; set; } = DefaultInit.DoNothing; + + [Parameter] + public bool Display { get; set; } = false; + + [Parameter] + public EventCallback DisplayChanged { get; set; } + + [Parameter] + public AppRole AppRole { get; set; } = new AppRole(); + + [Parameter] + public Func NewAppRole { get; set; } = DefaultInit.DoNothing; + + [Parameter] + public Func UpdateAppRole { get; set; } = DefaultInit.DoNothing; + + [Parameter] + public bool AddMode { get; set; } = false; + + + private DnDContainer Container { get; set; } = new DnDContainer(); + int sidebarLeftWidth = GlobalConfig.kSidebarLeftWidth + 300; + + public List IpsToAdd { get; set; } = new List(); + public List IpsToDelete { get; set; } = new List(); + + private List areas = new List(); + private List IpAddresses = new List(){}; + + // Test data + static NetworkArea TestArea1 = new NetworkArea(){ Id = 1, Name = "NA50"}; + static NetworkArea TestArea2 = new NetworkArea(){ Id = 2, Name = "NA91"}; + static NetworkObject TestIp3 = new NetworkObject(){ Id = 3, IP = "1.2.3.4", IpEnd = "1.2.3.4"}; + static NetworkObject TestIp4 = new NetworkObject(){ Id = 4, IP = "111.222.1.0", IpEnd = "111.222.1.7"}; + static NetworkObject TestIp5 = new NetworkObject(){ Id = 5, IP = "10.0.1.1", IpEnd = "10.0.1.1"}; + static NetworkObject TestIp6 = new NetworkObject(){ Id = 6, IP = "123.1.1.0", IpEnd = "123.1.1.1"}; + + + protected override async Task OnInitializedAsync() + { + try + { + // todo: get areas + areas = new List(){TestArea1, TestArea2}; + } + catch (Exception exception) + { + DisplayMessageInUi(exception, userConfig.GetText("fetch_data"), "", true); + } + } + + protected override async Task OnParametersSetAsync() + { + if(Display) + { + SelectedAreaChanged(AddMode ? areas.First() : AppRole.Area); + } + } + + private async Task HandleServerDrop() + { + if(Container.IpElements.Count > 0) + { + AddServer(Container.IpElements); + } + Container.Clear(); + } + + private async Task Save() + { + foreach(var ip in IpsToDelete) + { + AppRole.NetworkObjects.Remove(ip); + } + foreach(var ip in IpsToAdd) + { + AppRole.NetworkObjects.Add(ip); + } + if(AddMode) + { + await NewAppRole(AppRole); + } + else + { + await UpdateAppRole(AppRole); + } + Close(); + } + + private void Close() + { + IpsToAdd = new List(); + IpsToDelete = new List(); + Display = false; + DisplayChanged.InvokeAsync(Display); + } + + private string DisplayIp(NetworkObject elem) + { + return FWO.Ui.Display.NwObjDisplay.DisplayIp(elem.IP, elem.IpEnd); + } + + private bool AddServer(List nwObjects) + { + foreach(var nwobj in nwObjects) + { + if(!AppRole.NetworkObjects.Contains(nwobj) && !IpsToAdd.Contains(nwobj)) + { + IpsToAdd.Add(nwobj); + } + } + StateHasChanged(); + return true; + } + + private void SelectedAreaChanged(NetworkArea newArea) + { + AppRole.Area = newArea; + if(newArea != null && newArea.Name.Length == 4 && AddMode) + { + AppRole.Name = newArea.Name.Remove(1, 1).Insert(1, "Z"); + } + IpAddresses = SelectIpsFromArea(newArea); + } + + private List SelectIpsFromArea(NetworkArea area) + { + // todo: logic + if(area.Id == 1) + { + return new List(){TestIp3, TestIp4}; + } + else + { + return new List(){TestIp5, TestIp6}; + } + } +} diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor new file mode 100644 index 000000000..8399c3417 --- /dev/null +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditAppRoleLeftSide.razor @@ -0,0 +1,90 @@ +@using FWO.Config.Api + +@inject ApiConnection apiConnection +@inject UserConfig userConfig + +
+

@(userConfig.GetText("library"))

+
+
+
@(userConfig.GetText("app_server"))
+
+
+ +
+
+ +
+
+ +
+ +@code +{ + [CascadingParameter] + Action DisplayMessageInUi { get; set; } = DefaultInit.DoNothing; + + [Parameter] + public DnDContainer Container { get; set; } = new(); + + [Parameter] + public EventCallback ContainerChanged { get; set; } + + [Parameter] + public int Width { get; set; } + + [Parameter] + public EventCallback WidthChanged { get; set; } + + [Parameter] + public List IpAddresses { get; set; } + + [Parameter] + public Func, bool> ToAppRole { get; set; } + + + private long[] selectedIpAddresses = new long[]{}; + private int sidebarLeftWidth { get { return Width; } set { Width = value; WidthChanged.InvokeAsync(Width);}} + + protected override async Task OnInitializedAsync() + { + try + { + } + catch (Exception exception) + { + DisplayMessageInUi(exception, userConfig.GetText("fetch_data"), "", true); + } + } + + private void HandleDragStart(List selectedIps) + { + Container.Clear(); + Container.IpElements = selectedIps; + } + + private List ResolveElem(long[] selectedIds) + { + List addedIps = new(); + foreach(var id in selectedIds) + { + addedIps.Add(IpAddresses.FirstOrDefault(x => x.Id == id)); + } + return addedIps; + } + + private async Task DataInconsistent() + { + + } + + private string DisplayIp(NetworkObject elem) + { + return FWO.Ui.Display.NwObjDisplay.DisplayIp(elem.IP, elem.IpEnd); + } +} diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor new file mode 100644 index 000000000..447c3a993 --- /dev/null +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/EditConn.razor @@ -0,0 +1,517 @@ +@using FWO.Config.Api + +@inject ApiConnection apiConnection +@inject UserConfig userConfig + +@if (Display) +{ + @if(!ReadOnly) + { + + } +
+

@(ReadOnly || AddMode ? userConfig.GetText("connection") : userConfig.GetText("edit_connection"))

+
+
+ + +
+
+ + +
+ +
+ +

diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsLanguage.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsLanguage.razor index 789d1d89a..e1e50a6e4 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsLanguage.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsLanguage.razor @@ -13,14 +13,16 @@ @(userConfig.GetText("U5412"))
-
- - - - @(userConfig.GetText(language.Name)) - - -
+
+ +
+ + + @(userConfig.GetText(language.Name)) + + +
+

diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsModelling.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsModelling.razor index 0cf0d2a4f..7e7dd1ae6 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsModelling.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsModelling.razor @@ -19,107 +19,109 @@ { -
- -
- -
-
-
- -
- + +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
-
-
- +
+
- +
- -
- +
+
+
- + +
+ +
- -
-
- + +
+ +
-
-
-
-
-
- + +
+ +
-
-
- -
- +
+
+
+ +
+ +
- -
-
-
- -
- - -
-
@context
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
@context
+
+
+
+
+
+ +
- - -
-
- -
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
-
- -
- +
+
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +

diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsPasswordPolicy.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsPasswordPolicy.razor index 27262ec5e..371f8fccc 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsPasswordPolicy.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsPasswordPolicy.razor @@ -15,34 +15,36 @@ @if (configData != null) { -
- -
- + +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +

diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationGen.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationGen.razor index c40137bfa..c23762736 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationGen.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationGen.razor @@ -16,182 +16,184 @@ @if (configData != null) { -
- -
- + +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
-
- -
- +
+
+ +
+ +
- -
- -
-
-
- -
-
- - - @(userConfig.GetText(interval.ToString())) - - -
- @if(recCheckParams.RecertCheckInterval == Interval.Weeks) - { - +
+ +
+
+
+ +
- - - @(weekday != null ? userConfig.GetText(weekday.ToString() ?? "undefined") : "-") + + + @(userConfig.GetText(interval.ToString()))
- } - else if(recCheckParams.RecertCheckInterval == Interval.Months) - { - -
- -
- } + @if(recCheckParams.RecertCheckInterval == Interval.Weeks) + { + +
+ + + @(weekday != null ? userConfig.GetText(weekday.ToString() ?? "undefined") : "-") + + +
+ } + else if(recCheckParams.RecertCheckInterval == Interval.Months) + { + +
+ +
+ } +
- -
- -
- -
-
-
- -
- -
-
-
- -
- +
+ +
+ +
- -
-
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- +
+ +
+ +
- -
- -
- - - @prio.Name - - +
+ +
+ +
- -
- -
- - - @state.Name - - +
+ +
+ +
- -
-
- -
- - +
+ +
+ + + @prio.Name + + +
-
- - +
+ +
+ + + @state.Name + + +
-
- - - @if (!recertCalcInProgress) - { - - } - else - { -
Loading...
- } -
-
- - - -
+
+
+ +
+ + +
+
+ + +
+
+ + + @if (!recertCalcInProgress) + { + + } + else + { +
Loading...
+ } +
+
+ + + +
+

diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor index d9c340191..de3c86399 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsRecertificationPers.razor @@ -15,10 +15,12 @@ @if (configData != null) { -
- -
- + +
+ +
+ +

diff --git a/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor b/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor index 7dda3575f..ee696052d 100644 --- a/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor +++ b/roles/ui/files/FWO.UI/Pages/Settings/SettingsReport.razor @@ -15,41 +15,43 @@ @if (configData != null) { -
- -
- + +
+ +
+ +
- -
- -
- -
-
- @*
- -
- +
+ +
+ +
- *@ -
- -
- + @*
+ +
+ +
+
*@ +
+ +
+ +
- -
-
- -
- +
+
+ +
+ +
- -
- -
- +
+ +
+ +

From df58d1217be9ebf7c9ae9ed19baa8d2bb53ffe15 Mon Sep 17 00:00:00 2001 From: Tim Purschke Date: Wed, 10 Jan 2024 19:12:41 +0100 Subject: [PATCH 158/255] cosmetics --- roles/importer/files/importer/fwo_log.py | 4 ++++ roles/importer/files/importer/import-main-loop.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/importer/files/importer/fwo_log.py b/roles/importer/files/importer/fwo_log.py index ccb489a35..06d749feb 100644 --- a/roles/importer/files/importer/fwo_log.py +++ b/roles/importer/files/importer/fwo_log.py @@ -4,6 +4,7 @@ import time import threading + class LogLock: semaphore = threading.Semaphore() @@ -54,6 +55,7 @@ def handle_log_lock(): # Wait a second time.sleep(1) + # Used to accquire lock before log processing class LogFilter(logging.Filter): def filter(self, record): @@ -62,6 +64,7 @@ def filter(self, record): # Return True to allow the log record to be processed return True + # Used to release lock after log processing class LogHandler(logging.StreamHandler): def emit(self, record): @@ -70,6 +73,7 @@ def emit(self, record): # Release lock LogLock.semaphore.release() + def getFwoLogger(): debug_level = int(fwo_globals.debug_level) if debug_level >= 1: diff --git a/roles/importer/files/importer/import-main-loop.py b/roles/importer/files/importer/import-main-loop.py index fe0efd327..a57acf166 100755 --- a/roles/importer/files/importer/import-main-loop.py +++ b/roles/importer/files/importer/import-main-loop.py @@ -37,7 +37,6 @@ def __init__(self): def run(self): while not self._stop_event.is_set(): - # Your background task logic here threading.Thread(target = LogLock.handle_log_lock) time.sleep(1) @@ -181,6 +180,7 @@ def stop(self): time.sleep(1) counter += 1 + # got break signal stopping background process for handling log locking logLockerTask.stop() logLockerTask.join() logger.info("importer-main-loop exited gracefully.") From d154514c684a2a5d268c7ab8afb1fb174b741b8e Mon Sep 17 00:00:00 2001 From: abarz722 Date: Thu, 11 Jan 2024 21:07:11 +0100 Subject: [PATCH 159/255] layout fixes --- .../Pages/Monitoring/MonitorAlerts.razor | 56 +++++--- .../FWO.UI/Pages/Monitoring/MonitorAll.razor | 50 ++++--- .../Monitoring/MonitorAutodiscoveryLog.razor | 50 ++++--- .../Pages/Monitoring/MonitorDailyChecks.razor | 29 ++-- .../Pages/Monitoring/MonitorImportLog.razor | 46 +++--- .../Monitoring/MonitorImportStatus.razor | 135 ++++++++++-------- .../Pages/Monitoring/MonitorUiLog.razor | 38 ++--- .../Pages/Monitoring/MonitoringMain.razor | 117 ++++++++------- .../NetworkModelling/ManualAppServer.razor | 62 ++++---- .../NetworkModelling/NetworkModelling.razor | 33 +++-- .../NetworkModelling/PredefServices.razor | 44 +++--- .../Pages/NetworkModelling/ShowHistory.razor | 46 +++--- .../FWO.UI/Pages/Reporting/Archive.razor | 70 ++++----- .../files/FWO.UI/Pages/Reporting/Report.razor | 2 +- .../Reporting/ReportTemplateComponent.razor | 10 +- .../Reporting/Reports/ChangesReport.razor | 4 +- .../Pages/Reporting/Reports/RulesReport.razor | 4 +- .../FWO.UI/Pages/Reporting/Schedule.razor | 74 +++++----- .../Pages/Request/DisplayImplTaskTable.razor | 4 +- .../Pages/Request/DisplayPathAnalysis.razor | 4 +- .../Pages/Request/DisplayTicketTable.razor | 4 +- .../Pages/Settings/SettingsActions.razor | 4 +- .../Pages/Settings/SettingsCredentials.razor | 4 +- .../Pages/Settings/SettingsCustomTexts.razor | 36 ++--- .../Pages/Settings/SettingsCustomizing.razor | 4 +- .../Pages/Settings/SettingsGateways.razor | 4 +- .../Pages/Settings/SettingsGroups.razor | 12 +- .../FWO.UI/Pages/Settings/SettingsLdap.razor | 4 +- .../Pages/Settings/SettingsManagements.razor | 4 +- .../FWO.UI/Pages/Settings/SettingsOwner.razor | 4 +- .../FWO.UI/Pages/Settings/SettingsRoles.razor | 4 +- .../Pages/Settings/SettingsStateMatrix.razor | 2 +- .../Pages/Settings/SettingsStates.razor | 8 +- .../Pages/Settings/SettingsTenants.razor | 4 +- .../FWO.UI/Pages/Settings/SettingsUsers.razor | 38 ++--- roles/ui/files/FWO.UI/Shared/Dropdown.razor | 8 +- roles/ui/files/FWO.UI/wwwroot/css/site.css | 12 +- 37 files changed, 569 insertions(+), 465 deletions(-) diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor index b8bf32418..601d32ca5 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor @@ -13,28 +13,38 @@ @(userConfig.GetText("U7101"))
- - - - - - - - - - - - - - - - -
- +@if(InitComplete) +{ +
+ + + + + + + + + + + + + + + + +
+
+} +else +{ +
+ Loading... +
+} @code { @@ -44,6 +54,7 @@ private List alertEntrys = new List(); private List uiUsers = new List(); private List managements = new List(); + private bool InitComplete = false; protected override async Task OnInitializedAsync() { @@ -59,6 +70,7 @@ managements = await apiConnection.SendQueryAsync>(FWO.Api.Client.Queries.DeviceQueries.getManagementsDetails); else managements = await apiConnection.SendQueryAsync>(FWO.Api.Client.Queries.DeviceQueries.getManagementDetailsWithoutSecrets); + InitComplete = true; } catch (Exception exception) { diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor index f820130b4..ac9735407 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor @@ -9,25 +9,35 @@

@(userConfig.GetText("monitoring"))

- - - - - - - - - - - - - - - - - -
- +@if(InitComplete) +{ +
+ + + + + + + + + + + + + + + + + +
+
+} +else +{ +
+ Loading... +
+} @code @@ -36,12 +46,14 @@ Action DisplayMessageInUi { get; set; } = DefaultInit.DoNothing; private List logEntrys = new List(); + private bool InitComplete = false; protected override async Task OnInitializedAsync() { try { logEntrys = await apiConnection.SendQueryAsync>(MonitorQueries.getLogEntrys); + InitComplete = true; } catch (Exception exception) { diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor index b882f9d0a..2f55a25aa 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor @@ -10,24 +10,35 @@ @(userConfig.GetText("U7401"))
- - - - - - - - - - - - - -
+@if(InitComplete) +{ +
+ + + + + + + + + + + + + +
+
+} +else +{ +
+ Loading... +
+} @code @@ -38,6 +49,7 @@ private List logEntrys = new List(); private List uiUsers = new List(); private List managements = new List(); + private bool InitComplete = false; protected override async Task OnInitializedAsync() { @@ -54,7 +66,7 @@ managements = await apiConnection.SendQueryAsync>(FWO.Api.Client.Queries.DeviceQueries.getManagementDetailsWithoutSecrets); // managements = await apiConnection.SendQueryAsync>(FWO.Api.Client.Queries.DeviceQueries.getManagementsDetails); - + InitComplete = true; } catch (Exception exception) { diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor index c229e3dd8..3ff0595c4 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor @@ -10,14 +10,25 @@ @(userConfig.GetText("U7501"))
- - - - - - - -
+@if(InitComplete) +{ +
+ + + + + + + +
+
+} +else +{ +
+ Loading... +
+} @code @@ -26,12 +37,14 @@ Action DisplayMessageInUi { get; set; } = DefaultInit.DoNothing; private List logEntrys = new List(); + private bool InitComplete = false; protected override async Task OnInitializedAsync() { try { logEntrys = await apiConnection.SendQueryAsync>(MonitorQueries.getDailyCheckLogEntrys); + InitComplete = true; } catch (Exception exception) { diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor index 326749037..26f44dac8 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor @@ -10,23 +10,33 @@ @(userConfig.GetText("U7201"))
- - - - - - - - - - - - - - - -
- +@if(InitComplete) +{ +
+ + + + + + + + + + + + + + + +
+
+} +else +{ +
+ Loading... +
+} @code { @@ -34,12 +44,14 @@ Action DisplayMessageInUi { get; set; } = DefaultInit.DoNothing; private List logEntrys = new List(); + private bool InitComplete = false; protected override async Task OnInitializedAsync() { try { logEntrys = await apiConnection.SendQueryAsync>(MonitorQueries.getImportLogEntrys); + InitComplete = true; } catch (Exception exception) { diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor index 080d9564a..8fec957f0 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor @@ -15,70 +15,79 @@ -
- - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + +
+} +else +{ +
+ Loading... +
+} @@ -93,6 +102,7 @@ private bool DetailsMode = false; private bool rollbackMode = false; private ImportStatus actStatus = new ImportStatus(); + private bool InitComplete = false; protected override async Task OnInitializedAsync() { @@ -107,6 +117,7 @@ countErrors(); setSortPrio(); sortedImportStati = importStati.OrderByDescending(stat=>stat.SortPrio).ToList(); + InitComplete = true; } catch (System.Exception exception) { diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor index d9018ff7e..bc24ea2b6 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor @@ -14,33 +14,35 @@ {
-
+
@user.Name
- +

} - - - - - @if(seeAllUsers) - { - - - - } - - - -
+
+ + + + + @if(seeAllUsers) + { + + + + } + + + +
+
} else { diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor index 605ceb4cb..1e34db1a0 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor @@ -20,62 +20,73 @@
@(userConfig.GetText("open_alerts"))
- @if(alertEntrys.Count == 0) + @if(InitComplete) { - @(userConfig.GetText("no_open_alerts")) + @if(alertEntrys.Count == 0) + { + @(userConfig.GetText("no_open_alerts")) + } + else + { +
+ + + + + + + + + + + + + + + +
+
+ } } else { - - - - - - - - - - - - - - - -
+
+ Loading... +
}
@@ -102,6 +113,7 @@ private bool RemoveSampleDataMode = false; private Alert actAlert = new Alert(); private bool workInProgress = false; + private bool InitComplete = false; protected override async Task OnInitializedAsync() { @@ -121,6 +133,7 @@ } await Refresh(); } + InitComplete = true; } catch (Exception exception) { diff --git a/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor b/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor index f3b76222e..4aa4b69a2 100644 --- a/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor +++ b/roles/ui/files/FWO.UI/Pages/NetworkModelling/ManualAppServer.razor @@ -12,36 +12,38 @@ @if (Display) { - - - - - - - - - - - - - - +
+ + + + + + + + + + + + + + +
}