inputs.fetch().catch(() => { /* fetch errors surface via inputs.error */ })
})
-/* "Active streams" = total subscriptions across all tuner inputs
- * (each tuner's `subs` count summed — one tuner serving several
- * channels off the same transponder counts each). status/inputs
- * also emits an idle "empty status" placeholder row per
- * enabled-but-idle tuner (mpegts_input_get_streams); those carry
- * subs:0, so summing `subs` excludes them naturally. */
-const activeStreams = computed(() =>
+/* Active subscriptions = total subscriptions across all tuner
+ * inputs (each tuner's `subs` count summed — one tuner serving
+ * several channels off the same transponder counts each).
+ * status/inputs also emits an idle "empty status" placeholder row
+ * per enabled-but-idle tuner (mpegts_input_get_streams); those
+ * carry subs:0, so summing `subs` excludes them naturally. The
+ * label counts subscriptions and links to Status → Subscriptions,
+ * so it reads "subscriptions" (not "streams") to match where it
+ * lands. */
+const activeSubscriptions = computed(() =>
inputs.entries.reduce((sum, row) => {
const subs = row.subs
return sum + (typeof subs === 'number' ? subs : 0)
}, 0),
)
-const streamsLabel = computed(() => {
- const n = activeStreams.value
+const subscriptionsLabel = computed(() => {
+ const n = activeSubscriptions.value
if (n === 0) return t('Idle')
- if (n === 1) return t('1 active stream')
- return t('{0} active streams', n)
+ if (n === 1) return t('1 active subscription')
+ return t('{0} active subscriptions', n)
})
/* The label is a router-link to Status → Subscriptions for
* text instead of a link they'd land on a permission denial
* from. Idle ("0 streams") also stays plain text — there's
* nothing to drill into. */
-const streamsLinkable = computed(
- () => activeStreams.value > 0 && access.has('admin'),
+const subscriptionsLinkable = computed(
+ () => activeSubscriptions.value > 0 && access.has('admin'),
)
/* Free space below this fraction of total → the low-disk warning. */
aria-hidden="true"
/>
<router-link
- v-if="streamsLinkable"
+ v-if="subscriptionsLinkable"
:to="{ name: 'status-subscriptions' }"
class="health-line__streams-link"
:title="t('Open Subscriptions')"
>
- {{ streamsLabel }}
+ {{ subscriptionsLabel }}
</router-link>
- <span v-else>{{ streamsLabel }}</span>
+ <span v-else>{{ subscriptionsLabel }}</span>
</p>
</section>
</template>
{ uuid: 'tuner-idle', subs: 0 } /* idle "empty status" placeholder */,
)
const w = mount(HealthLine, globalMountOpts)
- expect(w.find('.health-line__streams').text()).toBe('3 active streams')
+ expect(w.find('.health-line__streams').text()).toBe('3 active subscriptions')
})
- it('uses the singular for a single active stream', () => {
+ it('uses the singular for a single active subscription', () => {
accessData.totaldiskspace = 2 * TIB
accessData.freediskspace = TIB
statusEntries.push({ uuid: 'tuner-a', subs: 1 })
const w = mount(HealthLine, globalMountOpts)
- expect(w.find('.health-line__streams').text()).toBe('1 active stream')
+ expect(w.find('.health-line__streams').text()).toBe('1 active subscription')
})
it('reads "Idle" when only idle tuners are present', () => {
expect(w.find('.health-line__streams').text()).toBe('Idle')
})
- describe('active-streams link to status/subscriptions', () => {
- it('wraps the streams count in a router-link to status-subscriptions for admins with active streams', () => {
+ describe('active-subscriptions link to status/subscriptions', () => {
+ it('wraps the subscriptions count in a router-link to status-subscriptions for admins with active subscriptions', () => {
accessData.totaldiskspace = 2 * TIB
accessData.freediskspace = TIB
mockIsAdmin = true
const link = w.find('.health-line__streams-link')
expect(link.exists()).toBe(true)
expect(link.attributes('data-to')).toContain('status-subscriptions')
- expect(link.text()).toBe('3 active streams')
+ expect(link.text()).toBe('3 active subscriptions')
})
- it('renders the streams count as plain text (no link) for non-admin users', () => {
+ it('renders the subscriptions count as plain text (no link) for non-admin users', () => {
accessData.totaldiskspace = 2 * TIB
accessData.freediskspace = TIB
mockIsAdmin = false
statusEntries.push({ uuid: 'tuner-a', subs: 3 })
const w = mount(HealthLine, globalMountOpts)
expect(w.find('.health-line__streams-link').exists()).toBe(false)
- expect(w.find('.health-line__streams').text()).toBe('3 active streams')
+ expect(w.find('.health-line__streams').text()).toBe('3 active subscriptions')
})
it('renders Idle as plain text (no link) even for admins — nothing to drill into', () => {