mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
polish usage output rate and installer progress
This commit is contained in:
@@ -289,10 +289,9 @@
|
|||||||
:title="getRecordPerformanceTitle(record)"
|
:title="getRecordPerformanceTitle(record)"
|
||||||
>
|
>
|
||||||
<span class="whitespace-nowrap">{{ formatRecordLatencyPair(record) }}</span>
|
<span class="whitespace-nowrap">{{ formatRecordLatencyPair(record) }}</span>
|
||||||
<span
|
<span class="text-muted-foreground tabular-nums whitespace-nowrap">
|
||||||
v-if="getRecordDisplayOutputRate(record) != null"
|
{{ formatOutputRate(getRecordDisplayOutputRate(record)) }}
|
||||||
class="text-muted-foreground tabular-nums whitespace-nowrap"
|
</span>
|
||||||
>{{ formatOutputRate(getRecordDisplayOutputRate(record)) }}</span>
|
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-else
|
v-else
|
||||||
@@ -751,10 +750,9 @@
|
|||||||
:title="getRecordPerformanceTitle(record)"
|
:title="getRecordPerformanceTitle(record)"
|
||||||
>
|
>
|
||||||
<span class="tabular-nums whitespace-nowrap">{{ formatRecordLatencyPair(record) }}</span>
|
<span class="tabular-nums whitespace-nowrap">{{ formatRecordLatencyPair(record) }}</span>
|
||||||
<span
|
<span class="text-muted-foreground tabular-nums whitespace-nowrap">
|
||||||
v-if="getRecordDisplayOutputRate(record) != null"
|
{{ formatOutputRate(getRecordDisplayOutputRate(record)) }}
|
||||||
class="text-muted-foreground tabular-nums whitespace-nowrap"
|
</span>
|
||||||
>{{ formatOutputRate(getRecordDisplayOutputRate(record)) }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
v-else
|
v-else
|
||||||
|
|||||||
@@ -172,6 +172,27 @@ describe('UsageRecordsTable', () => {
|
|||||||
expect(titles.join('\n')).not.toContain('首字后生成耗时')
|
expect(titles.join('\n')).not.toContain('首字后生成耗时')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('shows an output speed placeholder when the rate is unavailable', () => {
|
||||||
|
const root = mountUsageRecordsTable([buildRecord({
|
||||||
|
output_tokens: 0,
|
||||||
|
response_time_ms: 1000,
|
||||||
|
first_byte_time_ms: 500,
|
||||||
|
})])
|
||||||
|
|
||||||
|
const performanceCell = root.querySelector('table tbody tr td:last-child') as HTMLElement
|
||||||
|
expect(performanceCell.textContent).toContain('0.50s / 1.00s')
|
||||||
|
expect([...performanceCell.querySelectorAll<HTMLElement>('.text-muted-foreground')]
|
||||||
|
.some((element) => element.textContent?.trim() === '-')).toBe(true)
|
||||||
|
|
||||||
|
const titles = [...root.querySelectorAll<HTMLElement>('[title]')].map((element) => element.title)
|
||||||
|
expect(titles).toContain([
|
||||||
|
'首字: 0.50s',
|
||||||
|
'总耗时: 1.00s',
|
||||||
|
'生成耗时: 0.50s',
|
||||||
|
'输出速度: -',
|
||||||
|
].join('\n'))
|
||||||
|
})
|
||||||
|
|
||||||
it('keeps active request latency in one first-byte / live-total line without TPS', () => {
|
it('keeps active request latency in one first-byte / live-total line without TPS', () => {
|
||||||
const root = mountUsageRecordsTable([buildRecord({
|
const root = mountUsageRecordsTable([buildRecord({
|
||||||
status: 'streaming',
|
status: 'streaming',
|
||||||
|
|||||||
20
install.sh
20
install.sh
@@ -308,10 +308,24 @@ detect_arch() {
|
|||||||
download_to() {
|
download_to() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
local output="$2"
|
local output="$2"
|
||||||
|
local mode="${3:-quiet}"
|
||||||
|
local show_progress="false"
|
||||||
|
if [[ "${mode}" == "progress" && -t 2 ]]; then
|
||||||
|
show_progress="true"
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
curl -fsSL "${url}" -o "${output}"
|
if [[ "${show_progress}" == "true" ]]; then
|
||||||
|
curl -fL --progress-bar "${url}" -o "${output}"
|
||||||
|
else
|
||||||
|
curl -fsSL "${url}" -o "${output}"
|
||||||
|
fi
|
||||||
elif command -v wget >/dev/null 2>&1; then
|
elif command -v wget >/dev/null 2>&1; then
|
||||||
wget -qO "${output}" "${url}"
|
if [[ "${show_progress}" == "true" ]]; then
|
||||||
|
wget -O "${output}" "${url}"
|
||||||
|
else
|
||||||
|
wget -qO "${output}" "${url}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
die "curl or wget is required to download release assets"
|
die "curl or wget is required to download release assets"
|
||||||
fi
|
fi
|
||||||
@@ -431,7 +445,7 @@ download_or_unpack_bundle() {
|
|||||||
sums_file="${TMP_ROOT}/SHA256SUMS"
|
sums_file="${TMP_ROOT}/SHA256SUMS"
|
||||||
|
|
||||||
info "downloading ${asset} from ${REPO}"
|
info "downloading ${asset} from ${REPO}"
|
||||||
download_to "${base_url}/${asset}" "${archive_file}"
|
download_to "${base_url}/${asset}" "${archive_file}" progress
|
||||||
download_to "${base_url}/SHA256SUMS" "${sums_file}"
|
download_to "${base_url}/SHA256SUMS" "${sums_file}"
|
||||||
verify_checksum "${sums_file}" "${archive_file}"
|
verify_checksum "${sums_file}" "${archive_file}"
|
||||||
tar -xzf "${archive_file}" -C "${TMP_ROOT}"
|
tar -xzf "${archive_file}" -C "${TMP_ROOT}"
|
||||||
|
|||||||
Reference in New Issue
Block a user