Skip to content

Commit

Permalink
[#14] moved conf stats and added summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Eriikah committed Jun 25, 2024
1 parent f46975f commit cccb41a
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 45 deletions.
85 changes: 45 additions & 40 deletions src/components/ConfStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,51 @@ export function ConfStats({ config }: { config: llngConfig }) {
? Object.keys(config.casAppMetaDataOptions).length
: 0);
return (
<div className="main">
<div className="box" style={{ maxWidth: "350px" }}>
<strong>
{t("appNum")} ({appNum})
</strong>
<PieChart
paddingAngle={18}
data={[
{
title: t("saml"),
value: config.samlSPMetaDataXML
? Object.keys(config.samlSPMetaDataXML).length
: 0,
color: "#E38627",
},
{
title: t("oidc"),
value: config.oidcRPMetaDataOptions
? Object.keys(config.oidcRPMetaDataOptions).length
: 0,
color: "#C13C37",
},
{
title: t("cas"),
value: config.casAppMetaDataOptions
? Object.keys(config.casAppMetaDataOptions).length
: 0,
color: "#6A2135",
},
]}
label={({ dataEntry }) => dataEntry.title + " : " + dataEntry.value}
labelStyle={() => ({
fontSize: "5px",
fontFamily: "sans-serif",
})}
lineWidth={30}
labelPosition={110}
radius={30}
/>
</div>
<div>
<strong>
{t("appNum")} ({appNum})
</strong>
<PieChart
paddingAngle={15}
data={[
{
title: t("saml"),
value: config.samlSPMetaDataXML
? Object.keys(config.samlSPMetaDataXML).length
: 0,
color: "#E38627",
},
{
title: t("virtualHost"),
value: config.locationRules
? Object.keys(config.locationRules).length
: 0,
color: "#d65600",
},
{
title: t("oidc"),
value: config.oidcRPMetaDataOptions
? Object.keys(config.oidcRPMetaDataOptions).length
: 0,
color: "#C13C37",
},
{
title: t("cas"),
value: config.casAppMetaDataOptions
? Object.keys(config.casAppMetaDataOptions).length
: 0,
color: "#6A2135",
},
]}
label={({ dataEntry }) => dataEntry.title + " : " + dataEntry.value}
labelStyle={() => ({
fontSize: "5px",
fontFamily: "sans-serif",
})}
lineWidth={30}
labelPosition={110}
radius={20}
/>
</div>
);
}
3 changes: 2 additions & 1 deletion src/dashboards/HomePage.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.infoTable {
border: 1px solid #acacac;
width: 100%;
margin: 10px;
text-align: left;
max-width: 100%;
flex-wrap: wrap;
Expand All @@ -17,7 +18,7 @@ th {
.desc {
display: flex;
flex-direction: row;
align-content: space-between;
align-content: space-evenly;
margin: 2%;
}

Expand Down
19 changes: 15 additions & 4 deletions src/dashboards/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,21 @@ export function HomePage() {
</tbody>
</table>
</div>
</div>
<div>
<strong className="title2">{t("Latest conf stats")}</strong>
<ConfStats config={config.data.config} />
<div>
<table className="infoTable">
<tbody>
<tr>
<th>{t("cfgLog")}</th>
</tr>
<tr>
<td>{config.data.config.cfgLog}</td>
</tr>
</tbody>
</table>
</div>
<div className="statBox">
<ConfStats config={config.data.config} />
</div>
</div>
<div
style={{
Expand Down

0 comments on commit cccb41a

Please sign in to comment.