+11
src/App.svelte
+11
src/App.svelte
···
6
import instancesData from './instances.json';
7
import numeral from 'numeral';
8
9
const PLC_DIRECTORY = 'plc.directory'
10
const ROOT = 'cbab6809a136d6a621906ee11199d3b0faf85b422fe0d0d2c346ce8e9dcd7485'
11
const AUTO_REFRESH_INTERVAL = 10 // in seconds
···
107
recalculateHead()
108
}))
109
isUpdating = false
110
setTimeout(() => { canRefresh = true }, 500)
111
}
112
113
onMount(async () => {
···
6
import instancesData from './instances.json';
7
import numeral from 'numeral';
8
9
+
const APP_TITLE = 'plcbundle instances'
10
const PLC_DIRECTORY = 'plc.directory'
11
const ROOT = 'cbab6809a136d6a621906ee11199d3b0faf85b422fe0d0d2c346ce8e9dcd7485'
12
const AUTO_REFRESH_INTERVAL = 10 // in seconds
···
108
recalculateHead()
109
}))
110
isUpdating = false
111
+
document.title = genTitle()
112
setTimeout(() => { canRefresh = true }, 500)
113
+
}
114
+
115
+
function genTitle () {
116
+
const arr = []
117
+
if (lastUpdated > 0) {
118
+
const upCount = instances.filter(i => i._head)
119
+
arr.push(`${isConflict ? '⚠️' : '✅'} [${upCount.length}/${instances.length}]`)
120
+
}
121
+
return [...arr, APP_TITLE].join(' ')
122
}
123
124
onMount(async () => {