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,353 +7,354 @@ import { Modal, notification } from "ant-design-vue";
import { useSiteIpMonitor } from "/@/views/certd/monitor/site/ip/use";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const api = siteIpApi;
const { t } = useI18n();
const api = siteIpApi;
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
if (!query.query) {
query.query = {};
}
query.query.siteId = context.props.siteId;
return await api.GetList(query);
};
const editRequest = async (req: EditReq) => {
const { form, row } = req;
form.id = row.id;
const res = await api.UpdateObj(form);
return res;
};
const delRequest = async (req: DelReq) => {
const { row } = req;
return await api.DelObj(row.id);
};
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
if (!query.query) {
query.query = {};
}
query.query.siteId = context.props.siteId;
return await api.GetList(query);
};
const editRequest = async (req: EditReq) => {
const { form, row } = req;
form.id = row.id;
const res = await api.UpdateObj(form);
return res;
};
const delRequest = async (req: DelReq) => {
const { row } = req;
return await api.DelObj(row.id);
};
const addRequest = async (req: AddReq) => {
const { form } = req;
form.siteId = context.props.siteId;
const res = await api.AddObj(form);
return res;
};
const addRequest = async (req: AddReq) => {
const { form } = req;
form.siteId = context.props.siteId;
const res = await api.AddObj(form);
return res;
};
const checkStatusDict = dict({
data: [
{ label: "成功", value: "ok", color: "green" },
{ label: "检查中", value: "checking", color: "blue" },
{ label: "异常", value: "error", color: "red" },
],
});
const { openSiteIpImportDialog } = useSiteIpMonitor();
return {
crudOptions: {
request: {
pageRequest,
addRequest,
editRequest,
delRequest,
},
form: {
labelCol: {
//固定label宽度
span: null,
style: {
width: "100px",
},
},
col: {
span: 22,
},
wrapper: {
width: 600,
},
},
actionbar: {
buttons: {
add: {
async click() {
await crudExpose.openAdd({});
},
},
import: {
show: true,
text: "批量导入",
type: "primary",
async click() {
openSiteIpImportDialog({
siteId: context.props.siteId,
afterSubmit() {
crudExpose.doRefresh();
},
});
},
},
load: {
text: "同步IP",
type: "primary",
async click() {
Modal.confirm({
title: "同步IP",
content: "确定要同步IP吗",
onOk: async () => {
await api.DoSync(context.props.siteId);
await crudExpose.doRefresh();
notification.success({
message: "同步完成",
});
},
});
},
},
checkAll: {
text: "检查全部",
type: "primary",
click: () => {
Modal.confirm({
title: "确认",
content: "确认触发检查全部IP站点的证书吗?",
onOk: async () => {
await siteIpApi.CheckAll(context.props.siteId);
notification.success({
message: "检查任务已提交",
description: "请稍后刷新页面查看结果",
});
},
});
},
},
},
},
rowHandle: {
fixed: "right",
width: 240,
buttons: {
check: {
order: 0,
type: "link",
text: null,
tooltip: {
title: "立即检查",
},
icon: "ion:play-sharp",
click: async ({ row }) => {
await api.DoCheck(row.id);
await crudExpose.doRefresh();
notification.success({
message: "检查任务已提交,请稍后刷新查看结果",
});
},
},
},
},
columns: {
id: {
title: "ID",
key: "id",
type: "number",
search: {
show: false,
},
column: {
width: 80,
align: "center",
},
form: {
show: false,
},
},
ipAddress: {
title: "IP",
search: {
show: true,
},
type: "text",
helper: "也支持填写CNAME域名",
form: {
rules: [{ required: true, message: "请输入IP" }],
},
column: {
width: 160,
},
},
certDomains: {
title: "证书域名",
search: {
show: false,
},
type: "text",
form: {
show: false,
},
column: {
width: 200,
sorter: true,
show: false,
cellRender({ value }) {
return (
<a-tooltip title={value} placement="left">
{value}
</a-tooltip>
);
},
},
},
certProvider: {
title: "颁发机构",
search: {
show: false,
},
type: "text",
form: {
show: false,
},
column: {
width: 200,
show: false,
sorter: true,
cellRender({ value }) {
return <a-tooltip title={value}>{value}</a-tooltip>;
},
},
},
certStatus: {
title: "证书状态",
search: {
show: true,
},
type: "dict-select",
dict: dict({
data: [
{ label: "正常", value: "ok", color: "green" },
{ label: "过期", value: "expired", color: "red" },
],
}),
form: {
show: false,
},
column: {
width: 100,
sorter: true,
show: true,
align: "center",
},
},
certExpiresTime: {
title: "证书到期时间",
search: {
show: false,
},
type: "date",
form: {
show: false,
},
column: {
sorter: true,
cellRender({ value }) {
if (!value) {
return "-";
}
const expireDate = dayjs(value).format("YYYY-MM-DD");
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}`} />;
},
},
},
checkStatus: {
title: "检查状态",
search: {
show: false,
},
type: "dict-select",
dict: checkStatusDict,
form: {
show: false,
},
column: {
width: 100,
align: "center",
sorter: true,
cellRender({ value, row, key }) {
return (
<a-tooltip title={row.error}>
<fs-values-format v-model={value} dict={checkStatusDict}></fs-values-format>
</a-tooltip>
);
},
},
},
lastCheckTime: {
title: "上次检查时间",
search: {
show: false,
},
type: "datetime",
form: {
show: false,
},
column: {
sorter: true,
width: 155,
},
},
from: {
title: "来源",
search: {
show: false,
},
type: "dict-switch",
dict: dict({
data: [
{ label: "同步", value: "sync", color: "green" },
{ label: "手动", value: "manual", color: "blue" },
{ label: "导入", value: "import", color: "blue" },
],
}),
form: {
value: false,
},
column: {
width: 100,
sorter: true,
align: "center",
},
},
disabled: {
title: "禁用启用",
search: {
show: false,
},
type: "dict-switch",
dict: dict({
data: [
{ label: "启用", value: false, color: "green" },
{ label: "禁用", value: true, color: "red" },
],
}),
form: {
value: false,
},
column: {
width: 100,
sorter: true,
align: "center",
},
},
remark: {
title: "备注",
search: {
show: false,
},
type: "text",
form: {
show: false,
},
column: {
width: 200,
sorter: true,
tooltip: true,
},
},
},
},
};
const checkStatusDict = dict({
data: [
{ 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();
return {
crudOptions: {
request: {
pageRequest,
addRequest,
editRequest,
delRequest,
},
form: {
labelCol: {
//固定label宽度
span: null,
style: {
width: "100px",
},
},
col: {
span: 22,
},
wrapper: {
width: 600,
},
},
actionbar: {
buttons: {
add: {
async click() {
await crudExpose.openAdd({});
},
},
import: {
show: true,
text: t("certd.actionImportBatch"),
type: "primary",
async click() {
openSiteIpImportDialog({
siteId: context.props.siteId,
afterSubmit() {
crudExpose.doRefresh();
},
});
},
},
load: {
text: t("certd.actionSyncIp"),
type: "primary",
async click() {
Modal.confirm({
title: t("certd.modalTitleSyncIp"),
content: t("certd.modalContentSyncIp"),
onOk: async () => {
await api.DoSync(context.props.siteId);
await crudExpose.doRefresh();
notification.success({
message: t("certd.notificationSyncComplete"),
});
},
});
},
},
checkAll: {
text: t("certd.actionCheckAll"),
type: "primary",
click: () => {
Modal.confirm({
title: t("certd.modalTitleConfirm"),
content: t("certd.modalContentCheckAll"),
onOk: async () => {
await siteIpApi.CheckAll(context.props.siteId);
notification.success({
message: t("certd.notificationCheckSubmitted"),
description: t("certd.notificationCheckDescription"),
});
},
});
},
},
},
},
rowHandle: {
fixed: "right",
width: 240,
buttons: {
check: {
order: 0,
type: "link",
text: null,
tooltip: {
title: t("certd.tooltipCheckNow"),
},
icon: "ion:play-sharp",
click: async ({ row }) => {
await api.DoCheck(row.id);
await crudExpose.doRefresh();
notification.success({
message: t("certd.notificationCheckSubmittedPleaseRefresh"),
});
},
},
},
},
columns: {
id: {
title: t("certd.columnId"),
key: "id",
type: "number",
search: {
show: false,
},
column: {
width: 80,
align: "center",
},
form: {
show: false,
},
},
ipAddress: {
title: t("certd.columnIp"),
search: {
show: true,
},
type: "text",
helper: t("certd.helperIpCname"),
form: {
rules: [{ required: true, message: t("certd.ruleIpRequired") }],
},
column: {
width: 160,
},
},
certDomains: {
title: t("certd.columnCertDomains"),
search: {
show: false,
},
type: "text",
form: {
show: false,
},
column: {
width: 200,
sorter: true,
show: false,
cellRender({ value }) {
return (
<a-tooltip title={value} placement="left">
{value}
</a-tooltip>
);
},
},
},
certProvider: {
title: t("certd.columnCertProvider"),
search: {
show: false,
},
type: "text",
form: {
show: false,
},
column: {
width: 200,
show: false,
sorter: true,
cellRender({ value }) {
return <a-tooltip title={value}>{value}</a-tooltip>;
},
},
},
certStatus: {
title: t("certd.columnCertStatus"),
search: {
show: true,
},
type: "dict-select",
dict: dict({
data: [
{ label: t("certd.statusNormal"), value: "ok", color: "green" },
{ label: t("certd.statusExpired"), value: "expired", color: "red" },
],
}),
form: {
show: false,
},
column: {
width: 100,
sorter: true,
show: true,
align: "center",
},
},
certExpiresTime: {
title: t("certd.columnCertExpiresTime"),
search: {
show: false,
},
type: "date",
form: {
show: false,
},
column: {
sorter: true,
cellRender({ value }) {
if (!value) {
return "-";
}
const expireDate = dayjs(value).format("YYYY-MM-DD");
const leftDays = dayjs(value).diff(dayjs(), "day");
const color = leftDays < 20 ? "red" : "#389e0d";
const percent = (leftDays / 90) * 100;
return <a-progress title={expireDate + " " + t("certd.expired")} percent={percent} strokeColor={color} format={(percent: number) => `${leftDays} ${t("certd.days")}`} />;
},
},
},
checkStatus: {
title: t("certd.columnCheckStatus"),
search: {
show: false,
},
type: "dict-select",
dict: checkStatusDict,
form: {
show: false,
},
column: {
width: 100,
align: "center",
sorter: true,
cellRender({ value, row, key }) {
return (
<a-tooltip title={row.error}>
<fs-values-format v-model={value} dict={checkStatusDict}></fs-values-format>
</a-tooltip>
);
},
},
},
lastCheckTime: {
title: t("certd.columnLastCheckTime"),
search: {
show: false,
},
type: "datetime",
form: {
show: false,
},
column: {
sorter: true,
width: 155,
},
},
from: {
title: t("certd.columnSource"),
search: {
show: false,
},
type: "dict-switch",
dict: dict({
data: [
{ 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: {
value: false,
},
column: {
width: 100,
sorter: true,
align: "center",
},
},
disabled: {
title: t("certd.columnDisabled"),
search: {
show: false,
},
type: "dict-switch",
dict: dict({
data: [
{ label: t("certd.enabled"), value: false, color: "green" },
{ label: t("certd.disabled"), value: true, color: "red" },
],
}),
form: {
value: false,
},
column: {
width: 100,
sorter: true,
align: "center",
},
},
remark: {
title: t("certd.columnRemark"),
search: {
show: false,
},
type: "text",
form: {
show: false,
},
column: {
width: 200,
sorter: true,
tooltip: true,
},
},
},
},
};
}

View File

@ -1,150 +1,152 @@
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 pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
const list = await api.GetTree();
const { t } = useI18n();
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
const list = await api.GetTree();
return {
offset: 0,
records: list,
total: 10000,
limit: 10000
};
};
return {
offset: 0,
records: list,
total: 10000,
limit: 10000
};
};
async function afterChange() {
await permissionTreeDict.reloadDict();
}
const editRequest = async ({ form, row }: EditReq) => {
form.id = row.id;
const ret = await api.UpdateObj(form);
await afterChange();
return ret;
};
const delRequest = async ({ row }: DelReq) => {
const ret = await api.DelObj(row.id);
await afterChange();
return ret;
};
async function afterChange() {
await permissionTreeDict.reloadDict();
}
const editRequest = async ({ form, row }: EditReq) => {
form.id = row.id;
const ret = await api.UpdateObj(form);
await afterChange();
return ret;
};
const delRequest = async ({ row }: DelReq) => {
const ret = await api.DelObj(row.id);
await afterChange();
return ret;
};
const addRequest = async ({ form }: AddReq) => {
const ret = await api.AddObj(form);
await afterChange();
return ret;
};
const permissionTreeDict = dict({
url: "/sys/authority/permission/tree",
isTree: true,
value: "id",
label: "title",
async onReady({ dict }: any) {
dict.setData([{ id: -1, title: "根节点", children: dict.data }]);
}
});
return {
crudOptions: {
request: {
pageRequest,
addRequest,
editRequest,
delRequest
},
actionbar: {
show: false
},
toolbar: {
show: false
},
table: {
show: false
// scroll: { fixed: true }
},
rowHandle: {
fixed: "right"
},
search: {
show: false
},
pagination: {
show: false,
pageSize: 100000
},
columns: {
id: {
title: "id",
type: "number",
form: { show: false }, // 表单配置
column: {
width: 120,
sortable: "custom"
}
},
title: {
title: "权限名称",
type: "text",
form: {
rules: [
{ required: true, message: "请输入权限名称" },
{ max: 50, message: "最大50个字符" }
],
component: {
placeholder: "权限名称"
}
},
column: {
width: 200
}
},
const addRequest = async ({ form }: AddReq) => {
const ret = await api.AddObj(form);
await afterChange();
return ret;
};
const permissionTreeDict = dict({
url: "/sys/authority/permission/tree",
isTree: true,
value: "id",
label: "title",
async onReady({ dict }: any) {
dict.setData([{ id: -1, title: t("certd.rootNode"), children: dict.data }]);
}
});
return {
crudOptions: {
request: {
pageRequest,
addRequest,
editRequest,
delRequest
},
actionbar: {
show: false
},
toolbar: {
show: false
},
table: {
show: false
// scroll: { fixed: true }
},
rowHandle: {
fixed: "right"
},
search: {
show: false
},
pagination: {
show: false,
pageSize: 100000
},
columns: {
id: {
title: "id",
type: "number",
form: { show: false }, // 表单配置
column: {
width: 120,
sortable: "custom"
}
},
title: {
title: t("certd.permissionName"),
type: "text",
form: {
rules: [
{ required: true, message: t("certd.enterPermissionName") },
{ max: 50, message: t("certd.max50Chars") }
],
component: {
placeholder: t("certd.permissionName")
}
},
column: {
width: 200
}
},
permission: {
title: t("certd.permissionCode"),
type: "text",
column: {
width: 170
},
form: {
rules: [
{ required: true, message: t("certd.enterPermissionCode") },
{ max: 100, message: t("certd.max100Chars") }
],
component: {
placeholder: t("certd.examplePermissionCode")
}
}
},
sort: {
title: t("certd.sortOrder"),
type: "number",
column: {
width: 100
},
form: {
value: 100,
rules: [{ required: true, type: "number", message: t("certd.sortRequired") }]
}
},
parentId: {
title: t("certd.parentNode"),
type: "dict-tree",
column: {
width: 100
},
dict: permissionTreeDict,
form: {
value: -1,
component: {
multiple: false,
defaultExpandAll: true,
dict: { cache: false },
fieldNames: {
value: "id",
label: "title"
}
}
}
}
permission: {
title: "权限代码",
type: "text",
column: {
width: 170
},
form: {
rules: [
{ required: true, message: "请输入权限代码" },
{ max: 100, message: "最大100个字符" }
],
component: {
placeholder: "例如:sys:user:view"
}
}
},
sort: {
title: "排序",
type: "number",
column: {
width: 100
},
form: {
value: 100,
rules: [{ required: true, type: "number", message: "排序号必填" }]
}
},
parentId: {
title: "父节点",
type: "dict-tree",
column: {
width: 100
},
dict: permissionTreeDict,
form: {
value: -1,
component: {
multiple: false,
defaultExpandAll: true,
dict: { cache: false },
fieldNames: {
value: "id",
label: "title"
}
}
}
}
}
}
};
}
}
};
}

View File

@ -1,193 +1,194 @@
<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"
>
<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)" />
</div>
</div>
</template>
</a-tree>
<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)" />
</div>
</div>
</template>
</a-tree>
</template>
<script lang="ts">
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",
props: {
/**
* 树形数据
* */
tree: {},
/**
* 是否可编辑
*/
editable: {
default: true
},
actions: {
default: {}
}
} as any,
emits: ["add", "edit", "remove"],
setup(props: any, ctx) {
const treeRef = ref();
const computedTree = computed(() => {
if (props.tree == null) {
return null;
}
const clone = cloneDeep(props.tree);
utils.deepdash.forEachDeep(clone, (value: any, key: any, pNode: any, context: any) => {
if (value == null) {
return;
}
if (!(value instanceof Object) || value instanceof Array) {
return;
}
if (value.class === "is-leaf") {
//
return;
}
value.class = "is-twig";
if (value.children != null && value.children.length > 0) {
return;
}
const parents = context.parents;
if (parents.length < 2) {
return;
}
const parent = parents[parents.length - 2].value;
//parentchildrenchildren
for (const child of parent.children) {
if (child.children != null && child.children.length > 0) {
//childchildren
return;
}
}
// children
parent.class = "is-twig"; //
let i = 0;
for (const child of parent.children) {
child.class = "is-leaf";
if (i !== 0) {
child.class += " leaf-after";
}
i++;
}
});
return [
{
title: "根节点",
id: -1,
children: clone
}
];
});
function add(scope: any) {
ctx.emit("add", scope.dataRef);
}
function edit(scope: any) {
ctx.emit("edit", scope.dataRef);
}
function remove(scope: any) {
ctx.emit("remove", scope.dataRef);
}
function onChecked(a: any, b: any, c: any) {
utils.logger.info("chedcked", a, b, c);
}
function getChecked() {
const checked = treeRef.value.checkedKeys;
const halfChecked = treeRef.value.halfCheckedKeys;
return {
checked,
halfChecked
};
}
return {
computedTree,
add,
edit,
remove,
treeRef,
onChecked,
getChecked
};
}
name: "FsPermissionTree",
props: {
/**
* 树形数据
* */
tree: {},
/**
* 是否可编辑
*/
editable: {
default: true
},
actions: {
default: {}
}
} as any,
emits: ["add", "edit", "remove"],
setup(props: any, ctx) {
const { t } = useI18n();
const treeRef = ref();
const computedTree = computed(() => {
if (props.tree == null) {
return null;
}
const clone = cloneDeep(props.tree);
utils.deepdash.forEachDeep(clone, (value: any, key: any, pNode: any, context: any) => {
if (value == null) {
return;
}
if (!(value instanceof Object) || value instanceof Array) {
return;
}
if (value.class === "is-leaf") {
//
return;
}
value.class = "is-twig";
if (value.children != null && value.children.length > 0) {
return;
}
const parents = context.parents;
if (parents.length < 2) {
return;
}
const parent = parents[parents.length - 2].value;
//parentchildrenchildren
for (const child of parent.children) {
if (child.children != null && child.children.length > 0) {
//childchildren
return;
}
}
// children
parent.class = "is-twig"; //
let i = 0;
for (const child of parent.children) {
child.class = "is-leaf";
if (i !== 0) {
child.class += " leaf-after";
}
i++;
}
});
return [
{
title: t("certd.rootNode"),
id: -1,
children: clone
}
];
});
function add(scope: any) {
ctx.emit("add", scope.dataRef);
}
function edit(scope: any) {
ctx.emit("edit", scope.dataRef);
}
function remove(scope: any) {
ctx.emit("remove", scope.dataRef);
}
function onChecked(a: any, b: any, c: any) {
utils.logger.info("chedcked", a, b, c);
}
function getChecked() {
const checked = treeRef.value.checkedKeys;
const halfChecked = treeRef.value.halfCheckedKeys;
return {
checked,
halfChecked
};
}
return {
computedTree,
add,
edit,
remove,
treeRef,
onChecked,
getChecked,
t
};
}
});
</script>
<style lang="less">
.fs-permission-tree {
.ant-tree-list-holder-inner {
flex-direction: row !important;
flex-wrap: wrap;
.is-twig {
width: 100%;
}
.ant-tree-list-holder-inner {
flex-direction: row !important;
flex-wrap: wrap;
.is-leaf {
//border-bottom: 1px solid #ddd;
&::before {
display: none;
}
.is-twig {
width: 100%;
}
&.leaf-after {
.ant-tree-indent-unit {
display: none;
}
}
.is-leaf {
.node-title-pane {
border-bottom: 1px solid #ddd;
}
}
}
//.is-twig ul {
// display: flex;
// flex-wrap: wrap;
//}
.node-title-pane {
display: flex;
.node-title {
width: 110px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
//border-bottom: 1px solid #ddd;
&::before {
display: none;
}
&.is-editable {
.ant-tree-title {
&:hover {
.node-suffix {
visibility: visible;
}
}
}
&.leaf-after {
.ant-tree-indent-unit {
display: none;
}
}
.node-suffix {
visibility: hidden;
> * {
margin-left: 3px;
}
}
}
.node-title-pane {
border-bottom: 1px solid #ddd;
}
}
}
//.is-twig ul {
// display: flex;
// flex-wrap: wrap;
//}
.node-title-pane {
display: flex;
.node-title {
width: 110px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
&.is-editable {
.ant-tree-title {
&:hover {
.node-suffix {
visibility: visible;
}
}
}
.node-suffix {
visibility: hidden;
>* {
margin-left: 3px;
}
}
}
}
</style>

View File

@ -1,76 +1,81 @@
<template>
<fs-page>
<template #header>
<div class="title">权限管理</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>
添加
</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-crud>
</fs-page>
<fs-page>
<template #header>
<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-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",
components: { FsPermissionTree },
setup() {
// permissioncommonOptionsactionbarrowHandleshow
// ./src/plugin/fast-crud/index.js 75-77
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { permission: "sys:auth:per" } });
name: "AuthorityManager",
components: { FsPermissionTree },
setup() {
// 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 () => {
await crudExpose.doRefresh();
});
onActivated(async () => {
await crudExpose.doRefresh();
});
//
onMounted(async () => {
await crudExpose.doRefresh();
});
onActivated(async () => {
await crudExpose.doRefresh();
});
const { ui } = useUi();
const { ui } = useUi();
//
//
async function addHandle(item: any) {
await crudExpose.openAdd({ row: { parentId: item?.id ?? -1 } });
}
async function editHandle(item: any) {
await crudExpose.openEdit({ row: item });
}
async function removeHandle(item: any) {
await crudExpose.doRemove({ row: { id: item.id }, index: null });
}
async function addHandle(item: any) {
await crudExpose.openAdd({ row: { parentId: item?.id ?? -1 } });
}
async function editHandle(item: any) {
await crudExpose.openEdit({ row: item });
}
async function removeHandle(item: any) {
await crudExpose.doRemove({ row: { id: item.id }, index: null });
}
const { hasPermissions } = usePermission();
const permission = ref({
add: hasPermissions("1sys:auth:per:add"),
edit: hasPermissions("1sys:auth:per:edit"),
remove: hasPermissions("1sys:auth:per:remove"),
});
const { hasPermissions } = usePermission();
const permission = ref({
add: hasPermissions("1sys:auth:per:add"),
edit: hasPermissions("1sys:auth:per:edit"),
remove: hasPermissions("1sys:auth:per:remove"),
});
return {
ui,
crudBinding,
crudRef,
addHandle,
editHandle,
removeHandle,
permission,
};
},
return {
ui,
crudBinding,
crudRef,
addHandle,
editHandle,
removeHandle,
permission,
t
};
},
});
</script>
<style lang="less">
.permission-tree {
margin-left: 20px;
margin-left: 20px;
}
</style>

View File

@ -1,84 +1,86 @@
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 pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
const editRequest = async ({ form, row }: EditReq) => {
form.id = row.id;
return await api.UpdateObj(form);
};
const delRequest = async ({ row }: DelReq) => {
return await api.DelObj(row.id);
};
const { t } = useI18n();
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
const editRequest = async ({ form, row }: EditReq) => {
form.id = row.id;
return await api.UpdateObj(form);
};
const delRequest = async ({ row }: DelReq) => {
return await api.DelObj(row.id);
};
const addRequest = async ({ form }: AddReq) => {
return await api.AddObj(form);
};
return {
crudOptions: {
request: {
pageRequest,
addRequest,
editRequest,
delRequest
},
rowHandle: {
width: 300,
buttons: {
authz: {
type: "link",
text: "授权",
async click(context) {
await authz.authzOpen(context.record.id);
}
}
}
},
columns: {
id: {
title: "id",
type: "text",
form: { show: false }, // 表单配置
column: {
width: 70,
sorter: true
}
},
name: {
title: "角色名称",
type: "text",
search: { show: true },
form: {
rules: [
{ required: true, message: "请输入角色名称" },
{ max: 50, message: "最大50个字符" }
]
}, // 表单配置
column: {
sorter: true
}
},
createTime: {
title: "创建时间",
type: "datetime",
column: {
sorter: true
},
form: {
show: false
}
},
updateTime: {
title: "更新时间",
type: "datetime",
column: {
sorter: true
},
form: { show: false } // 表单配置
}
}
}
};
const addRequest = async ({ form }: AddReq) => {
return await api.AddObj(form);
};
return {
crudOptions: {
request: {
pageRequest,
addRequest,
editRequest,
delRequest
},
rowHandle: {
width: 300,
buttons: {
authz: {
type: "link",
text: "授权",
async click(context) {
await authz.authzOpen(context.record.id);
}
}
}
},
columns: {
id: {
title: "id",
type: "text",
form: { show: false }, // 表单配置
column: {
width: 70,
sorter: true
}
},
name: {
title: t("certd.roleName"),
type: "text",
search: { show: true },
form: {
rules: [
{ required: true, message: t("certd.enterRoleName") },
{ max: 50, message: t("certd.max50Chars") }
]
}, // 表单配置
column: {
sorter: true
}
},
createTime: {
title: t("certd.createTime"),
type: "datetime",
column: {
sorter: true
},
form: {
show: false
}
},
updateTime: {
title: t("certd.updateTime"),
type: "datetime",
column: {
sorter: true
},
form: { show: false } // 表单配置
}
}
}
};
}

View File

@ -1,15 +1,18 @@
<template>
<fs-page>
<template #header>
<div class="title">角色管理</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>
</fs-page>
<fs-page>
<template #header>
<div class="title">{{ t("certd.roleManagement") }}</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding" />
<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,103 +22,106 @@ 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();
const checkedKeys = ref();
const permissionTreeData = ref();
const permissionTreeData = ref();
const permissionTreeRef = ref();
const authzDialogVisible = ref(false);
const permissionTreeRef = ref();
const authzDialogVisible = ref(false);
const currentRoleId = ref();
const currentRoleId = ref();
// tree
// tree
function getAllCheckedLeafNodeId(tree: any, checkedIds: any, temp: any) {
for (let i = 0; i < tree.length; i++) {
const item = tree[i];
if (item.children && item.children.length !== 0) {
getAllCheckedLeafNodeId(item.children, checkedIds, temp);
} else {
if (checkedIds.indexOf(item.id) !== -1) {
temp.push(item.id);
}
}
}
return temp;
}
function authzClose() {
authzDialogVisible.value = false;
}
async function authzOpen(roleId: any) {
permissionTreeData.value = await permissionApi.GetTree();
checkedKeys.value = [];
currentRoleId.value = roleId;
// this.treeData = ret.data
await updateChecked(roleId);
authzDialogVisible.value = true;
}
async function updateChecked(roleId: any) {
let checkedIds = await api.getPermissionIds(roleId);
//
checkedIds = getAllCheckedLeafNodeId(permissionTreeData.value, checkedIds, []);
checkedKeys.value = checkedIds;
}
async function updatePermission() {
const roleId = currentRoleId.value;
const { checked, halfChecked } = permissionTreeRef.value.getChecked();
const allChecked = [...checked, ...halfChecked];
await api.DoAuthz(roleId, allChecked);
authzClose();
//await updateChecked(roleId);
// tree
// tree
function getAllCheckedLeafNodeId(tree: any, checkedIds: any, temp: any) {
for (let i = 0; i < tree.length; i++) {
const item = tree[i];
if (item.children && item.children.length !== 0) {
getAllCheckedLeafNodeId(item.children, checkedIds, temp);
} else {
if (checkedIds.indexOf(item.id) !== -1) {
temp.push(item.id);
}
}
}
return temp;
}
function authzClose() {
authzDialogVisible.value = false;
}
async function authzOpen(roleId: any) {
permissionTreeData.value = await permissionApi.GetTree();
checkedKeys.value = [];
currentRoleId.value = roleId;
// this.treeData = ret.data
await updateChecked(roleId);
authzDialogVisible.value = true;
}
async function updateChecked(roleId: any) {
let checkedIds = await api.getPermissionIds(roleId);
//
checkedIds = getAllCheckedLeafNodeId(permissionTreeData.value, checkedIds, []);
checkedKeys.value = checkedIds;
}
async function updatePermission() {
const roleId = currentRoleId.value;
const { checked, halfChecked } = permissionTreeRef.value.getChecked();
const allChecked = [...checked, ...halfChecked];
await api.DoAuthz(roleId, allChecked);
authzClose();
//await updateChecked(roleId);
message.success("授权成功");
}
message.success("授权成功");
}
return {
authzOpen,
updatePermission,
authzDialogVisible,
permissionTreeData,
checkedKeys,
permissionTreeRef,
};
return {
authzOpen,
updatePermission,
authzDialogVisible,
permissionTreeData,
checkedKeys,
permissionTreeRef,
};
}
export default defineComponent({
name: "RoleManager",
components: { FsPermissionTree },
setup() {
//
const authz = useAuthz();
const permission: UseCrudPermissionCompProps = {
prefix: "sys:auth:role", //
extra: ({ hasActionPermission }: UseCrudPermissionExtraProps): any => {
//
return { rowHandle: { buttons: { authz: { show: hasActionPermission("authz") } } } };
},
};
name: "RoleManager",
components: { FsPermissionTree },
setup() {
//
const { t } = useI18n();
const authz = useAuthz();
const permission: UseCrudPermissionCompProps = {
prefix: "sys:auth:role", //
extra: ({ hasActionPermission }: UseCrudPermissionExtraProps): any => {
//
return { rowHandle: { buttons: { authz: { show: hasActionPermission("authz") } } } };
},
};
// crud
// permissioncommonOptionsactionbarrowHandleshow
// ./src/plugin/fast-crud/index.js 75-77
// crud
// permissioncommonOptionsactionbarrowHandleshow
// ./src/plugin/fast-crud/index.js 75-77
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { authz, permission } });
const { crudBinding, crudRef, crudExpose } = useFs({ createCrudOptions, context: { authz, permission } });
//
onMounted(() => {
crudExpose.doRefresh();
});
//
onMounted(() => {
crudExpose.doRefresh();
});
onActivated(async () => {
await crudExpose.doRefresh();
});
return {
crudBinding,
crudRef,
...authz,
};
},
onActivated(async () => {
await crudExpose.doRefresh();
});
return {
crudBinding,
crudRef,
...authz,
t
};
},
});
</script>

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

@ -8,244 +8,244 @@ import { useSettingStore } from "/@/store/settings";
import { Modal } from "ant-design-vue";
export default function ({ crudExpose, context }: CreateCrudOptionsProps): CreateCrudOptionsRet {
const router = useRouter();
const { t } = useI18n();
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
const editRequest = async ({ form, row }: EditReq) => {
form.id = row.id;
const res = await api.UpdateObj(form);
return res;
};
const delRequest = async ({ row }: DelReq) => {
return await api.DelObj(row.id);
};
const router = useRouter();
const { t } = useI18n();
const pageRequest = async (query: UserPageQuery): Promise<UserPageRes> => {
return await api.GetList(query);
};
const editRequest = async ({ form, row }: EditReq) => {
form.id = row.id;
const res = await api.UpdateObj(form);
return res;
};
const delRequest = async ({ row }: DelReq) => {
return await api.DelObj(row.id);
};
const addRequest = async ({ form }: AddReq) => {
const res = await api.AddObj(form);
return res;
};
const addRequest = async ({ form }: AddReq) => {
const res = await api.AddObj(form);
return res;
};
const userStore = useUserStore();
const settingStore = useSettingStore();
const selectedRowKeys: Ref<any[]> = ref([]);
context.selectedRowKeys = selectedRowKeys;
const userStore = useUserStore();
const settingStore = useSettingStore();
const selectedRowKeys: Ref<any[]> = ref([]);
context.selectedRowKeys = selectedRowKeys;
return {
crudOptions: {
settings: {
plugins: {
//这里使用行选择插件生成行选择crudOptions配置最终会与crudOptions合并
rowSelection: {
enabled: true,
order: -2,
before: true,
// handle: (pluginProps,useCrudProps)=>CrudOptions,
props: {
multiple: true,
crossPage: true,
selectedRowKeys
}
}
}
},
request: {
pageRequest,
addRequest,
editRequest,
delRequest
},
rowHandle: {
minWidth: 200,
fixed: "right"
},
columns: {
id: {
title: "ID",
key: "id",
type: "number",
column: {
width: 100
},
form: {
show: false
}
},
domain: {
title: "CNAME域名",
type: "text",
editForm: {
component: {
disabled: true
}
},
search: {
show: true
},
form: {
component: {
placeholder: "cname.handsfree.work"
},
helper: "需要一个右边DNS提供商注册的域名也可以将其他域名的dns服务器转移到这几家来。\nCNAME域名一旦确定不可修改建议使用一级子域名",
rules: [{ required: true, message: "此项必填" }]
},
column: {
width: 200
}
},
dnsProviderType: {
title: "DNS提供商",
type: "dict-select",
search: {
show: true
},
dict: dict({
url: "pi/dnsProvider/list",
value: "key",
label: "title"
}),
form: {
rules: [{ required: true, message: "此项必填" }]
},
column: {
width: 150,
component: {
color: "auto"
}
}
},
accessId: {
title: "DNS提供商授权",
type: "dict-select",
dict: dict({
url: "/pi/access/list",
value: "id",
label: "name"
}),
form: {
component: {
name: "access-selector",
vModel: "modelValue",
type: compute(({ form }) => {
return form.dnsProviderType;
})
},
rules: [{ required: true, message: "此项必填" }]
},
column: {
width: 150,
component: {
color: "auto"
}
}
},
isDefault: {
title: "是否默认",
type: "dict-switch",
dict: dict({
data: [
{ label: "是", value: true, color: "success" },
{ label: "否", value: false, color: "default" }
]
}),
form: {
value: false,
rules: [{ required: true, message: "请选择是否默认" }]
},
column: {
align: "center",
width: 100
}
},
setDefault: {
title: "设置默认",
type: "text",
form: {
show: false
},
column: {
width: 100,
align: "center",
conditionalRenderDisabled: true,
cellRender: ({ row }) => {
if (row.isDefault) {
return;
}
const onClick = async () => {
Modal.confirm({
title: "提示",
content: `确定要设置为默认吗?`,
onOk: async () => {
await api.SetDefault(row.id);
await crudExpose.doRefresh();
}
});
};
return {
crudOptions: {
settings: {
plugins: {
//这里使用行选择插件生成行选择crudOptions配置最终会与crudOptions合并
rowSelection: {
enabled: true,
order: -2,
before: true,
// handle: (pluginProps,useCrudProps)=>CrudOptions,
props: {
multiple: true,
crossPage: true,
selectedRowKeys
}
}
}
},
request: {
pageRequest,
addRequest,
editRequest,
delRequest
},
rowHandle: {
minWidth: 200,
fixed: "right"
},
columns: {
id: {
title: "ID",
key: "id",
type: "number",
column: {
width: 100
},
form: {
show: false
}
},
domain: {
title: t("certd.cnameDomain"),
type: "text",
editForm: {
component: {
disabled: true,
},
},
search: {
show: true,
},
form: {
component: {
placeholder: t("certd.cnameDomainPlaceholder"),
},
helper: t("certd.cnameDomainHelper"),
rules: [{ required: true, message: t("certd.requiredField") }],
},
column: {
width: 200,
},
},
dnsProviderType: {
title: t("certd.dnsProvider"),
type: "dict-select",
search: {
show: true,
},
dict: dict({
url: "pi/dnsProvider/list",
value: "key",
label: "title",
}),
form: {
rules: [{ required: true, message: t("certd.requiredField") }],
},
column: {
width: 150,
component: {
color: "auto",
},
},
},
accessId: {
title: t("certd.dnsProviderAuthorization"),
type: "dict-select",
dict: dict({
url: "/pi/access/list",
value: "id",
label: "name",
}),
form: {
component: {
name: "access-selector",
vModel: "modelValue",
type: compute(({ form }) => {
return form.dnsProviderType;
}),
},
rules: [{ required: true, message: t("certd.requiredField") }],
},
column: {
width: 150,
component: {
color: "auto",
},
},
},
isDefault: {
title: t("certd.isDefault"),
type: "dict-switch",
dict: dict({
data: [
{ label: t("certd.yes"), value: true, color: "success" },
{ label: t("certd.no"), value: false, color: "default" },
],
}),
form: {
value: false,
rules: [{ required: true, message: t("certd.selectIsDefault") }],
},
column: {
align: "center",
width: 100,
},
},
setDefault: {
title: t("certd.setDefault"),
type: "text",
form: {
show: false,
},
column: {
width: 100,
align: "center",
conditionalRenderDisabled: true,
cellRender: ({ row }) => {
if (row.isDefault) {
return;
}
const onClick = async () => {
Modal.confirm({
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}>
</a-button>
);
}
}
},
disabled: {
title: "禁用/启用",
type: "dict-switch",
dict: dict({
data: [
{ label: "启用", value: false, color: "success" },
{ label: "禁用", value: true, color: "error" }
]
}),
form: {
value: false
},
column: {
width: 100,
component: {
title: "点击可禁用/启用",
on: {
async click({ value, row }) {
Modal.confirm({
title: "提示",
content: `确定要${!value ? "禁用" : "启用"}吗?`,
onOk: async () => {
await api.SetDisabled(row.id, !value);
await crudExpose.doRefresh();
}
});
}
}
}
}
},
createTime: {
title: "创建时间",
type: "datetime",
form: {
show: false
},
column: {
sorter: true,
width: 160,
align: "center"
}
},
updateTime: {
title: "更新时间",
type: "datetime",
form: {
show: false
},
column: {
show: true,
width: 160
}
}
}
}
};
return (
<a-button type={"link"} size={"small"} onClick={onClick}>
{t("certd.setAsDefault")}
</a-button>
);
},
},
},
disabled: {
title: t("certd.disabled"),
type: "dict-switch",
dict: dict({
data: [
{ label: t("certd.enabled"), value: false, color: "success" },
{ label: t("certd.disabledLabel"), value: true, color: "error" },
],
}),
form: {
value: false,
},
column: {
width: 100,
component: {
title: t("certd.clickToToggle"),
on: {
async click({ value, row }) {
Modal.confirm({
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: t("certd.createTime"),
type: "datetime",
form: {
show: false,
},
column: {
sorter: true,
width: 160,
align: "center",
},
},
updateTime: {
title: t("certd.updateTime"),
type: "datetime",
form: {
show: false,
},
column: {
show: true,
width: 160,
},
},
}
}
};
}

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -1,58 +1,63 @@
<template>
<fs-page class="page-cert">
<template #header>
<div class="title">
插件管理
<span class="sub">自定义插件处于BETA测试版后续可能会有破坏性变更</span>
</div>
</template>
<fs-crud ref="crudRef" v-bind="crudBinding">
<!-- <template #pagination-left>-->
<!-- <a-tooltip title="批量删除">-->
<!-- <fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>-->
<!-- </a-tooltip>-->
<!-- </template>-->
</fs-crud>
</fs-page>
<fs-page class="page-cert">
<template #header>
<div class="title">
{{ 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="t('certd.batchDelete')">-->
<!-- <fs-button icon="DeleteOutlined" @click="handleBatchDelete"></fs-button>-->
<!-- </a-tooltip>-->
<!-- </template>-->
</fs-crud>
</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",
name: "SysPlugin",
});
const { crudBinding, crudRef, crudExpose, context } = useFs({ createCrudOptions });
onActivated(async () => {
await crudExpose.doRefresh();
await crudExpose.doRefresh();
});
const selectedRowKeys = context.selectedRowKeys;
const handleBatchDelete = () => {
if (selectedRowKeys.value?.length > 0) {
Modal.confirm({
title: "确认",
content: `确定要批量删除这${selectedRowKeys.value.length}条记录吗`,
async onOk() {
await DeleteBatch(selectedRowKeys.value);
message.info("删除成功");
crudExpose.doRefresh();
selectedRowKeys.value = [];
},
});
} else {
message.error("请先勾选记录");
}
if (selectedRowKeys.value?.length > 0) {
Modal.confirm({
title: t("certd.confirm"),
content: t("certd.batchDeleteConfirm", { count: selectedRowKeys.value.length }),
async onOk() {
await DeleteBatch(selectedRowKeys.value);
message.info(t("certd.deleteSuccess"));
crudExpose.doRefresh();
selectedRowKeys.value = [];
},
});
} else {
message.error(t("certd.pleaseSelectRecord"));
}
};
//
onMounted(() => {
crudExpose.doRefresh();
crudExpose.doRefresh();
});
</script>
<style lang="less"></style>

View File

@ -1,73 +1,86 @@
<template>
<fs-page class="page-setting-email">
<template #header>
<div class="title">
邮件服务器设置
<span class="sub">设置邮件发送服务器</span>
</div>
</template>
<fs-page class="page-setting-email">
<template #header>
<div class="title">
{{ 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">
<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-input v-model:value="formState.host" />
</a-form-item>
<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">
<div v-if="!formState.usePlus" class="email-form">
<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-input v-model:value="formState.port" />
</a-form-item>
<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-input v-model:value="formState.auth.user" />
</a-form-item>
<a-form-item label="密码" :name="['auth', 'pass']" :rules="[{ required: true, message: '请输入密码' }]">
<a-input-password v-model:value="formState.auth.pass" />
<div class="helper">如果是qq邮箱需要到qq邮箱的设置里面申请授权码作为密码</div>
</a-form-item>
<a-form-item label="发件邮箱" name="sender" :rules="[{ required: true, message: '请输入发件邮箱' }]">
<a-input v-model:value="formState.sender" />
</a-form-item>
<a-form-item label="是否ssl" name="secure">
<a-switch v-model:checked="formState.secure" />
<div class="helper">ssl和非ssl的smtp端口是不一样的注意修改端口</div>
</a-form-item>
<a-form-item label="忽略证书校验" :name="['tls', 'rejectUnauthorized']">
<a-switch v-model:checked="formState.tls.rejectUnauthorized" />
</a-form-item>
<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="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">{{ t('certd.qqEmailAuthCodeHelper') }}</div>
</a-form-item>
<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="t('certd.useSsl')" name="secure">
<a-switch v-model:checked="formState.secure" />
<div class="helper">{{ t('certd.sslPortNote') }}</div>
</a-form-item>
<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-form-item>
</div>
<div class="email-form">
<a-form-item label="使用官方邮件服务器" name="usePlus">
<div class="flex-o">
<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>
</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-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>
</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-form-item>
</a-form>
</div>
</fs-page>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
<a-button type="primary" html-type="submit">{{ t('certd.save') }}</a-button>
</a-form-item>
</div>
<div class="email-form">
<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" />
<vip-button class="ml-5" mode="button"></vip-button>
</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="t('certd.testReceiverEmail')" name="receiver"
:rules="[{ required: true, message: t('certd.pleaseEnterTestReceiverEmail') }]">
<a-input v-model:value="testFormState.receiver" />
<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">{{ 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,96 +88,102 @@ 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",
name: "EmailSetting",
});
interface FormState {
host: string;
port: number;
auth: {
user: string;
pass: string;
};
secure: boolean; // use TLS
tls: {
// do not fail on invalid certs
rejectUnauthorized?: boolean;
};
sender: string;
usePlus: boolean;
host: string;
port: number;
auth: {
user: string;
pass: string;
};
secure: boolean; // use TLS
tls: {
// do not fail on invalid certs
rejectUnauthorized?: boolean;
};
sender: string;
usePlus: boolean;
}
const formState = reactive<Partial<FormState>>({
auth: {
user: "",
pass: "",
},
tls: {},
usePlus: false,
auth: {
user: "",
pass: "",
},
tls: {},
usePlus: false,
});
async function load() {
const data: any = await api.EmailSettingsGet();
_.merge(formState, data);
const data: any = await api.EmailSettingsGet();
_.merge(formState, data);
}
load();
const onFinish = async (form: any) => {
console.log("Success:", form);
await api.EmailSettingsSave(form);
notification.success({
message: "保存成功",
});
console.log("Success:", form);
await api.EmailSettingsSave(form);
notification.success({
message: t("certd.saveSuccess"),
});
};
const onFinishFailed = (errorInfo: any) => {
// console.log("Failed:", errorInfo);
// console.log("Failed:", errorInfo);
};
async function onUsePlusChanged() {
await api.EmailSettingsSave(formState);
await api.EmailSettingsSave(formState);
}
interface TestFormState {
receiver: string;
loading: boolean;
receiver: string;
loading: boolean;
}
const testFormState = reactive<TestFormState>({
receiver: "",
loading: false,
receiver: "",
loading: false,
});
async function onTestSend() {
testFormState.loading = true;
try {
await emailApi.TestSend(testFormState.receiver);
notification.success({
message: "发送成功",
});
} finally {
testFormState.loading = false;
}
testFormState.loading = true;
try {
await emailApi.TestSend(testFormState.receiver);
notification.success({
message: t("certd.sendSuccess"),
});
} finally {
testFormState.loading = false;
}
}
const settingStore = useSettingStore();
</script>
<style lang="less">
.page-setting-email {
.email-form-box {
display: flex;
}
.email-form {
width: 500px;
margin: 20px;
}
.email-form-box {
display: flex;
}
.helper {
padding: 1px;
margin: 0px;
color: #999;
font-size: 10px;
}
.email-form {
width: 500px;
margin: 20px;
}
.helper {
padding: 1px;
margin: 0px;
color: #999;
font-size: 10px;
}
}
</style>

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-item>
<a-form-item label="网安备案号" :name="['public', 'mpsNo']">
<a-input v-model:value="formState.public.mpsNo" placeholder="京公网安备xxxxxxx号" />
</a-form-item>
<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="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="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-switch v-model:checked="formState.public.aiChatEnabled" />
</a-form-item>
<a-form-item label="允许爬虫" :name="['public', 'robots']">
<a-switch v-model:checked="formState.public.robots" />
</a-form-item>
<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="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>
<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">
<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>
</div>
<div class="helper">一般这两个代理填一样的保存后再测试</div>
</a-form-item>
<a-form-item :label="t('certd.httpsProxy')" :name="['private', 'httpsProxy']" :rules="urlRules">
<div class="flex">
<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">{{ t('certd.httpsProxyHelper') }}</div>
</a-form-item>
<a-form-item label="双栈网络" :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>
<div class="helper">如果选择IPv6优先需要在docker-compose.yaml中启用ipv6</div>
</a-form-item>
<a-form-item :label="t('certd.dualStackNetwork')" :name="['private', 'dnsResultOrder']">
<a-select v-model:value="formState.private.dnsResultOrder">
<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">{{ t('certd.dualStackNetworkHelper') }}</div>
</a-form-item>
<a-form-item label="启用公共CNAME服务" :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>
</a-form-item>
<a-form-item :label="t('certd.enableCommonCnameService')" :name="['private', 'commonCnameEnabled']">
<a-switch v-model:checked="formState.private.commonCnameEnabled" />
<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-form-item>
</a-form>
</div>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 8 }">
<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,90 +62,94 @@ 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",
name: "SettingBase",
});
const formState = reactive<Partial<SysSettings>>({
public: {
icpNo: "",
mpsNo: "",
},
private: {},
public: {
icpNo: "",
mpsNo: "",
},
private: {},
});
const urlRules = ref({
type: "url",
message: "请输入正确的URL",
type: "url",
message: "请输入正确的URL",
});
async function loadSysSettings() {
const data: any = await api.SysSettingsGet();
merge(formState, data);
const data: any = await api.SysSettingsGet();
merge(formState, data);
}
const saveLoading = ref(false);
loadSysSettings();
const settingsStore = useSettingStore();
const onFinish = async (form: any) => {
try {
saveLoading.value = true;
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: "保存成功",
});
} finally {
saveLoading.value = false;
}
try {
saveLoading.value = true;
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: t('certd.saveSuccess'),
});
} finally {
saveLoading.value = false;
}
};
const onFinishFailed = (errorInfo: any) => {
// console.log("Failed:", errorInfo);
// console.log("Failed:", errorInfo);
};
async function stopOtherUserTimer() {
await api.stopOtherUserTimer();
notification.success({
message: "停止成功",
});
await api.stopOtherUserTimer();
notification.success({
message: t('certd.stopSuccess'),
});
}
const testProxyLoading = ref(false);
async function testProxy() {
testProxyLoading.value = true;
try {
const res = await api.TestProxy();
let success = true;
if (res.google !== true || res.baidu !== true) {
success = false;
}
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>
);
};
if (!success) {
notification.error({
message: "测试失败",
description: content,
});
return;
}
notification.success({
message: "测试完成",
description: content,
});
} finally {
testProxyLoading.value = false;
}
testProxyLoading.value = true;
try {
const res = await api.TestProxy();
let success = true;
if (res.google !== true || res.baidu !== true) {
success = false;
}
const content = () => {
return (
<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: t('certd.testFailed'),
description: content,
});
return;
}
notification.success({
message: t('certd.testCompleted'),
description: content,
});
} finally {
testProxyLoading.value = false;
}
}
</script>
<style lang="less">
.sys-settings-base {
}
.sys-settings-base {}
</style>

View File

@ -1,67 +1,78 @@
<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-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item label="限制用户流水线数量" :name="['public', 'limitUserPipelineCount']">
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">0为不限制</div>
</a-form-item>
<a-form-item label="开启自助注册" :name="['public', 'registerEnabled']">
<a-switch v-model:checked="formState.public.registerEnabled" />
</a-form-item>
<a-form-item label="开启用户有效期" :name="['public', 'userValidTimeEnabled']">
<div class="flex-o">
<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>
</a-form-item>
<template v-if="formState.public.registerEnabled">
<a-form-item label="开启用户名注册" :name="['public', 'usernameRegisterEnabled']">
<a-switch v-model:checked="formState.public.usernameRegisterEnabled" />
</a-form-item>
<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="t('certd.manageOtherUserPipeline')" :name="['public', 'managerOtherUserPipeline']">
<a-switch v-model:checked="formState.public.managerOtherUserPipeline" />
</a-form-item>
<a-form-item :label="t('certd.limitUserPipelineCount')" :name="['public', 'limitUserPipelineCount']">
<a-input-number v-model:value="formState.public.limitUserPipelineCount" />
<div class="helper">{{ t('certd.limitUserPipelineCountHelper') }}</div>
</a-form-item>
<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="t('certd.enableUserValidityPeriod')" :name="['public', 'userValidTimeEnabled']">
<div class="flex-o">
<a-switch v-model:checked="formState.public.userValidTimeEnabled"
:disabled="!settingsStore.isPlus" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">{{ t('certd.userValidityPeriodHelper') }}</div>
</a-form-item>
<template v-if="formState.public.registerEnabled">
<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']">
<div class="flex-o">
<a-switch v-model:checked="formState.public.emailRegisterEnabled" :disabled="!settingsStore.isPlus" title="专业版功能" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">需要<router-link to="/sys/settings/email">设置邮箱服务器</router-link></div>
</a-form-item>
<a-form-item label="开启手机号登录、注册" :name="['public', 'smsLoginEnabled']">
<div class="flex-o">
<a-switch v-model:checked="formState.public.smsLoginEnabled" :disabled="!settingsStore.isComm" title="商业版功能" />
<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-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>
</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" />
</template>
<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="t('certd.proFeature')" />
<vip-button class="ml-5" mode="button"></vip-button>
</div>
<div class="helper">
<router-link to="/sys/settings/email">{{ t('certd.emailServerSetup') }}</router-link>
</div>
</a-form-item>
<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="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="t('certd.smsProvider')" :name="['private', 'sms', 'type']">
<a-select v-model:value="formState.private.sms.type" @change="smsTypeChange">
<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" />
</template>
<a-form-item label="短信测试">
<div class="flex">
<a-input v-model:value="testMobile" placeholder="输入测试手机号" />
<loading-button class="ml-5" title="保存后再点击测试" type="primary" :click="testSendSms">测试</loading-button>
</div>
<div class="helper">保存后再点击测试</div>
</a-form-item>
</template>
</template>
<a-form-item :label="t('certd.smsTest')">
<div class="flex">
<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">{{ 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-form-item>
</a-form>
</div>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<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">
@ -71,123 +82,127 @@ 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",
name: "SettingRegister",
});
const testMobile = ref("");
async function testSendSms() {
if (!testMobile.value) {
notification.error({
message: "请输入测试手机号",
});
return;
}
await api.TestSms({
mobile: testMobile.value,
});
notification.success({
message: "发送成功",
});
if (!testMobile.value) {
notification.error({
message: t('certd.enterTestMobile'),
});
return;
}
await api.TestSms({
mobile: testMobile.value,
});
notification.success({
message: t('certd.sendSuccess'),
});
}
const formState = reactive<Partial<SysSettings>>({
public: {
registerEnabled: false,
},
private: {
sms: {
type: "aliyun",
config: {},
},
},
public: {
registerEnabled: false,
},
private: {
sms: {
type: "aliyun",
config: {},
},
},
});
const rules = {
leastOneLogin: {
validator: (rule: any, value: any) => {
if (!formState.public.passwordLoginEnabled && !formState.public.smsLoginEnabled) {
return Promise.reject("密码登录和手机号登录至少开启一个");
}
return Promise.resolve();
},
},
required: {
required: true,
trigger: "change",
message: "此项必填",
},
leastOneLogin: {
validator: (rule: any, value: any) => {
if (!formState.public.passwordLoginEnabled && !formState.public.smsLoginEnabled) {
return Promise.reject(t('certd.atLeastOneLoginRequired'));
}
return Promise.resolve();
},
},
required: {
required: true,
trigger: "change",
message: t('certd.fieldRequired'),
},
};
async function smsTypeChange(value: string) {
if (formState.private?.sms?.config) {
formState.private.sms.config = {};
}
await loadTypeDefine(value);
async function smsTypeChange(value: string) {
if (formState.private?.sms?.config) {
formState.private.sms.config = {};
}
await loadTypeDefine(value);
}
const smsTypeDefineInputs: Ref = ref({});
async function loadTypeDefine(type: string) {
const define: any = await api.GetSmsTypeDefine(type);
const keys = Object.keys(define.input);
const inputs: any = {};
keys.forEach(key => {
const value = define.input[key];
value.simpleKey = key;
value.key = "private.sms.config." + key;
if (!value.component) {
value.component = {
name: "a-input",
};
}
if (!value.component.name) {
value.component.vModel = "value";
}
if (!value.rules) {
value.rules = [];
}
if (value.required) {
value.rules.push(rules.required);
}
const define: any = await api.GetSmsTypeDefine(type);
const keys = Object.keys(define.input);
const inputs: any = {};
keys.forEach(key => {
const value = define.input[key];
value.simpleKey = key;
value.key = "private.sms.config." + key;
if (!value.component) {
value.component = {
name: "a-input",
};
}
if (!value.component.name) {
value.component.vModel = "value";
}
if (!value.rules) {
value.rules = [];
}
if (value.required) {
value.rules.push(rules.required);
}
inputs[key] = define.input[key];
});
smsTypeDefineInputs.value = inputs;
inputs[key] = define.input[key];
});
smsTypeDefineInputs.value = inputs;
}
async function loadSysSettings() {
const data: any = await api.SysSettingsGet();
merge(formState, data);
if (data?.private.sms?.type) {
await loadTypeDefine(data.private.sms.type);
}
if (!settingsStore.isPlus) {
formState.public.userValidTimeEnabled = false;
formState.public.emailRegisterEnabled = false;
}
const data: any = await api.SysSettingsGet();
merge(formState, data);
if (data?.private.sms?.type) {
await loadTypeDefine(data.private.sms.type);
}
if (!settingsStore.isPlus) {
formState.public.userValidTimeEnabled = false;
formState.public.emailRegisterEnabled = false;
}
if (!settingsStore.isComm) {
formState.public.smsLoginEnabled = false;
}
if (!settingsStore.isComm) {
formState.public.smsLoginEnabled = false;
}
}
const saveLoading = ref(false);
loadSysSettings();
const settingsStore = useSettingStore();
const onFinish = async (form: any) => {
try {
saveLoading.value = true;
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: "保存成功",
});
} finally {
saveLoading.value = false;
}
try {
saveLoading.value = true;
await api.SysSettingsSave(form);
await settingsStore.loadSysSettings();
notification.success({
message: t('certd.saveSuccess'),
});
} finally {
saveLoading.value = false;
}
};
</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">
<div class="flex">
<a-switch v-model:checked="formState.hidden.enabled" />
</div>
<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>{{ 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>
</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="随机地址" :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>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="完整解除隐藏地址" :name="['hidden', 'openPath']" :required="true">
<div class="flex"><fs-copyable v-model="openUrl" class="flex-inline"></fs-copyable></div>
<div class="helper red">请保存好此地址</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="解除密码" :name="['hidden', 'openPassword']" :required="false">
<a-input-password v-model:value="formState.hidden.openPassword" :allow-clear="true" />
<div class="helper">解除隐藏时需要输入密码第一次需要设置密码填写则重置密码</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="自动隐藏时间" :name="['hidden', 'autoHiddenTimes']" :required="true">
<a-input-number v-model:value="formState.hidden.autoHiddenTimes" :allow-clear="true" />
<div class="helper">多少分钟内无请求自动隐藏</div>
</a-form-item>
<a-form-item v-if="formState.hidden.enabled" label="隐藏开放接口" :name="['hidden', 'hiddenOpenApi']" :required="true">
<a-switch v-model:checked="formState.hidden.hiddenOpenApi" />
<div class="helper">是否隐藏开放接口是否放开/api/v1开头的接口</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>
<a-form-item label=" " :colon="false" :wrapper-col="{ span: 16 }">
<loading-button type="primary" html-type="button" :click="onClick">保存</loading-button>
</a-form-item>
</a-form>
</div>
<div class="helper">
{{ 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="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">{{ t('certd.siteHideUrlHelper') }}</div>
</a-form-item>
<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">{{ t('certd.saveThisUrl') }}</div>
</a-form-item>
<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">{{ t('certd.unlockPasswordHelper') }}</div>
</a-form-item>
<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">{{ t('certd.autoHideTimeHelper') }}</div>
</a-form-item>
<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">{{ t('certd.hideOpenApiHelper') }}</div>
</a-form-item>
<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">{{ 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,106 +65,109 @@ 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",
name: "SettingSafe",
});
const settingsStore = useSettingStore();
const api = {
async SettingGet() {
return await request({
url: "/sys/settings/safe/get",
method: "post",
});
},
async SettingSave(data: any) {
return await request({
url: "/sys/settings/safe/save",
method: "post",
data,
});
},
async HiddenImmediate() {
return await request({
url: "/sys/settings/safe/hidden",
method: "post",
});
},
async SettingGet() {
return await request({
url: "/sys/settings/safe/get",
method: "post",
});
},
async SettingSave(data: any) {
return await request({
url: "/sys/settings/safe/save",
method: "post",
data,
});
},
async HiddenImmediate() {
return await request({
url: "/sys/settings/safe/hidden",
method: "post",
});
},
};
const defaultState = {
hidden: {
enabled: false,
autoHiddenTimes: 5,
hiddenOpenApi: false,
},
hidden: {
enabled: false,
autoHiddenTimes: 5,
hiddenOpenApi: false,
},
};
const formRef = ref<any>(defaultState);
type SiteHidden = {
enabled: boolean;
openPath?: string;
autoHiddenTimes?: number;
openPassword?: string;
hiddenOpenApi?: boolean;
enabled: boolean;
openPath?: string;
autoHiddenTimes?: number;
openPassword?: string;
hiddenOpenApi?: boolean;
};
const formState = reactive<
Partial<{
hidden: SiteHidden;
}>
Partial<{
hidden: SiteHidden;
}>
>({
hidden: { enabled: false },
hidden: { enabled: false },
});
function changeOpenPath() {
formState.hidden.openPath = util.randomString(16);
formState.hidden.openPath = util.randomString(16);
}
async function loadSettings() {
const data: any = await api.SettingGet();
merge(formState, defaultState, formState, data);
if (!formState.hidden.openPath) {
changeOpenPath();
}
const data: any = await api.SettingGet();
merge(formState, defaultState, formState, data);
if (!formState.hidden.openPath) {
changeOpenPath();
}
}
loadSettings();
const openUrl = computed(() => {
const url = new URL(window.location.href);
url.pathname = `/api/unhidden/${formState.hidden?.openPath || ""}`;
//@ts-ignore
url.query = undefined;
url.hash = "";
return url.href;
const url = new URL(window.location.href);
url.pathname = `/api/unhidden/${formState.hidden?.openPath || ""}`;
//@ts-ignore
url.query = undefined;
url.hash = "";
return url.href;
});
const onClick = async () => {
const form = await formRef.value.validateFields();
//md5
// if (form.hidden?.openPassword) {
// form.hidden.openPassword = util.hash.md5(form.hidden.openPassword);
// }
await api.SettingSave(form);
await loadSettings();
notification.success({
message: "保存成功",
});
const form = await formRef.value.validateFields();
//md5
// if (form.hidden?.openPassword) {
// form.hidden.openPassword = util.hash.md5(form.hidden.openPassword);
// }
await api.SettingSave(form);
await loadSettings();
notification.success({
message: t('certd.saveSuccess'),
});
};
async function doHiddenImmediate() {
Modal.confirm({
title: "确定要立即隐藏站点吗?",
content: "隐藏后,将无法访问站点,请谨慎操作",
async onOk() {
await api.HiddenImmediate();
notification.success({
message: "站点已隐藏",
});
},
});
Modal.confirm({
title: t('certd.confirmHideSiteTitle'),
content: t('certd.confirmHideSiteContent'),
async onOk() {
await api.HiddenImmediate();
notification.success({
message: t('certd.siteHiddenSuccess'),
});
},
});
}
</script>
<style lang="less">
.sys-settings-base {
}
.sys-settings-base {}
</style>