Skip to content

Commit

Permalink
Suspended state indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
laszlocph committed Apr 8, 2024
1 parent 0fa0dee commit c0f86f6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/src/HelmRelease.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function HelmRelease(props) {
return (
<div
ref={ref}
className={`${highlight ? "ring-2 ring-indigo-600 ring-offset-2" : ""} ${item.spec.suspend ? "bg-neutral-400" : ""} rounded-md border border-neutral-300 p-4 grid grid-cols-12 gap-x-4 bg-white shadow`}
className={`${highlight ? "ring-2 ring-indigo-600 ring-offset-2" : ""} rounded-md border border-neutral-300 p-4 grid grid-cols-12 gap-x-4 bg-white shadow`}
key={`hr-${item.metadata.namespace}/${item.metadata.name}`}
>
<div className="col-span-2">
Expand Down
2 changes: 1 addition & 1 deletion web/src/Kustomization.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function Kustomization(props) {

return (
<div
className={`${highlight ? "ring-2 ring-indigo-600 ring-offset-2" : ""} ${item.spec.suspend ? "bg-neutral-400" : ""} rounded-md border border-neutral-300 p-4 grid grid-cols-12 gap-x-4 bg-white shadow`}
className={`${highlight ? "ring-2 ring-indigo-600 ring-offset-2" : ""} rounded-md border border-neutral-300 p-4 grid grid-cols-12 gap-x-4 bg-white shadow`}
key={`${item.metadata.namespace}/${item.metadata.name}`}
>
<div className="col-span-2">
Expand Down
9 changes: 8 additions & 1 deletion web/src/ReadyWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,19 @@ export function ReadyWidget(props) {
messageColor = ready ? "text-neutral-600 field" : (reconciling || dependencyNotReady) && !stalled ? "text-neutral-600" : "bg-orange-400"
}

const suspended = resource.spec.suspend

if (suspended) {
color = "bg-yellow-400"
statusLabel = "Suspended"
}

return (
<div className="relative">
<div className='font-medium text-neutral-700'>
<span className={`absolute -left-4 top-1 rounded-full h-3 w-3 ${color} inline-block`}></span>
<span>{statusLabel}</span>
{readyCondition &&
{readyCondition && !suspended &&
<span className='ml-1'><TimeLabel title={exactDate} date={parsed} /> ago</span>
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/src/Source.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function Source(props) {
return (
<div
ref={ref}
className={`${highlight ? "ring-2 ring-indigo-600 ring-offset-2" : ""} ${source.spec.suspend ? "bg-neutral-400" : ""} rounded-md border border-neutral-300 p-4 grid grid-cols-12 gap-x-4 bg-white shadow`}
className={`${highlight ? "ring-2 ring-indigo-600 ring-offset-2" : ""} rounded-md border border-neutral-300 p-4 grid grid-cols-12 gap-x-4 bg-white shadow`}
key={`${source.kind}/${source.metadata.namespace}/${source.metadata.name}`}
>
<div className="col-span-2">
Expand Down

0 comments on commit c0f86f6

Please sign in to comment.