MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / #botEntry

Method #botEntry

renderer/renderJS/main_ui_lib.js:296–312  ·  view source on GitHub ↗
(id, response, isGood, l10n)

Source from the content-addressed store, hash-verified

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() {

Callers 1

updateStateMethod · 0.95

Calls 1

addEventListenerMethod · 0.45

Tested by

no test coverage detected