fix: change language

This commit is contained in:
junchi.zhang
2025-12-15 11:36:56 +08:00
parent c142df632a
commit fd16102fda
6 changed files with 23 additions and 23 deletions
+3 -3
View File
@@ -45,7 +45,7 @@ export default async function bindCmd(): Promise<void> {
return;
}
// 前置校验域名
// Pre-check domain availability
const check = await checkDomainAvailable(domain);
if (!check.is_valid) {
console.log(chalk.red(`Domain not available: ${check.error || 'unknown reason'}`));
@@ -53,7 +53,7 @@ export default async function bindCmd(): Promise<void> {
}
console.log(chalk.green(`Domain available: ${domain}`));
// 上传
// Upload
const absolutePath = path.resolve(targetPath);
console.log(chalk.blue(`Uploading: ${absolutePath}`));
const up = await upload(absolutePath);
@@ -63,7 +63,7 @@ export default async function bindCmd(): Promise<void> {
}
console.log(chalk.green(`Upload success, CID: ${up.contentHash}`));
// 绑定
// Bind domain
const ok = await bindPinmeDomain(domain, up.contentHash);
if (!ok) {
console.log(chalk.red('Binding failed. Please try again later.'));
+4 -4
View File
@@ -39,7 +39,7 @@ export interface CheckDomainResult {
export async function checkDomainAvailable(domainName: string): Promise<CheckDomainResult> {
const client = createClient();
// 端点可能未固定,优先使用环境变量,其次尝试两个常见路径
// Endpoint may not be fixed, prioritize environment variable, then try two common paths
const configured = process.env.PINME_CHECK_DOMAIN_PATH || '/check_domain';
const fallbacks = [configured, '/check_domain_available'];
@@ -52,12 +52,12 @@ export async function checkDomainAvailable(domainName: string): Promise<CheckDom
if (data?.data && typeof data.data.is_valid === 'boolean') {
return { is_valid: data.data.is_valid, error: data.data?.error };
}
// 不符合预期结构,继续尝试下一个路径
// Unexpected structure, continue trying next path
} catch (e: any) {
// 404/405/500 等继续尝试下一个
// 404/405/500 etc., continue trying next path
}
}
// 如果所有尝试失败,则返回未知状态,交由后续 bind 返回报错提示
// If all attempts fail, return unknown state, let subsequent bind return error message
return { is_valid: true };
}
+1 -1
View File
@@ -8,7 +8,7 @@
flex: 1;
}
/* 如果需要添加页脚 */
/* If footer needs to be added */
.footer {
margin-top: auto;
padding: 1rem;
+6 -6
View File
@@ -1,4 +1,4 @@
/* 基础样式 */
/* Base styles */
:root {
--primary-color: #4F46E5;
--primary-hover: #4338CA;
@@ -29,7 +29,7 @@ body {
padding: 2rem 1rem;
}
/* 按钮样式 */
/* Button styles */
.btn {
display: inline-block;
padding: 0.5rem 1rem;
@@ -59,7 +59,7 @@ body {
background-color: var(--dark-gray);
}
/* 表单元素 */
/* Form elements */
input[type="text"],
input[type="email"],
input[type="password"] {
@@ -79,7 +79,7 @@ input[type="password"]:focus {
outline: none;
}
/* 卡片样式 */
/* Card styles */
.card {
background-color: white;
border-radius: var(--border-radius);
@@ -87,7 +87,7 @@ input[type="password"]:focus {
overflow: hidden;
}
/* 工具类 */
/* Utility classes */
.text-center {
text-align: center;
}
@@ -104,7 +104,7 @@ input[type="password"]:focus {
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }
/* 自定义滚动条 */
/* Custom scrollbar */
::-webkit-scrollbar {
width: 8px;
}
+1 -1
View File
@@ -41,7 +41,7 @@
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
/* 响应式设计 */
/* Responsive design */
@media (max-width: 640px) {
.home-card {
max-width: 100%;
+8 -8
View File
@@ -7,7 +7,7 @@ const copy = require('rollup-plugin-copy');
const path = require('path');
const fs = require('fs');
// 确保dist目录存在
// Ensure dist directory exists
const distDir = path.resolve(__dirname, 'dist');
if (!fs.existsSync(distDir)) {
fs.mkdirSync(distDir, { recursive: true });
@@ -22,7 +22,7 @@ module.exports = {
banner: '#!/usr/bin/env node',
sourcemap: false,
},
// 将所有npm依赖项设为外部依赖,不打包进最终文件
// Set all npm dependencies as external, don't bundle into final file
external: [
...Object.keys(require('./package.json').dependencies || {}),
...require('module').builtinModules,
@@ -32,15 +32,15 @@ module.exports = {
tsconfig: './tsconfig.json',
sourceMap: false
}),
// 解析第三方模块
// Resolve third-party modules
nodeResolve({
preferBuiltins: true,
}),
// 转换CommonJS模块为ES模块
// Convert CommonJS modules to ES modules
commonjs(),
// 支持导入JSON文件
// Support importing JSON files
json(),
// 压缩代码
// Minify code
terser({
format: {
comments: false,
@@ -50,7 +50,7 @@ module.exports = {
drop_debugger: true,
},
}),
// 自定义插件:确保生成的文件有执行权限
// Custom plugin: ensure generated file has executable permissions
{
name: 'make-executable',
writeBundle() {
@@ -65,7 +65,7 @@ module.exports = {
}
],
onwarn(warning, warn) {
// 忽略某些警告
// Ignore certain warnings
if (warning.code === 'CIRCULAR_DEPENDENCY') return;
if (warning.code === 'UNRESOLVED_IMPORT' && warning.source.startsWith('node:')) return;
warn(warning);