More translation

pull/436/head
Lorenzo 2025-06-27 01:31:31 +02:00
parent adc3ab7e0a
commit fc1084ce33
18 changed files with 2772 additions and 2253 deletions

View File

@ -447,4 +447,237 @@ export default {
subdomainManagement: "Subdomain Management",
isDisabled: "Is Disabled",
enabled: "Enabled",
uploadCustomCert: "Upload Custom Certificate",
sourcee: "Source",
sourcePipeline: "Pipeline",
sourceManualUpload: "Manual Upload",
domains: "Domains",
enterDomain: "Please enter domain",
validDays: "Valid Days",
expires: " expires",
days: " days",
expireTime: "Expiration Time",
certIssuer: "Certificate Issuer",
applyTime: "Application Time",
relatedPipeline: "Related Pipeline",
statusSuccess: "Success",
statusChecking: "Checking",
statusError: "Error",
actionImportBatch: "Batch Import",
actionSyncIp: "Sync IP",
modalTitleSyncIp: "Sync IP",
modalContentSyncIp: "Are you sure to sync IP?",
notificationSyncComplete: "Sync Complete",
actionCheckAll: "Check All",
modalTitleConfirm: "Confirm",
modalContentCheckAll: "Confirm to trigger checking all IP site's certificates?",
notificationCheckSubmitted: "Check task submitted",
notificationCheckDescription: "Please refresh later to see results",
tooltipCheckNow: "Check Now",
notificationCheckSubmittedPleaseRefresh: "Check task submitted, please refresh later",
columnId: "ID",
columnIp: "IP",
helperIpCname: "Supports entering CNAME domain name",
ruleIpRequired: "Please enter IP",
columnCertDomains: "Certificate Domains",
columnCertProvider: "Issuer",
columnCertStatus: "Certificate Status",
statusNormal: "Normal",
statusExpired: "Expired",
columnCertExpiresTime: "Certificate Expiration Time",
expired: "expired",
columnCheckStatus: "Check Status",
columnLastCheckTime: "Last Check Time",
columnSource: "Source",
sourceSync: "Sync",
sourceManual: "Manual",
sourceImport: "Import",
columnDisabled: "Enabled/Disabled",
columnRemark: "Remark",
pluginFile: "Plugin File",
selectPluginFile: "Select plugin file",
overrideSameName: "Override same name",
override: "Override",
noOverride: "No override",
overrideHelper: "If a plugin with the same name exists, override it directly",
importPlugin: "Import Plugin",
operationSuccess: "Operation successful",
customPlugin: "Custom Plugin",
import: "Import",
export: "Export",
pluginType: "Plugin Type",
auth: "Authorization",
dns: "DNS",
deployPlugin: "Deploy Plugin",
icon: "Icon",
pluginName: "Plugin Name",
pluginNameHelper: "Must be English letters or digits, camelCase with type prefix\nExample: AliyunDeployToCDN\nDo not modify name once plugin is used",
pluginNameRuleMsg: "Must be English letters or digits, camelCase with type prefix",
author: "Author",
authorHelper: "Used as prefix when uploading to plugin store, e.g., greper/pluginName",
authorRuleMsg: "Must be English letters or digits",
titleHelper: "Plugin name in Chinese",
descriptionHelper: "Description of the plugin",
builtIn: "Built-in",
custom: "Custom",
store: "Store",
version: "Version",
pluginDependencies: "Plugin Dependencies",
pluginDependenciesHelper: "Dependencies to install first in format: [author/]pluginName[:version]",
editableRunStrategy: "Editable Run Strategy",
editable: "Editable",
notEditable: "Not Editable",
runStrategy: "Run Strategy",
normalRun: "Normal Run",
skipOnSuccess: "Skip on success (Deploy task)",
defaultRunStrategyHelper: "Default run strategy",
enableDisable: "Enable/Disable",
clickToToggle: "Click to toggle enable/disable",
confirmToggle: "Are you sure to",
disable: "disable",
enable: "enable",
pluginGroup: "Plugin Group",
icpRegistrationNumber: "ICP Registration Number",
icpPlaceholder: "Guangdong ICP xxxxxxx Number",
publicSecurityRegistrationNumber: "Public Security Registration Number",
publicSecurityPlaceholder: "Beijing Public Security xxxxxxx Number",
enableAssistant: "Enable Assistant",
allowCrawlers: "Allow Crawlers",
httpProxy: "HTTP Proxy",
httpProxyPlaceholder: "http://192.168.1.2:18010/",
httpProxyHelper: "Configure when some websites are blocked",
httpsProxy: "HTTPS Proxy",
httpsProxyPlaceholder: "http://192.168.1.2:18010/",
saveThenTestTitle: "Save first, then click test",
testButton: "Test",
httpsProxyHelper: "Usually both proxies are the same, save first then test",
dualStackNetwork: "Dual Stack Network",
default: "Default",
ipv4Priority: "IPv4 Priority",
ipv6Priority: "IPv6 Priority",
dualStackNetworkHelper: "If IPv6 priority is selected, enable IPv6 in docker-compose.yaml",
enableCommonCnameService: "Enable Public CNAME Service",
commonCnameHelper: "Allow use of public CNAME service. If disabled and no <router-link to='/sys/cname/provider'>custom CNAME service</router-link> is set, CNAME proxy certificate application will not work.",
saveButton: "Save",
stopSuccess: "Stopped successfully",
google: "Google",
baidu: "Baidu",
success: "Success",
testFailed: "Test Failed",
testCompleted: "Test Completed",
manageOtherUserPipeline: "Manage other users' pipelines",
limitUserPipelineCount: "Limit user pipeline count",
limitUserPipelineCountHelper: "0 means no limit",
enableSelfRegistration: "Enable self-registration",
enableUserValidityPeriod: "Enable user validity period",
userValidityPeriodHelper: "Users can use normally within validity; pipelines disabled after expiry",
enableUsernameRegistration: "Enable username registration",
enableEmailRegistration: "Enable email registration",
proFeature: "Pro feature",
emailServerSetup: "Set up email server",
enableSmsLoginRegister: "Enable SMS login and registration",
commFeature: "Commercial feature",
smsProvider: "SMS provider",
aliyunSms: "Aliyun SMS",
yfySms: "YFY SMS",
smsTest: "SMS test",
testMobilePlaceholder: "Enter test mobile number",
saveThenTest: "Save first then test",
enterTestMobile: "Please enter test mobile number",
sendSuccess: "Sent successfully",
atLeastOneLoginRequired: "At least one of password login or SMS login must be enabled",
fieldRequired: "This field is required",
siteHide: "Site Hide",
enableSiteHide: "Enable Site Hide",
siteHideDescription: "You can disable site accessibility normally and enable it when needed to enhance site security",
helpDoc: "Help Document",
randomAddress: "Random Address",
siteHideUrlHelper: "After the site is hidden, you need to visit this URL to unlock to access normally",
fullUnlockUrl: "Full Unlock URL",
saveThisUrl: "Please save this URL carefully",
unlockPassword: "Unlock Password",
unlockPasswordHelper: "Password needed to unlock the hide; set on first time or reset when filled",
autoHideTime: "Auto Hide Time",
autoHideTimeHelper: "Minutes without requests before auto hiding",
hideOpenApi: "Hide Open API",
hideOpenApiHelper: "Whether to hide open APIs; whether to expose /api/v1 prefixed endpoints",
hideSiteImmediately: "Hide Site Immediately",
hideImmediately: "Hide Immediately",
confirmHideSiteTitle: "Are you sure to hide the site immediately?",
confirmHideSiteContent: "After hiding, the site will be inaccessible. Please operate cautiously.",
siteHiddenSuccess: "Site has been hidden",
emailServerSettings: "Email Server Settings",
setEmailSendingServer: "Set the email sending server",
useCustomEmailServer: "Use Custom Email Server",
smtpDomain: "SMTP Domain",
pleaseEnterSmtpDomain: "Please enter SMTP domain or IP",
smtpPort: "SMTP Port",
pleaseEnterSmtpPort: "Please enter SMTP port",
username: "Username",
pleaseEnterUsername: "Please enter username",
password: "Password",
pleaseEnterPassword: "Please enter password",
qqEmailAuthCodeHelper: "If using QQ email, get an authorization code in QQ email settings as the password",
senderEmail: "Sender Email",
pleaseEnterSenderEmail: "Please enter sender email",
useSsl: "Use SSL",
sslPortNote: "SSL and non-SSL SMTP ports are different, please adjust port accordingly",
ignoreCertValidation: "Ignore Certificate Validation",
useOfficialEmailServer: "Use Official Email Server",
useOfficialEmailServerHelper: "Send emails directly using the official server to avoid complicated setup",
testReceiverEmail: "Test Receiver Email",
pleaseEnterTestReceiverEmail: "Please enter test receiver email",
saveBeforeTest: "Save before testing",
sendFailHelpDoc: "Failed to send??? ",
emailConfigHelpDoc: "Email configuration help document",
tryOfficialEmailServer: "You can also try using the official email server ↗↗↗↗↗↗↗↗",
pluginManagement: "Plugin Management",
pluginBetaWarning: "Custom plugins are in BETA and may have breaking changes in future",
pleaseSelectRecord: "Please select records first",
permissionManagement: "Permission Management",
adda: "Add",
rootNode: "Root Node",
permissionName: "Permission Name",
enterPermissionName: "Please enter permission name",
permissionCode: "Permission Code",
enterPermissionCode: "Please enter permission code",
max100Chars: "Maximum 100 characters",
examplePermissionCode: "e.g.: sys:user:view",
sortOrder: "Sort Order",
sortRequired: "Sort order is required",
parentNode: "Parent Node",
roleManagement: "Role Management",
assignPermissions: "Assign Permissions",
roleName: "Role Name",
enterRoleName: "Please enter role name",
unlockLogin: "Unlock Login",
notice: "Notice",
confirmUnlock: "Are you sure you want to unlock this user's login?",
unlockSuccess: "Unlock successful",
enterUsername: "Please enter username",
modifyPasswordIfFilled: "Fill in to change the password",
emaila: "Email",
mobile: "Mobile",
avatar: "Avatar",
validTime: "Valid Time",
remark: "Remark",
roles: "Roles",
cnameTitle: "CNAME Service Configuration",
cnameDescription:
"The domain name configured here serves as a proxy for verifying other domains. When other domains apply for certificates, they map to this domain via CNAME for ownership verification. The advantage is that any domain can apply for a certificate this way without providing an AccessSecret.",
cnameLinkText: "CNAME principle and usage instructions",
confirmTitle: "Confirm",
confirmDeleteBatch: "Are you sure you want to delete these {count} records?",
selectRecordsFirst: "Please select records first",
cnameDomain: "CNAME Domain",
cnameDomainPlaceholder: "cname.handsfree.work",
cnameDomainHelper:
"Requires a domain registered with a DNS provider on the right (or you can transfer other domain DNS servers here).\nOnce the CNAME domain is set, it cannot be changed. It is recommended to use a first-level subdomain.",
dnsProvider: "DNS Provider",
dnsProviderAuthorization: "DNS Provider Authorization",
setDefault: "Set Default",
confirmSetDefault: "Are you sure to set as default?",
setAsDefault: "Set as Default",
disabledLabel: "Disabled",
confirmToggleStatus: "Are you sure to {action}?",
};

View File

@ -453,4 +453,238 @@ export default {
subdomainManagement: "子域管理",
isDisabled: "是否禁用",
enabled: "启用",
uploadCustomCert: "上传自定义证书",
sourcee: "来源",
sourcePipeline: "流水线",
sourceManualUpload: "手动上传",
domains: "域名",
enterDomain: "请输入域名",
validDays: "有效天数",
expires: "过期",
days: "天",
expireTime: "过期时间",
certIssuer: "证书颁发机构",
applyTime: "申请时间",
relatedPipeline: "关联流水线",
statusSuccess: "成功",
statusChecking: "检查中",
statusError: "异常",
actionImportBatch: "批量导入",
actionSyncIp: "同步IP",
modalTitleSyncIp: "同步IP",
modalContentSyncIp: "确定要同步IP吗",
notificationSyncComplete: "同步完成",
actionCheckAll: "检查全部",
modalTitleConfirm: "确认",
modalContentCheckAll: "确认触发检查全部IP站点的证书吗?",
notificationCheckSubmitted: "检查任务已提交",
notificationCheckDescription: "请稍后刷新页面查看结果",
tooltipCheckNow: "立即检查",
notificationCheckSubmittedPleaseRefresh: "检查任务已提交,请稍后刷新查看结果",
columnId: "ID",
columnIp: "IP",
helperIpCname: "也支持填写CNAME域名",
ruleIpRequired: "请输入IP",
columnCertDomains: "证书域名",
columnCertProvider: "颁发机构",
columnCertStatus: "证书状态",
statusNormal: "正常",
statusExpired: "过期",
columnCertExpiresTime: "证书到期时间",
expired: "过期",
columnCheckStatus: "检查状态",
columnLastCheckTime: "上次检查时间",
columnSource: "来源",
sourceSync: "同步",
sourceManual: "手动",
sourceImport: "导入",
columnDisabled: "禁用启用",
columnRemark: "备注",
pluginFile: "插件文件",
selectPluginFile: "选择插件文件",
overrideSameName: "同名覆盖",
override: "覆盖",
noOverride: "不覆盖",
overrideHelper: "如果已有相同名称插件,直接覆盖",
importPlugin: "导入插件",
operationSuccess: "操作成功",
customPlugin: "自定义插件",
import: "导入",
export: "导出",
pluginType: "插件类型",
auth: "授权",
dns: "DNS",
deployPlugin: "部署插件",
icon: "图标",
pluginName: "插件名称",
pluginNameHelper: "必须为英文或数字,驼峰命名,类型作为前缀\n示例AliyunDeployToCDN\n插件使用后名称不可修改",
pluginNameRuleMsg: "必须为英文或数字,驼峰命名,类型作为前缀",
author: "作者",
authorHelper: "上传插件市场时作为前缀,如 greper/pluginName",
authorRuleMsg: "必须为英文或数字",
titleHelper: "插件中文名称",
descriptionHelper: "插件描述",
builtIn: "内置",
custom: "自定义",
store: "市场",
version: "版本",
pluginDependencies: "插件依赖",
pluginDependenciesHelper: "格式: [作者/]插件名[:版本],需先安装依赖插件",
editableRunStrategy: "可编辑运行策略",
editable: "可编辑",
notEditable: "不可编辑",
runStrategy: "运行策略",
normalRun: "正常运行",
skipOnSuccess: "成功跳过(部署任务)",
defaultRunStrategyHelper: "默认运行策略",
enableDisable: "启用/禁用",
clickToToggle: "点击切换启用/禁用",
confirmToggle: "确认要",
disable: "禁用",
enable: "启用",
pluginGroup: "插件分组",
icpRegistrationNumber: "ICP备案号",
icpPlaceholder: "粤ICP备xxxxxxx号",
publicSecurityRegistrationNumber: "网安备案号",
publicSecurityPlaceholder: "京公网安备xxxxxxx号",
enableAssistant: "开启小助手",
allowCrawlers: "允许爬虫",
httpProxy: "HTTP代理",
httpProxyPlaceholder: "http://192.168.1.2:18010/",
httpProxyHelper: "当某些网站被墙时可以配置",
httpsProxy: "HTTPS代理",
httpsProxyPlaceholder: "http://192.168.1.2:18010/",
saveThenTestTitle: "保存后,再点击测试",
testButton: "测试",
httpsProxyHelper: "一般这两个代理填一样的,保存后再测试",
dualStackNetwork: "双栈网络",
default: "默认",
ipv4Priority: "IPV4优先",
ipv6Priority: "IPV6优先",
dualStackNetworkHelper: "如果选择IPv6优先需要在docker-compose.yaml中启用ipv6",
enableCommonCnameService: "启用公共CNAME服务",
commonCnameHelper: "是否可以使用公共CNAME服务如果禁用且没有设置<router-link to='/sys/cname/provider'>自定义CNAME服务</router-link>则无法使用CNAME代理方式申请证书",
saveButton: "保存",
stopSuccess: "停止成功",
google: "Google",
baidu: "百度",
success: "成功",
testFailed: "测试失败",
testCompleted: "测试完成",
manageOtherUserPipeline: "管理其他用户流水线",
limitUserPipelineCount: "限制用户流水线数量",
limitUserPipelineCountHelper: "0为不限制",
enableSelfRegistration: "开启自助注册",
enableUserValidityPeriod: "开启用户有效期",
userValidityPeriodHelper: "有效期内用户可正常使用,失效后流水线将被停用",
enableUsernameRegistration: "开启用户名注册",
enableEmailRegistration: "开启邮箱注册",
proFeature: "专业版功能",
emailServerSetup: "设置邮箱服务器",
enableSmsLoginRegister: "开启手机号登录、注册",
commFeature: "商业版功能",
smsProvider: "短信提供商",
aliyunSms: "阿里云短信",
yfySms: "易发云短信",
smsTest: "短信测试",
testMobilePlaceholder: "输入测试手机号",
saveThenTest: "保存后再点击测试",
enterTestMobile: "请输入测试手机号",
sendSuccess: "发送成功",
atLeastOneLoginRequired: "密码登录和手机号登录至少开启一个",
fieldRequired: "此项必填",
siteHide: "站点隐藏",
enableSiteHide: "启用站点隐藏",
siteHideDescription: "可以在平时关闭站点的可访问性,需要时再打开,增强站点安全性",
helpDoc: "帮助说明",
randomAddress: "随机地址",
siteHideUrlHelper: "站点被隐藏后需要访问此URL解锁才能正常访问",
fullUnlockUrl: "完整解除隐藏地址",
saveThisUrl: "请保存好此地址",
unlockPassword: "解除密码",
unlockPasswordHelper: "解除隐藏时需要输入密码,第一次需要设置密码,填写则重置密码",
autoHideTime: "自动隐藏时间",
autoHideTimeHelper: "多少分钟内无请求自动隐藏",
hideOpenApi: "隐藏开放接口",
hideOpenApiHelper: "是否隐藏开放接口,是否放开/api/v1开头的接口",
hideSiteImmediately: "立即隐藏站点",
hideImmediately: "立即隐藏",
confirmHideSiteTitle: "确定要立即隐藏站点吗?",
confirmHideSiteContent: "隐藏后,将无法访问站点,请谨慎操作",
siteHiddenSuccess: "站点已隐藏",
emailServerSettings: "邮件服务器设置",
setEmailSendingServer: "设置邮件发送服务器",
useCustomEmailServer: "使用自定义邮件服务器",
smtpDomain: "SMTP域名",
pleaseEnterSmtpDomain: "请输入smtp域名或ip",
smtpPort: "SMTP端口",
pleaseEnterSmtpPort: "请输入smtp端口号",
username: "用户名",
pleaseEnterUsername: "请输入用户名",
password: "密码",
pleaseEnterPassword: "请输入密码",
qqEmailAuthCodeHelper: "如果是qq邮箱需要到qq邮箱的设置里面申请授权码作为密码",
senderEmail: "发件邮箱",
pleaseEnterSenderEmail: "请输入发件邮箱",
useSsl: "是否ssl",
sslPortNote: "ssl和非ssl的smtp端口是不一样的注意修改端口",
ignoreCertValidation: "忽略证书校验",
useOfficialEmailServer: "使用官方邮件服务器",
useOfficialEmailServerHelper: "使用官方邮箱服务器直接发邮件,免除繁琐的配置",
testReceiverEmail: "测试收件邮箱",
pleaseEnterTestReceiverEmail: "请输入测试收件邮箱",
saveBeforeTest: "保存后再点击测试",
sendFailHelpDoc: "发送失败???",
emailConfigHelpDoc: "邮件配置帮助文档",
tryOfficialEmailServer: "您还可以试试使用官方邮件服务器↗↗↗↗↗↗↗↗",
pluginManagement: "插件管理",
pluginBetaWarning: "自定义插件处于BETA测试版后续可能会有破坏性变更",
pleaseSelectRecord: "请先勾选记录",
permissionManagement: "权限管理",
adda: "添加",
rootNode: "根节点",
permissionName: "权限名称",
enterPermissionName: "请输入权限名称",
permissionCode: "权限代码",
enterPermissionCode: "请输入权限代码",
max100Chars: "最大100个字符",
examplePermissionCode: "例如:sys:user:view",
sortOrder: "排序",
sortRequired: "排序号必填",
parentNode: "父节点",
roleManagement: "角色管理",
assignPermissions: "分配权限",
roleName: "角色名称",
enterRoleName: "请输入角色名称",
unlockLogin: "解除登录锁定",
notice: "提示",
confirmUnlock: "确定要解除该用户的登录锁定吗?",
unlockSuccess: "解除成功",
enterUsername: "请输入用户名",
modifyPasswordIfFilled: "填写则修改密码",
emaila: "邮箱",
mobile: "手机号",
avatar: "头像",
validTime: "有效期",
remark: "备注",
roles: "角色",
cnameTitle: "CNAME服务配置",
cnameDescription:
"此处配置的域名作为其他域名校验的代理当别的域名需要申请证书时通过CNAME映射到此域名上来验证所有权。好处是任何域名都可以通过此方式申请证书也无需填写AccessSecret。",
cnameLinkText: "CNAME功能原理及使用说明",
confirmTitle: "确认",
confirmDeleteBatch: "确定要批量删除这{count}条记录吗",
selectRecordsFirst: "请先勾选记录",
cnameDomain: "CNAME域名",
cnameDomainPlaceholder: "cname.handsfree.work",
cnameDomainHelper:
"需要一个右边DNS提供商注册的域名也可以将其他域名的dns服务器转移到这几家来。\nCNAME域名一旦确定不可修改建议使用一级子域名",
dnsProvider: "DNS提供商",
dnsProviderAuthorization: "DNS提供商授权",
setDefault: "设置默认",
confirmSetDefault: "确定要设置为默认吗?",
setAsDefault: "设为默认",
disabledLabel: "禁用",
confirmToggleStatus: "确定要{action}吗?",
};

View File

@ -82,7 +82,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
show: true,
buttons: {
add: {
text: "上传自定义证书",
text: t('certd.uploadCustomCert'),
type: "primary",
show: false,
async click() {
@ -150,15 +150,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
fromType: {
title: "来源",
title: t('certd.sourcee'),
search: {
show: true,
},
type: "dict-select",
dict: dict({
data: [
{ label: "流水线", value: "pipeline" },
{ label: "手动上传", value: "upload" },
{ label: t('certd.sourcePipeline'), value: "pipeline" },
{ label: t('certd.sourceManualUpload'), value: "upload" },
],
}),
form: {
@ -179,13 +179,13 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
domains: {
title: "域名",
title: t('certd.domains'),
search: {
show: true,
},
type: "text",
form: {
rules: [{ required: true, message: "请输入域名" }],
rules: [{ required: true, message: t('certd.enterDomain') }],
},
column: {
width: 450,
@ -197,7 +197,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
domainCount: {
title: "域名数量",
title: t('certd.domainCount'),
type: "number",
form: {
show: false,
@ -209,7 +209,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
expiresLeft: {
title: "有效天数",
title: t('certd.validDays'),
search: {
show: false,
},
@ -229,12 +229,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const leftDays = dayjs(value).diff(dayjs(), "day");
const color = leftDays < 20 ? "red" : "#389e0d";
const percent = (leftDays / 90) * 100;
return <a-progress title={expireDate + "过期"} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}`} />;
return <a-progress title={expireDate + t('certd.expires')} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}${t('certd.days')}`} />;
},
},
},
expiresTime: {
title: "过期时间",
title: t('certd.expireTime'),
search: {
show: false,
},
@ -247,7 +247,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certProvider: {
title: "证书颁发机构",
title: t('certd.certIssuer'),
search: {
show: false,
},
@ -260,7 +260,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
applyTime: {
title: "申请时间",
title: t('certd.applyTime'),
search: {
show: false,
},
@ -273,7 +273,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
"pipeline.title": {
title: "关联流水线",
title: t('certd.relatedPipeline'),
search: { show: false },
type: "link",
form: {
@ -291,6 +291,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
},
},
},
};

View File

@ -7,6 +7,7 @@ import { Modal, notification } from "ant-design-vue";
import { useSiteIpMonitor } from "/@/views/certd/monitor/site/ip/use";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
const api = siteIpApi;
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
@ -36,9 +37,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const checkStatusDict = dict({
data: [
{ label: "成功", value: "ok", color: "green" },
{ label: "检查中", value: "checking", color: "blue" },
{ label: "异常", value: "error", color: "red" },
{ label: t("certd.statusSuccess"), value: "ok", color: "green" },
{ label: t("certd.statusChecking"), value: "checking", color: "blue" },
{ label: t("certd.statusError"), value: "error", color: "red" },
],
});
const { openSiteIpImportDialog } = useSiteIpMonitor();
@ -74,7 +75,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
import: {
show: true,
text: "批量导入",
text: t("certd.actionImportBatch"),
type: "primary",
async click() {
openSiteIpImportDialog({
@ -86,34 +87,34 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
load: {
text: "同步IP",
text: t("certd.actionSyncIp"),
type: "primary",
async click() {
Modal.confirm({
title: "同步IP",
content: "确定要同步IP吗",
title: t("certd.modalTitleSyncIp"),
content: t("certd.modalContentSyncIp"),
onOk: async () => {
await api.DoSync(context.props.siteId);
await crudExpose.doRefresh();
notification.success({
message: "同步完成",
message: t("certd.notificationSyncComplete"),
});
},
});
},
},
checkAll: {
text: "检查全部",
text: t("certd.actionCheckAll"),
type: "primary",
click: () => {
Modal.confirm({
title: "确认",
content: "确认触发检查全部IP站点的证书吗?",
title: t("certd.modalTitleConfirm"),
content: t("certd.modalContentCheckAll"),
onOk: async () => {
await siteIpApi.CheckAll(context.props.siteId);
notification.success({
message: "检查任务已提交",
description: "请稍后刷新页面查看结果",
message: t("certd.notificationCheckSubmitted"),
description: t("certd.notificationCheckDescription"),
});
},
});
@ -130,14 +131,14 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
type: "link",
text: null,
tooltip: {
title: "立即检查",
title: t("certd.tooltipCheckNow"),
},
icon: "ion:play-sharp",
click: async ({ row }) => {
await api.DoCheck(row.id);
await crudExpose.doRefresh();
notification.success({
message: "检查任务已提交,请稍后刷新查看结果",
message: t("certd.notificationCheckSubmittedPleaseRefresh"),
});
},
},
@ -145,7 +146,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
columns: {
id: {
title: "ID",
title: t("certd.columnId"),
key: "id",
type: "number",
search: {
@ -160,21 +161,21 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
ipAddress: {
title: "IP",
title: t("certd.columnIp"),
search: {
show: true,
},
type: "text",
helper: "也支持填写CNAME域名",
helper: t("certd.helperIpCname"),
form: {
rules: [{ required: true, message: "请输入IP" }],
rules: [{ required: true, message: t("certd.ruleIpRequired") }],
},
column: {
width: 160,
},
},
certDomains: {
title: "证书域名",
title: t("certd.columnCertDomains"),
search: {
show: false,
},
@ -196,7 +197,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certProvider: {
title: "颁发机构",
title: t("certd.columnCertProvider"),
search: {
show: false,
},
@ -214,15 +215,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certStatus: {
title: "证书状态",
title: t("certd.columnCertStatus"),
search: {
show: true,
},
type: "dict-select",
dict: dict({
data: [
{ label: "正常", value: "ok", color: "green" },
{ label: "过期", value: "expired", color: "red" },
{ label: t("certd.statusNormal"), value: "ok", color: "green" },
{ label: t("certd.statusExpired"), value: "expired", color: "red" },
],
}),
form: {
@ -236,7 +237,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
certExpiresTime: {
title: "证书到期时间",
title: t("certd.columnCertExpiresTime"),
search: {
show: false,
},
@ -254,12 +255,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
const leftDays = dayjs(value).diff(dayjs(), "day");
const color = leftDays < 20 ? "red" : "#389e0d";
const percent = (leftDays / 90) * 100;
return <a-progress title={expireDate + "过期"} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays}`} />;
return <a-progress title={expireDate + " " + t("certd.expired")} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays} ${t("certd.days")}`} />;
},
},
},
checkStatus: {
title: "检查状态",
title: t("certd.columnCheckStatus"),
search: {
show: false,
},
@ -282,7 +283,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
lastCheckTime: {
title: "上次检查时间",
title: t("certd.columnLastCheckTime"),
search: {
show: false,
},
@ -296,16 +297,16 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
from: {
title: "来源",
title: t("certd.columnSource"),
search: {
show: false,
},
type: "dict-switch",
dict: dict({
data: [
{ label: "同步", value: "sync", color: "green" },
{ label: "手动", value: "manual", color: "blue" },
{ label: "导入", value: "import", color: "blue" },
{ label: t("certd.sourceSync"), value: "sync", color: "green" },
{ label: t("certd.sourceManual"), value: "manual", color: "blue" },
{ label: t("certd.sourceImport"), value: "import", color: "blue" },
],
}),
form: {
@ -318,15 +319,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
disabled: {
title: "禁用启用",
title: t("certd.columnDisabled"),
search: {
show: false,
},
type: "dict-switch",
dict: dict({
data: [
{ label: "启用", value: false, color: "green" },
{ label: "禁用", value: true, color: "red" },
{ label: t("certd.enabled"), value: false, color: "green" },
{ label: t("certd.disabled"), value: true, color: "red" },
],
}),
form: {
@ -339,7 +340,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
remark: {
title: "备注",
title: t("certd.columnRemark"),
search: {
show: false,
},

View File

@ -1,7 +1,9 @@
import * as api from "./api.js";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, dict, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { useI18n } from "vue-i18n";
export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
const list = await api.GetTree();
@ -39,7 +41,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
value: "id",
label: "title",
async onReady({ dict }: any) {
dict.setData([{ id: -1, title: "根节点", children: dict.data }]);
dict.setData([{ id: -1, title: t("certd.rootNode"), children: dict.data }]);
}
});
return {
@ -81,51 +83,50 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
}
},
title: {
title: "权限名称",
title: t("certd.permissionName"),
type: "text",
form: {
rules: [
{ required: true, message: "请输入权限名称" },
{ max: 50, message: "最大50个字符" }
{ required: true, message: t("certd.enterPermissionName") },
{ max: 50, message: t("certd.max50Chars") }
],
component: {
placeholder: "权限名称"
placeholder: t("certd.permissionName")
}
},
column: {
width: 200
}
},
permission: {
title: "权限代码",
title: t("certd.permissionCode"),
type: "text",
column: {
width: 170
},
form: {
rules: [
{ required: true, message: "请输入权限代码" },
{ max: 100, message: "最大100个字符" }
{ required: true, message: t("certd.enterPermissionCode") },
{ max: 100, message: t("certd.max100Chars") }
],
component: {
placeholder: "例如:sys:user:view"
placeholder: t("certd.examplePermissionCode")
}
}
},
sort: {
title: "排序",
title: t("certd.sortOrder"),
type: "number",
column: {
width: 100
},
form: {
value: 100,
rules: [{ required: true, type: "number", message: "排序号必填" }]
rules: [{ required: true, type: "number", message: t("certd.sortRequired") }]
}
},
parentId: {
title: "父节点",
title: t("certd.parentNode"),
type: "dict-tree",
column: {
width: 100
@ -144,6 +145,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
}
}
}
}
}
};

View File

@ -1,23 +1,16 @@
<template>
<a-tree
v-if="computedTree"
ref="treeRef"
class="fs-permission-tree"
:class="{ 'is-editable': editable }"
:selectable="false"
show-line
:show-icon="false"
:default-expand-all="true"
:tree-data="computedTree"
@check="onChecked"
>
<a-tree v-if="computedTree" ref="treeRef" class="fs-permission-tree" :class="{ 'is-editable': editable }"
:selectable="false" show-line :show-icon="false" :default-expand-all="true" :tree-data="computedTree"
@check="onChecked">
<template #title="scope">
<div class="node-title-pane">
<div class="node-title">{{ scope.title }}</div>
<div v-if="editable === true" class="node-suffix">
<fs-icon v-if="actions.add !== false" :icon="$fsui.icons.add" @click.stop="add(scope)" />
<fs-icon v-if="actions.edit !== false && scope.id !== -1" :icon="$fsui.icons.edit" @click.stop="edit(scope)" />
<fs-icon v-if="actions.remove !== false && scope.id !== -1" :icon="$fsui.icons.remove" @click.stop="remove(scope)" />
<fs-icon v-if="actions.edit !== false && scope.id !== -1" :icon="$fsui.icons.edit"
@click.stop="edit(scope)" />
<fs-icon v-if="actions.remove !== false && scope.id !== -1" :icon="$fsui.icons.remove"
@click.stop="remove(scope)" />
</div>
</div>
</template>
@ -28,6 +21,7 @@
import { utils } from "@fast-crud/fast-crud";
import { cloneDeep } from "lodash-es";
import { computed, defineComponent, ref } from "vue";
import { useI18n } from "vue-i18n";
export default defineComponent({
name: "FsPermissionTree",
@ -48,6 +42,7 @@ export default defineComponent({
} as any,
emits: ["add", "edit", "remove"],
setup(props: any, ctx) {
const { t } = useI18n();
const treeRef = ref();
const computedTree = computed(() => {
if (props.tree == null) {
@ -94,7 +89,7 @@ export default defineComponent({
});
return [
{
title: "根节点",
title: t("certd.rootNode"),
id: -1,
children: clone
}
@ -127,7 +122,8 @@ export default defineComponent({
remove,
treeRef,
onChecked,
getChecked
getChecked,
t
};
}
});
@ -138,11 +134,13 @@ export default defineComponent({
.ant-tree-list-holder-inner {
flex-direction: row !important;
flex-wrap: wrap;
.is-twig {
width: 100%;
}
.is-leaf {
//border-bottom: 1px solid #ddd;
&::before {
display: none;
@ -159,12 +157,14 @@ export default defineComponent({
}
}
}
//.is-twig ul {
// display: flex;
// flex-wrap: wrap;
//}
.node-title-pane {
display: flex;
.node-title {
width: 110px;
white-space: nowrap;
@ -184,7 +184,8 @@ export default defineComponent({
.node-suffix {
visibility: hidden;
> * {
>* {
margin-left: 3px;
}
}

View File

@ -1,24 +1,27 @@
<template>
<fs-page>
<template #header>
<div class="title">权限管理</div>
<div class="title">{{ t("certd.permissionManagement") }}</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<a-button v-permission="'1sys:auth:per:add'" style="margin-left: 20px" @click="addHandle({})">
<fs-icon :icon="ui.icons.add"></fs-icon>
添加
{{ t("certd.adda") }}
</a-button>
<fs-permission-tree class="permission-tree mt-10" :tree="crudBinding.data" :checkable="false" :actions="permission" @add="addHandle" @edit="editHandle" @remove="removeHandle"></fs-permission-tree>
<fs-permission-tree class="permission-tree mt-10" :tree="crudBinding.data" :checkable="false"
:actions="permission" @add="addHandle" @edit="editHandle" @remove="removeHandle"></fs-permission-tree>
</fs-crud>
</fs-page>
</template>
<script lang="ts">
import { defineComponent, onActivated, onMounted, ref } from "vue";
import createCrudOptions from "./crud.js";
import FsPermissionTree from "./fs-permission-tree.vue";
import { usePermission } from "/src/plugin/permission";
import { useFs, useUi } from "@fast-crud/fast-crud";
import { useI18n } from "vue-i18n";
export default defineComponent({
name: "AuthorityManager",
@ -27,6 +30,7 @@ export default defineComponent({
// permissioncommonOptionsactionbarrowHandleshow
// ./src/plugin/fast-crud/index.js 75-77
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: "sys:auth:per" } });
const { t } = useI18n();
//
onMounted(async () => {
@ -65,6 +69,7 @@ export default defineComponent({
editHandle,
removeHandle,
permission,
t
};
},
});

View File

@ -1,7 +1,9 @@
import * as api from "./api";
import { AddReq, CreateCrudOptionsProps, CreateCrudOptionsRet, DelReq, EditReq, UserPageQuery, UserPageRes } from "@fast-crud/fast-crud";
import { useI18n } from "vue-i18n";
export default function ({ crudExpose, context: { authz } }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const { t } = useI18n();
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
@ -47,13 +49,13 @@ export default function ({ crudExpose, context: { authz } }: CreateCrudOptionsPr
}
},
name: {
title: "角色名称",
title: t("certd.roleName"),
type: "text",
search: { show: true },
form: {
rules: [
{ required: true, message: "请输入角色名称" },
{ max: 50, message: "最大50个字符" }
{ required: true, message: t("certd.enterRoleName") },
{ max: 50, message: t("certd.max50Chars") }
]
}, // 表单配置
column: {
@ -61,7 +63,7 @@ export default function ({ crudExpose, context: { authz } }: CreateCrudOptionsPr
}
},
createTime: {
title: "创建时间",
title: t("certd.createTime"),
type: "datetime",
column: {
sorter: true
@ -71,7 +73,7 @@ export default function ({ crudExpose, context: { authz } }: CreateCrudOptionsPr
}
},
updateTime: {
title: "更新时间",
title: t("certd.updateTime"),
type: "datetime",
column: {
sorter: true

View File

@ -1,15 +1,18 @@
<template>
<fs-page>
<template #header>
<div class="title">角色管理</div>
<div class="title">{{ t("certd.roleManagement") }}</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding" />
<a-modal v-model:open="authzDialogVisible" width="860px" title="分配权限" @ok="updatePermission">
<fs-permission-tree ref="permissionTreeRef" v-model:checked-keys="checkedKeys" :tree="permissionTreeData" :editable="false" checkable :replace-fields="{ key: 'id', label: 'title' }"> </fs-permission-tree>
<a-modal v-model:open="authzDialogVisible" width="860px" :title="t('certd.assignPermissions')"
@ok="updatePermission">
<fs-permission-tree ref="permissionTreeRef" v-model:checked-keys="checkedKeys" :tree="permissionTreeData"
:editable="false" checkable :replace-fields="{ key: 'id', label: 'title' }"> </fs-permission-tree>
</a-modal>
</fs-page>
</template>
<script lang="ts">
import { defineComponent, onActivated, onMounted, ref } from "vue";
import { useFs } from "@fast-crud/fast-crud";
@ -19,6 +22,7 @@ import * as api from "./api";
import { message } from "ant-design-vue";
import FsPermissionTree from "../permission/fs-permission-tree.vue";
import { UseCrudPermissionCompProps, UseCrudPermissionExtraProps } from "/@/plugin/permission";
import { useI18n } from "vue-i18n";
function useAuthz() {
const checkedKeys = ref();
@ -88,6 +92,7 @@ export default defineComponent({
components: { FsPermissionTree },
setup() {
//
const { t } = useI18n();
const authz = useAuthz();
const permission: UseCrudPermissionCompProps = {
prefix: "sys:auth:role", //
@ -115,6 +120,7 @@ export default defineComponent({
crudBinding,
crudRef,
...authz,
t
};
},
});

View File

@ -42,18 +42,18 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
fixed: "right",
buttons: {
unlock: {
title: "解除登录锁定",
title: t("certd.unlockLogin"),
text: null,
type: "link",
icon: "ion:lock-open-outline",
click: async ({ row }) => {
Modal.confirm({
title: "提示",
content: "确定要解除该用户的登录锁定吗?",
title: t("certd.notice"),
content: t("certd.confirmUnlock"),
onOk: async () => {
await api.Unlock(row.id);
notification.success({
message: "解除成功",
message: t("certd.unlockSuccess"),
});
},
});
@ -78,7 +78,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
createTime: {
title: "创建时间",
title: t("certd.createTime"),
type: "datetime",
form: { show: false }, // 表单配置
column: {
@ -96,13 +96,13 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
// }
// },
username: {
title: "用户名",
title: t("certd.username"),
type: "text",
search: { show: true }, // 开启查询
form: {
rules: [
{ required: true, message: "请输入用户名" },
{ max: 50, message: "最大50个字符" },
{ required: true, message: t("certd.enterUsername") },
{ max: 50, message: t("certd.max50Chars") },
],
},
editForm: { component: { disabled: false } },
@ -112,18 +112,18 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
password: {
title: "密码",
title: t("certd.password"),
type: "text",
key: "password",
column: {
show: false,
},
form: {
rules: [{ max: 50, message: "最大50个字符" }],
rules: [{ max: 50, message: t("certd.max50Chars") }],
component: {
showPassword: true,
},
helper: "填写则修改密码",
helper: t("certd.modifyPasswordIfFilled"),
},
},
nickName: {
@ -138,11 +138,11 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
email: {
title: "邮箱",
title: t("certd.emaila"),
type: "text",
search: { show: true }, // 开启查询
form: {
rules: [{ max: 50, message: "最大50个字符" }],
rules: [{ max: 50, message: t("certd.max50Chars") }],
},
column: {
sorter: true,
@ -150,11 +150,11 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
mobile: {
title: "手机号",
title: t("certd.mobile"),
type: "text",
search: { show: true }, // 开启查询
form: {
rules: [{ max: 50, message: "最大50个字符" }],
rules: [{ max: 50, message: t("certd.max50Chars") }],
},
column: {
sorter: true,
@ -162,12 +162,11 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
avatar: {
title: "头像",
title: t("certd.avatar"),
type: "cropper-uploader",
column: {
width: 70,
component: {
//设置高度,修复操作列错位的问题
style: {
height: "30px",
width: "auto",
@ -205,12 +204,12 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
status: {
title: "状态",
title: t("certd.status"),
type: "dict-switch",
dict: dict({
data: [
{ label: "启用", value: 1, color: "green" },
{ label: "禁用", value: 0, color: "red" },
{ label: t("certd.enabled"), value: 1, color: "green" },
{ label: t("certd.disabled"), value: 0, color: "red" },
],
}),
column: {
@ -220,7 +219,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
validTime: {
title: "有效期",
title: t("certd.validTime"),
type: "date",
form: {
show: userValidTimeEnabled,
@ -235,7 +234,7 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
return "";
}
if (value < dayjs().valueOf()) {
return <a-tag color={"red"}></a-tag>;
return <a-tag color={"red"}>{t("certd.expired")}</a-tag>;
}
const date = dayjs(value).format("YYYY-MM-DD");
return (
@ -257,17 +256,17 @@ export default function ({ crudExpose }: CreateCrudOptionsProps): CreateCrudOpti
},
},
remark: {
title: "备注",
title: t("certd.remark"),
type: "text",
column: {
sorter: true,
},
form: {
rules: [{ max: 100, message: "最大100个字符" }],
rules: [{ max: 100, message: t("certd.max100Chars") }],
},
},
roles: {
title: "角色",
title: t("certd.roles"),
type: "dict-select",
dict: dict({
url: "/sys/authority/role/list",

View File

@ -73,55 +73,55 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}
},
domain: {
title: "CNAME域名",
title: t("certd.cnameDomain"),
type: "text",
editForm: {
component: {
disabled: true
}
disabled: true,
},
},
search: {
show: true
show: true,
},
form: {
component: {
placeholder: "cname.handsfree.work"
placeholder: t("certd.cnameDomainPlaceholder"),
},
helper: "需要一个右边DNS提供商注册的域名也可以将其他域名的dns服务器转移到这几家来。\nCNAME域名一旦确定不可修改建议使用一级子域名",
rules: [{ required: true, message: "此项必填" }]
helper: t("certd.cnameDomainHelper"),
rules: [{ required: true, message: t("certd.requiredField") }],
},
column: {
width: 200
}
width: 200,
},
},
dnsProviderType: {
title: "DNS提供商",
title: t("certd.dnsProvider"),
type: "dict-select",
search: {
show: true
show: true,
},
dict: dict({
url: "pi/dnsProvider/list",
value: "key",
label: "title"
label: "title",
}),
form: {
rules: [{ required: true, message: "此项必填" }]
rules: [{ required: true, message: t("certd.requiredField") }],
},
column: {
width: 150,
component: {
color: "auto"
}
}
color: "auto",
},
},
},
accessId: {
title: "DNS提供商授权",
title: t("certd.dnsProviderAuthorization"),
type: "dict-select",
dict: dict({
url: "/pi/access/list",
value: "id",
label: "name"
label: "name",
}),
form: {
component: {
@ -129,40 +129,40 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
vModel: "modelValue",
type: compute(({ form }) => {
return form.dnsProviderType;
})
}),
},
rules: [{ required: true, message: "此项必填" }]
rules: [{ required: true, message: t("certd.requiredField") }],
},
column: {
width: 150,
component: {
color: "auto"
}
}
color: "auto",
},
},
},
isDefault: {
title: "是否默认",
title: t("certd.isDefault"),
type: "dict-switch",
dict: dict({
data: [
{ label: "是", value: true, color: "success" },
{ label: "否", value: false, color: "default" }
]
{ label: t("certd.yes"), value: true, color: "success" },
{ label: t("certd.no"), value: false, color: "default" },
],
}),
form: {
value: false,
rules: [{ required: true, message: "请选择是否默认" }]
rules: [{ required: true, message: t("certd.selectIsDefault") }],
},
column: {
align: "center",
width: 100
}
width: 100,
},
},
setDefault: {
title: "设置默认",
title: t("certd.setDefault"),
type: "text",
form: {
show: false
show: false,
},
column: {
width: 100,
@ -174,77 +174,77 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
}
const onClick = async () => {
Modal.confirm({
title: "提示",
content: `确定要设置为默认吗?`,
title: t("certd.prompt"),
content: t("certd.confirmSetDefault"),
onOk: async () => {
await api.SetDefault(row.id);
await crudExpose.doRefresh();
}
},
});
};
return (
<a-button type={"link"} size={"small"} onClick={onClick}>
{t("certd.setAsDefault")}
</a-button>
);
}
}
},
},
},
disabled: {
title: "禁用/启用",
title: t("certd.disabled"),
type: "dict-switch",
dict: dict({
data: [
{ label: "启用", value: false, color: "success" },
{ label: "禁用", value: true, color: "error" }
]
{ label: t("certd.enabled"), value: false, color: "success" },
{ label: t("certd.disabledLabel"), value: true, color: "error" },
],
}),
form: {
value: false
value: false,
},
column: {
width: 100,
component: {
title: "点击可禁用/启用",
title: t("certd.clickToToggle"),
on: {
async click({ value, row }) {
Modal.confirm({
title: "提示",
content: `确定要${!value ? "禁用" : "启用"}吗?`,
title: t("certd.prompt"),
content: t("certd.confirmToggleStatus", { action: !value ? t("certd.disable") : t("certd.enable") }),
onOk: async () => {
await api.SetDisabled(row.id, !value);
await crudExpose.doRefresh();
}
},
});
}
}
}
}
},
},
},
},
},
createTime: {
title: "创建时间",
title: t("certd.createTime"),
type: "datetime",
form: {
show: false
show: false,
},
column: {
sorter: true,
width: 160,
align: "center"
}
align: "center",
},
},
updateTime: {
title: "更新时间",
title: t("certd.updateTime"),
type: "datetime",
form: {
show: false
show: false,
},
column: {
show: true,
width: 160
}
}
width: 160,
},
},
}
}
};

View File

@ -2,16 +2,18 @@
<fs-page class="page-cert">
<template #header>
<div class="title">
CNAME服务配置
{{ t("certd.cnameTitle") }}
<span class="sub">
此处配置的域名作为其他域名校验的代理当别的域名需要申请证书时通过CNAME映射到此域名上来验证所有权好处是任何域名都可以通过此方式申请证书也无需填写AccessSecret
<a href="https://certd.docmirror.cn/guide/feature/cname/" target="_blank">CNAME功能原理及使用说明</a>
{{ t("certd.cnameDescription") }}
<a href="https://certd.docmirror.cn/guide/feature/cname/" target="_blank">
{{ t("certd.cnameLinkText") }}
</a>
</span>
</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<template #pagination-left>
<a-tooltip title="批量删除">
<a-tooltip :title="t('certd.batchDelete')">
<fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>
</a-tooltip>
</template>
@ -19,12 +21,16 @@
</fs-page>
</template>
<script lang="ts" setup>
import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
defineOptions({
name: "CnameProvider",
@ -35,20 +41,21 @@ const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
if (selectedRowKeys.value?.length > 0) {
Modal.confirm({
title: "确认",
content: `确定要批量删除这${selectedRowKeys.value.length}条记录吗`,
title: t("certd.confirmTitle"),
content: t("certd.confirmDeleteBatch", { count: selectedRowKeys.value.length }),
async onOk() {
await DeleteBatch(selectedRowKeys.value);
message.info("删除成功");
message.info(t("certd.deleteSuccess"));
crudExpose.doRefresh();
selectedRowKeys.value = [];
},
});
} else {
message.error("请先勾选记录");
message.error(t("certd.selectRecordsFirst"));
}
};
//
onMounted(() => {
crudExpose.doRefresh();

View File

@ -14,7 +14,6 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
let lastType = "";
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
if (lastType && lastType != query?.query?.type) {
//lastType有变化
query.page.offset = 0;
}
lastType = query?.query?.type;
@ -44,7 +43,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
crudOptions: {
columns: {
content: {
title: "插件文件",
title: t("certd.pluginFile"),
type: "text",
form: {
component: {
@ -57,21 +56,21 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
col: {
span: 24,
},
helper: "选择插件文件",
helper: t("certd.selectPluginFile"),
},
},
override: {
title: "同名覆盖",
title: t("certd.overrideSameName"),
type: "dict-switch",
dict: dict({
data: [
{
value: true,
label: "覆盖",
label: t("certd.override"),
},
{
value: false,
label: "不覆盖",
label: t("certd.noOverride"),
},
],
}),
@ -80,17 +79,17 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
col: {
span: 24,
},
helper: "如果已有相同名称插件,直接覆盖",
helper: t("certd.overrideHelper"),
},
},
},
form: {
wrapper: {
title: "导入插件",
title: t("certd.importPlugin"),
saveRemind: false,
},
afterSubmit() {
notification.success({ message: "操作成功" });
notification.success({ message: t("certd.operationSuccess") });
crudExpose.doRefresh();
},
async doSubmit({ form }: any) {
@ -109,12 +108,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
crudOptions: {
settings: {
plugins: {
//这里使用行选择插件生成行选择crudOptions配置最终会与crudOptions合并
rowSelection: {
enabled: true,
order: -2,
before: true,
// handle: (pluginProps,useCrudProps)=>CrudOptions,
props: {
multiple: true,
crossPage: true,
@ -134,12 +131,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
add: {
show: true,
icon: "ion:ios-add-circle-outline",
text: "自定义插件",
text: t("certd.customPlugin"),
},
import: {
show: true,
icon: "ion:cloud-upload-outline",
text: "导入",
text: t("certd.import"),
type: "primary",
async click() {
await openImportDialog();
@ -171,13 +168,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
export: {
text: null,
icon: "ion:cloud-download-outline",
title: "导出",
title: t("certd.export"),
type: "link",
show: compute(({ row }) => {
return row.type === "custom";
}),
async click({ row }) {
//将文本内容,作为文件下载
const content = await api.ExportPlugin(row.id);
if (content) {
const blob = new Blob([content], { type: "text/plain;charset=utf-8" });
@ -215,19 +211,8 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
columns: {
// id: {
// title: "ID",
// key: "id",
// type: "number",
// column: {
// width: 100
// },
// form: {
// show: false
// }
// },
pluginType: {
title: "插件类型",
title: t("certd.pluginType"),
type: "dict-select",
search: {
show: true,
@ -246,9 +231,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
dict: dict({
data: [
{ label: "授权", value: "access" },
{ label: "DNS", value: "dnsProvider" },
{ label: "部署插件", value: "deploy" },
{ label: t("certd.auth"), value: "access" },
{ label: t("certd.dns"), value: "dnsProvider" },
{ label: t("certd.deployPlugin"), value: "deploy" },
],
}),
column: {
@ -260,7 +245,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
icon: {
title: "图标",
title: t("certd.icon"),
type: "icon",
form: {
rules: [{ required: true }],
@ -278,20 +263,20 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
name: {
title: "插件名称",
title: t("certd.pluginName"),
type: "text",
search: {
show: true,
},
form: {
show: true,
helper: "必须为英文或数字,驼峰命名,类型作为前缀\n例如AliyunDeployToCDN\n插件一旦被使用不要修改名称",
helper: t("certd.pluginNameHelper"),
rules: [
{ required: true },
{
type: "regexp",
pattern: /^[a-zA-Z][a-zA-Z0-9]+$/,
message: "必须为英文或数字,驼峰命名,类型作为前缀",
message: t("certd.pluginNameRuleMsg"),
},
],
},
@ -307,20 +292,20 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
author: {
title: "作者",
title: t("certd.author"),
type: "text",
search: {
show: true,
},
form: {
show: true,
helper: "上传到插件商店时,将作为插件名称前缀,例如greper/pluginName",
helper: t("certd.authorHelper"),
rules: [
{ required: true },
{
type: "regexp",
pattern: /^[a-zA-Z][a-zA-Z0-9]+$/,
message: "必须为英文字母或数字",
message: t("certd.authorRuleMsg"),
},
],
},
@ -330,10 +315,10 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
title: {
title: "标题",
title: t("certd.titlea"),
type: "text",
form: {
helper: "插件中文名称",
helper: t("certd.titleHelper"),
rules: [{ required: true }],
},
column: {
@ -347,17 +332,16 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
desc: {
title: "描述",
title: t("certd.description"),
type: "textarea",
helper: "插件的描述",
helper: t("certd.descriptionHelper"),
column: {
width: 300,
show: false,
},
},
type: {
title: "来源",
title: t("certd.sourcee"),
type: "dict-select",
search: {
show: true,
@ -370,9 +354,9 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
dict: dict({
data: [
{ label: "内置", value: "builtIn" },
{ label: "自建", value: "custom" },
{ label: "商店", value: "store" },
{ label: t("certd.builtIn"), value: "builtIn" },
{ label: t("certd.custom"), value: "custom" },
{ label: t("certd.store"), value: "store" },
],
}),
column: {
@ -384,31 +368,15 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
version: {
title: "版本",
title: t("certd.version"),
type: "text",
column: {
width: 100,
align: "center",
},
},
// "extra.dependLibs": {
// title: "第三方依赖",
// type: "text",
// form: {
// helper: "依赖的第三方库,package.dependencies的格式name[:^version]",
// component: {
// name: "a-select",
// mode: "tags",
// allowClear: true,
// open: false,
// },
// },
// column: {
// show: false,
// },
// },
"extra.dependPlugins": {
title: "插件依赖",
title: t("certd.pluginDependencies"),
type: "text",
form: {
component: {
@ -417,19 +385,19 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
open: false,
allowClear: true,
},
helper: "安装时会先安装依赖的插件,格式:[author/]pluginName[:version]",
helper: t("certd.pluginDependenciesHelper"),
},
column: {
show: false,
},
},
"extra.showRunStrategy": {
title: "可修改运行策略",
title: t("certd.editableRunStrategy"),
type: "dict-switch",
dict: dict({
data: [
{ value: true, label: "可修改" },
{ value: false, label: "不可修改" },
{ value: true, label: t("certd.editable") },
{ value: false, label: t("certd.notEditable") },
],
}),
form: {
@ -443,18 +411,18 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
"extra.default.strategy.runStrategy": {
title: "运行策略",
title: t("certd.runStrategy"),
type: "dict-select",
dict: dict({
data: [
{ value: 0, label: "正常运行" },
{ value: 1, label: "成功后跳过(部署任务)" },
{ value: 0, label: t("certd.normalRun") },
{ value: 1, label: t("certd.skipOnSuccess") },
],
}),
form: {
value: 1,
rules: [{ required: true }],
helper: "默认运行策略",
helper: t("certd.defaultRunStrategyHelper"),
show: compute(({ form }) => {
return form.extra.showRunStrategy;
}),
@ -479,28 +447,28 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
disabled: {
title: "点击禁用/启用",
title: t("certd.enableDisable"),
type: "dict-switch",
dict: dict({
data: [
{ label: "启用", value: false, color: "success" },
{ label: "禁用", value: true, color: "error" },
{ label: t("certd.enabled"), value: false, color: "success" },
{ label: t("certd.disabled"), value: true, color: "error" },
],
}),
form: {
title: "禁用/启用",
title: t("certd.enableDisable"),
value: false,
},
column: {
width: 120,
align: "center",
component: {
title: "点击可禁用/启用",
title: t("certd.clickToToggle"),
on: {
async click({ value, row }) {
Modal.confirm({
title: "提示",
content: `确定要${!value ? "禁用" : "启用"}吗?`,
title: t("certd.confirm"),
content: `${t("certd.confirmToggle")} ${!value ? t("certd.disable") : t("certd.enable")}?`,
onOk: async () => {
await api.SetDisabled({
id: row.id,
@ -517,7 +485,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
group: {
title: "插件分组",
title: t("certd.pluginGroup"),
type: "dict-select",
dict: dict({
url: "/pi/plugin/groupsList",
@ -539,7 +507,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
createTime: {
title: "创建时间",
title: t("certd.createTime"),
type: "datetime",
form: {
show: false,
@ -551,7 +519,7 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat
},
},
updateTime: {
title: "更新时间",
title: t("certd.updateTime"),
type: "datetime",
form: {
show: false,

View File

@ -2,13 +2,13 @@
<fs-page class="page-cert">
<template #header>
<div class="title">
插件管理
<span class="sub">自定义插件处于BETA测试版后续可能会有破坏性变更</span>
{{ t("certd.pluginManagement") }}
<span class="sub">{{ t("certd.pluginBetaWarning") }}</span>
</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<!-- <template #pagination-left>-->
<!-- <a-tooltip title="批量删除">-->
<!-- <a-tooltip :title="t('certd.batchDelete')">-->
<!-- <fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>-->
<!-- </a-tooltip>-->
<!-- </template>-->
@ -16,12 +16,16 @@
</fs-page>
</template>
<script lang="ts" setup>
import { onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
import { DeleteBatch } from "./api";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
defineOptions({
name: "SysPlugin",
@ -36,20 +40,21 @@ const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
if (selectedRowKeys.value?.length > 0) {
Modal.confirm({
title: "确认",
content: `确定要批量删除这${selectedRowKeys.value.length}条记录吗`,
title: t("certd.confirm"),
content: t("certd.batchDeleteConfirm", { count: selectedRowKeys.value.length }),
async onOk() {
await DeleteBatch(selectedRowKeys.value);
message.info("删除成功");
message.info(t("certd.deleteSuccess"));
crudExpose.doRefresh();
selectedRowKeys.value = [];
},
});
} else {
message.error("请先勾选记录");
message.error(t("certd.pleaseSelectRecord"));
}
};
//
onMounted(() => {
crudExpose.doRefresh();

View File

@ -2,72 +2,85 @@
<fs-page class="page-setting-email">
<template #header>
<div class="title">
邮件服务器设置
<span class="sub">设置邮件发送服务器</span>
{{ t('certd.emailServerSettings') }}
<span class="sub">{{ t('certd.setEmailSendingServer') }}</span>
</div>
</template>
<div class="flex-o">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" class="email-form-box" @finish="onFinish" @finish-failed="onFinishFailed">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"
autocomplete="off" class="email-form-box" @finish="onFinish" @finish-failed="onFinishFailed">
<div v-if="!formState.usePlus" class="email-form">
<a-form-item label="使用自定义邮件服务器"> </a-form-item>
<a-form-item label="SMTP域名" name="host" :rules="[{ required: true, message: '请输入smtp域名或ip' }]">
<a-form-item :label="t('certd.useCustomEmailServer')"> </a-form-item>
<a-form-item :label="t('certd.smtpDomain')" name="host"
:rules="[{ required: true, message: t('certd.pleaseEnterSmtpDomain') }]">
<a-input v-model:value="formState.host" />
</a-form-item>
<a-form-item label="SMTP端口" name="port" :rules="[{ required: true, message: '请输入smtp端口号' }]">
<a-form-item :label="t('certd.smtpPort')" name="port"
:rules="[{ required: true, message: t('certd.pleaseEnterSmtpPort') }]">
<a-input v-model:value="formState.port" />
</a-form-item>
<a-form-item label="用户名" :name="['auth', 'user']" :rules="[{ required: true, message: '请输入用户名' }]">
<a-form-item :label="t('certd.username')" :name="['auth', 'user']"
:rules="[{ required: true, message: t('certd.pleaseEnterUsername') }]">
<a-input v-model:value="formState.auth.user" />
</a-form-item>
<a-form-item label="密码" :name="['auth', 'pass']" :rules="[{ required: true, message: '请输入密码' }]">
<a-form-item :label="t('certd.password')" :name="['auth', 'pass']"
:rules="[{ required: true, message: t('certd.pleaseEnterPassword') }]">
<a-input-password v-model:value="formState.auth.pass" />
<div class="helper">如果是qq邮箱需要到qq邮箱的设置里面申请授权码作为密码</div>
<div class="helper">{{ t('certd.qqEmailAuthCodeHelper') }}</div>
</a-form-item>
<a-form-item label="发件邮箱" name="sender" :rules="[{ required: true, message: '请输入发件邮箱' }]">
<a-form-item :label="t('certd.senderEmail')" name="sender"
:rules="[{ required: true, message: t('certd.pleaseEnterSenderEmail') }]">
<a-input v-model:value="formState.sender" />
</a-form-item>
<a-form-item label="是否ssl" name="secure">
<a-form-item :label="t('certd.useSsl')" name="secure">
<a-switch v-model:checked="formState.secure" />
<div class="helper">ssl和非ssl的smtp端口是不一样的注意修改端口</div>
<div class="helper">{{ t('certd.sslPortNote') }}</div>
</a-form-item>
<a-form-item label="忽略证书校验" :name="['tls', 'rejectUnauthorized']">
<a-form-item :label="t('certd.ignoreCertValidation')" :name="['tls', 'rejectUnauthorized']">
<a-switch v-model:checked="formState.tls.rejectUnauthorized" />
</a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
<a-button type="primary" html-type="submit">保存</a-button>
<a-button type="primary" html-type="submit">{{ t('certd.save') }}</a-button>
</a-form-item>
</div>
<div class="email-form">
<a-form-item label="使用官方邮件服务器" name="usePlus">
<a-form-item :label="t('certd.useOfficialEmailServer')" name="usePlus">
<div class="flex-o">
<a-switch v-model:checked="formState.usePlus" :disabled="!settingStore.isPlus" @change="onUsePlusChanged" />
<a-switch v-model:checked="formState.usePlus" :disabled="!settingStore.isPlus"
@change="onUsePlusChanged" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">使用官方邮箱服务器直接发邮件免除繁琐的配置</div>
<div class="helper">{{ t('certd.useOfficialEmailServerHelper') }}</div>
</a-form-item>
</div>
</a-form>
</div>
<div class="email-form">
<a-form :model="testFormState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onTestSend">
<a-form-item label="测试收件邮箱" name="receiver" :rules="[{ required: true, message: '请输入测试收件邮箱' }]">
<a-form :model="testFormState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"
autocomplete="off" @finish="onTestSend">
<a-form-item :label="t('certd.testReceiverEmail')" name="receiver"
:rules="[{ required: true, message: t('certd.pleaseEnterTestReceiverEmail') }]">
<a-input v-model:value="testFormState.receiver" />
<div class="helper">保存后再点击测试</div>
<div class="helper">发送失败<a href="https://certd.docmirror.cn/guide/use/email/" target="_blank">邮件配置帮助文档</a></div>
<div class="helper">您还可以试试使用官方邮件服务器</div>
<div class="helper">{{ t('certd.saveBeforeTest') }}</div>
<div class="helper">{{ t('certd.sendFailHelpDoc') }}<a
href="https://certd.docmirror.cn/guide/use/email/" target="_blank">{{
t('certd.emailConfigHelpDoc') }}</a></div>
<div class="helper">{{ t('certd.tryOfficialEmailServer') }}</div>
</a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
<a-button type="primary" :loading="testFormState.loading" html-type="submit">测试</a-button>
<a-button type="primary" :loading="testFormState.loading" html-type="submit">{{ t('certd.test')
}}</a-button>
</a-form-item>
</a-form>
</div>
</fs-page>
</template>
<script setup lang="ts">
import { reactive } from "vue";
import * as api from "../api";
@ -75,6 +88,9 @@ import * as emailApi from "./api.email";
import { notification } from "ant-design-vue";
import { useSettingStore } from "/src/store/settings";
import * as _ from "lodash-es";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
defineOptions({
name: "EmailSetting",
});
@ -115,10 +131,11 @@ const onFinish = async (form: any) => {
console.log("Success:", form);
await api.EmailSettingsSave(form);
notification.success({
message: "保存成功",
message: t("certd.saveSuccess"),
});
};
const onFinishFailed = (errorInfo: any) => {
// console.log("Failed:", errorInfo);
};
@ -140,13 +157,14 @@ async function onTestSend() {
try {
await emailApi.TestSend(testFormState.receiver);
notification.success({
message: "发送成功",
message: t("certd.sendSuccess"),
});
} finally {
testFormState.loading = false;
}
}
const settingStore = useSettingStore();
</script>
@ -155,6 +173,7 @@ const settingStore = useSettingStore();
.email-form-box {
display: flex;
}
.email-form {
width: 500px;
margin: 20px;

View File

@ -1,54 +1,59 @@
<template>
<div class="sys-settings-form sys-settings-base">
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish" @finish-failed="onFinishFailed">
<a-form-item label="ICP备案号" :name="['public', 'icpNo']">
<a-input v-model:value="formState.public.icpNo" placeholder="粤ICP备xxxxxxx号" />
<a-form :model="formState" name="basic" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off"
@finish="onFinish" @finish-failed="onFinishFailed">
<a-form-item :label="t('certd.icpRegistrationNumber')" :name="['public', 'icpNo']">
<a-input v-model:value="formState.public.icpNo" :placeholder="t('certd.icpPlaceholder')" />
</a-form-item>
<a-form-item label="网安备案号" :name="['public', 'mpsNo']">
<a-input v-model:value="formState.public.mpsNo" placeholder="京公网安备xxxxxxx号" />
<a-form-item :label="t('certd.publicSecurityRegistrationNumber')" :name="['public', 'mpsNo']">
<a-input v-model:value="formState.public.mpsNo" :placeholder="t('certd.publicSecurityPlaceholder')" />
</a-form-item>
<a-form-item label="开启小助手" :name="['public', 'aiChatEnabled']">
<a-form-item :label="t('certd.enableAssistant')" :name="['public', 'aiChatEnabled']">
<a-switch v-model:checked="formState.public.aiChatEnabled" />
</a-form-item>
<a-form-item label="允许爬虫" :name="['public', 'robots']">
<a-form-item :label="t('certd.allowCrawlers')" :name="['public', 'robots']">
<a-switch v-model:checked="formState.public.robots" />
</a-form-item>
<a-form-item label="HTTP代理" :name="['private', 'httpProxy']" :rules="urlRules">
<a-input v-model:value="formState.private.httpProxy" placeholder="http://192.168.1.2:18010/" />
<div class="helper">当某些网站被墙时可以配置</div>
<a-form-item :label="t('certd.httpProxy')" :name="['private', 'httpProxy']" :rules="urlRules">
<a-input v-model:value="formState.private.httpProxy" :placeholder="t('certd.httpProxyPlaceholder')" />
<div class="helper">{{ t('certd.httpProxyHelper') }}</div>
</a-form-item>
<a-form-item label="HTTPS代理" :name="['private', 'httpsProxy']" :rules="urlRules">
<a-form-item :label="t('certd.httpsProxy')" :name="['private', 'httpsProxy']" :rules="urlRules">
<div class="flex">
<a-input v-model:value="formState.private.httpsProxy" placeholder="http://192.168.1.2:18010/" />
<a-button class="ml-5" type="primary" :loading="testProxyLoading" title="保存后,再点击测试" @click="testProxy"></a-button>
<a-input v-model:value="formState.private.httpsProxy"
:placeholder="t('certd.httpsProxyPlaceholder')" />
<a-button class="ml-5" type="primary" :loading="testProxyLoading"
:title="t('certd.saveThenTestTitle')" @click="testProxy">{{ t('certd.testButton') }}</a-button>
</div>
<div class="helper">一般这两个代理填一样的保存后再测试</div>
<div class="helper">{{ t('certd.httpsProxyHelper') }}</div>
</a-form-item>
<a-form-item label="双栈网络" :name="['private', 'dnsResultOrder']">
<a-form-item :label="t('certd.dualStackNetwork')" :name="['private', 'dnsResultOrder']">
<a-select v-model:value="formState.private.dnsResultOrder">
<a-select-option value="verbatim">默认</a-select-option>
<a-select-option value="ipv4first">IPV4优先</a-select-option>
<a-select-option value="ipv6first">IPV6优先</a-select-option>
<a-select-option value="verbatim">{{ t('certd.default') }}</a-select-option>
<a-select-option value="ipv4first">{{ t('certd.ipv4Priority') }}</a-select-option>
<a-select-option value="ipv6first">{{ t('certd.ipv6Priority') }}</a-select-option>
</a-select>
<div class="helper">如果选择IPv6优先需要在docker-compose.yaml中启用ipv6</div>
<div class="helper">{{ t('certd.dualStackNetworkHelper') }}</div>
</a-form-item>
<a-form-item label="启用公共CNAME服务" :name="['private', 'commonCnameEnabled']">
<a-form-item :label="t('certd.enableCommonCnameService')" :name="['private', 'commonCnameEnabled']">
<a-switch v-model:checked="formState.private.commonCnameEnabled" />
<div class="helper">是否可以使用公共CNAME服务如果禁用且没有设置<router-link to="/sys/cname/provider">自定义CNAME服务</router-link>使CNAME</div>
<div class="helper" v-html="t('certd.commonCnameHelper')"></div>
</a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
<a-button :loading="saveLoading" type="primary" html-type="submit">保存</a-button>
<a-button :loading="saveLoading" type="primary" html-type="submit">{{ t('certd.saveButton')
}}</a-button>
</a-form-item>
</a-form>
</div>
</template>
<script setup lang="tsx">
import { reactive, ref } from "vue";
import { SysSettings } from "/@/views/sys/settings/api";
@ -57,6 +62,9 @@ import { merge } from "lodash-es";
import { useSettingStore } from "/@/store/settings";
import { notification } from "ant-design-vue";
import { util } from "/@/utils";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
defineOptions({
name: "SettingBase",
@ -89,13 +97,14 @@ const onFinish = async (form: any) => {
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: "保存成功",
message: t('certd.saveSuccess'),
});
} finally {
saveLoading.value = false;
}
};
const onFinishFailed = (errorInfo: any) => {
// console.log("Failed:", errorInfo);
};
@ -103,7 +112,7 @@ const onFinishFailed = (errorInfo: any) => {
async function stopOtherUserTimer() {
await api.stopOtherUserTimer();
notification.success({
message: "停止成功",
message: t('certd.stopSuccess'),
});
}
@ -119,28 +128,28 @@ async function testProxy() {
const content = () => {
return (
<div>
<div>Google: {res.google === true ? "成功" : util.maxLength(res.google)}</div>
<div>Baidu: {res.baidu === true ? "成功" : util.maxLength(res.google)}</div>
<div>{t('certd.google')}: {res.google === true ? t('certd.success') : util.maxLength(res.google)}</div>
<div>{t('certd.baidu')}: {res.baidu === true ? t('certd.success') : util.maxLength(res.baidu)}</div>
</div>
);
};
if (!success) {
notification.error({
message: "测试失败",
message: t('certd.testFailed'),
description: content,
});
return;
}
notification.success({
message: "测试完成",
message: t('certd.testCompleted'),
description: content,
});
} finally {
testProxyLoading.value = false;
}
}
</script>
<style lang="less">
.sys-settings-base {
}
.sys-settings-base {}
</style>

View File

@ -1,64 +1,75 @@
<template>
<div class="sys-settings-form sys-settings-register">
<a-form :model="formState" name="register" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off" @finish="onFinish">
<a-form-item label="管理其他用户流水线" :name="['public', 'managerOtherUserPipeline']">
<a-form :model="formState" name="register" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"
autocomplete="off" @finish="onFinish">
<a-form-item :label="t('certd.manageOtherUserPipeline')" :name="['public', 'managerOtherUserPipeline']">
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item label="限制用户流水线数量" :name="['public', 'limitUserPipelineCount']">
<a-form-item :label="t('certd.limitUserPipelineCount')" :name="['public', 'limitUserPipelineCount']">
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">0为不限制</div>
<div class="helper">{{ t('certd.limitUserPipelineCountHelper') }}</div>
</a-form-item>
<a-form-item label="开启自助注册" :name="['public', 'registerEnabled']">
<a-form-item :label="t('certd.enableSelfRegistration')" :name="['public', 'registerEnabled']">
<a-switch v-model:checked="formState.public.registerEnabled" />
</a-form-item>
<a-form-item label="开启用户有效期" :name="['public', 'userValidTimeEnabled']">
<a-form-item :label="t('certd.enableUserValidityPeriod')" :name="['public', 'userValidTimeEnabled']">
<div class="flex-o">
<a-switch v-model:checked="formState.public.userValidTimeEnabled" :disabled="!settingsStore.isPlus" />
<a-switch v-model:checked="formState.public.userValidTimeEnabled"
:disabled="!settingsStore.isPlus" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">有效期内用户可正常使用失效后流水线将被停用</div>
<div class="helper">{{ t('certd.userValidityPeriodHelper') }}</div>
</a-form-item>
<template v-if="formState.public.registerEnabled">
<a-form-item label="开启用户名注册" :name="['public', 'usernameRegisterEnabled']">
<a-form-item :label="t('certd.enableUsernameRegistration')"
:name="['public', 'usernameRegisterEnabled']">
<a-switch v-model:checked="formState.public.usernameRegisterEnabled" />
</a-form-item>
<a-form-item label="开启邮箱注册" :name="['public', 'emailRegisterEnabled']">
<a-form-item :label="t('certd.enableEmailRegistration')" :name="['public', 'emailRegisterEnabled']">
<div class="flex-o">
<a-switch v-model:checked="formState.public.emailRegisterEnabled" :disabled="!settingsStore.isPlus" title="专业版功能" />
<a-switch v-model:checked="formState.public.emailRegisterEnabled"
:disabled="!settingsStore.isPlus" :title="t('certd.proFeature')" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">需要<router-link to="/sys/settings/email">设置邮箱服务器</router-link></div>
<div class="helper">
<router-link to="/sys/settings/email">{{ t('certd.emailServerSetup') }}</router-link>
</div>
</a-form-item>
<a-form-item label="开启手机号登录、注册" :name="['public', 'smsLoginEnabled']">
<a-form-item :label="t('certd.enableSmsLoginRegister')" :name="['public', 'smsLoginEnabled']">
<div class="flex-o">
<a-switch v-model:checked="formState.public.smsLoginEnabled" :disabled="!settingsStore.isComm" title="商业版功能" />
<a-switch v-model:checked="formState.public.smsLoginEnabled" :disabled="!settingsStore.isComm"
:title="t('certd.commFeature')" />
<vip-button class="ml-5" mode="comm"></vip-button>
</div>
</a-form-item>
<template v-if="formState.public.smsLoginEnabled">
<a-form-item label="短信提供商" :name="['private', 'sms', 'type']">
<a-form-item :label="t('certd.smsProvider')" :name="['private', 'sms', 'type']">
<a-select v-model:value="formState.private.sms.type" @change="smsTypeChange">
<a-select-option value="aliyun">阿里云短信</a-select-option>
<a-select-option value="yfysms">易发云短信</a-select-option>
<a-select-option value="aliyun">{{ t('certd.aliyunSms') }}</a-select-option>
<a-select-option value="yfysms">{{ t('certd.yfySms') }}</a-select-option>
</a-select>
</a-form-item>
<template v-for="item of smsTypeDefineInputs" :key="item.simpleKey">
<fs-form-item v-model="formState.private.sms.config[item.simpleKey]" :path="'private.sms.config' + item.key" :item="item" />
<fs-form-item v-model="formState.private.sms.config[item.simpleKey]"
:path="'private.sms.config' + item.key" :item="item" />
</template>
<a-form-item label="短信测试">
<a-form-item :label="t('certd.smsTest')">
<div class="flex">
<a-input v-model:value="testMobile" placeholder="输入测试手机号" />
<loading-button class="ml-5" title="保存后再点击测试" type="primary" :click="testSendSms">测试</loading-button>
<a-input v-model:value="testMobile" :placeholder="t('certd.testMobilePlaceholder')" />
<loading-button class="ml-5" :title="t('certd.saveThenTest')" type="primary"
:click="testSendSms">{{
t('certd.testButton') }}</loading-button>
</div>
<div class="helper">保存后再点击测试</div>
<div class="helper">{{ t('certd.saveThenTest') }}</div>
</a-form-item>
</template>
</template>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<a-button :loading="saveLoading" type="primary" html-type="submit">保存</a-button>
<a-button :loading="saveLoading" type="primary" html-type="submit">{{ t('certd.saveButton')
}}</a-button>
</a-form-item>
</a-form>
</div>
@ -71,6 +82,9 @@ import * as api from "/@/views/sys/settings/api";
import { merge } from "lodash-es";
import { useSettingStore } from "/@/store/settings";
import { notification } from "ant-design-vue";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
defineOptions({
name: "SettingRegister",
@ -80,7 +94,7 @@ const testMobile = ref("");
async function testSendSms() {
if (!testMobile.value) {
notification.error({
message: "请输入测试手机号",
message: t('certd.enterTestMobile'),
});
return;
}
@ -88,9 +102,10 @@ async function testSendSms() {
mobile: testMobile.value,
});
notification.success({
message: "发送成功",
message: t('certd.sendSuccess'),
});
}
const formState = reactive<Partial<SysSettings>>({
public: {
registerEnabled: false,
@ -107,7 +122,7 @@ const rules = {
leastOneLogin: {
validator: (rule: any, value: any) => {
if (!formState.public.passwordLoginEnabled && !formState.public.smsLoginEnabled) {
return Promise.reject("密码登录和手机号登录至少开启一个");
return Promise.reject(t('certd.atLeastOneLoginRequired'));
}
return Promise.resolve();
},
@ -115,10 +130,11 @@ const rules = {
required: {
required: true,
trigger: "change",
message: "此项必填",
message: t('certd.fieldRequired'),
},
};
async function smsTypeChange(value: string) {
if (formState.private?.sms?.config) {
formState.private.sms.config = {};
@ -180,7 +196,7 @@ const onFinish = async (form: any) => {
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: "保存成功",
message: t('certd.saveSuccess'),
});
} finally {
saveLoading.value = false;
@ -188,6 +204,5 @@ const onFinish = async (form: any) => {
};
</script>
<style lang="less">
.sys-settings-site {
}
.sys-settings-site {}
</style>

View File

@ -1,54 +1,63 @@
<template>
<div class="sys-settings-form sys-settings-safe">
<a-form ref="formRef" :model="formState" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
<h2>站点隐藏</h2>
<a-form-item label="启用站点隐藏" :name="['hidden', 'enabled']" :required="true">
<a-form ref="formRef" :model="formState" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }"
autocomplete="off">
<h2>{{ t('certd.siteHide') }}</h2>
<a-form-item :label="t('certd.enableSiteHide')" :name="['hidden', 'enabled']" :required="true">
<div class="flex">
<a-switch v-model:checked="formState.hidden.enabled" />
</div>
<div class="helper">
可以在平时关闭站点的可访问性需要时再打开增强站点安全性
<a href="https://certd.docmirror.cn/guide/feature/safe/hidden" class="flex items-center" target="_blank">
<span>帮助说明</span>
<fs-icon class="ml-1" icon="mingcute:question-line"></fs-icon
></a>
{{ t('certd.siteHideDescription') }}
<a href="https://certd.docmirror.cn/guide/feature/safe/hidden" class="flex items-center"
target="_blank">
<span>{{ t('certd.helpDoc') }}</span>
<fs-icon class="ml-1" icon="mingcute:question-line"></fs-icon></a>
</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="随机地址" :name="['hidden', 'openPath']" :required="true">
<a-form-item v-if="formState.hidden.enabled" :label="t('certd.randomAddress')"
:name="['hidden', 'openPath']" :required="true">
<a-input-search v-model:value="formState.hidden.openPath" :allow-clear="true" @search="changeOpenPath">
<template #enterButton>
<fs-icon icon="ion:refresh"></fs-icon>
</template>
</a-input-search>
<div class="helper">站点被隐藏后需要访问此URL解锁才能正常访问</div>
<div class="helper">{{ t('certd.siteHideUrlHelper') }}</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="完整解除隐藏地址" :name="['hidden', 'openPath']" :required="true">
<a-form-item v-if="formState.hidden.enabled" :label="t('certd.fullUnlockUrl')"
:name="['hidden', 'openPath']" :required="true">
<div class="flex"><fs-copyable v-model="openUrl" class="flex-inline"></fs-copyable></div>
<div class="helper red">请保存好此地址</div>
<div class="helper red">{{ t('certd.saveThisUrl') }}</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="解除密码" :name="['hidden', 'openPassword']" :required="false">
<a-form-item v-if="formState.hidden.enabled" :label="t('certd.unlockPassword')"
:name="['hidden', 'openPassword']" :required="false">
<a-input-password v-model:value="formState.hidden.openPassword" :allow-clear="true" />
<div class="helper">解除隐藏时需要输入密码第一次需要设置密码填写则重置密码</div>
<div class="helper">{{ t('certd.unlockPasswordHelper') }}</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="自动隐藏时间" :name="['hidden', 'autoHiddenTimes']" :required="true">
<a-form-item v-if="formState.hidden.enabled" :label="t('certd.autoHideTime')"
:name="['hidden', 'autoHiddenTimes']" :required="true">
<a-input-number v-model:value="formState.hidden.autoHiddenTimes" :allow-clear="true" />
<div class="helper">多少分钟内无请求自动隐藏</div>
<div class="helper">{{ t('certd.autoHideTimeHelper') }}</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="隐藏开放接口" :name="['hidden', 'hiddenOpenApi']" :required="true">
<a-form-item v-if="formState.hidden.enabled" :label="t('certd.hideOpenApi')"
:name="['hidden', 'hiddenOpenApi']" :required="true">
<a-switch v-model:checked="formState.hidden.hiddenOpenApi" />
<div class="helper">是否隐藏开放接口是否放开/api/v1开头的接口</div>
<div class="helper">{{ t('certd.hideOpenApiHelper') }}</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="立即隐藏站点">
<loading-button class="ml-1" type="primary" html-type="button" :click="doHiddenImmediate">立即隐藏</loading-button>
<a-form-item v-if="formState.hidden.enabled" :label="t('certd.hideSiteImmediately')">
<loading-button class="ml-1" type="primary" html-type="button" :click="doHiddenImmediate">{{
t('certd.hideImmediately') }}</loading-button>
</a-form-item>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<loading-button type="primary" html-type="button" :click="onClick">保存</loading-button>
<loading-button type="primary" html-type="button" :click="onClick">{{ t('certd.save')
}}</loading-button>
</a-form-item>
</a-form>
</div>
</template>
<script setup lang="tsx">
import { computed, reactive, ref } from "vue";
import { merge } from "lodash-es";
@ -56,6 +65,9 @@ import { Modal, notification } from "ant-design-vue";
import { request } from "/@/api/service";
import { util, utils } from "/@/utils";
import { useSettingStore } from "/@/store/settings";
import { useI18n } from "vue-i18n";
const { t } = useI18n();
defineOptions({
name: "SettingSafe",
});
@ -138,24 +150,24 @@ const onClick = async () => {
await api.SettingSave(form);
await loadSettings();
notification.success({
message: "保存成功",
message: t('certd.saveSuccess'),
});
};
async function doHiddenImmediate() {
Modal.confirm({
title: "确定要立即隐藏站点吗?",
content: "隐藏后,将无法访问站点,请谨慎操作",
title: t('certd.confirmHideSiteTitle'),
content: t('certd.confirmHideSiteContent'),
async onOk() {
await api.HiddenImmediate();
notification.success({
message: "站点已隐藏",
message: t('certd.siteHiddenSuccess'),
});
},
});
}
</script>
<style lang="less">
.sys-settings-base {
}
.sys-settings-base {}
</style>