<%
const items = [
{ id: 'browser', icon: 'browser', default_location: 'You', default_name: 'Browser' },
{ id: 'cloudflare', icon: 'cloud', default_location: 'San Francisco', default_name: 'Cloudflare' },
{ id: 'host', icon: 'server', default_location: 'Website', default_name: 'Host' }
];
items.forEach(({ id, icon, default_location, default_name }) => {
const item = params[id + '_status'] || {};
const status = item.status || 'ok';
let text_color;
if (item.status_text_color) {
text_color = item.status_text_color;
} else if (status === 'ok') {
text_color = '#9bca3e'; // text-green-success
} else if (status === 'error') {
text_color = '#bd2426'; // text-red-error
}
const status_text = item.status_text || (status === 'ok' ? 'Working' : 'Error');
const is_error_source = params.error_source === id;
%>
<%= item.location || default_location %>
><%= item.name || default_name %>
<%= status_text %>
<% }); %>