Skip to content

Commit

Permalink
Fix Ansible add directory UI layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Etheryte committed Mar 3, 2025
1 parent 774aab5 commit 3f28fd9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
3 changes: 2 additions & 1 deletion web/html/src/manager/minion/ansible/ansible-control-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ export class AnsibleControlNode extends React.Component<PropsType, StateType> {
<NewAnsiblePath
title={t("Add an Inventory file")}
pathType="inventory"
newInventoryPath={this.state.newInventoryPath}
// TODO: @parlt91: Is this bugfix correct?
newPathValue={this.state.newInventoryPath}
placeholder={t("e.g., /etc/ansible/testing/hosts")}
newPath={(path: string) => this.newPath("inventory", path)}
savePath={() => this.savePath("inventory")}
Expand Down
43 changes: 28 additions & 15 deletions web/html/src/manager/minion/ansible/new-ansible-path.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,39 @@ import * as React from "react";
import { AsyncButton } from "components/buttons";
import { TextField } from "components/fields";

const NewAnsiblePath = (props) => {
type Props = {
title: string;
pathType: string;
newPathValue: string;
newPath: (value: string) => any;
placeholder?: string;
savePath: (...args: any) => any;
};

const NewAnsiblePath = (props: Props) => {
return (
<>
<h4>{props.title}</h4>
<div className="form-group">
<TextField
id={"new_" + props.pathType + "_path_input"}
placeholder={props.placeholder}
value={props.newPathValue}
onChange={(e: any) => props.newPath(e.target.value.toString())}
/>
<div>
<TextField
id={"new_" + props.pathType + "_path_input"}
placeholder={props.placeholder}
value={props.newPathValue}
onChange={(e: any) => props.newPath(e.target.value.toString())}
/>
</div>
</div>
<div className="pull-right btn-group">
<AsyncButton
id={"new_" + props.pathType + "_path_save"}
action={props.savePath}
defaultType="btn-primary"
text={t("Save")}
icon="fa-save"
/>
<div className="d-flex justify-content-end">
<div className="btn-group">
<AsyncButton
id={"new_" + props.pathType + "_path_save"}
action={props.savePath}
defaultType="btn-primary"
text={t("Save")}
icon="fa-save"
/>
</div>
</div>
</>
);
Expand Down
1 change: 1 addition & 0 deletions web/spacewalk-web.changes.eth.ans
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix layout issues on Ansible pages

0 comments on commit 3f28fd9

Please sign in to comment.