mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-17 10:19:49 +00:00
Enhancement: statusStyle improvements (#2119)
This commit is contained in:
parent
861ab32ca3
commit
571f627b3b
8 changed files with 100 additions and 80 deletions
|
@ -15,6 +15,7 @@ export default function Item({ service, group }) {
|
|||
const hasLink = service.href && service.href !== "#";
|
||||
const { settings } = useContext(SettingsContext);
|
||||
const showStats = (service.showStats === false) ? false : settings.showStats;
|
||||
const statusStyle = (service.statusStyle !== undefined) ? service.statusStyle : settings.statusStyle;
|
||||
const [statsOpen, setStatsOpen] = useState(service.showStats);
|
||||
const [statsClosing, setStatsClosing] = useState(false);
|
||||
|
||||
|
@ -76,10 +77,10 @@ export default function Item({ service, group }) {
|
|||
</div>
|
||||
)}
|
||||
|
||||
<div className="absolute top-0 right-0 flex flex-row justify-end gap-2 mr-2 z-30 service-tags">
|
||||
<div className={`absolute top-0 right-0 flex flex-row justify-end ${statusStyle === 'dot' ? 'gap-0' : 'gap-2'} mr-2 z-30 service-tags`}>
|
||||
{service.ping && (
|
||||
<div className="flex-shrink-0 flex items-center justify-center service-tag service-ping">
|
||||
<Ping group={group} service={service.name} style={service.statusStyle} />
|
||||
<Ping group={group} service={service.name} style={statusStyle} />
|
||||
<span className="sr-only">Ping status</span>
|
||||
</div>
|
||||
)}
|
||||
|
@ -90,7 +91,7 @@ export default function Item({ service, group }) {
|
|||
onClick={() => (statsOpen ? closeStats() : setStatsOpen(true))}
|
||||
className="flex-shrink-0 flex items-center justify-center cursor-pointer service-tag service-container-stats"
|
||||
>
|
||||
<Status service={service} />
|
||||
<Status service={service} style={statusStyle} />
|
||||
<span className="sr-only">View container stats</span>
|
||||
</button>
|
||||
)}
|
||||
|
@ -100,7 +101,7 @@ export default function Item({ service, group }) {
|
|||
onClick={() => (statsOpen ? closeStats() : setStatsOpen(true))}
|
||||
className="flex-shrink-0 flex items-center justify-center cursor-pointer service-tag service-app"
|
||||
>
|
||||
<KubernetesStatus service={service} />
|
||||
<KubernetesStatus service={service} style={statusStyle} />
|
||||
<span className="sr-only">View container stats</span>
|
||||
</button>
|
||||
)}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue