From fc7e666476df4bfc14277b90b4f81f516a47b407 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Wed, 24 Aug 2022 13:28:55 -0700 Subject: [PATCH] Fleet UI: Update agent options in-page documentation (#7255) --- changes/issue-7125-update-agent-options-cta | 1 + .../AppSettingsPage/cards/Agents/Agents.tsx | 43 +++++++++++++------ .../OrgSettingsForm/OrgSettingsForm.tsx | 8 +++- .../components/OrgSettingsForm/_styles.scss | 31 ++----------- .../AgentOptionsPage/AgentOptionsPage.tsx | 14 +++++- 5 files changed, 53 insertions(+), 44 deletions(-) create mode 100644 changes/issue-7125-update-agent-options-cta diff --git a/changes/issue-7125-update-agent-options-cta b/changes/issue-7125-update-agent-options-cta new file mode 100644 index 0000000000..ed0560f887 --- /dev/null +++ b/changes/issue-7125-update-agent-options-cta @@ -0,0 +1 @@ +* Improved agent options in-page documentation \ No newline at end of file diff --git a/frontend/pages/admin/AppSettingsPage/cards/Agents/Agents.tsx b/frontend/pages/admin/AppSettingsPage/cards/Agents/Agents.tsx index 74802c9b29..c486f341e3 100644 --- a/frontend/pages/admin/AppSettingsPage/cards/Agents/Agents.tsx +++ b/frontend/pages/admin/AppSettingsPage/cards/Agents/Agents.tsx @@ -3,6 +3,7 @@ import React, { useState, useEffect } from "react"; // @ts-ignore import constructErrorString from "utilities/yaml"; import yaml from "js-yaml"; +import paths from "router/paths"; import Button from "components/buttons/Button"; // @ts-ignore @@ -19,7 +20,10 @@ const baseClass = "app-config-form"; const Agents = ({ appConfig, handleSubmit, + isPremiumTier, }: IAppConfigFormProps): JSX.Element => { + const { ADMIN_TEAMS } = paths; + const [formData, setFormData] = useState({ agentOptions: yaml.dump(appConfig.agent_options) || {}, }); @@ -65,29 +69,42 @@ const Agents = ({
-

Global agent options

+

Agent options

- This code will be used by osquery when it checks for configuration - options. + Agent options configure the osquery agent. When you update agent + options, they will be applied the next time a host checks in to + Fleet.
- - Changes to these configuration options will be applied to all - hosts in your organization that do not belong to any team. - -

- - How do global agent options interact with team-level agent - options?  Learn more about agent options  open new tab - +

+ {isPremiumTier ? ( + + These options are not applied to hosts on a team. To update agent + options for hosts on a team, head to the  + Teams page and select a team. + + ) : ( + + Want some hosts to have different options?  + + Learn more about teams  + open new tab + + + )}

YAML

diff --git a/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/OrgSettingsForm.tsx b/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/OrgSettingsForm.tsx index 6c5014be39..0117fa79b8 100644 --- a/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/OrgSettingsForm.tsx +++ b/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/OrgSettingsForm.tsx @@ -119,7 +119,11 @@ const OrgSettingsForm = ({ )} {activeSection === "agents" && ( - + )} {activeSection === "host-status-webhook" && ( - Global agent options + Agent options
  • diff --git a/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/_styles.scss b/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/_styles.scss index d8efd4b8e2..e797e75de6 100644 --- a/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/_styles.scss +++ b/frontend/pages/admin/AppSettingsPage/components/OrgSettingsForm/_styles.scss @@ -1,5 +1,4 @@ .org-settings-form { - &__settings-form { display: flex; } @@ -47,29 +46,7 @@ .app-config-form { width: 100%; - &__config-docs { - display: flex; - flex-direction: row; - align-items: center; - padding: $pad-medium; - border-radius: $border-radius; - border: 1px solid #d9d9fe; - background-color: $ui-vibrant-blue-10; - margin-bottom: $pad-medium; - font-size: $x-small; - - p { - margin: 0; - font-size: $x-small; - } - } - &__learn-more { - color: $core-vibrant-blue; - font-size: $x-small; - font-weight: $bold; - text-decoration: none; - &--inline { margin-left: $pad-medium; } @@ -123,10 +100,10 @@ padding-bottom: $pad-small; max-width: 65%; font-size: $medium; - font-weight: $regular; - color: $core-fleet-black; - border-bottom: solid 1px $ui-fleet-blue-15; - margin: 0 0 $pad-xxlarge; + font-weight: $regular; + color: $core-fleet-black; + border-bottom: solid 1px $ui-fleet-blue-15; + margin: 0 0 $pad-xxlarge; } .smtp-options { diff --git a/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/AgentOptionsPage/AgentOptionsPage.tsx b/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/AgentOptionsPage/AgentOptionsPage.tsx index 282fd7706a..61ebc67cb9 100644 --- a/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/AgentOptionsPage/AgentOptionsPage.tsx +++ b/frontend/pages/admin/TeamManagementPage/TeamDetailsWrapper/AgentOptionsPage/AgentOptionsPage.tsx @@ -77,8 +77,18 @@ const AgentOptionsPage = ({ return (

    - This file describes options returned to osquery when it checks for - configuration. + Agent options configure the osquery agent. When you update agent + options, they will be applied the next time a host checks in to Fleet. +
    + + Learn more about agent options  + open new tab +

    See Fleet documentation for an example file that includes the overrides