feat/864-playht on prem conditional block (#515)

* feat/864-playht on prem conditional block

* feat/864 playht on prem condition for checkobox

---------

Co-authored-by: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com>
This commit is contained in:
Vasudev Anubrolu
2025-05-10 20:05:41 +05:30
committed by GitHub
parent 020b11e8ef
commit 94a873cffb

View File

@@ -1556,132 +1556,132 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
</fieldset>
)}
{vendor === VENDOR_PLAYHT && (
<fieldset>
<Checkzone
disabled={hasValue(credential)}
hidden
name="use_hosted_playht_service"
label="Use hosted PlayHT Service"
initialCheck={!initialPlayhtOnpremCheck}
handleChecked={(e) => {
setInitialPlayhtOnpremCheck(!e.target.checked);
if (e.target.checked) {
setTmpPlayhtTtsUri(playhtTtsUri);
setPlayhtTtsUri("");
} else {
if (tmpPlayhtTtsUri) {
setPlayhtTtsUri(tmpPlayhtTtsUri);
}
}
}}
>
<fieldset>
<label htmlFor={`${vendor}_userid`}>
User ID<span>*</span>
</label>
<input
id="playht_user_id"
type="text"
name="playht_user_id"
placeholder="User ID"
required
value={userId}
onChange={(e) => {
setUserId(e.target.value);
}}
disabled={credential ? true : false}
/>
<label htmlFor={`${vendor}_apikey`}>
API key<span>*</span>
</label>
<Passwd
id={`${vendor}_apikey`}
required
name={`${vendor}_apikey`}
placeholder="API key"
value={apiKey ? getObscuredSecret(apiKey) : apiKey}
onChange={(e) => setApiKey(e.target.value)}
disabled={credential ? true : false}
/>
</fieldset>
</Checkzone>
<Checkzone
disabled={hasValue(credential)}
hidden
name="use_on-prem_playht_container"
label="Use on-prem PlayHT container"
initialCheck={initialPlayhtOnpremCheck}
handleChecked={(e) => {
setInitialPlayhtOnpremCheck(e.target.checked);
if (e.target.checked) {
if (tmpPlayhtTtsUri) {
setPlayhtTtsUri(tmpPlayhtTtsUri);
}
} else {
setTmpPlayhtTtsUri(playhtTtsUri);
setPlayhtTtsUri("");
}
}}
>
<fieldset>
<label htmlFor="playht_uri_for_tts">
TTS Container URI<span>*</span>
</label>
<input
id="playht_uri_for_tts"
required
type="text"
name="playht_uri_for_tts"
placeholder="http://"
value={playhtTtsUri}
onChange={(e) => setPlayhtTtsUri(e.target.value)}
/>
<label htmlFor={`${vendor}_userid`}>
User ID<span>*</span>
</label>
<input
id="playht_user_id"
type="text"
name="playht_user_id"
placeholder="User ID"
required
value={userId}
onChange={(e) => {
setUserId(e.target.value);
}}
disabled={credential ? true : false}
/>
<label htmlFor={`${vendor}_apikey`}>
Api key<span>*</span>
</label>
<Passwd
id={`${vendor}_apikey`}
name={`${vendor}_apikey`}
placeholder="API key"
required
value={apiKey ? getObscuredSecret(apiKey) : apiKey}
onChange={(e) => setApiKey(e.target.value)}
disabled={credential ? true : false}
/>
</fieldset>
</Checkzone>
</fieldset>
)}
{(vendor === VENDOR_WELLSAID ||
vendor === VENDOR_ASSEMBLYAI ||
vendor === VENDOR_VOXIST ||
vendor == VENDOR_ELEVENLABS ||
vendor === VENDOR_WHISPER ||
vendor === VENDOR_PLAYHT ||
vendor === VENDOR_RIMELABS ||
vendor === VENDOR_SONIOX ||
vendor === VENDOR_CARTESIA ||
vendor === VENDOR_OPENAI ||
vendor === VENDOR_SPEECHMATICS) && (
<>
{vendor === VENDOR_PLAYHT && (
<fieldset>
<Checkzone
disabled={hasValue(credential)}
hidden
name="use_hosted_playht_service"
label="Use hosted PlayHT Service"
initialCheck={!initialPlayhtOnpremCheck}
handleChecked={(e) => {
setInitialPlayhtOnpremCheck(!e.target.checked);
if (e.target.checked) {
setTmpPlayhtTtsUri(playhtTtsUri);
setPlayhtTtsUri("");
} else {
if (tmpPlayhtTtsUri) {
setPlayhtTtsUri(tmpPlayhtTtsUri);
}
}
}}
>
<fieldset>
<label htmlFor={`${vendor}_userid`}>
User ID<span>*</span>
</label>
<input
id="playht_user_id"
type="text"
name="playht_user_id"
placeholder="User ID"
required
value={userId}
onChange={(e) => {
setUserId(e.target.value);
}}
disabled={credential ? true : false}
/>
<label htmlFor={`${vendor}_apikey`}>
API key<span>*</span>
</label>
<Passwd
id={`${vendor}_apikey`}
required
name={`${vendor}_apikey`}
placeholder="API key"
value={apiKey ? getObscuredSecret(apiKey) : apiKey}
onChange={(e) => setApiKey(e.target.value)}
disabled={credential ? true : false}
/>
</fieldset>
</Checkzone>
<Checkzone
disabled={hasValue(credential)}
hidden
name="use_on-prem_playht_container"
label="Use on-prem PlayHT container"
initialCheck={initialPlayhtOnpremCheck}
handleChecked={(e) => {
setInitialPlayhtOnpremCheck(e.target.checked);
if (e.target.checked) {
if (tmpPlayhtTtsUri) {
setPlayhtTtsUri(tmpPlayhtTtsUri);
}
} else {
setTmpPlayhtTtsUri(playhtTtsUri);
setPlayhtTtsUri("");
}
}}
>
<fieldset>
<label htmlFor="playht_uri_for_tts">
TTS Container URI<span>*</span>
</label>
<input
id="playht_uri_for_tts"
required
type="text"
name="playht_uri_for_tts"
placeholder="http://"
value={playhtTtsUri}
onChange={(e) => setPlayhtTtsUri(e.target.value)}
/>
<label htmlFor={`${vendor}_userid`}>
User ID<span>*</span>
</label>
<input
id="playht_user_id"
type="text"
name="playht_user_id"
placeholder="User ID"
required
value={userId}
onChange={(e) => {
setUserId(e.target.value);
}}
disabled={credential ? true : false}
/>
<label htmlFor={`${vendor}_apikey`}>
Api key<span>*</span>
</label>
<Passwd
id={`${vendor}_apikey`}
name={`${vendor}_apikey`}
placeholder="API key"
required
value={apiKey ? getObscuredSecret(apiKey) : apiKey}
onChange={(e) => setApiKey(e.target.value)}
disabled={credential ? true : false}
/>
</fieldset>
</Checkzone>
</fieldset>
)}
<fieldset>
<label htmlFor={`${vendor}_apikey`}>
API key<span>*</span>
</label>
@@ -1694,7 +1694,7 @@ export const SpeechServiceForm = ({ credential }: SpeechServiceFormProps) => {
onChange={(e) => setApiKey(e.target.value)}
disabled={credential ? true : false}
/>
</>
</fieldset>
)}
{(vendor == VENDOR_ELEVENLABS ||
vendor == VENDOR_WHISPER ||