mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 08:58:41 +00:00
UI - Add global "Disable query reports" setting to advanced org settings (#14268)
## Addresses #13474 <img width="842" alt="Screenshot 2023-10-03 at 11 38 12 AM" src="https://github.com/fleetdm/fleet/assets/61553566/b8f0d81f-ba41-458f-acb5-2224e2774ef8"> - small alignment issues with tooltip-wrapped text should be fixed by upcoming TooltipWrapper refactor PR ## Checklist for submitter - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
ee365ea276
commit
be0ce917c1
3 changed files with 25 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ const DEFAULT_CONFIG_MOCK: IConfig = {
|
|||
live_query_disabled: false,
|
||||
enable_analytics: true,
|
||||
deferred_save_host: false,
|
||||
query_reports_disabled: false,
|
||||
},
|
||||
smtp_settings: {
|
||||
enable_smtp: false,
|
||||
|
|
|
|||
|
|
@ -196,6 +196,7 @@ export interface IConfig {
|
|||
live_query_disabled: boolean;
|
||||
enable_analytics: boolean;
|
||||
deferred_save_host: boolean;
|
||||
query_reports_disabled: boolean;
|
||||
};
|
||||
smtp_settings: {
|
||||
enable_smtp: boolean;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ const Advanced = ({
|
|||
handleSubmit,
|
||||
isUpdatingSettings,
|
||||
}: IAppConfigFormProps): JSX.Element => {
|
||||
const [formData, setFormData] = useState<any>({
|
||||
const [formData, setFormData] = useState({
|
||||
domain: appConfig.smtp_settings.domain || "",
|
||||
verifySSLCerts: appConfig.smtp_settings.verify_ssl_certs || false,
|
||||
enableStartTLS: appConfig.smtp_settings.enable_start_tls,
|
||||
|
|
@ -26,6 +26,8 @@ const Advanced = ({
|
|||
appConfig.host_expiry_settings.host_expiry_enabled || false,
|
||||
hostExpiryWindow: appConfig.host_expiry_settings.host_expiry_window || 0,
|
||||
disableLiveQuery: appConfig.server_settings.live_query_disabled || false,
|
||||
disableQueryReports:
|
||||
appConfig.server_settings.query_reports_disabled || false,
|
||||
});
|
||||
|
||||
const {
|
||||
|
|
@ -35,6 +37,7 @@ const Advanced = ({
|
|||
enableHostExpiry,
|
||||
hostExpiryWindow,
|
||||
disableLiveQuery,
|
||||
disableQueryReports,
|
||||
} = formData;
|
||||
|
||||
const [formErrors, setFormErrors] = useState<IAppConfigFormErrors>({});
|
||||
|
|
@ -69,6 +72,7 @@ const Advanced = ({
|
|||
server_url: appConfig.server_settings.server_url || "",
|
||||
live_query_disabled: disableLiveQuery,
|
||||
enable_analytics: appConfig.server_settings.enable_analytics,
|
||||
query_reports_disabled: disableQueryReports,
|
||||
},
|
||||
smtp_settings: {
|
||||
enable_smtp: appConfig.smtp_settings.enable_smtp || false,
|
||||
|
|
@ -172,6 +176,24 @@ const Advanced = ({
|
|||
>
|
||||
Disable live queries
|
||||
</Checkbox>
|
||||
<Checkbox
|
||||
onChange={handleInputChange}
|
||||
name="disableQueryReports"
|
||||
value={disableQueryReports}
|
||||
parseTarget
|
||||
// TODO - update to JSX once tooltip wrapper refactor is merged
|
||||
// TODO - once refactor is merged, have this and bove tooltips disappear more
|
||||
// quickly to get out of users' way
|
||||
tooltip={
|
||||
'<p>Disabling query reports will decrease database usage, <br />\
|
||||
but will prevent you from accessing query results in<br /> \
|
||||
Fleet and will delete existing reports. This can also be<br />\
|
||||
disabled on a per-query basis by enabling "Discard <br />\
|
||||
data". <em>(Default: <b>Off</b>)</em></p>'
|
||||
}
|
||||
>
|
||||
Disable query reports
|
||||
</Checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue