mirror of
https://github.com/fleetdm/fleet
synced 2026-05-24 01:18:42 +00:00
Fleet UI (unreleased bugs): Related to code fields in modals (#28173)
This commit is contained in:
parent
229b51ff5b
commit
aa5d668893
8 changed files with 56 additions and 90 deletions
|
|
@ -116,21 +116,17 @@ export const AppInstallDetails = ({
|
|||
</span>
|
||||
</div>
|
||||
{showCommandPayload && (
|
||||
<div className={`${baseClass}__script-output`}>
|
||||
<Textarea label="Request payload:" variant="code">
|
||||
{result.payload}
|
||||
</Textarea>
|
||||
</div>
|
||||
<Textarea label="Request payload:" variant="code">
|
||||
{result.payload}
|
||||
</Textarea>
|
||||
)}
|
||||
{showCommandResponse && (
|
||||
<div className={`${baseClass}__script-output`}>
|
||||
<Textarea
|
||||
label={`The response from ${formattedHost}:`}
|
||||
variant="code"
|
||||
>
|
||||
{result.result}
|
||||
</Textarea>
|
||||
</div>
|
||||
<Textarea
|
||||
label={<>The response from {formattedHost}:</>}
|
||||
variant="code"
|
||||
>
|
||||
{result.result}
|
||||
</Textarea>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
.app-install-details {
|
||||
overflow-wrap: anywhere; // Prevent long software name overflow
|
||||
|
||||
&__software-install-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $pad-medium;
|
||||
}
|
||||
|
||||
.modal__content {
|
||||
margin-top: $pad-xlarge;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,14 +80,12 @@ const Output = ({
|
|||
result: ISoftwareInstallResult;
|
||||
}) => {
|
||||
return (
|
||||
<div className={`${baseClass}__script-output`}>
|
||||
<Textarea
|
||||
label={`${SOFTWARE_INSTALL_OUTPUT_DISPLAY_LABELS[displayKey]}:`}
|
||||
variant="code"
|
||||
>
|
||||
{result[displayKey]}
|
||||
</Textarea>
|
||||
</div>
|
||||
<Textarea
|
||||
label={`${SOFTWARE_INSTALL_OUTPUT_DISPLAY_LABELS[displayKey]}:`}
|
||||
variant="code"
|
||||
>
|
||||
{result[displayKey]}
|
||||
</Textarea>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -128,17 +128,12 @@ const SoftwareUninstallDetailsModal = ({
|
|||
/>
|
||||
{!isPendingStatus(status) && scriptResult && (
|
||||
<>
|
||||
<div className={`${baseClass}__script-output`}>
|
||||
<Textarea label="Uninstall script content:" variant="code">
|
||||
{scriptResult.script_contents}
|
||||
</Textarea>
|
||||
</div>
|
||||
|
||||
<div className={`${baseClass}__script-output`}>
|
||||
<Textarea label="Uninstall script output:" variant="code">
|
||||
{scriptResult.output}
|
||||
</Textarea>
|
||||
</div>
|
||||
<Textarea label="Uninstall script content:" variant="code">
|
||||
{scriptResult.script_contents}
|
||||
</Textarea>
|
||||
<Textarea label="Uninstall script output:" variant="code">
|
||||
{scriptResult.output}
|
||||
</Textarea>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
|
|
|||
|
|
@ -20,15 +20,14 @@ const ActivityAutomationDetailsModal = ({
|
|||
return (
|
||||
<>
|
||||
<div className={`${baseClass}__modal-content`}>
|
||||
<p>
|
||||
Fleet will send a JSON payload to this URL whenever a new activity
|
||||
is generated:
|
||||
</p>
|
||||
<div className={`${baseClass}__webhook-url`}>
|
||||
<Textarea className={`${baseClass}__webhook-url-textarea`}>
|
||||
{details.webhook_url}
|
||||
</Textarea>
|
||||
</div>
|
||||
<Textarea
|
||||
label="Fleet will send a JSON payload to this URL whenever a new activity
|
||||
is generated:"
|
||||
className={`${baseClass}__webhook-url`}
|
||||
variant="code"
|
||||
>
|
||||
{details.webhook_url}
|
||||
</Textarea>
|
||||
</div>
|
||||
<div className="modal-cta-wrap">
|
||||
<Button onClick={onCancel} variant="brand">
|
||||
|
|
|
|||
|
|
@ -10,10 +10,4 @@
|
|||
gap: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__webhook-url-textarea {
|
||||
box-sizing: border-box;
|
||||
font-family: "SourceCodePro";
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,12 +20,9 @@ interface IScriptContentProps {
|
|||
|
||||
const ScriptContent = ({ content }: IScriptContentProps) => {
|
||||
return (
|
||||
<div className={`${baseClass}__script-content`}>
|
||||
<span>Script content:</span>
|
||||
<Textarea className={`${baseClass}__script-content-textarea`}>
|
||||
{content}
|
||||
</Textarea>
|
||||
</div>
|
||||
<Textarea label="Script content:" variant="code">
|
||||
{content}
|
||||
</Textarea>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -126,20 +123,24 @@ interface IScriptOutputProps {
|
|||
|
||||
const ScriptOutput = ({ output, hostname }: IScriptOutputProps) => {
|
||||
return (
|
||||
<div className={`${baseClass}__script-output`}>
|
||||
<p>
|
||||
The{" "}
|
||||
<TooltipWrapper
|
||||
tipContent="Fleet records the last 10,000 characters to prevent downtime."
|
||||
tooltipClass={`${baseClass}__output-tooltip`}
|
||||
isDelayed
|
||||
>
|
||||
output recorded
|
||||
</TooltipWrapper>{" "}
|
||||
when <b>{hostname}</b> ran the script above:
|
||||
</p>
|
||||
<Textarea className={`${baseClass}__output-textarea`}>{output}</Textarea>
|
||||
</div>
|
||||
<Textarea
|
||||
label={
|
||||
<>
|
||||
The{" "}
|
||||
<TooltipWrapper
|
||||
tipContent="Fleet records the last 10,000 characters to prevent downtime."
|
||||
tooltipClass={`${baseClass}__output-tooltip`}
|
||||
isDelayed
|
||||
>
|
||||
output recorded
|
||||
</TooltipWrapper>{" "}
|
||||
when <b>{hostname}</b> ran the script above:
|
||||
</>
|
||||
}
|
||||
variant="code"
|
||||
>
|
||||
{output}
|
||||
</Textarea>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,13 +17,6 @@
|
|||
gap: $pad-medium;
|
||||
}
|
||||
|
||||
&__script-content-textarea {
|
||||
box-sizing: border-box;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
font-family: "SourceCodePro";
|
||||
}
|
||||
|
||||
&__status-message {
|
||||
p {
|
||||
display: flex;
|
||||
|
|
@ -45,23 +38,7 @@
|
|||
gap: $pad-xlarge;
|
||||
}
|
||||
|
||||
&__script-output {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $pad-medium;
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__output-tooltip {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
&__output-textarea {
|
||||
font-family: "SourceCodePro";
|
||||
max-height: 150px;
|
||||
overflow: auto;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue