- Full-featured monitoring dashboard for local web apps - Real-time status tracking with uptime percentages - Visual sparklines for status history - Add/Edit/Delete apps dynamically - Categories and color coding - Auto-refresh every 30 seconds - API endpoints for apps and status management
23 lines
582 B
JavaScript
23 lines
582 B
JavaScript
export default function maxIndex(values, valueof) {
|
|
let max;
|
|
let maxIndex = -1;
|
|
let index = -1;
|
|
if (valueof === undefined) {
|
|
for (const value of values) {
|
|
++index;
|
|
if (value != null
|
|
&& (max < value || (max === undefined && value >= value))) {
|
|
max = value, maxIndex = index;
|
|
}
|
|
}
|
|
} else {
|
|
for (let value of values) {
|
|
if ((value = valueof(value, ++index, values)) != null
|
|
&& (max < value || (max === undefined && value >= value))) {
|
|
max = value, maxIndex = index;
|
|
}
|
|
}
|
|
}
|
|
return maxIndex;
|
|
}
|