-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement: Add suspend/resume buttons #81
Conversation
web/src/Kustomization.jsx
Outdated
<div className="grid grid-cols-1 text-right space-y-1"> | ||
<button className="bg-transparent hover:bg-neutral-100 font-medium text-sm text-neutral-700 py-1 px-2 border border-neutral-300 rounded" | ||
onClick={() => capacitorClient.suspend("kustomization", item.metadata.namespace, item.metadata.name)} | ||
> | ||
Suspend | ||
</button> | ||
<button className="bg-transparent hover:bg-neutral-100 font-medium text-sm text-neutral-700 py-1 px-2 border border-neutral-300 rounded" | ||
onClick={() => capacitorClient.resume("kustomization", item.metadata.namespace, item.metadata.name)} | ||
> | ||
Resume | ||
</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just add one button depending on the state of the object?
If resource is already suspended, show resume
If resource is not suspended, show suspend
Something like this:
<div className="grid-cols-1 text-right">
<button className="bg-transparent hover:bg-neutral-100 font-medium text-sm text-neutral-700 py-1 px-2 border border-neutral-300 rounded"
onClick={() => {
if (source.spec.suspend) {
capacitorClient.resume("kustomization", source.metadata.namespace, source.metadata.name);
} else {
capacitorClient.suspend("kustomization", source.metadata.namespace, source.metadata.name);
}
}}
>
{source.spec.suspend ? "Resume" : "Suspend"}
</button>
</div>
Of course would be needed for the other resource types as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On ReadyWidget.jsx we could expand the checks:
Same on Summary.jsx:
What do you think? |
No description provided.