Release: fix portable runtime and updater

This commit is contained in:
faumaray committed 2026-07-26 16:48:53 +03:00
1 parent 3632f2cd43
commit c1c1ebdae5
5 files changed
+129 -9

No files matched your search

+9 -1
View File
@@ -4,6 +4,7 @@ import type { RpcMethodName } from '../lib/rpc';
import { confirmDialog, promptDialog } from '../lib/dialog';
import { EmptyRow } from './TrackRow';
import { t, tf } from '../i18n';
import { teamSpeakChannelDisplayName } from '../lib/teamspeak';
interface AdminClient {
id: number;
@@ -281,10 +282,17 @@ export function TeamSpeakAdmin() {
}
function Channel({ channel, depth = 0 }: { channel: AdminChannel; depth?: number }) {
const displayName = teamSpeakChannelDisplayName(channel.name);
return (
<div className="ts-admin-channel" style={{ marginLeft: depth * 16 }}>
<div className="ts-admin-channel-head">
<strong>{channel.name}</strong>
<strong
className={displayName.spacer ? 'ts-admin-spacer' : undefined}
title={channel.name}
>
{displayName.label}
</strong>
<span className="muted">#{channel.id}</span>
<span className="ts-capacity">
{channel.currentClients}/{channel.maxClients || '∞'}
+33
View File
@@ -0,0 +1,33 @@
import { describe, expect, it } from 'vitest';
import { teamSpeakChannelDisplayName } from './teamspeak';
describe('TeamSpeak channel display names', () => {
it('leaves ordinary channel names unchanged', () => {
expect(teamSpeakChannelDisplayName('Minecraft')).toEqual({
label: 'Minecraft',
spacer: false,
alignment: 'left',
});
});
it('removes spacer control prefixes and preserves alignment', () => {
expect(teamSpeakChannelDisplayName('[cspacer0]Гамесы')).toEqual({
label: 'Гамесы',
spacer: true,
alignment: 'center',
});
expect(teamSpeakChannelDisplayName('[rspacer12]Подвал')).toEqual({
label: 'Подвал',
spacer: true,
alignment: 'right',
});
});
it('recognizes repeating spacer channels', () => {
expect(teamSpeakChannelDisplayName('[*spacer3]—')).toEqual({
label: '—',
spacer: true,
alignment: 'repeat',
});
});
});
+33
View File
@@ -0,0 +1,33 @@
export type TeamSpeakSpacerAlignment = 'left' | 'center' | 'right' | 'repeat';
export interface TeamSpeakChannelDisplayName {
label: string;
spacer: boolean;
alignment: TeamSpeakSpacerAlignment;
}
const SPACER_NAME = /^\[([clr]|\*)?spacer\d*\](.*)$/i;
export function teamSpeakChannelDisplayName(
name: string
): TeamSpeakChannelDisplayName {
const match = SPACER_NAME.exec(name);
if (!match) {
return { label: name, spacer: false, alignment: 'left' };
}
const alignment =
match[1]?.toLowerCase() === 'c'
? 'center'
: match[1]?.toLowerCase() === 'r'
? 'right'
: match[1] === '*'
? 'repeat'
: 'left';
return {
label: match[2].trim(),
spacer: true,
alignment,
};
}
+34
View File
@@ -579,6 +579,39 @@ select:focus:not(:focus-visible) { outline: none; }
.ts-channel-row:hover, .ts-client-row:hover { background: rgba(255, 255, 255, 0.035); }
.ts-channel-caret { width: 14px; color: var(--faint); text-align: center; }
.ts-channel-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.ts-channel-row.ts-spacer {
margin: 4px 0 3px;
padding-inline: 5px;
background: linear-gradient(90deg, rgba(124, 92, 255, 0.06), transparent);
}
.ts-channel-row.ts-spacer:hover {
background: linear-gradient(90deg, rgba(124, 92, 255, 0.11), transparent);
}
.ts-channel-row.ts-spacer .ts-channel-caret {
order: 2;
margin-left: auto;
}
.ts-channel-row.ts-spacer .ts-channel-name {
display: flex;
flex: 1;
align-items: center;
gap: 10px;
color: var(--text-2);
letter-spacing: 0.015em;
}
.ts-channel-row.ts-spacer .ts-channel-name::before,
.ts-channel-row.ts-spacer .ts-channel-name::after {
content: '';
flex: 1;
border-top: 1px solid rgba(124, 92, 255, 0.3);
}
.ts-channel-row.ts-spacer-left .ts-channel-name::before,
.ts-channel-row.ts-spacer-repeat .ts-channel-name::before {
display: none;
}
.ts-channel-row.ts-spacer-right .ts-channel-name::after {
display: none;
}
.ts-capacity { margin-left: auto; color: var(--faint); font: 11px var(--font-mono); }
.ts-tag {
padding: 2px 6px; border-radius: 999px; color: var(--muted-2);
@@ -620,6 +653,7 @@ select:focus:not(:focus-visible) { outline: none; }
display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
min-height: 34px;
}
.ts-admin-spacer { color: var(--accent-text); letter-spacing: 0.02em; }
.ts-admin-channel-head .ts-capacity { margin-left: 0; margin-right: auto; }
.ts-admin-client {
display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(250px, 1.2fr) auto;
+20 -8
View File
@@ -16,6 +16,7 @@ import {
} from '../components/icons';
import { t, tf } from '../i18n';
import type { PublicDashboardChannel } from '../lib/types';
import { teamSpeakChannelDisplayName } from '../lib/teamspeak';
const DASHBOARD_VIDEO_PREF_KEY = 'echoion.npVideo';
@@ -32,26 +33,37 @@ function ChannelNode({
channel: PublicDashboardChannel;
depth?: number;
}) {
const displayName = teamSpeakChannelDisplayName(channel.name);
const rowClassName = displayName.spacer
? `ts-channel-row ts-spacer ts-spacer-${displayName.alignment}`
: 'ts-channel-row';
return (
<div
className="ts-channel"
style={{ '--tree-depth': depth } as CSSProperties}
>
<div className="ts-channel-row">
<div className={rowClassName}>
<span className="ts-channel-caret" aria-hidden="true">
{channel.channels.length || channel.clients.length ? '⌄' : '·'}
</span>
<span className="ts-channel-name">{channel.name}</span>
{channel.default && <span className="ts-tag">{t('default')}</span>}
{channel.password && (
<span className="ts-channel-name" title={channel.name}>
{displayName.label}
</span>
{!displayName.spacer && channel.default && (
<span className="ts-tag">{t('default')}</span>
)}
{!displayName.spacer && channel.password && (
<span className="ts-tag" title={t('Password protected')}>
{t('locked')}
</span>
)}
<span className="ts-capacity">
{channel.currentClients}/
{channel.maxClients > 0 ? channel.maxClients : '∞'}
</span>
{!displayName.spacer && (
<span className="ts-capacity">
{channel.currentClients}/
{channel.maxClients > 0 ? channel.maxClients : '∞'}
</span>
)}
</div>
{channel.clients.map((client, index) => (
<div