Skip to content

Commit 0cc4ca2

Browse files
committed
Simplify stupid query and include open outages
1 parent de131bc commit 0cc4ca2

4 files changed

Lines changed: 334 additions & 12 deletions

File tree

html/build/assets/app-BZJEOsDP.js

Lines changed: 328 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

html/build/assets/app-DOd638d0.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

html/build/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
"src": "html/fonts/glyphicons-halflings-regular.woff2"
2121
},
2222
"resources/js/app.js": {
23-
"file": "assets/app-BGAYfKwQ.js",
23+
"file": "assets/app-BZJEOsDP.js",
2424
"name": "app",
2525
"src": "resources/js/app.js",
2626
"isEntry": true,
2727
"css": [
28-
"assets/app-Tnvu5h2p.css"
28+
"assets/app-DOd638d0.css"
2929
],
3030
"assets": [
3131
"assets/glyphicons-halflings-regular-BUJKDMgK.eot",

includes/html/pages/device/overview/availability_bar.inc.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,9 @@
4040

4141
$outages = DeviceOutage::where('device_id', $device_id)
4242
->where(function ($q) use ($start_ts): void {
43-
$q->where('going_down', '>=', $start_ts)
44-
->orWhere(function ($q2) use ($start_ts): void {
45-
$q2->where('going_down', '<', $start_ts)
46-
->where(function ($q3) use ($start_ts): void {
47-
$q3->whereNull('up_again')
48-
->orWhere('up_again', '>', $start_ts);
49-
});
50-
});
43+
$q->whereNull('up_again')
44+
->orWhere('up_again', '>', $start_ts);
5145
})
52-
->where('up_again', '!=', 0)
5346
->orderBy('going_down')
5447
->toBase()
5548
->get(['going_down', 'up_again']);
@@ -172,7 +165,7 @@ class="tw:fixed tw:bg-white tw:border tw:border-gray-300 tw:rounded tw:min-w-70
172165
} elseif ($total_avail >= $threshold_medium) {
173166
$total_color = 'tw:text-orange-400';
174167
} else {
175-
$total_color = 'tw:text-red-400';
168+
$total_color = 'tw:text-red-500';
176169
}
177170

178171
echo <<<HTML

0 commit comments

Comments
 (0)