diff --git a/CHANGELOG.md b/CHANGELOG.md index 773ea68c..eca4116a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,11 @@ ### New features TBD ### Bug fixes -TBD +- Fix logic issue with `get_files` API permissions check ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/654)) ### Tweaks -TBD +- Auto refresh Crafty Announcements on 30m interval ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/653)) ### Lang -TBD +- Update zh_CN lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/652))

## --- [4.2.0] - 2023/10/18 diff --git a/app/classes/web/routes/api/servers/server/files.py b/app/classes/web/routes/api/servers/server/files.py index 9ed720ac..37007acd 100644 --- a/app/classes/web/routes/api/servers/server/files.py +++ b/app/classes/web/routes/api/servers/server/files.py @@ -86,7 +86,7 @@ class ApiServersServerFilesIndexHandler(BaseApiHandler): not in self.controller.server_perms.get_user_id_permissions_list( auth_data[4]["user_id"], server_id ) - or EnumPermissionsServer.BACKUP + and EnumPermissionsServer.BACKUP not in self.controller.server_perms.get_user_id_permissions_list( auth_data[4]["user_id"], server_id ) diff --git a/app/frontend/templates/notify.html b/app/frontend/templates/notify.html index 4527d46b..b7dd6dd9 100644 --- a/app/frontend/templates/notify.html +++ b/app/frontend/templates/notify.html @@ -136,6 +136,10 @@ }); let responseData = await res.json(); console.log(responseData); + setTimeout(function() { + getAnnouncements(); + }, 1800); + console.log("Registered annoucement fetch event in 30 minutes.") if (responseData.status === "ok") { updateAnnouncements(responseData.data) } else { diff --git a/app/translations/zh_CN_incomplete.json b/app/translations/zh_CN.json similarity index 81% rename from app/translations/zh_CN_incomplete.json rename to app/translations/zh_CN.json index 07a3f3f7..bbfec7e8 100644 --- a/app/translations/zh_CN_incomplete.json +++ b/app/translations/zh_CN.json @@ -53,6 +53,20 @@ "translationTitle": "语言翻译", "translator": "译者" }, + "customLogin": { + "apply": "应用", + "backgroundUpload": "后台上传", + "customLoginPage": "自定义登录页面", + "delete": "删除", + "labelLoginImage": "选择您的登录页面背景", + "loginBackground": "登录页面背景图片", + "loginImage": "上传登录页面背景图片。", + "loginOpacity": "选择登录窗口透明度", + "pageTitle": "自定义登录页面", + "preview": "预览", + "select": "选择", + "selectImage": "选择一张图片" + }, "dashboard": { "actions": "操作", "allServers": "所有服务器", @@ -75,6 +89,7 @@ "dashboard": "仪表板", "delay-explained": "服务进程已经在刚才启动,并且正在延迟 Minecraft 服务器实例的启动", "host": "主机", + "installing": "安装中……", "kill": "杀死进程", "killing": "正在杀死进程……", "lastBackup": "上次:", @@ -164,20 +179,33 @@ } }, "error": { + "agree": "同意", + "bedrockError": "基岩版下载不可用。请检查", + "cancel": "取消", "contact": "通过 Discord 联系 Crafty Control 支持", + "craftyStatus": "Crafty 的状态页面", + "cronFormat": "检测到无效的定时(Cron)格式", "embarassing": "哦,天哪,这太尴尬了。", "error": "错误!", "eulaAgree": "你同意吗?", "eulaMsg": "你必须同意最终用户许可协议(EULA)。一份 Minecraft EULA 副本的链接在此消息下方。", "eulaTitle": "同意最终用户许可协议(EULA)", + "fileError": "文件类型必须是图片。", "fileTooLarge": "上传失败。上传的文件过大。联系系统管理员以获取协助。", "hereIsTheError": "错误如下", + "installerJava": "安装 {} 失败:安装 Forge 服务器需要 Java。我们检测到 Java 未安装。请先安装 java 然后再安装服务器。", "internet": "我们检测到运行 Crafty 的设备没有网络连接。客户端到服务器的连接可能受限。", + "migration": "Crafty 的主服务器存储正在被迁移到新位置。期间的所有服务器启动已被暂停。请等待我们完成迁移", "no-file": "我们似乎找不到请求的文件。请再次检查路径。Crafty 是否拥有了正确的权限?", + "noInternet": "Crafty 无法访问网络。服务器创建已被禁用。请检查您的网络连接并刷新此页面。", "noJava": "服务器 {} 启动失败,并输出了如下错误码:我们检测到 Java 未安装。请先安装 java 然后再启动服务器。", "not-downloaded": "我们似乎找不到您的可执行文件。它下载完成了吗?可执行文件的权限设置正确了吗?", "portReminder": "我们检测到这是你首次运行 {}。请确保从您的路由器/防火墙转发 {} 端口,以使程序可以从公网远程访问。", + "privMsg": "以及", + "serverJars1": "无法访问服务器 JAR API。请检查", + "serverJars2": "以获取最新信息。", "start-error": "服务器 {} 启动失败,错误代码为:{}", + "superError": "您必须作为超级用户来完成此操作。", "terribleFailure": "多糟糕的错误!" }, "footer": { @@ -189,7 +217,8 @@ "forgotPassword": "忘记密码", "login": "登录", "password": "密码", - "username": "用户名" + "username": "用户名", + "viewStatus": "查看公开状态页面" }, "notify": { "activityLog": "活动日志", @@ -201,24 +230,38 @@ "preparingLogs": " 请等待,我们正在准备您的日志……准备好时我们会发送一次提醒。这对于大型的部署来说可能需要一点时间。", "supportLogs": "支持日志" }, + "offline": { + "offline": "离线", + "pleaseConnect": "请连接至网络以使用 Crafty。" + }, "panelConfig": { "adminControls": "管理员控制", "allowedServers": "允许的服务器", + "apply": "应用", "assignedRoles": "已分配的角色", "cancel": "取消", "clearComms": "清除未执行的指令", + "custom": "自定义 Crafty", "delete": "删除", "edit": "编辑", + "enableLang": "启用所有语言", "enabled": "已启用", + "globalExplain": "Crafty 存储您的所有服务器文件的位置。(我们会在路径后添加 /servers/[服务器的 uuid])", + "globalServer": "全局服务器文件夹", + "json": "Config.json", + "match": "密码必须匹配", "newRole": "添加新角色", "newUser": "添加新用户", + "noMounts": "不在仪表板上显示挂载的驱动器", "pageTitle": "面板配置", "role": "角色", "roleUsers": "被分配了该角色的用户", "roles": "角色", "save": "保存", + "select": "选择", "superConfirm": "仅在你希望此用户能访问所有数据(所有用户账户、服务器、面板设置等)的情况下继续。它们甚至可以撤回您的超级用户权限。", "superConfirmTitle": "启用超级用户?您确定吗?", + "title": "Crafty 配置", "user": "用户", "users": "用户" }, @@ -242,14 +285,17 @@ "roleTitle": "角色设置", "roleUserName": "用户名称", "roleUsers": "角色用户:", + "selectManager": "选择此角色的管理员", "serverAccess": "访问?", "serverName": "服务器名称", "serversDesc": "此角色允许访问的服务器" }, "serverBackups": { + "after": "备份后运行指令", "backupAtMidnight": "午夜自动备份?", "backupNow": "现在备份!", "backupTask": "一个备份任务已开始。", + "before": "备份前运行指令", "cancel": "取消", "clickExclude": "点击来选择排除项", "compress": "压缩备份", @@ -289,6 +335,8 @@ "deleteServerQuestionMessage": "您确定要删除此服务器吗?在此之后将无法撤销……", "exeUpdateURL": "服务器可执行文件更新地址", "exeUpdateURLDesc": "用于下载更新的直接链接。", + "ignoredExits": "忽略的崩溃退出代码", + "ignoredExitsExplain": "Crafty 的崩溃检测应该忽略为正常的“停止”的退出代码(以英文逗号分隔)", "javaNoChange": "不覆盖", "javaVersion": "覆盖当前的 Java 版本", "javaVersionDesc": "如果你要覆盖 Java,请确保你当前“运行命令”中的 Java 路径括在了引号中(不包括默认的“java”变量)", @@ -319,7 +367,13 @@ "serverPortDesc": "Crafty 要连接以获取状态的端口", "serverStopCommand": "服务器停止指令", "serverStopCommandDesc": "要发送给程序以关闭它的指令", + "showStatus": "在公开状态页面上显示", + "shutdownTimeout": "停止超时", + "statsHint1": "此处应填写您的服务器运行在的端口。这是 Crafty 与您的服务器建立连接以获取状态的方式。", + "statsHint2": "此选项不会更改您的服务器的端口。您仍必须更改您的服务器配置文件中的端口。", "stopBeforeDeleting": "请在删除之前停止服务器", + "timeoutExplain1": "Crafty 执行", + "timeoutExplain2": "指令之后,在强制结束进程前等待您的服务器停止的时间。", "update": "更新可执行文件", "yesDelete": "是,删除", "yesDeleteFiles": "是,删除文件" @@ -345,8 +399,12 @@ "backup": "备份", "config": "配置", "files": "文件", + "filter": "过滤日志", + "filterList": "被过滤的字符", "logs": "日志", + "metrics": "指标", "playerControls": "玩家管理", + "reset": "重置滚动", "schedule": "计划", "serverDetails": "服务器详情", "terminal": "终端" @@ -383,6 +441,11 @@ "waitUpload": "请等待,我们正在上传您的文件……这需要一点时间。", "yesDelete": "是,我知道结果" }, + "serverMetrics": { + "resetZoom": "重置缩放", + "zoomHint1": "按住 shift 键并使用您的滚轮以缩放图表。", + "zoomHint2": "或者按住 shift 键并拖动选择您想放大的区域。" + }, "serverPlayerManagement": { "bannedPlayers": "已封禁的玩家", "loadingBannedPlayers": "正在加载已封禁的玩家", @@ -410,18 +473,36 @@ "parent-explain": "哪个计划会触发这一个计划?", "reaction": "响应", "restart": "重启服务器", + "select": "基本 / 定时(Cron) / 连锁反应选择", "start": "启动服务器", "stop": "停止服务器", "time": "时间", "time-explain": "你想要在什么时候执行这个计划?" }, "serverSchedules": { + "action": "操作", "areYouSure": "删除计划任务?", "cancel": "取消", "cannotSee": "什么都看不到?", "cannotSeeOnMobile": "尝试点击一个计划任务来查看全部详细信息。", + "child": "父计划 ID", + "close": "关闭", + "command": "指令", "confirm": "确认", - "confirmDelete": "您想要删除这个计划任务吗?此操作不能撤销。" + "confirmDelete": "您想要删除这个计划任务吗?此操作不能撤销。", + "create": "创建新计划", + "cron": "定时(Cron)字符串", + "delete": "删除", + "details": "计划详细信息", + "edit": "编辑", + "enabled": "已启用", + "every": "每", + "interval": "间隔", + "name": "名称", + "nextRun": "下次运行", + "no": "否", + "scheduledTasks": "计划任务", + "yes": "是" }, "serverStats": { "cpuUsage": "CPU 使用率", @@ -444,6 +525,8 @@ "commandInput": "输入您的指令", "delay-explained": "服务进程已经在刚才启动,并且正在延迟 Minecraft 服务器实例的启动", "downloading": "下载中……", + "importing": "正在导入……", + "installing": "正在安装……", "restart": "重启", "sendCommand": "发送指令", "start": "启动", @@ -468,6 +551,7 @@ "importServerButton": "导入服务器!", "importZip": "从 Zip 文件导入", "importing": "导入服务器中……", + "labelZipFile": "选择您的 Zip 文件", "maxMem": "最大内存", "minMem": "最小内存", "myNewServer": "我的新服务器", @@ -478,6 +562,7 @@ "save": "保存", "selectRole": "选择角色", "selectRoot": "选择压缩文件中的根目录", + "selectServer": "选择一个服务器", "selectType": "选择一种类型", "selectVersion": "选择一个版本", "selectZipDir": "选择你想要我们解压的压缩文件中的目录", @@ -485,9 +570,13 @@ "serverName": "服务器名称", "serverPath": "服务器路径", "serverPort": "服务器端口", + "serverSelect": "服务器选择", "serverType": "服务器类型", + "serverUpload": "上传打包为 Zip 文件的服务器", "serverVersion": "服务器版本", "sizeInGB": "大小(以 GB 为单位)", + "uploadButton": "上传", + "uploadZip": "上传 Zip 文件以导入服务器", "zipPath": "服务器路径" }, "sidebar": { @@ -495,6 +584,7 @@ "credits": "鸣谢", "dashboard": "仪表板", "documentation": "文档", + "inApp": "内置文档", "navigation": "导航栏", "newServer": "创建新服务器", "servers": "服务器" @@ -519,6 +609,7 @@ "lastLogin": "上次登录:", "lastUpdate": "上次更新:", "leaveBlank": "如果要编辑此用户但不更改密码,请留空。", + "manager": "管理员", "member": "成员?", "notExist": "您不能删除不存在的东西!", "pageTitle": "编辑用户", @@ -527,6 +618,7 @@ "permName": "权限名称", "repeat": "重复密码", "roleName": "角色名称", + "selectManager": "选择用户的管理员", "super": "超级用户", "userLang": "用户语言", "userName": "用户名称", @@ -534,6 +626,30 @@ "userRoles": "用户角色", "userRolesDesc": "此用户充当成员的角色。", "userSettings": "用户设置", + "userTheme": "UI 主题", "uses": "使用次数限制(-1==无限制)" + }, + "webhooks": { + "areYouSureDel": "您确定要删除此 webhook 吗?", + "areYouSureRun": "您确定要测试此 webhook 吗?", + "backup_server": "服务器备份完成", + "bot_name": "机器人名称", + "color": "选择主题色", + "crash_detected": "服务器已崩溃", + "edit": "编辑", + "enabled": "已启用", + "jar_update": "服务器可执行文件已更新", + "kill": "服务器进程已杀死", + "name": "名称", + "new": "新 Webhook", + "run": "测试 Webhook", + "send_command": "服务器指令已接收", + "start_server": "服务器已启动", + "stop_server": "服务器已停止", + "trigger": "触发器", + "type": "Webhook 类型", + "url": "Webhook 地址", + "webhook_body": "Webhook 消息体(Body)", + "webhooks": "Webhook" } }