Skip to content

Commit

Permalink
Add staging container
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Sep 25, 2023
1 parent d570902 commit 0f5b7bc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
48 changes: 40 additions & 8 deletions assets/js/components/SaptuneDetails/SaptuneDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ const renderNote = (noteID) => (
</Link>
);

const renderNotes = (notes) =>
notes.map((noteID, index) => [index > 0 && ', ', renderNote(noteID)]);
const renderNotes = (notes) => {
if (notes.length === 0) {
return <span>-</span>;
}
return notes.map((noteID, index) => [index > 0 && ', ', renderNote(noteID)]);
};

const renderSolution = ({ id, notes, partial }) => (
<span>
Expand All @@ -54,6 +58,7 @@ function SaptuneDetails({
hostID,
packageVersion,
services,
staging,
tuningState,
}) {
return (
Expand Down Expand Up @@ -87,7 +92,7 @@ function SaptuneDetails({
/>
</div>

<div className="flex flex-direction-row mt-5">
<div className="flex flex-direction-row mt-7">
<h2 className="text-2xl font-bold self-center">
Saptune Services Status
</h2>
Expand All @@ -112,7 +117,7 @@ function SaptuneDetails({
/>
</div>

<div className="flex flex-direction-row mt-5">
<div className="flex flex-direction-row mt-7">
<h2 className="text-2xl font-bold self-center">
Saptune Tuning Solutions
</h2>
Expand All @@ -133,10 +138,8 @@ function SaptuneDetails({
/>
</div>

<div className="flex flex-direction-row mt-5">
<h2 className="text-2xl font-bold self-center">
Saptune Tuning Notes
</h2>
<div className="flex flex-direction-row mt-7">
<h2 className="text-2xl font-bold self-center">Saptune Tuning Notes</h2>
</div>
<div className="mt-4 bg-white shadow rounded-lg py-4 px-8">
<ListView
Expand All @@ -153,6 +156,35 @@ function SaptuneDetails({
]}
/>
</div>

<div className="flex flex-direction-row mt-7">
<h2 className="text-2xl font-bold self-center">
Saptune Staging Status
</h2>
</div>
<div className="mt-4 bg-white shadow rounded-lg py-4 px-8">
<ListView
orientation="vertical"
data={[
{
title: 'Staging',
content: staging.enabled ? (
<span>Enabled</span>
) : (
<span>Disabled</span>
),
},
{
title: 'Staged Notes',
content: renderNotes(staging.notes),
},
{
title: 'Staged Solutions',
content: staging.solutions_ids.join(', ') || <span>-</span>,
},
]}
/>
</div>
</div>
);
}
Expand Down
1 change: 1 addition & 0 deletions assets/js/components/SaptuneDetails/SaptuneDetailsPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function SaptuneDetailsPage() {
packageVersion={saptuneStatus.package_version}
configuredVersion={saptuneStatus.configured_version}
services={saptuneStatus.services}
staging={saptuneStatus.staging}
tuningState={saptuneStatus.tuning_state}
/>
);
Expand Down

0 comments on commit 0f5b7bc

Please sign in to comment.