【调整】前后空格移除的方法和调整部分提示不准确的问题

This commit is contained in:
chudong
2025-05-20 11:45:02 +08:00
parent 59dc0a4108
commit ad0cd016f6
128 changed files with 10519 additions and 10314 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -6,6 +6,7 @@ import rules from './verify'
import DnsProviderSelect from '@components/dnsProviderSelect'
import type { ApplyNodeConfig } from '@components/flowChart/types'
import { deepClone } from '@baota/utils/data'
import { noSideSpace } from '@lib/utils'
export default defineComponent({
name: 'ApplyNodeDrawer',
@@ -43,18 +44,14 @@ export default defineComponent({
return [
useFormInput($t('t_17_1745227838561'), 'domains', {
placeholder: $t('t_0_1745735774005'),
allowInput: noSideSpace,
onInput: (val: string) => {
param.value.domains = val.trim() // 去除空格
param.value.domains = param.value.domains.replace(//g, ',') // 中文逗号分隔
param.value.domains = param.value.domains.replace(/;/g, ',') // 去除分号
},
onFocus: () => {
param.value.domains = param.value.domains.replace(/,^/g, '') // 中文逗号分隔
param.value.domains = val.replace(//g, ',').replace(/;/g, ',') // 中文逗号分隔
},
}),
useFormInput($t('t_1_1745735764953'), 'email', {
placeholder: $t('t_2_1745735773668'),
onInput: (val: string) => (param.value.email = val.trim()),
allowInput: noSideSpace,
}),
{
type: 'custom' as const,
@@ -111,13 +108,9 @@ export default defineComponent({
'name_server',
{
placeholder: $t('t_1_1747106961747'),
allowInput: noSideSpace,
onInput: (val: string) => {
param.value.name_server = val.trim() // 去除空格
param.value.name_server = param.value.name_server.replace(//g, ',') // 中文逗号分隔
param.value.name_server = param.value.name_server.replace(/;/g, ',') // 去除分号
},
onFocus: () => {
param.value.name_server = param.value.name_server.replace(/,^/g, '') // 中文逗号分隔
param.value.name_server = val.replace(//g, ',').replace(/;/g, ',') // 中文逗号分隔
},
},
{ showRequireMark: false },

View File

@@ -25,6 +25,7 @@ import SearchOutlined from '@vicons/antd/es/SearchOutlined'
import styles from './index.module.css'
import verifyRules from './verify'
import { deepClone } from '@baota/utils/data'
import { noSideSpace } from '@lib/utils'
type StepStatus = 'process' | 'wait' | 'finish' | 'error'
@@ -153,11 +154,11 @@ export default defineComponent({
...[
useFormInput($t('t_1_1747280813656'), 'certPath', {
placeholder: $t('t_30_1746667591892'),
onInput: (val: string) => (param.value.certPath = val.trim()),
allowInput: noSideSpace,
}),
useFormInput($t('t_2_1747280811593'), 'keyPath', {
placeholder: $t('t_31_1746667593074'),
onInput: (val: string) => (param.value.keyPath = val.trim()),
allowInput: noSideSpace,
}),
useFormTextarea(
$t('t_3_1747280812067'),
@@ -182,7 +183,7 @@ export default defineComponent({
...[
useFormInput($t('t_0_1747296173751'), 'siteName', {
placeholder: $t('t_1_1747296175494'),
onInput: (val: string) => (param.value.siteName = val.trim()),
allowInput: noSideSpace,
}),
],
)
@@ -192,7 +193,7 @@ export default defineComponent({
...[
useFormInput($t('t_6_1747280809615'), 'site_id', {
placeholder: $t('t_24_1745735766826'),
onInput: (val: string) => (param.value.site_id = val.trim()),
allowInput: noSideSpace,
}),
],
)
@@ -203,7 +204,7 @@ export default defineComponent({
...[
useFormInput($t('t_17_1745227838561'), 'domain', {
placeholder: $t('t_0_1744958839535'),
onInput: (val: string) => (param.value.domain = val.trim()),
allowInput: noSideSpace,
}),
],
)
@@ -214,7 +215,7 @@ export default defineComponent({
...[
useFormInput($t('t_17_1745227838561'), 'domain', {
placeholder: $t('t_0_1744958839535'),
onInput: (val: string) => (param.value.domain = val.trim()),
allowInput: noSideSpace,
}),
],
)
@@ -222,7 +223,7 @@ export default defineComponent({
...[
useFormInput($t('t_7_1747280808936'), 'region', {
placeholder: $t('t_25_1745735766651'),
onInput: (val: string) => (param.value.region = val.trim()),
allowInput: noSideSpace,
}),
],
)
@@ -230,7 +231,7 @@ export default defineComponent({
...[
useFormInput($t('t_8_1747280809382'), 'bucket', {
placeholder: $t('t_26_1745735767144'),
onInput: (val: string) => (param.value.bucket = val.trim()),
allowInput: noSideSpace,
}),
],
)

View File

@@ -10,6 +10,7 @@ import verify from './verify'
import { NotifyNodeConfig } from '@components/flowChart/types'
import { deepClone } from '@baota/utils/data'
import { noSideSpace } from '@lib/utils'
export default defineComponent({
name: 'NotifyNodeDrawer',
@@ -39,12 +40,12 @@ export default defineComponent({
const formConfig: FormConfig = [
useFormInput($t('t_0_1745920566646'), 'subject', {
placeholder: $t('t_3_1745887835089'),
onInput: (val: string) => (param.value.subject = val.trim()),
allowInput: noSideSpace,
}),
useFormTextarea($t('t_1_1745920567200'), 'body', {
placeholder: $t('t_4_1745887835265'),
rows: 4,
onInput: (val: string) => (param.value.body = val.trim()),
allowInput: noSideSpace,
}),
useFormCustom(() => (
<NotifyProviderSelect

View File

@@ -10,6 +10,7 @@ import verifyRules from './verify'
import type { FormConfig } from '@baota/naive-ui/types/form'
import type { UploadNodeConfig } from '@components/flowChart/types'
import type { CertItem } from '@/types/cert'
import { noSideSpace } from '@lib/utils'
export default defineComponent({
name: 'UploadNodeDrawer',
@@ -76,13 +77,13 @@ export default defineComponent({
placeholder: $t('t_35_1745735781545'),
rows: 6,
readonly: param.value.cert_id === '' ? false : true,
onInput: (val: string) => (param.value.cert = val.trim()),
allowInput: noSideSpace,
}),
useFormTextarea($t('t_36_1745735769443'), 'key', {
placeholder: $t('t_37_1745735779980'),
rows: 6,
readonly: param.value.cert_id === '' ? false : true,
onInput: (val: string) => (param.value.key = val.trim()),
allowInput: noSideSpace,
}),
useFormHelp([
{

View File

@@ -1,10 +1,5 @@
:root {
--bg-color: #f5f5f7;
--border-color: #5a5e66;
}
.flowContainer {
@apply flex relative box-border w-full h-[calc(100vh-19rem)] overflow-x-auto overflow-y-auto bg-slate-50 ;
@apply flex relative box-border w-full h-[calc(100vh-19rem)] overflow-x-auto overflow-y-auto p-[1rem];
}
.flowProcess {
@@ -17,7 +12,7 @@
.flowZoomIcon {
@apply w-[2.5rem] h-[2.5rem] cursor-pointer border flex items-center justify-center;
border-color: var(--border-color);
border-color: var(--n-border-color);
}
/* 嵌套节点包装器样式 */

View File

@@ -1,7 +1,7 @@
import { defineComponent, VNode } from 'vue'
import { NButton, NFlex, NFormItemGi, NGrid, NSelect, NText } from 'naive-ui'
import { $t } from '@locales/index'
import { useStore } from '@/views/layout/useStore'
import { useStore } from '@layout/useStore'
import SvgIcon from '@components/svgIcon'
interface NotifyProviderOption {

View File

@@ -0,0 +1,17 @@
/**
* @description 移除输入框中的空格
* @param {string} value 输入框的值
* @returns {boolean} 是否为空
*/
export const noSideSpace = (value: string) => {
return !value.startsWith(' ') && !value.endsWith(' ')
}
/**
* @description 数字验证
* @param {string} value 输入框的值
* @returns {boolean} 是否为数字
*/
export const onlyAllowNumber = (value: string) => {
return !value || /^\d+$/.test(value)
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "خوارزمية الشهادة",
"t_0_1747711335067": "يرجى إدخال كلمة مرور SSH",
"t_1_1747711335336": "عنوان المضيف",
"t_2_1747711337958": "الرجاء إدخال عنوان المضيف، لا يمكن أن يكون فارغًا",
"t_0_1744098811152": "تحذير: لقد دخلتم منطقة غير معروفة، الصفحة التي تحاول زيارتها غير موجودة، يرجى الضغط على الزر للعودة إلى الصفحة الرئيسية.",
"t_1_1744098801860": "رجوع إلى الصفحة الرئيسية",
"t_2_1744098804908": "نصيحة أمنية: إذا كنت تعتقد أن هذا خطأ، يرجى الاتصال بالمدير على الفور",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "الرجاء إدخال مفتاح Leichi WAF-API الصحيح",
"t_0_1747365600180": "الرجاء إدخال اسم المستخدم Western Digital",
"t_1_1747365603108": "الرجاء إدخال كلمة مرور ويسترن ديجيتال",
"t_2_1747365599051": "يرجى إدخال كلمة مرور SSH",
"t_3_1747365600828": "يرجى إدخال مفتاح الوصول AccessKey لمحرك Volcano",
"t_4_1747365600137": "الرجاء إدخال SecretKey لمحرك بركان",
"t_0_1747367069267": "موقع Pagoda docker",
"t_0_1747617113090": "الرجاء إدخال رمز API الخاص بـ Leichi",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "خوارزمية الشهادة",
"t_0_1747709067998": "الرجاء إدخال مفتاح SSH، المحتوى لا يمكن أن يكون فارغًا"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "Certificate algorithm",
"t_0_1747711335067": "Please enter the SSH password",
"t_1_1747711335336": "Host address",
"t_2_1747711337958": "Please enter the host address cannot be empty",
"t_0_1744098811152": "Warning: You have entered an unknown area, the page you are visiting does not exist, please click the button to return to the homepage.",
"t_1_1744098801860": "Return Home",
"t_2_1744098804908": "Safety Tip: If you think this is an error, please contact the administrator immediately",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "Please enter the correct Leichi WAF-API key",
"t_0_1747365600180": "Please enter the Western Digital username",
"t_1_1747365603108": "Please enter the Western Digital password",
"t_2_1747365599051": "Please enter the SSH Password",
"t_3_1747365600828": "Please enter the AccessKey of Volcano Engine",
"t_4_1747365600137": "Please enter the SecretKey of Volcano Engine",
"t_0_1747367069267": "Pagoda docker site",
"t_0_1747617113090": "Please enter the Leichi API Token",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "Certificate algorithm",
"t_0_1747709067998": "Please enter the SSH key, the content cannot be empty"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "Algoritmo de certificado",
"t_0_1747711335067": "Por favor ingrese la contraseña SSH",
"t_1_1747711335336": "Dirección del host",
"t_2_1747711337958": "Por favor ingrese la dirección del host, no puede estar vacía",
"t_0_1744098811152": "Advertencia: Ha ingresado a una zona desconocida, la página que intenta visitar no existe, por favor, haga clic en el botón para regresar a la página de inicio.",
"t_1_1744098801860": "Volver al inicio",
"t_2_1744098804908": "Consejo de seguridad: Si piensa que es un error, póngase en contacto con el administrador inmediatamente",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "Por favor, ingrese la clave correcta de Leichi WAF-API",
"t_0_1747365600180": "Por favor, ingrese el nombre de usuario de Western Digital",
"t_1_1747365603108": "Por favor, ingrese la contraseña de Western Digital",
"t_2_1747365599051": "Por favor ingrese la contraseña SSH",
"t_3_1747365600828": "Por favor ingrese la AccessKey de Volcano Engine",
"t_4_1747365600137": "Por favor ingrese el SecretKey de Volcano Engine",
"t_0_1747367069267": "Sitio Pagoda docker",
"t_0_1747617113090": "Por favor, ingrese el Token API de Leichi",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "Algoritmo de certificado",
"t_0_1747709067998": "Ingrese la clave SSH, el contenido no puede estar vacío"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "Algorithme de certificat",
"t_0_1747711335067": "Veuillez entrer le mot de passe SSH",
"t_1_1747711335336": "Adresse de l'hôte",
"t_2_1747711337958": "Veuillez saisir l'adresse de l'hôte, elle ne peut pas être vide",
"t_0_1744098811152": "Avertissement : Vous avez entré dans une zone inconnue, la page que vous visitez n'existe pas, veuillez cliquer sur le bouton pour revenir à la page d'accueil.",
"t_1_1744098801860": "Retour à l'accueil",
"t_2_1744098804908": "Avis de sécurité : Si vous pensez que c'est une erreur, veuillez contacter l'administrateur immédiatement",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "Veuillez saisir la clé correcte de Leichi WAF-API",
"t_0_1747365600180": "Veuillez saisir le nom d'utilisateur Western Digital",
"t_1_1747365603108": "Veuillez entrer le mot de passe de Western Digital",
"t_2_1747365599051": "Veuillez entrer le mot de passe SSH",
"t_3_1747365600828": "Veuillez saisir la clé d'accès du moteur Volcano",
"t_4_1747365600137": "Veuillez entrer le SecretKey de Volcano Engine",
"t_0_1747367069267": "Site Pagoda docker",
"t_0_1747617113090": "Veuillez entrer le jeton API de Leichi",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "Algorithme de certificat",
"t_0_1747709067998": "Veuillez entrer la clé SSH, le contenu ne peut pas être vide"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "証明書アルゴリズム",
"t_0_1747711335067": "SSHパスワードを入力してください",
"t_1_1747711335336": "ホストアドレス",
"t_2_1747711337958": "ホストアドレスを入力してください。空にすることはできません",
"t_0_1744098811152": "警告:未知のエリアに進入しました。アクセスしようとしたページは存在しません。ボタンをクリックしてホームページに戻ってください。",
"t_1_1744098801860": "ホームに戻る",
"t_2_1744098804908": "安全注意:これが誤りだと思われる場合は、すぐに管理者に連絡してください",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "正しい雷池WAF-APIキーを入力してください",
"t_0_1747365600180": "Western Digitalのユーザー名を入力してください",
"t_1_1747365603108": "ウェスタンデジタルのパスワードを入力してください",
"t_2_1747365599051": "SSHのパスワードを入力してください",
"t_3_1747365600828": "ボルケーエンジンのAccessKeyを入力してください",
"t_4_1747365600137": "火山エンジンのSecretKeyを入力してください",
"t_0_1747367069267": "Pagoda dockerサイト",
"t_0_1747617113090": "雷池のAPIトークンを入力してください",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "証明書アルゴリズム",
"t_0_1747709067998": "SSHキーを入力してください。内容は空にできません。"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "인증서 알고리즘",
"t_0_1747711335067": "SSH 비밀번호를 입력하세요",
"t_1_1747711335336": "호스트 주소",
"t_2_1747711337958": "호스트 주소를 입력하세요. 비워 둘 수 없습니다",
"t_0_1744098811152": "경고: 알 수 없는 영역에 진입했습니다. 방문하려는 페이지가 존재하지 않습니다. 버튼을 클릭하여 홈페이지로 돌아가세요。",
"t_1_1744098801860": "홈으로 돌아가기",
"t_2_1744098804908": "안전 유의사항: 이가 오류라면 즉시 관리자에게 연락하십시오",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "올바른 레이치 WAF-API 키를 입력하세요",
"t_0_1747365600180": "Western Digital 사용자 이름을 입력하세요",
"t_1_1747365603108": "웨스턴 디지털의 비밀번호를 입력하세요",
"t_2_1747365599051": "SSH 비밀번호를 입력하세요",
"t_3_1747365600828": "볼케이노 엔진의 AccessKey를 입력하세요",
"t_4_1747365600137": "볼케이노 엔진의 SecretKey를 입력하세요",
"t_0_1747367069267": "Pagoda docker 사이트",
"t_0_1747617113090": "레치 API 토큰을 입력하세요",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "인증서 알고리즘",
"t_0_1747709067998": "SSH 키를 입력하십시오. 내용은 비울 수 없습니다."
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "Algoritmo de certificado",
"t_0_1747711335067": "Por favor, insira a senha SSH",
"t_1_1747711335336": "Endereço do host",
"t_2_1747711337958": "Por favor, insira o endereço do host, não pode estar vazio",
"t_0_1744098811152": "Aviso: Você entrou em uma área desconhecida, a página que você está visitando não existe, por favor, clique no botão para voltar para a página inicial.",
"t_1_1744098801860": "Voltar para a homepage",
"t_2_1744098804908": "Dica de Segurança: Se você acha que isso é um erro, entre em contato com o administrador imediatamente",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "Por favor, insira a chave correta do Leichi WAF-API",
"t_0_1747365600180": "Por favor, insira o nome de usuário da Western Digital",
"t_1_1747365603108": "Por favor, insira a senha da Western Digital",
"t_2_1747365599051": "Por favor, insira a senha SSH",
"t_3_1747365600828": "Por favor, insira a AccessKey do Volcano Engine",
"t_4_1747365600137": "Por favor, insira o SecretKey do Volcano Engine",
"t_0_1747367069267": "Site Pagoda docker",
"t_0_1747617113090": "Por favor, insira o Token API do Leichi",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "Algoritmo de certificado",
"t_0_1747709067998": "Digite a chave SSH, o conteúdo não pode estar vazio"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "Алгоритм сертификата",
"t_0_1747711335067": "Введите пароль SSH",
"t_1_1747711335336": "Адрес хоста",
"t_2_1747711337958": "Пожалуйста, введите адрес хоста, он не может быть пустым",
"t_0_1744098811152": "Предупреждение: Вы вошли в неизвестную зону, посещаемая страница не существует, пожалуйста, нажмите кнопку, чтобы вернуться на главную страницу.",
"t_1_1744098801860": "Вернуться на главную",
"t_2_1744098804908": "Совет по безопасности: Если вы считаете, что это ошибка, немедленно свяжитесь с администратором",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "Пожалуйста, введите правильный ключ Leichi WAF-API",
"t_0_1747365600180": "Пожалуйста, введите имя пользователя Western Digital",
"t_1_1747365603108": "Пожалуйста, введите пароль Western Digital",
"t_2_1747365599051": "Пожалуйста, введите пароль SSH",
"t_3_1747365600828": "Пожалуйста, введите AccessKey Volcano Engine",
"t_4_1747365600137": "Введите SecretKey Volcano Engine",
"t_0_1747367069267": "Сайт Pagoda docker",
"t_0_1747617113090": "Пожалуйста, введите API-токен Leichi",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "Алгоритм сертификата",
"t_0_1747709067998": "Введите SSH-ключ, содержимое не может быть пустым"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "证书算法",
"t_0_1747711335067": "请输入SSH密码",
"t_1_1747711335336": "主机地址",
"t_2_1747711337958": "请输入主机地址不能为空",
"t_0_1744098811152": "警告:您已进入未知区域,所访问的页面不存在,请点击按钮返回首页。",
"t_1_1744098801860": "返回首页",
"t_2_1744098804908": "安全提示:如果您认为这是个错误,请立即联系管理员",
@@ -543,10 +545,11 @@
"t_2_1747300385222": "请输入正确的雷池WAF-API密钥",
"t_0_1747365600180": "请输入西部数码的用户名",
"t_1_1747365603108": "请输入西部数码的密码",
"t_2_1747365599051": "请输入SSH的Password",
"t_3_1747365600828": "请输入火山引擎的AccessKey",
"t_4_1747365600137": "请输入火山引擎的SecretKey",
"t_0_1747367069267": "宝塔docker站点",
"t_0_1747617113090": "请输入雷池的API令牌",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "证书算法",
"t_0_1747709067998": "请输入SSH密钥内容不能为空"
}

View File

@@ -1,5 +1,7 @@
{
"t_0_1747647014927": "證書算法",
"t_0_1747711335067": "請輸入SSH密碼",
"t_1_1747711335336": "主機地址",
"t_2_1747711337958": "請輸入主機地址不能為空",
"t_0_1744098811152": "警告:您已進入未知區域,所訪問的頁面不存在,請點擊按鈕返回首頁。",
"t_1_1744098801860": "返回首頁",
"t_2_1744098804908": "安全提示:如果您認為這是個錯誤,請立即聯繫管理員",
@@ -542,10 +544,11 @@
"t_2_1747300385222": "請輸入正確的雷池WAF-API密鑰",
"t_0_1747365600180": "請輸入西部數碼的用戶名",
"t_1_1747365603108": "請輸入西部數碼的密碼",
"t_2_1747365599051": "請輸入SSH的Password",
"t_3_1747365600828": "請輸入火山引擎的AccessKey",
"t_4_1747365600137": "請輸入火山引擎的SecretKey",
"t_0_1747367069267": "寶塔docker站點",
"t_0_1747617113090": "請輸入雷池的API令牌",
"t_1_1747617105179": "API Token"
"t_1_1747617105179": "API Token",
"t_0_1747647014927": "證書算法",
"t_0_1747709067998": "請輸入SSH密鑰內容不能為空"
}

View File

@@ -17,6 +17,7 @@ import { directives, useDirectives } from '@lib/directive'
const app = createApp(App)
app.use(router) // 路由
console.log('app', router)
app.use(pinia) // 使用状态管理
app.use(i18n) // 国际化
app.mount('#app') // 挂载到DOM

View File

@@ -49,6 +49,7 @@ import ApiManageForm from './components/apiManageForm'
import SvgIcon from '@components/svgIcon'
import TypeIcon from '@components/typeIcon'
import { useStore as useLayoutStore } from '@layout/useStore'
import { noSideSpace } from '@lib/utils'
const { sourceTypes } = useLayoutStore()
// 状态和方法
@@ -292,7 +293,7 @@ export const useApiFormController = (props: { data: AccessItem }) => {
if (!value) {
const mapTips = {
westcn: $t('t_1_1747365603108'),
ssh: $t('t_2_1747365599051'),
ssh: $t('t_0_1747711335067'),
}
return callback(new Error(mapTips[param.value.type as keyof typeof mapTips]))
}
@@ -440,10 +441,11 @@ export const useApiFormController = (props: { data: AccessItem }) => {
useFormCustom(() => {
return (
<NGrid cols={24} xGap={4}>
<NFormItemGi label={$t('t_1_1745833931535')} span={16} path="config.host">
<NFormItemGi label={$t('t_1_1747711335336')} span={16} path="config.host">
<NInput
v-model:value={(param.value.config as SshAccessConfig).host}
onInput={(val: string) => ((param.value.config as SshAccessConfig).host = val.trim())}
placeholder={$t('t_2_1747711337958')}
allow-input={noSideSpace}
/>
</NFormItemGi>
<NFormItemGi label={$t('t_2_1745833931404')} span={8} path="config.port">
@@ -458,10 +460,12 @@ export const useApiFormController = (props: { data: AccessItem }) => {
{ label: $t('t_1_1746667588689'), value: 'key' },
]),
(param.value.config as SshAccessConfig)?.mode === 'password'
? useFormInput($t('t_48_1745289355714'), 'config.password')
? useFormInput($t('t_48_1745289355714'), 'config.password', {
allowInput: noSideSpace,
})
: useFormTextarea($t('t_1_1746667588689'), 'config.key', {
rows: 3,
placeholder: $t('t_3_1745317313561'),
placeholder: $t('t_0_1747709067998'),
}),
)
break
@@ -471,76 +475,53 @@ export const useApiFormController = (props: { data: AccessItem }) => {
case 'safeline':
items.push(
useFormInput(typeUrlMap.get(param.value.type) || '', 'config.url', {
onInput: (val: string) => ((param.value.config as PanelAccessConfig).url = val.trim()),
allowInput: noSideSpace,
}),
useFormInput(
param.value.type === 'safeline' ? $t('t_1_1747617105179') : $t('t_55_1745289355715'),
param.value.type === 'safeline' ? 'config.api_token' : 'config.api_key',
{
onInput: (val: string) => ((param.value.config as PanelAccessConfig).api_key = val.trim()),
allowInput: noSideSpace,
},
),
useFormSwitch(
$t('t_3_1746667592270'),
'config.ignore_ssl',
{
checkedValue: '1',
uncheckedValue: '0',
},
{ checkedValue: '1', uncheckedValue: '0' },
{ showRequireMark: false },
),
)
break
case 'aliyun':
items.push(
useFormInput('AccessKeyId', 'config.access_key_id', {
onInput: (val: string) => ((param.value.config as AliyunAccessConfig).access_key_id = val.trim()),
}),
useFormInput('AccessKeySecret', 'config.access_key_secret', {
onInput: (val: string) => ((param.value.config as AliyunAccessConfig).access_key_secret = val.trim()),
}),
useFormInput('AccessKeyId', 'config.access_key_id', { allowInput: noSideSpace }),
useFormInput('AccessKeySecret', 'config.access_key_secret', { allowInput: noSideSpace }),
)
break
case 'tencentcloud':
items.push(
useFormInput('SecretId', 'config.secret_id', {
onInput: (val: string) => ((param.value.config as TencentCloudAccessConfig).secret_id = val.trim()),
}),
useFormInput('SecretKey', 'config.secret_key', {
onInput: (val: string) => ((param.value.config as TencentCloudAccessConfig).secret_key = val.trim()),
}),
useFormInput('SecretId', 'config.secret_id', { allowInput: noSideSpace }),
useFormInput('SecretKey', 'config.secret_key', { allowInput: noSideSpace }),
)
break
case 'huaweicloud':
case 'baidu':
case 'volcengine':
items.push(
useFormInput('AccessKey', 'config.access_key', {
onInput: (val: string) => ((param.value.config as HuaWeiCloudAccessConfig).access_key = val.trim()),
}),
useFormInput('SecretKey', 'config.secret_key', {
onInput: (val: string) => ((param.value.config as HuaWeiCloudAccessConfig).secret_key = val.trim()),
}),
useFormInput('AccessKey', 'config.access_key', { allowInput: noSideSpace }),
useFormInput('SecretKey', 'config.secret_key', { allowInput: noSideSpace }),
)
break
case 'cloudflare':
items.push(
useFormInput('邮箱', 'config.email', {
onInput: (val: string) => ((param.value.config as CloudflareAccessConfig).email = val.trim()),
}),
useFormInput('APIKey', 'config.api_key', {
onInput: (val: string) => ((param.value.config as CloudflareAccessConfig).api_key = val.trim()),
}),
useFormInput('邮箱', 'config.email', { allowInput: noSideSpace }),
useFormInput('APIKey', 'config.api_key', { allowInput: noSideSpace }),
)
break
case 'westcn':
items.push(
useFormInput('Username', 'config.username', {
onInput: (val: string) => ((param.value.config as WestcnAccessConfig).username = val.trim()),
}),
useFormInput('Password', 'config.password', {
onInput: (val: string) => ((param.value.config as WestcnAccessConfig).password = val.trim()),
}),
useFormInput('Username', 'config.username', { allowInput: noSideSpace }),
useFormInput('Password', 'config.password', { allowInput: noSideSpace }),
)
break
default: