diff --git a/CODING_GUIDELINES_FRONTEND.md b/CODING_GUIDELINES_FRONTEND.md new file mode 100644 index 000000000..1a7384eb8 --- /dev/null +++ b/CODING_GUIDELINES_FRONTEND.md @@ -0,0 +1,16 @@ + +# Code Guidelines + + +## General +- Close your tag - Leaving some tags open is simply a bad practice. Only self-closing tags are valid. Normal elements can never have self-closing tags. +- Don't use inline styles(if possible) - When creating your markup, do not use inline styling because it would be very hard to override these styles in case you need to. +- Try not to use "!important" - Using the !important declaration is often considered bad practice because it has side effects that mess with one of CSS's core mechanisms: specificity. In many cases, using it could indicate poor CSS architecture. + +## Components +- Organize files and components in a folder structure like this. This makes it easy to find the code related to a page, without having to browse the entire file explorer. Try, as much as possible, to respect the SOLID principles. Mainly by creating autonomous and extensible components: inject the smallest possible service or parameter, manage all the possibilities offered by the component. For example, a data modification page should display the data, check their values and save the data at the end of the process. + +## UI +# Responsiveness +- Use the bootstrap grid and it's column classes to have easy and responsive design. [Bootstrap](https://getbootstrap.com/docs/5.3/layout/columns/) +- Decide if you want to develop mobile or desktop design first and test respectively. \ No newline at end of file diff --git a/documentation/revision-history-develop.md b/documentation/revision-history-develop.md index cc25de252..dd68f0d62 100644 --- a/documentation/revision-history-develop.md +++ b/documentation/revision-history-develop.md @@ -222,3 +222,6 @@ bugfix release: - workflow: external state handling - fix config value - remove uniqueness of owner names + +# 8.3.2 - 09.09.2024 DEVELOP +- Added welcome message and settings \ No newline at end of file diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 2adddd6c0..e304131c9 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -1,5 +1,5 @@ ### general settings -product_version: "8.3.1" +product_version: "8.3.2" ansible_user: "{{ lookup('env', 'USER') }}" ansible_become_method: sudo ansible_python_interpreter: /usr/bin/python3 diff --git a/roles/database/files/sql/creation/fworch-fill-stm.sql b/roles/database/files/sql/creation/fworch-fill-stm.sql index 7b1ec01df..412c45ea8 100644 --- a/roles/database/files/sql/creation/fworch-fill-stm.sql +++ b/roles/database/files/sql/creation/fworch-fill-stm.sql @@ -113,6 +113,7 @@ insert into config (config_key, config_value, config_user) VALUES ('impChangeNot insert into config (config_key, config_value, config_user) VALUES ('impChangeNotifyStartAt', '00:00:00', 0); insert into config (config_key, config_value, config_user) VALUES ('extTicketSystems', '[{"Url":"","TicketTemplate":"{\"ticket\":{\"subject\":\"@@TICKET_SUBJECT@@\",\"priority\":\"@@PRIORITY@@\",\"requester\":\"@@ONBEHALF@@\",\"domain_name\":\"\",\"workflow\":{\"name\":\"@@WORKFLOW_NAME@@\"},\"steps\":{\"step\":[{\"name\":\"Erfassung des Antrags\",\"tasks\":{\"task\":{\"fields\":{\"field\":[@@TASKS@@]}}}}]}}}","TasksTemplate":"{\"@xsi.type\":\"multi_access_request\",\"name\":\"GewünschterZugang\",\"read_only\":false,\"access_request\":{\"order\":\"AR1\",\"verifier_result\":{\"status\":\"notrun\"},\"use_topology\":true,\"targets\":{\"target\":{\"@type\":\"ANY\"}},\"users\":{\"user\":@@USERS@@},\"sources\":{\"source\":@@SOURCES@@},\"destinations\":{\"destination\":@@DESTINATIONS@@},\"services\":{\"service\":@@SERVICES@@},\"action\":\"@@ACTION@@\",\"labels\":\"\"}},{\"@xsi.type\":\"text_area\",\"name\":\"Grund für den Antrag\",\"read_only\":false,\"text\":\"@@REASON@@\"},{\"@xsi.type\":\"drop_down_list\",\"name\":\"Regel Log aktivieren?\",\"selection\":\"@@LOGGING@@\"},{\"@xsi.type\":\"date\",\"name\":\"Regel befristen bis:\"},{\"@xsi.type\":\"text_field\",\"name\":\"Anwendungs-ID\",\"text\":\"@@APPID@@\"},{\"@xsi.type\":\"checkbox\",\"name\":\"Die benötigte Kommunikationsverbindung ist im Kommunikationsprofil nach IT-Sicherheitsstandard hinterlegt\",\"value\":@@COM_DOCUMENTED@@},{\"@xsi.type\":\"drop_down_list\",\"name\":\"Expertenmodus: Exakt wie beantragt implementieren (Designervorschlag ignorieren)\",\"selection\":\"Nein\"}"}]', 0); +insert into config (config_key, config_value, config_user) VALUES ('welcomeMessage', '', 0); INSERT INTO "report_format" ("report_format_name") VALUES ('json'); INSERT INTO "report_format" ("report_format_name") VALUES ('pdf'); diff --git a/roles/database/files/sql/idempotent/fworch-texts.sql b/roles/database/files/sql/idempotent/fworch-texts.sql index 288b1bcc1..334e30475 100644 --- a/roles/database/files/sql/idempotent/fworch-texts.sql +++ b/roles/database/files/sql/idempotent/fworch-texts.sql @@ -1831,6 +1831,8 @@ INSERT INTO txt VALUES ('sessionTimeoutNoticePeriod', 'German','Benachrichtigung INSERT INTO txt VALUES ('sessionTimeoutNoticePeriod', 'English','Warning before session timeout (in minutes)'); INSERT INTO txt VALUES ('uiHostName', 'German', 'Hostname der UI'); INSERT INTO txt VALUES ('uiHostName', 'English', 'UI Hostname'); +INSERT INTO txt VALUES ('welcomeMessage', 'German', 'Willkommensnachricht'); +INSERT INTO txt VALUES ('welcomeMessage', 'English', 'Welcome Message'); INSERT INTO txt VALUES ('maxMessages', 'German', 'Max Anzahl Nachrichten'); INSERT INTO txt VALUES ('maxMessages', 'English', 'Max number of messages'); INSERT INTO txt VALUES ('messageViewTime', 'German', 'Nachrichten-Anzeigedauer (in Sekunden)'); @@ -6219,3 +6221,6 @@ INSERT INTO txt VALUES ('H9053', 'English', 'The assigned modeller can reject th
  • If configured by the administrator (Actions), the interface can also be rejected inside the workflow request.
  • '); + +INSERT INTO txt VALUES ('H9054', 'German', 'Nachricht die auf der Anmeldeseite angezeigt werden soll.'); +INSERT INTO txt VALUES ('H9054', 'English', 'Message that is displayed on Login Page.'); diff --git a/roles/database/files/upgrade/8.3.2.sql b/roles/database/files/upgrade/8.3.2.sql new file mode 100644 index 000000000..e6bc4349c --- /dev/null +++ b/roles/database/files/upgrade/8.3.2.sql @@ -0,0 +1 @@ +insert into config (config_key, config_value, config_user) VALUES ('welcomeMessage', '', 0) ON CONFLICT DO NOTHING; \ No newline at end of file diff --git a/roles/importer/files/importer/import-main-loop.py b/roles/importer/files/importer/import-main-loop.py index 3eb827985..f58a1c099 100755 --- a/roles/importer/files/importer/import-main-loop.py +++ b/roles/importer/files/importer/import-main-loop.py @@ -176,7 +176,7 @@ def stop(self): if not skipping and mgm_details["deviceType"]["id"] in (9, 11, 17, 22, 23, 24): # only handle CPR8x Manager, fortiManager, Cisco MgmCenter, Palo Panorama, Palo FW, FortiOS REST logger.debug("import-main-loop: starting import of mgm_id=" + id) try: - import_result = import_management(mgm_id=id, debug_level_in=debug_level, + import_result = import_management(mgmId=id, debug_level_in=debug_level, clearManagementData=args.clear, force=args.force, limit=str(api_fetch_limit)) except (FwoApiFailedLockImport, FwLoginFailed): pass # minor errors for a single mgm, go to next one diff --git a/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql b/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql index 3a5405a07..3b96a268d 100644 --- a/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql +++ b/roles/lib/files/FWO.Api.Client/APIcalls/request/getTickets.graphql @@ -1,5 +1,5 @@ query getTickets($fromState: Int!, $toState: Int!) { - request_ticket(where: {_or: [{_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}, {reqtasks: {_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}}]}, order_by: {id: asc}) { + request_ticket(where: {_or: [{_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}, {reqtasks: {_and: [{state_id: {_gte: $fromState}}, {state_id: {_lt: $toState}}]}}]}, order_by: {id: desc}) { ...ticketDetails } } diff --git a/roles/lib/files/FWO.Api.Client/APIcalls/rule/fragments/ruleDetailsForReport.graphql b/roles/lib/files/FWO.Api.Client/APIcalls/rule/fragments/ruleDetailsForReport.graphql index d1e8bcbe7..bacdfe347 100644 --- a/roles/lib/files/FWO.Api.Client/APIcalls/rule/fragments/ruleDetailsForReport.graphql +++ b/roles/lib/files/FWO.Api.Client/APIcalls/rule/fragments/ruleDetailsForReport.graphql @@ -15,6 +15,7 @@ rule_metadata_id rule_created rule_first_hit + rule_last_hit rule_last_modified rule_last_certified rule_last_certifier_dn diff --git a/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs b/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs index 167297c45..acf9521de 100644 --- a/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/NwObjectElement.cs @@ -16,7 +16,7 @@ public string IpString get { return Cidr.CidrString; } set { Cidr = new Cidr(value); } } - public Cidr Cidr { get; set; } = new Cidr(); + public Cidr Cidr { get; set; } = new(); [JsonProperty("ip_end"), JsonPropertyName("ip_end")] public string IpEndString @@ -24,7 +24,7 @@ public string IpEndString get { return CidrEnd.CidrString; } // ?? Cidr.CidrString; } set { CidrEnd = new Cidr(value ?? Cidr.CidrString); } // if End value is not set, asume host and set start ip as end ip } - public Cidr CidrEnd { get; set; } = new Cidr(); + public Cidr CidrEnd { get; set; } = new(); [JsonProperty("name"), JsonPropertyName("name")] public string? Name { get; set; } @@ -55,9 +55,9 @@ public NwObjectElement(IPAddressRange ipAddressRange, long taskId) TaskId = taskId; } - public RequestReqElement ToReqElement(ElemFieldType field) + public WfReqElement ToReqElement(ElemFieldType field) { - RequestReqElement element = new RequestReqElement() + WfReqElement element = new() { Id = ElemId, TaskId = TaskId, @@ -68,9 +68,9 @@ public RequestReqElement ToReqElement(ElemFieldType field) return element; } - public RequestImplElement ToImplElement(ElemFieldType field) + public WfImplElement ToImplElement(ElemFieldType field) { - RequestImplElement element = new RequestImplElement() + WfImplElement element = new() { Id = ElemId, ImplTaskId = TaskId, diff --git a/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs b/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs index 6c5a9641d..b5c8d375b 100644 --- a/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/NwRuleElement.cs @@ -7,9 +7,9 @@ public class NwRuleElement public string RuleUid { get; set; } = ""; - public RequestReqElement ToReqElement() + public WfReqElement ToReqElement() { - RequestReqElement element = new RequestReqElement() + WfReqElement element = new() { Id = ElemId, TaskId = TaskId, @@ -19,9 +19,9 @@ public RequestReqElement ToReqElement() return element; } - public RequestImplElement ToImplElement() + public WfImplElement ToImplElement() { - RequestImplElement element = new RequestImplElement() + WfImplElement element = new() { Id = ElemId, ImplTaskId = TaskId, diff --git a/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs b/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs index 363b19d9b..3dfebd877 100644 --- a/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/NwServiceElement.cs @@ -9,9 +9,9 @@ public class NwServiceElement public long? ServiceId { get; set; } - public RequestReqElement ToReqElement() + public WfReqElement ToReqElement() { - RequestReqElement element = new () + WfReqElement element = new () { Id = ElemId, TaskId = TaskId, @@ -23,9 +23,9 @@ public RequestReqElement ToReqElement() return element; } - public RequestImplElement ToImplElement() + public WfImplElement ToImplElement() { - RequestImplElement element = new () + WfImplElement element = new () { Id = ElemId, ImplTaskId = TaskId, diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs b/roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs deleted file mode 100644 index bb629235c..000000000 --- a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalWriter.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace FWO.Api.Data -{ - public class RequestApprovalWriter : RequestApprovalBase - { - public RequestApprovalWriter() - { } - - public RequestApprovalWriter(RequestApproval approval) : base(approval) - { - } - } -} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs b/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs deleted file mode 100644 index 8a51341bf..000000000 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskWriter.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Text.Json.Serialization; -using Newtonsoft.Json; - -namespace FWO.Api.Data -{ - public class RequestReqTaskWriter : RequestReqTaskBase - { - [JsonProperty("elements"), JsonPropertyName("elements")] - public RequestElementDataHelper Elements { get; set; } = new (); - - [JsonProperty("approvals"), JsonPropertyName("approvals")] - public RequestApprovalDataHelper Approvals { get; set; } = new (); - - [JsonProperty("reqtask_owners"), JsonPropertyName("reqtask_owners")] - public RequestOwnerDataHelper Owners { get; set; } = new (); - - public RequestReqTaskWriter(RequestReqTask reqtask) : base(reqtask) - { - foreach(var element in reqtask.Elements) - { - Elements.RequestElementList.Add(new RequestReqElementWriter(element)); - } - foreach(var approval in reqtask.Approvals) - { - Approvals.RequestApprovalList.Add(new RequestApprovalWriter(approval)); - } - foreach(var owner in reqtask.Owners) - { - Owners.RequestOwnerList.Add(new RequestOwnerWriter(owner.Owner)); - } - } - } - - public class RequestElementDataHelper - { - [JsonProperty("data"), JsonPropertyName("data")] - public List RequestElementList { get; set; } = new (); - } - - public class RequestApprovalDataHelper - { - [JsonProperty("data"), JsonPropertyName("data")] - public List RequestApprovalList { get; set; } = new (); - } - - public class RequestOwnerDataHelper - { - [JsonProperty("data"), JsonPropertyName("data")] - public List RequestOwnerList { get; set; } = new (); - } -} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestApproval.cs b/roles/lib/files/FWO.Api.Client/Data/WfApproval.cs similarity index 84% rename from roles/lib/files/FWO.Api.Client/Data/RequestApproval.cs rename to roles/lib/files/FWO.Api.Client/Data/WfApproval.cs index 644d79392..ee00913cb 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestApproval.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfApproval.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestApproval : RequestApprovalBase + public class WfApproval : WfApprovalBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -12,13 +12,13 @@ public class RequestApproval : RequestApprovalBase public long TaskId { get; set; } [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public RequestApproval() + public WfApproval() { } - public RequestApproval(RequestApproval approval) : base(approval) + public WfApproval(WfApproval approval) : base(approval) { Id = approval.Id; TaskId = approval.TaskId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfApprovalBase.cs similarity index 90% rename from roles/lib/files/FWO.Api.Client/Data/RequestApprovalBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfApprovalBase.cs index b99a19490..fd424ab6a 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestApprovalBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfApprovalBase.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestApprovalBase : RequestStatefulObject + public class WfApprovalBase : WfStatefulObject { [JsonProperty("date_opened"), JsonPropertyName("date_opened")] public DateTime DateOpened { get; set; } = DateTime.Now; @@ -30,10 +30,10 @@ public class RequestApprovalBase : RequestStatefulObject public bool InitialApproval { get; set; } = true; - public RequestApprovalBase() + public WfApprovalBase() { } - public RequestApprovalBase(RequestApprovalBase approval) : base(approval) + public WfApprovalBase(WfApprovalBase approval) : base(approval) { DateOpened = approval.DateOpened; ApprovalDate = approval.ApprovalDate; diff --git a/roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs new file mode 100644 index 000000000..8d997e36f --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/WfApprovalWriter.cs @@ -0,0 +1,12 @@ +namespace FWO.Api.Data +{ + public class WfApprovalWriter : WfApprovalBase + { + public WfApprovalWriter() + { } + + public WfApprovalWriter(WfApproval approval) : base(approval) + { + } + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestComment.cs b/roles/lib/files/FWO.Api.Client/Data/WfComment.cs similarity index 52% rename from roles/lib/files/FWO.Api.Client/Data/RequestComment.cs rename to roles/lib/files/FWO.Api.Client/Data/WfComment.cs index 4d3a7d5f7..e9104a2ca 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestComment.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfComment.cs @@ -3,31 +3,31 @@ namespace FWO.Api.Data { - public class RequestComment : RequestCommentBase + public class WfComment : WfCommentBase { [JsonProperty("id"), JsonPropertyName("id")] public int Id { get; set; } - public RequestComment() + public WfComment() { } - public RequestComment(RequestComment comment) : base(comment) + public WfComment(WfComment comment) : base(comment) { Id = comment.Id; } } - public class RequestCommentDataHelper + public class WfCommentDataHelper { [JsonProperty("comment"), JsonPropertyName("comment")] - public RequestComment Comment { get; set; } = new (); + public WfComment Comment { get; set; } = new (); - public RequestCommentDataHelper() + public WfCommentDataHelper() {} - public RequestCommentDataHelper(RequestComment comment) + public WfCommentDataHelper(WfComment comment) { Comment = comment; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestCommentBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfCommentBase.cs similarity index 90% rename from roles/lib/files/FWO.Api.Client/Data/RequestCommentBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfCommentBase.cs index 1a5014ee2..8134ff1f6 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestCommentBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfCommentBase.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestCommentBase + public class WfCommentBase { [JsonProperty("ref_id"), JsonPropertyName("ref_id")] public long? RefId { get; set; } @@ -21,10 +21,10 @@ public class RequestCommentBase public string CommentText { get; set; } = ""; - public RequestCommentBase() + public WfCommentBase() { } - public RequestCommentBase(RequestCommentBase comment) + public WfCommentBase(WfCommentBase comment) { RefId = comment.RefId; Scope = comment.Scope; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestElementBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfElementBase.cs similarity index 93% rename from roles/lib/files/FWO.Api.Client/Data/RequestElementBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfElementBase.cs index 26f23757e..eb1cc7733 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestElementBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfElementBase.cs @@ -11,7 +11,7 @@ public enum ElemFieldType rule } - public class RequestElementBase + public class WfElementBase { [JsonProperty("ip"), JsonPropertyName("ip")] public string? IpString { get; set; } @@ -41,10 +41,10 @@ public class RequestElementBase public string? RuleUid { get; set; } - public RequestElementBase() + public WfElementBase() { } - public RequestElementBase(RequestElementBase element) + public WfElementBase(WfElementBase element) { IpString = element.IpString; Port = element.Port; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestExtState.cs b/roles/lib/files/FWO.Api.Client/Data/WfExtState.cs similarity index 93% rename from roles/lib/files/FWO.Api.Client/Data/RequestExtState.cs rename to roles/lib/files/FWO.Api.Client/Data/WfExtState.cs index 1b7fd785a..49138d5f3 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestExtState.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfExtState.cs @@ -11,7 +11,7 @@ public enum ExtStates Rejected } - public class RequestExtState + public class WfExtState { [JsonProperty("id"), JsonPropertyName("id")] public int? Id { get; set; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestImplElement.cs b/roles/lib/files/FWO.Api.Client/Data/WfImplElement.cs similarity index 84% rename from roles/lib/files/FWO.Api.Client/Data/RequestImplElement.cs rename to roles/lib/files/FWO.Api.Client/Data/WfImplElement.cs index 1c8061100..00f50f1f5 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestImplElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfImplElement.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestImplElement : RequestElementBase + public class WfImplElement : WfElementBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -16,10 +16,10 @@ public class RequestImplElement : RequestElementBase public Cidr Cidr { get; set; } = new Cidr(); - public RequestImplElement() + public WfImplElement() {} - public RequestImplElement(RequestImplElement element) : base(element) + public WfImplElement(WfImplElement element) : base(element) { Id = element.Id; ImplTaskId = element.ImplTaskId; @@ -27,7 +27,7 @@ public RequestImplElement(RequestImplElement element) : base(element) Cidr = new Cidr(element.Cidr != null ? element.Cidr.CidrString : ""); } - public RequestImplElement(RequestReqElement element) + public WfImplElement(WfReqElement element) { Id = 0; ImplAction = element.RequestAction; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestImplTask.cs b/roles/lib/files/FWO.Api.Client/Data/WfImplTask.cs similarity index 86% rename from roles/lib/files/FWO.Api.Client/Data/RequestImplTask.cs rename to roles/lib/files/FWO.Api.Client/Data/WfImplTask.cs index 7a41c5696..3b68cc47c 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestImplTask.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfImplTask.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestImplTask: RequestTaskBase + public class WfImplTask: WfTaskBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -18,20 +18,20 @@ public class RequestImplTask: RequestTaskBase public string ImplAction { get; set; } = RequestAction.create.ToString(); [JsonProperty("elements"), JsonPropertyName("elements")] - public List ImplElements { get; set; } = new (); + public List ImplElements { get; set; } = new (); [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public List RemovedElements { get; set; } = new (); + public List RemovedElements { get; set; } = new (); public long TicketId { get; set; } - public RequestImplTask() + public WfImplTask() {} - public RequestImplTask(RequestImplTask implTask): base(implTask) + public WfImplTask(WfImplTask implTask): base(implTask) { Id = implTask.Id; ReqTaskId = implTask.ReqTaskId; @@ -43,7 +43,7 @@ public RequestImplTask(RequestImplTask implTask): base(implTask) } - public RequestImplTask(RequestReqTask reqtask, bool copyComments = true) + public WfImplTask(WfReqTask reqtask, bool copyComments = true) { Id = 0; Title = reqtask.Title; @@ -73,17 +73,17 @@ public RequestImplTask(RequestReqTask reqtask, bool copyComments = true) { DeviceId = reqtask.Elements[0].DeviceId; } - ImplElements = new List(); - foreach(RequestReqElement element in reqtask.Elements) + ImplElements = new List(); + foreach(WfReqElement element in reqtask.Elements) { - ImplElements.Add(new RequestImplElement(element)); + ImplElements.Add(new WfImplElement(element)); } } if(copyComments) { foreach(var comm in reqtask.Comments) { - comm.Comment.Scope = RequestObjectScopes.ImplementationTask.ToString(); + comm.Comment.Scope = WfObjectScopes.ImplementationTask.ToString(); Comments.Add(comm); } } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestOwnerWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfOwnerWriter.cs similarity index 69% rename from roles/lib/files/FWO.Api.Client/Data/RequestOwnerWriter.cs rename to roles/lib/files/FWO.Api.Client/Data/WfOwnerWriter.cs index 4bd0ed3a7..f55435965 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestOwnerWriter.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfOwnerWriter.cs @@ -3,15 +3,15 @@ namespace FWO.Api.Data { - public class RequestOwnerWriter + public class WfOwnerWriter { [JsonProperty("owner_id"), JsonPropertyName("owner_id")] public int? OwnerId { get; set; } - public RequestOwnerWriter() + public WfOwnerWriter() {} - public RequestOwnerWriter(FwoOwner owner) + public WfOwnerWriter(FwoOwner owner) { OwnerId = owner.Id; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestPriority.cs b/roles/lib/files/FWO.Api.Client/Data/WfPriority.cs similarity index 94% rename from roles/lib/files/FWO.Api.Client/Data/RequestPriority.cs rename to roles/lib/files/FWO.Api.Client/Data/WfPriority.cs index cbaff92ba..4c73732fd 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestPriority.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfPriority.cs @@ -4,7 +4,7 @@ namespace FWO.Api.Data { - public class RequestPriority + public class WfPriority { [JsonProperty("numeric_prio"), JsonPropertyName("numeric_prio")] public int NumPrio { get; set; } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqElement.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqElement.cs similarity index 84% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqElement.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqElement.cs index 3f43cb334..083de3023 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqElement.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqElement.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestReqElement : RequestElementBase + public class WfReqElement : WfElementBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -19,10 +19,10 @@ public class RequestReqElement : RequestElementBase public Cidr Cidr { get; set; } = new Cidr(); - public RequestReqElement() + public WfReqElement() {} - public RequestReqElement(RequestReqElement element) : base (element) + public WfReqElement(WfReqElement element) : base (element) { Id = element.Id; TaskId = element.TaskId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqElementWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqElementWriter.cs similarity index 76% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqElementWriter.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqElementWriter.cs index fc378b75d..045c103da 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqElementWriter.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqElementWriter.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestReqElementWriter : RequestElementBase + public class WfReqElementWriter : WfElementBase { [JsonProperty("request_action"), JsonPropertyName("request_action")] public string RequestAction { get; set; } = Data.RequestAction.create.ToString(); @@ -11,10 +11,10 @@ public class RequestReqElementWriter : RequestElementBase [JsonProperty("device_id"), JsonPropertyName("device_id")] public int? DeviceId { get; set; } - public RequestReqElementWriter() + public WfReqElementWriter() {} - public RequestReqElementWriter(RequestReqElement element) : base(element) + public WfReqElementWriter(WfReqElement element) : base(element) { RequestAction = element.RequestAction; DeviceId = element.DeviceId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqTask.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqTask.cs similarity index 89% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqTask.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqTask.cs index 0c85fad9b..e98ad3016 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqTask.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqTask.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestReqTask : RequestReqTaskBase + public class WfReqTask : WfReqTaskBase { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -12,28 +12,28 @@ public class RequestReqTask : RequestReqTaskBase public long TicketId { get; set; } [JsonProperty("elements"), JsonPropertyName("elements")] - public List Elements { get; set; } = new (); + public List Elements { get; set; } = new (); [JsonProperty("implementation_tasks"), JsonPropertyName("implementation_tasks")] - public List ImplementationTasks { get; set; } = new (); + public List ImplementationTasks { get; set; } = new (); [JsonProperty("request_approvals"), JsonPropertyName("request_approvals")] - public List Approvals { get; set; } = new (); + public List Approvals { get; set; } = new (); [JsonProperty("owners"), JsonPropertyName("owners")] public List Owners { get; set; } = new (); [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public List RemovedElements { get; set; } = new (); + public List RemovedElements { get; set; } = new (); public List NewOwners { get; set; } = new (); public List RemovedOwners { get; set; } = new (); - public RequestReqTask() + public WfReqTask() { } - public RequestReqTask(RequestReqTask reqtask) : base(reqtask) + public WfReqTask(WfReqTask reqtask) : base(reqtask) { Id = reqtask.Id; TicketId = reqtask.TicketId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskBase.cs similarity index 92% rename from roles/lib/files/FWO.Api.Client/Data/RequestReqTaskBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfReqTaskBase.cs index 34307fba4..24efb8689 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestReqTaskBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskBase.cs @@ -16,9 +16,10 @@ public struct AdditionalInfoKeys { public const string ConnId = "ConnId"; public const string ReqOwner = "ReqOwner"; + public const string GrpName = "GrpName"; } - public class RequestReqTaskBase : RequestTaskBase + public class WfReqTaskBase : WfTaskBase { [JsonProperty("request_action"), JsonPropertyName("request_action")] public string RequestAction { get; set; } = Data.RequestAction.create.ToString(); @@ -48,10 +49,10 @@ public string SelectedDevices private List deviceList { get; set; } = new (); - public RequestReqTaskBase() + public WfReqTaskBase() { } - public RequestReqTaskBase(RequestReqTaskBase reqtask) : base(reqtask) + public WfReqTaskBase(WfReqTaskBase reqtask) : base(reqtask) { RequestAction = reqtask.RequestAction; Reason = reqtask.Reason; diff --git a/roles/lib/files/FWO.Api.Client/Data/WfReqTaskWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskWriter.cs new file mode 100644 index 000000000..86b7e19da --- /dev/null +++ b/roles/lib/files/FWO.Api.Client/Data/WfReqTaskWriter.cs @@ -0,0 +1,51 @@ +using System.Text.Json.Serialization; +using Newtonsoft.Json; + +namespace FWO.Api.Data +{ + public class WfReqTaskWriter : WfReqTaskBase + { + [JsonProperty("elements"), JsonPropertyName("elements")] + public WfElementDataHelper Elements { get; set; } = new (); + + [JsonProperty("approvals"), JsonPropertyName("approvals")] + public WfApprovalDataHelper Approvals { get; set; } = new (); + + [JsonProperty("reqtask_owners"), JsonPropertyName("reqtask_owners")] + public WfOwnerDataHelper Owners { get; set; } = new (); + + public WfReqTaskWriter(WfReqTask reqtask) : base(reqtask) + { + foreach(var element in reqtask.Elements) + { + Elements.WfElementList.Add(new WfReqElementWriter(element)); + } + foreach(var approval in reqtask.Approvals) + { + Approvals.WfApprovalList.Add(new WfApprovalWriter(approval)); + } + foreach(var owner in reqtask.Owners) + { + Owners.WfOwnerList.Add(new WfOwnerWriter(owner.Owner)); + } + } + } + + public class WfElementDataHelper + { + [JsonProperty("data"), JsonPropertyName("data")] + public List WfElementList { get; set; } = new (); + } + + public class WfApprovalDataHelper + { + [JsonProperty("data"), JsonPropertyName("data")] + public List WfApprovalList { get; set; } = new (); + } + + public class WfOwnerDataHelper + { + [JsonProperty("data"), JsonPropertyName("data")] + public List WfOwnerList { get; set; } = new (); + } +} diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestStateAction.cs b/roles/lib/files/FWO.Api.Client/Data/WfStateAction.cs similarity index 89% rename from roles/lib/files/FWO.Api.Client/Data/RequestStateAction.cs rename to roles/lib/files/FWO.Api.Client/Data/WfStateAction.cs index 24430d3e2..db6159981 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestStateAction.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfStateAction.cs @@ -31,7 +31,7 @@ public enum StateActionEvents OnAssignment = 15 } - public class RequestStateAction + public class WfStateAction { [JsonProperty("id"), JsonPropertyName("id")] public int Id { get; set; } @@ -43,7 +43,7 @@ public class RequestStateAction public string ActionType { get; set; } = StateActionTypes.DoNothing.ToString(); [JsonProperty("scope"), JsonPropertyName("scope")] - public string Scope { get; set; } = RequestObjectScopes.None.ToString(); + public string Scope { get; set; } = WfObjectScopes.None.ToString(); [JsonProperty("task_type"), JsonPropertyName("task_type")] public string TaskType { get; set; } = ""; @@ -61,7 +61,7 @@ public class RequestStateAction public string ExternalParams { get; set; } = ""; - public RequestStateAction() + public WfStateAction() { } public static bool IsReadonlyType(string actionTypeString) @@ -79,9 +79,9 @@ public static bool IsReadonlyType(string actionTypeString) } } - public class RequestStateActionDataHelper + public class WfStateActionDataHelper { [JsonProperty("action"), JsonPropertyName("action")] - public RequestStateAction Action { get; set; } = new RequestStateAction(); + public WfStateAction Action { get; set; } = new WfStateAction(); } } diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestStatefulObject.cs b/roles/lib/files/FWO.Api.Client/Data/WfStatefulObject.cs similarity index 93% rename from roles/lib/files/FWO.Api.Client/Data/RequestStatefulObject.cs rename to roles/lib/files/FWO.Api.Client/Data/WfStatefulObject.cs index 42a7511a1..621d917db 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestStatefulObject.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfStatefulObject.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public enum RequestObjectScopes + public enum WfObjectScopes { None = 0, Ticket = 1, @@ -12,7 +12,7 @@ public enum RequestObjectScopes Approval = 4 } - public class RequestStatefulObject + public class WfStatefulObject { [JsonProperty("state_id"), JsonPropertyName("state_id")] public int StateId @@ -71,10 +71,10 @@ public void ResetStateChanged() stateChanged = false; } - public RequestStatefulObject() + public WfStatefulObject() { } - public RequestStatefulObject(RequestStatefulObject obj) + public WfStatefulObject(WfStatefulObject obj) { stateId = obj.stateId; oldStateId = obj.oldStateId; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestStates.cs b/roles/lib/files/FWO.Api.Client/Data/WfStates.cs similarity index 74% rename from roles/lib/files/FWO.Api.Client/Data/RequestStates.cs rename to roles/lib/files/FWO.Api.Client/Data/WfStates.cs index e25812995..0e0a62aa3 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestStates.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfStates.cs @@ -5,7 +5,7 @@ namespace FWO.Api.Data { - public class RequestState + public class WfState { [JsonProperty("id"), JsonPropertyName("id")] public int Id { get; set; } @@ -14,12 +14,12 @@ public class RequestState public string Name { get; set; } = ""; [JsonProperty("actions"), JsonPropertyName("actions")] - public List Actions { get; set; } = new (); + public List Actions { get; set; } = new (); - public RequestState(){} + public WfState(){} - public RequestState(RequestState state) + public WfState(WfState state) { Id = state.Id; Name = state.Name; @@ -37,13 +37,13 @@ public string ActionList() } } - public class RequestStateDict + public class WfStateDict { public Dictionary Name = new (); public async Task Init(ApiConnection apiConnection) { - List states = await apiConnection.SendQueryAsync>(Client.Queries.RequestQueries.getStates); + List states = await apiConnection.SendQueryAsync>(Client.Queries.RequestQueries.getStates); Name = new (); foreach(var state in states) { diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTaskBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfTaskBase.cs similarity index 94% rename from roles/lib/files/FWO.Api.Client/Data/RequestTaskBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTaskBase.cs index c0607e3ca..631d816e3 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTaskBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTaskBase.cs @@ -23,7 +23,7 @@ public enum RequestAction modify } - public class RequestTaskBase : RequestStatefulObject + public class WfTaskBase : WfStatefulObject { [JsonProperty("title"), JsonPropertyName("title")] public string Title { get; set; } = ""; @@ -65,10 +65,10 @@ public class RequestTaskBase : RequestStatefulObject public DateTime? TargetEndDate { get; set; } - public RequestTaskBase() + public WfTaskBase() { } - public RequestTaskBase(RequestTaskBase reqtask) : base(reqtask) + public WfTaskBase(WfTaskBase reqtask) : base(reqtask) { Title = reqtask.Title; TaskNumber = reqtask.TaskNumber; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTicket.cs b/roles/lib/files/FWO.Api.Client/Data/WfTicket.cs similarity index 71% rename from roles/lib/files/FWO.Api.Client/Data/RequestTicket.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTicket.cs index 16e6aff9e..c7d6af549 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTicket.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTicket.cs @@ -3,19 +3,19 @@ namespace FWO.Api.Data { - public class RequestTicket : RequestTicketBase + public class WfTicket : WfTicketBase { [JsonProperty("reqtasks"), JsonPropertyName("reqtasks")] - public List Tasks { get; set; } = new (); + public List Tasks { get; set; } = new (); [JsonProperty("comments"), JsonPropertyName("comments")] - public List Comments { get; set; } = new (); + public List Comments { get; set; } = new (); - public RequestTicket() + public WfTicket() {} - public RequestTicket(RequestTicket ticket) : base(ticket) + public WfTicket(WfTicket ticket) : base(ticket) { Tasks = ticket.Tasks; Comments = ticket.Comments; @@ -46,9 +46,9 @@ public int NumberImplTasks() public void UpdateCidrStringsInTaskElements() { - foreach (RequestReqTask reqtask in Tasks) + foreach (WfReqTask reqtask in Tasks) { - foreach(RequestReqElement elem in reqtask.Elements) + foreach(WfReqElement elem in reqtask.Elements) { elem.IpString = elem.Cidr != null && elem.Cidr.Valid ? elem.Cidr.CidrString : null ; } @@ -57,18 +57,18 @@ public void UpdateCidrStringsInTaskElements() public void UpdateCidrsInTaskElements() { - foreach (RequestReqTask reqtask in Tasks) + foreach (WfReqTask reqtask in Tasks) { - foreach(RequestReqElement elem in reqtask.Elements) + foreach(WfReqElement elem in reqtask.Elements) { if (elem.IpString != null) { elem.Cidr = new Cidr(elem.IpString); } } - foreach(RequestImplTask implTask in reqtask.ImplementationTasks) + foreach(WfImplTask implTask in reqtask.ImplementationTasks) { - foreach(RequestImplElement elem in implTask.ImplElements) + foreach(WfImplElement elem in implTask.ImplElements) { if (elem.IpString != null) { diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTicketBase.cs b/roles/lib/files/FWO.Api.Client/Data/WfTicketBase.cs similarity index 94% rename from roles/lib/files/FWO.Api.Client/Data/RequestTicketBase.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTicketBase.cs index 758bf6288..d41c69928 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTicketBase.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTicketBase.cs @@ -3,7 +3,7 @@ namespace FWO.Api.Data { - public class RequestTicketBase: RequestStatefulObject + public class WfTicketBase: WfStatefulObject { [JsonProperty("id"), JsonPropertyName("id")] public long Id { get; set; } @@ -45,10 +45,10 @@ public class RequestTicketBase: RequestStatefulObject public int? Priority { get; set; } - public RequestTicketBase() + public WfTicketBase() { } - public RequestTicketBase(RequestTicketBase ticket) : base(ticket) + public WfTicketBase(WfTicketBase ticket) : base(ticket) { Id = ticket.Id; Title = ticket.Title; diff --git a/roles/lib/files/FWO.Api.Client/Data/RequestTicketWriter.cs b/roles/lib/files/FWO.Api.Client/Data/WfTicketWriter.cs similarity index 53% rename from roles/lib/files/FWO.Api.Client/Data/RequestTicketWriter.cs rename to roles/lib/files/FWO.Api.Client/Data/WfTicketWriter.cs index 87bf3f54b..5303a4fa8 100644 --- a/roles/lib/files/FWO.Api.Client/Data/RequestTicketWriter.cs +++ b/roles/lib/files/FWO.Api.Client/Data/WfTicketWriter.cs @@ -3,18 +3,18 @@ namespace FWO.Api.Data { - public class RequestTicketWriter + public class WfTicketWriter { [JsonProperty("data"), JsonPropertyName("data")] - public List Tasks { get; set; } = new (); + public List Tasks { get; set; } = new (); - public RequestTicketWriter(RequestTicket ticket) + public WfTicketWriter(WfTicket ticket) { foreach(var reqtask in ticket.Tasks) { - Tasks.Add(new RequestReqTaskWriter(reqtask)); + Tasks.Add(new WfReqTaskWriter(reqtask)); } } } diff --git a/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs b/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs index 29893c253..aab7cab77 100644 --- a/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs +++ b/roles/lib/files/FWO.Config.Api/Data/ConfigData.cs @@ -26,6 +26,9 @@ public class ConfigData : ICloneable [JsonProperty("uiHostName"), JsonPropertyName("uiHostName")] public string UiHostName { get; set; } = "http://localhost:5000"; + [JsonProperty("welcomeMessage"), JsonPropertyName("welcomeMessage")] + public string WelcomeMessage { get; set; } = ""; + // [JsonProperty("maxMessages"), JsonPropertyName("maxMessages"), UserConfigData] // public int MaxMessages { get; set; } = 3; diff --git a/roles/lib/files/FWO.DeviceAutoDiscovery/CheckPointAPI.cs b/roles/lib/files/FWO.DeviceAutoDiscovery/CheckPointAPI.cs index 7a030b4f3..ba7c117ff 100644 --- a/roles/lib/files/FWO.DeviceAutoDiscovery/CheckPointAPI.cs +++ b/roles/lib/files/FWO.DeviceAutoDiscovery/CheckPointAPI.cs @@ -92,7 +92,7 @@ public async Task> GetGateways(string session, string ManagementT body.Add("details-level", "full"); request.AddJsonBody(body); Log.WriteDebug("Autodiscovery", $"using CP REST API call 'show-gateways-and-servers'"); - List gwTypes = new List { "simple-gateway", "simple-cluster", "CpmiVsClusterNetobj", "CpmiGatewayPlain", "CpmiGatewayCluster", "CpmiVsxClusterNetobj" }; + List gwTypes = ["simple-gateway", "simple-cluster", "CpmiVsClusterNetobj", "CpmiGatewayPlain", "CpmiGatewayCluster", "CpmiVsxClusterNetobj", "CpmiVsxNetobj"]; // getting all gateways of this management RestResponse devices = await restClient.ExecuteAsync(request); diff --git a/roles/lib/files/FWO.Report/ReportAppRules.cs b/roles/lib/files/FWO.Report/ReportAppRules.cs index 1f48f44ed..28846c5de 100644 --- a/roles/lib/files/FWO.Report/ReportAppRules.cs +++ b/roles/lib/files/FWO.Report/ReportAppRules.cs @@ -132,6 +132,7 @@ private async Task GetAppServers(ApiConnection apiConnection) { relevantObjects.Add(obj); found = true; + break; } } } @@ -220,6 +221,7 @@ private void PrepareFilter(ManagementReport mgt) } } } + mgt.RelevantObjectIds = mgt.RelevantObjectIds.Distinct().ToList(); mgt.HighlightedObjectIds = mgt.HighlightedObjectIds.Distinct().ToList(); } diff --git a/roles/lib/files/FWO.Report/ReportRules.cs b/roles/lib/files/FWO.Report/ReportRules.cs index de8c93a91..e964d6d5e 100644 --- a/roles/lib/files/FWO.Report/ReportRules.cs +++ b/roles/lib/files/FWO.Report/ReportRules.cs @@ -380,7 +380,7 @@ private void appendRuleHeadlineHtml(ref StringBuilder report) report.AppendLine($"{userConfig.GetText("ip_matches")}"); report.AppendLine($"{userConfig.GetText("last_hit")}"); } - if(ReportType == ReportType.UnusedRules) // || ReportType == ReportType.AppRules) + if(ReportType == ReportType.UnusedRules || ReportType == ReportType.AppRules) { report.AppendLine($"{userConfig.GetText("last_hit")}"); } @@ -418,7 +418,7 @@ private void AppendRulesForDeviceHtml(ref StringBuilder report, DeviceReport dev report.AppendLine($"{ruleDisplayHtml.DisplayRecertIpMatches(rule)}"); report.AppendLine($"{ruleDisplayHtml.DisplayLastHit(rule)}"); } - if(ReportType == ReportType.UnusedRules) // || ReportType == ReportType.AppRules) + if(ReportType == ReportType.UnusedRules || ReportType == ReportType.AppRules) { report.AppendLine($"{ruleDisplayHtml.DisplayLastHit(rule)}"); } diff --git a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs index 42cf1c38b..42a0214a0 100644 --- a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs +++ b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicket.cs @@ -8,7 +8,7 @@ namespace FWO.Tufin.SecureChange { - abstract public class ExternalTicket : RequestTicket + abstract public class ExternalTicket : WfTicket { public List TicketTasks = []; diff --git a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs index 5a8c17d8c..47dd4c5f7 100644 --- a/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs +++ b/roles/lib/files/FWO.Tufin.SecureChange/ExternalTicketTask.cs @@ -3,7 +3,7 @@ namespace FWO.Tufin.SecureChange { - public class ExternalAccessRequestTicketTask : RequestReqTask + public class ExternalAccessRequestTicketTask : WfReqTask { private ModellingConnection Connection = new(); diff --git a/roles/ui/files/FWO.UI/Pages/Compliance/ZoneTable.razor b/roles/ui/files/FWO.UI/Pages/Compliance/ZoneTable.razor index ab90a9621..3663eb78d 100644 --- a/roles/ui/files/FWO.UI/Pages/Compliance/ZoneTable.razor +++ b/roles/ui/files/FWO.UI/Pages/Compliance/ZoneTable.razor @@ -56,6 +56,7 @@ @(userConfig.GetText("None")) } + @code diff --git a/roles/ui/files/FWO.UI/Pages/Login.razor b/roles/ui/files/FWO.UI/Pages/Login.razor index f34e8b176..78410f73b 100644 --- a/roles/ui/files/FWO.UI/Pages/Login.razor +++ b/roles/ui/files/FWO.UI/Pages/Login.razor @@ -20,14 +20,14 @@ @inject CircuitHandler circuitHandler @if (showLoginForm) -{ -
    -
    -

    +{ +
    +
    +
    -

    - @*

    @(userConfig.GetText("login"))

    *@ -
    +

    + @*

    @(userConfig.GetText("login"))

    *@ +
    @@ -42,16 +42,31 @@ } else { -
    +
    } @if(!string.IsNullOrEmpty(errorMessage)) { } - +
    -
    +
    +
    + @if(ShowWelcomeMessage) + { +
    +
    +
    +
    + +
    +
    +
    +
    + } } @if (showPasswordChangeForm) @@ -107,6 +122,8 @@ private string newPassword2 = ""; private string chgPwErrorMessage = ""; + private bool ShowWelcomeMessage { get; set; } + protected override async Task OnAfterRenderAsync(bool firstRender) { //ApiConnection.Dispose(); @@ -127,6 +144,9 @@ } catch (Exception ex) { Log.WriteError("Session Restore", "Session restore unsuccessful.", ex); } } + + if(!string.IsNullOrWhiteSpace(globalConfig.WelcomeMessage)) + ShowWelcomeMessage = true; // else no reconnect / reconnect unsuccessful showLoginForm = true; @@ -254,4 +274,4 @@ passwordChangeInProgress = false; } } -} +} \ No newline at end of file diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor index be2e504db..a6aa5eb96 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAlerts.razor @@ -17,7 +17,7 @@ @if(InitComplete) {
    - +
    @@ -43,7 +43,7 @@ else {
    - @(userConfig.GetText("loading")) + @(userConfig.GetText("loading"))
    } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor index 5eca9a687..55b1bd46b 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAll.razor @@ -12,7 +12,7 @@ @if(InitComplete) {
    -
    +
    @@ -35,7 +35,7 @@ else {
    - @(userConfig.GetText("loading")) + @(userConfig.GetText("loading"))
    } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor index 37468f39e..bd350e8f6 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorAutodiscoveryLog.razor @@ -36,7 +36,7 @@ else {
    - @(userConfig.GetText("loading")) + @(userConfig.GetText("loading"))
    } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor index e1f2a9736..bbe376763 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorDailyChecks.razor @@ -26,7 +26,7 @@ else {
    - @(userConfig.GetText("loading")) + @(userConfig.GetText("loading"))
    } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor index ee3961d2d..fb49809ba 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportLog.razor @@ -13,7 +13,7 @@ @if(InitComplete) {
    -
    +
    @@ -34,7 +34,7 @@ else {
    - @(userConfig.GetText("loading")) + @(userConfig.GetText("loading"))
    } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor index e0c6c160e..cab276967 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorImportStatus.razor @@ -80,13 +80,14 @@ }
    +
    } else {
    - @(userConfig.GetText("loading")) + @(userConfig.GetText("loading"))
    } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor index 0e4f17e56..1d58ba644 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitorUiLog.razor @@ -26,7 +26,7 @@
    }
    - +
    @@ -47,7 +47,7 @@ else {
    - @(userConfig.GetText("loading")) + @(userConfig.GetText("loading"))
    } diff --git a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor index 4b32ea453..dd263f5f7 100644 --- a/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor +++ b/roles/ui/files/FWO.UI/Pages/Monitoring/MonitoringMain.razor @@ -31,7 +31,7 @@ else {
    -
    +
    } - @if(SelectedReportType == ReportType.UnusedRules) // || SelectedReportType == ReportType.AppRules) + @if(SelectedReportType == ReportType.UnusedRules || SelectedReportType == ReportType.AppRules) {