(id, response, isGood, l10n)
| 294 | } |
| 295 | |
| 296 | #botEntry(id, response, isGood, l10n) { |
| 297 | const thisStatus = !isGood ? 'broken' : response.online ? 'online' : 'offline' |
| 298 | const thisTitle = !isGood ? |
| 299 | `${id} ${l10n.unknown}` : |
| 300 | response.online ? |
| 301 | `${response.name} :: ${response.playersOnline} / ${response.slotCount} ${l10n.online}` : |
| 302 | `${response.name} ${l10n.offline}` |
| 303 | const thisText = isGood && response.online ? response.playersOnline : '-' |
| 304 | const node = document.createElement('a') |
| 305 | node.setAttribute('title', thisTitle) |
| 306 | node.innerHTML = `<span class="bot-status bot-${thisStatus}">${thisText}</span>` |
| 307 | node.addEventListener('click', (e) => { |
| 308 | e.stopPropagation() |
| 309 | window.operations.url(`https://www.farmsimgame.com/Server/${id}`) |
| 310 | }) |
| 311 | return node |
| 312 | } |
| 313 | |
| 314 | // MARK: update UI |
| 315 | updateUI() { |
no test coverage detected