fix player2 healthcheck endpoints (#1) (#442)

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Rafal Jeczalik
2025-08-25 20:20:36 +08:00
committed by GitHub
co-authored by Copilot
parent ed322d4959
commit 539621271e
3 changed files with 5 additions and 4 deletions
@@ -54,7 +54,7 @@ onMounted(async () => {
console.error('Failed to validate provider config', providerConfig)
}
try {
const res = await fetch(`http://localhost:4315/v1/health`, {
const res = await fetch(`${providerConfig.baseUrl.endsWith('/') ? providerConfig.baseUrl.slice(0, -1) : providerConfig.baseUrl}/health`, {
method: 'GET',
headers: {
'player2-game-key': 'airi',
@@ -58,7 +58,7 @@ onMounted(async () => {
}
try {
const res = await fetch(`${providerConfig.baseUrl}/v1/health`, {
const res = await fetch(`${providerConfig.baseUrl.endsWith('/') ? providerConfig.baseUrl.slice(0, -1) : providerConfig.baseUrl}/health`, {
method: 'GET',
headers: {
'player2-game-key': 'airi',
+3 -2
View File
@@ -2177,8 +2177,9 @@ export const useProvidersStore = defineStore('providers', () => {
}),
createProvider: async config => createPlayer2((config.baseUrl as string).trim(), 'airi'),
capabilities: {
listVoices: async () => {
return await fetch('http://localhost:4315/v1/tts/voices').then(res => res.json()).then(({ voices }) => (voices as { id: string, language: 'american_english' | 'british_english' | 'japanese' | 'mandarin_chinese' | 'spanish' | 'french' | 'hindi' | 'italian' | 'brazilian_portuguese', name: string, gender: string }[]).map(({ id, language, name, gender }) => (
listVoices: async (config) => {
const baseUrl = (config.baseUrl as string).endsWith('/') ? (config.baseUrl as string).slice(0, -1) : config.baseUrl as string
return await fetch(`${baseUrl}/tts/voices`).then(res => res.json()).then(({ voices }) => (voices as { id: string, language: 'american_english' | 'british_english' | 'japanese' | 'mandarin_chinese' | 'spanish' | 'french' | 'hindi' | 'italian' | 'brazilian_portuguese', name: string, gender: string }[]).map(({ id, language, name, gender }) => (
{
id,