mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-08 07:41:10 +08:00
【修复】数据调整,导致的部署项目遗漏问题
This commit is contained in:
@@ -10605,5 +10605,22 @@
|
||||
"arDZ": "إضافة Zerossl، Google، تفويض CA مخصص"
|
||||
},
|
||||
"timestamp": "2025-05-23T08:57:06.044Z"
|
||||
},
|
||||
"宝塔docker网站": {
|
||||
"text": "宝塔docker网站",
|
||||
"key": "t_0_1747994891459",
|
||||
"translations": {
|
||||
"zhCN": "宝塔docker网站",
|
||||
"zhTW": "寶塔docker網站",
|
||||
"enUS": "Pagoda docker website",
|
||||
"jaJP": "宝塔dockerサイト",
|
||||
"koKR": "보타 docker 웹사이트",
|
||||
"ruRU": "Веб-сайт Pagoda docker",
|
||||
"ptBR": "Site do Pagoda docker",
|
||||
"frFR": "Site web Pagoda docker",
|
||||
"esAR": "Sitio web de Pagoda docker",
|
||||
"arDZ": "موقع باغودا docker"
|
||||
},
|
||||
"timestamp": "2025-05-23T10:08:11.459Z"
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,11 @@ export const ApiProjectConfig: Record<string, ApiProjectType> = {
|
||||
btpanel: {
|
||||
name: $t('t_10_1745735765165'),
|
||||
icon: 'btpanel',
|
||||
hostRelated: { default: { name: $t('t_10_1745735765165') }, site: { name: $t('t_1_1747886307276') } },
|
||||
hostRelated: {
|
||||
default: { name: $t('t_10_1745735765165') },
|
||||
site: { name: $t('t_1_1747886307276') },
|
||||
dockersite: { name: $t('t_0_1747994891459') },
|
||||
},
|
||||
type: ['host'],
|
||||
sort: 3,
|
||||
},
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { App, Directive, DirectiveBinding } from 'vue'
|
||||
import { App, Directive } from 'vue'
|
||||
|
||||
/**
|
||||
* 移除输入框中的空格
|
||||
* 用法:v-nospace
|
||||
*/
|
||||
export const vNospace: Directive = {
|
||||
mounted(el: HTMLElement, binding: DirectiveBinding) {
|
||||
mounted(el: HTMLElement) {
|
||||
el.addEventListener('input', (event: Event) => {
|
||||
const inputElement = event.target as HTMLInputElement
|
||||
const newValue = inputElement.value.replace(/\s+/g, '')
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "موقع باغودا docker",
|
||||
"t_0_1744098811152": "تحذير: لقد دخلتم منطقة غير معروفة، الصفحة التي تحاول زيارتها غير موجودة، يرجى الضغط على الزر للعودة إلى الصفحة الرئيسية.",
|
||||
"t_1_1744098801860": "رجوع إلى الصفحة الرئيسية",
|
||||
"t_2_1744098804908": "نصيحة أمنية: إذا كنت تعتقد أن هذا خطأ، يرجى الاتصال بالمدير على الفور",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "Pagoda docker website",
|
||||
"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",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "Sitio web de Pagoda docker",
|
||||
"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",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "Site web Pagoda docker",
|
||||
"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",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "宝塔dockerサイト",
|
||||
"t_0_1744098811152": "警告:未知のエリアに進入しました。アクセスしようとしたページは存在しません。ボタンをクリックしてホームページに戻ってください。",
|
||||
"t_1_1744098801860": "ホームに戻る",
|
||||
"t_2_1744098804908": "安全注意:これが誤りだと思われる場合は、すぐに管理者に連絡してください",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "보타 docker 웹사이트",
|
||||
"t_0_1744098811152": "경고: 알 수 없는 영역에 진입했습니다. 방문하려는 페이지가 존재하지 않습니다. 버튼을 클릭하여 홈페이지로 돌아가세요。",
|
||||
"t_1_1744098801860": "홈으로 돌아가기",
|
||||
"t_2_1744098804908": "안전 유의사항: 이가 오류라면 즉시 관리자에게 연락하십시오",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "Site do Pagoda docker",
|
||||
"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",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "Веб-сайт Pagoda docker",
|
||||
"t_0_1744098811152": "Предупреждение: Вы вошли в неизвестную зону, посещаемая страница не существует, пожалуйста, нажмите кнопку, чтобы вернуться на главную страницу.",
|
||||
"t_1_1744098801860": "Вернуться на главную",
|
||||
"t_2_1744098804908": "Совет по безопасности: Если вы считаете, что это ошибка, немедленно свяжитесь с администратором",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "宝塔docker网站",
|
||||
"t_0_1744098811152": "警告:您已进入未知区域,所访问的页面不存在,请点击按钮返回首页。",
|
||||
"t_1_1744098801860": "返回首页",
|
||||
"t_2_1744098804908": "安全提示:如果您认为这是个错误,请立即联系管理员",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"t_0_1747994891459": "寶塔docker網站",
|
||||
"t_0_1744098811152": "警告:您已進入未知區域,所訪問的頁面不存在,請點擊按鈕返回首頁。",
|
||||
"t_1_1744098801860": "返回首頁",
|
||||
"t_2_1744098804908": "安全提示:如果您認為這是個錯誤,請立即聯繫管理員",
|
||||
|
||||
@@ -11,8 +11,9 @@
|
||||
"test": "vitest",
|
||||
"clear": "sh ./scripts/clear-temp.sh",
|
||||
"cursor:backup": "sh ./scripts/cursor_backup.sh",
|
||||
"devcloud": "turbo run dev --filter cloud-control",
|
||||
"buildcloud": "turbo run build --filter cloud-control",
|
||||
"devcloud": "turbo run dev --filter cloud-control --",
|
||||
"buildcloud": "turbo run build --filter cloud-control && node apps/cloud-control/upload.js",
|
||||
"uploadcloud": "node apps/cloud-control/upload.js",
|
||||
"sync": "sh ./scripts/sync-project.sh"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -15,75 +15,87 @@ export interface FtpSyncTarget {
|
||||
const logger = {
|
||||
pluginName: "vite-plugin-ftp-sync",
|
||||
info: (message: string) => {
|
||||
console.log(`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[32m${message}\x1b[0m`);
|
||||
console.log(
|
||||
`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[32m${message}\x1b[0m`,
|
||||
);
|
||||
},
|
||||
warn: (message: string) => {
|
||||
console.warn(`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[33m${message}\x1b[0m`);
|
||||
console.warn(
|
||||
`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[33m${message}\x1b[0m`,
|
||||
);
|
||||
},
|
||||
error: (message: string, err?: any) => {
|
||||
console.error(`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[31m${message}\x1b[0m`, err || "");
|
||||
console.error(
|
||||
`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[31m${message}\x1b[0m`,
|
||||
err || "",
|
||||
);
|
||||
},
|
||||
success: (message: string) => {
|
||||
console.log(`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[32m${message} ✓\x1b[0m`);
|
||||
}
|
||||
console.log(
|
||||
`\x1b[36m[${logger.pluginName}]\x1b[0m \x1b[32m${message} ✓\x1b[0m`,
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export async function uploadFtp(options: FtpSyncTarget[] | FtpSyncTarget) {
|
||||
if (!Array.isArray(options)) options = [options];
|
||||
const results = await Promise.allSettled(
|
||||
options.map(async (target) => {
|
||||
const sftp = new Client();
|
||||
try {
|
||||
await sftp.connect({
|
||||
host: target.host,
|
||||
port: target.port,
|
||||
username: target.username,
|
||||
password: target.password,
|
||||
});
|
||||
|
||||
const localPath = target.localPath || "dist";
|
||||
logger.info(
|
||||
`开始同步文件到 SFTP 服务器 ${target.host}:${target.port} -> ${target.remotePath}`,
|
||||
);
|
||||
|
||||
if (target.clearRemote) {
|
||||
logger.info(`正在清除远程目录 ${target.remotePath}...`);
|
||||
try {
|
||||
await sftp.rmdir(target.remotePath, true);
|
||||
logger.success(`远程目录 ${target.remotePath} 已清除`);
|
||||
} catch (err) {
|
||||
logger.warn(`清除远程目录失败,可能目录不存在: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
await sftp.uploadDir(localPath, target.remotePath);
|
||||
logger.success(`文件同步到 ${target.host} 完成!`);
|
||||
|
||||
sftp.end();
|
||||
return { target, success: true };
|
||||
} catch (err) {
|
||||
logger.error(`SFTP 同步到 ${target.host} 失败:`, err);
|
||||
sftp.end();
|
||||
return { target, success: false, error: err };
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
const failures = results.filter(
|
||||
(result): result is PromiseRejectedResult => result.status === "rejected",
|
||||
);
|
||||
|
||||
if (failures.length > 0) {
|
||||
logger.error(`部分 SFTP 同步失败: ${failures.length} 个目标`);
|
||||
throw new Error(`部分 SFTP 同步失败: ${failures.length} 个目标`);
|
||||
} else {
|
||||
logger.success("所有同步任务已成功完成");
|
||||
}
|
||||
}
|
||||
|
||||
export function ftpSync(options: FtpSyncTarget[] | FtpSyncTarget): Plugin {
|
||||
return {
|
||||
name: "vite-plugin-ftp-sync",
|
||||
apply: "build",
|
||||
closeBundle: async () => {
|
||||
if (!Array.isArray(options)) options = [options];
|
||||
const results = await Promise.allSettled(
|
||||
options.map(async (target) => {
|
||||
const sftp = new Client();
|
||||
try {
|
||||
await sftp.connect({
|
||||
host: target.host,
|
||||
port: target.port,
|
||||
username: target.username,
|
||||
password: target.password,
|
||||
});
|
||||
|
||||
const localPath = target.localPath || "dist";
|
||||
logger.info(
|
||||
`开始同步文件到 SFTP 服务器 ${target.host}:${target.port} -> ${target.remotePath}`,
|
||||
);
|
||||
|
||||
if (target.clearRemote) {
|
||||
logger.info(`正在清除远程目录 ${target.remotePath}...`);
|
||||
try {
|
||||
await sftp.rmdir(target.remotePath, true);
|
||||
logger.success(`远程目录 ${target.remotePath} 已清除`);
|
||||
} catch (err) {
|
||||
logger.warn(`清除远程目录失败,可能目录不存在: ${err}`);
|
||||
}
|
||||
}
|
||||
|
||||
await sftp.uploadDir(localPath, target.remotePath);
|
||||
logger.success(`文件同步到 ${target.host} 完成!`);
|
||||
|
||||
sftp.end();
|
||||
return { target, success: true };
|
||||
} catch (err) {
|
||||
logger.error(`SFTP 同步到 ${target.host} 失败:`, err);
|
||||
sftp.end();
|
||||
return { target, success: false, error: err };
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
const failures = results.filter(
|
||||
(result): result is PromiseRejectedResult =>
|
||||
result.status === "rejected",
|
||||
);
|
||||
|
||||
if (failures.length > 0) {
|
||||
logger.error(`部分 SFTP 同步失败: ${failures.length} 个目标`);
|
||||
throw new Error(`部分 SFTP 同步失败: ${failures.length} 个目标`);
|
||||
} else {
|
||||
logger.success("所有同步任务已成功完成");
|
||||
}
|
||||
await uploadFtp(options);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user