mirror of
https://github.com/librenms/librenms.git
synced 2024-09-21 10:28:13 +00:00
Ondemand popup graphs (#15050)
* Only load popup graphs when popup is shown Might cause a small delay, but pre-loading all the graphs was causing a lot of un-needed work. Slowing down page loading. fixes #343 * remove extra div
This commit is contained in:
parent
da94ac5a85
commit
7390c0b0a0
@ -17,10 +17,14 @@
|
||||
</span>
|
||||
</x-slot>
|
||||
<x-slot name="body">
|
||||
@foreach($graphs as $graph)
|
||||
@isset($graph['text'], $graph['graph'])
|
||||
<x-graph-row loading="lazy" :device="$device" :type="$graph['graph']" :title="$graph['text']" :graphs="[['from' => '-1d'], ['from' => '-7d']]"></x-graph-row>
|
||||
@endisset
|
||||
@endforeach
|
||||
<template x-if="loadGraphs" x-data="{loadGraphs: false}" x-init="$watch('popupShow', shown => {if(shown) loadGraphs = true})">
|
||||
<div>
|
||||
@foreach($graphs as $graph)
|
||||
@isset($graph['text'], $graph['graph'])
|
||||
<x-graph-row loading="lazy" :device="$device" :type="$graph['graph']" :title="$graph['text']" :graphs="[['from' => '-1d'], ['from' => '-7d']]"></x-graph-row>
|
||||
@endisset
|
||||
@endforeach
|
||||
</div>
|
||||
</template>
|
||||
</x-slot>
|
||||
</x-popup>
|
||||
|
Loading…
Reference in New Issue
Block a user