diff --git a/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewNodesCompliance.elm b/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewNodesCompliance.elm index c87b3753adb..c18b7181a5a 100644 --- a/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewNodesCompliance.elm +++ b/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewNodesCompliance.elm @@ -53,6 +53,8 @@ displayNodesComplianceTable model = [ text ((if complianceFilters.showComplianceFilters then "Hide " else "Show ") ++ "compliance filters") , i [class ("fa " ++ (if complianceFilters.showComplianceFilters then "fa-minus" else "fa-plus"))][] ] + , button [class "btn btn-sm btn-primary btn-refresh", onClick (CallApi getDirectiveCompliance)] + [ i [class "fa fa-refresh"][] ] ] , displayComplianceFilters complianceFilters UpdateComplianceFilters ] diff --git a/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewRulesCompliance.elm b/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewRulesCompliance.elm index a254bc101cf..deca5c69ea3 100644 --- a/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewRulesCompliance.elm +++ b/webapp/sources/rudder/rudder-web/src/main/elm/sources/DirectiveCompliance/ViewRulesCompliance.elm @@ -52,8 +52,12 @@ displayRulesComplianceTable model = [ text ((if complianceFilters.showComplianceFilters then "Hide " else "Show ") ++ "compliance filters") , i [class ("fa " ++ (if complianceFilters.showComplianceFilters then "fa-minus" else "fa-plus"))][] ] - , button [class "btn btn-sm btn-primary btn-export", onClick (CallApi getCSVExport) ] - [ text "Export " , i [ class "fa fa-download" ] [] ] + , div [class "ms-auto my-auto"] + [ button [class "btn btn-sm btn-primary btn-export me-2", onClick (CallApi getCSVExport) ] + [ text "Export " , i [ class "fa fa-download" ] [] ] + , button [class "btn btn-sm btn-default btn-refresh", onClick (CallApi getDirectiveCompliance)] + [ i [class "fa fa-refresh"][] ] + ] ] , displayComplianceFilters complianceFilters UpdateComplianceFilters ] diff --git a/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/DataTypes.elm b/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/DataTypes.elm index 10f08960b53..76173275495 100644 --- a/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/DataTypes.elm +++ b/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/DataTypes.elm @@ -94,6 +94,7 @@ type Msg | GetPolicyModeResult (Result Error String) | GetGroupComplianceResult (Result Error GroupCompliance) --| Export (Result Error String) --TODO: later + | RefreshCompliance ComplianceScope | CallApi (Model -> Cmd Msg) | LoadCompliance ComplianceScope diff --git a/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/ViewUtils.elm b/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/ViewUtils.elm index 5c15f35c1e7..ca700905e4d 100644 --- a/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/ViewUtils.elm +++ b/webapp/sources/rudder/rudder-web/src/main/elm/sources/GroupCompliance/ViewUtils.elm @@ -357,6 +357,7 @@ filtersView model = let filters = model.ui.ruleFilters complianceFilters = model.ui.complianceFilters + complianceScope = model.complianceScope isGlobalMode = isGlobalCompliance model in div [class "table-header extra-filters"] @@ -398,6 +399,8 @@ filtersView model = [ text ((if complianceFilters.showComplianceFilters then "Hide " else "Show ") ++ "compliance filters") , i [class ("fa " ++ (if complianceFilters.showComplianceFilters then "fa-minus" else "fa-plus"))][] ] + , button [class "btn btn-default btn-sm btn-refresh", onClick (RefreshCompliance complianceScope)] + [ i [class "fa fa-refresh"][] ] ] , displayComplianceFilters complianceFilters UpdateComplianceFilters ] \ No newline at end of file diff --git a/webapp/sources/rudder/rudder-web/src/main/elm/sources/Groupcompliance.elm b/webapp/sources/rudder/rudder-web/src/main/elm/sources/Groupcompliance.elm index 9dcb6838f94..d8e5a8b6dda 100644 --- a/webapp/sources/rudder/rudder-web/src/main/elm/sources/Groupcompliance.elm +++ b/webapp/sources/rudder/rudder-web/src/main/elm/sources/Groupcompliance.elm @@ -128,6 +128,14 @@ update msg model = -- Err err -> -- processApiError "Export directive compliance" err model + RefreshCompliance complianceScope -> + let + getCompliance = case complianceScope of + GlobalCompliance -> getGlobalGroupCompliance + TargetedCompliance -> getTargetedGroupCompliance + in + (model, getCompliance model) + LoadCompliance complianceScope -> let ui = model.ui