From c49159a0e56e8f6753fa47841d270c7d243b58ea Mon Sep 17 00:00:00 2001 From: Zedifus Date: Thu, 19 Oct 2023 01:48:38 +0100 Subject: [PATCH 01/30] Prepare 4.2.1 release base --- CHANGELOG.md | 11 +++++++++++ README.md | 2 +- app/config/version.json | 2 +- sonar-project.properties | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 627014a0..773ea68c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ # Changelog +## --- [4.2.1] - 2023/TBD +### New features +TBD +### Bug fixes +TBD +### Tweaks +TBD +### Lang +TBD +

+ ## --- [4.2.0] - 2023/10/18 ### New features - Finish and Activate Arcadia notification backend ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/621) | [Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/626) | [Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/632)) diff --git a/README.md b/README.md index 5d2379c8..a805eca7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ [![Crafty Logo](app/frontend/static/assets/images/logo_long.svg)](https://craftycontrol.com) -# Crafty Controller 4.2.0 +# Crafty Controller 4.2.1 > Python based Control Panel for your Minecraft Server ## What is Crafty Controller? diff --git a/app/config/version.json b/app/config/version.json index 6c1274e0..47d57814 100644 --- a/app/config/version.json +++ b/app/config/version.json @@ -1,5 +1,5 @@ { "major": 4, "minor": 2, - "sub": 0 + "sub": 1 } diff --git a/sonar-project.properties b/sonar-project.properties index 1a11b1fd..210aa767 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=crafty-controller # This is the name and version displayed in the SonarCloud UI. sonar.projectName=Crafty 4 -sonar.projectVersion=4.2.0 +sonar.projectVersion=4.2.1 sonar.python.version=3.9, 3.10, 3.11 sonar.exclusions=app/migrations/**, app/frontend/static/assets/vendors/** From 0dc714551726ee15a53ddd256af610bad282acf8 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Thu, 19 Oct 2023 13:01:48 -0400 Subject: [PATCH 02/30] Update zn_CH translations --- .../{zh_CN_incomplete.json => zh_CN.json} | 120 +++++++++++++++++- 1 file changed, 118 insertions(+), 2 deletions(-) rename app/translations/{zh_CN_incomplete.json => zh_CN.json} (81%) 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" } } From 2461c326418f08da860b33fde4600d0687387e0e Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 20 Oct 2023 15:36:57 -0500 Subject: [PATCH 03/30] Auto refresh annoucements every 30 minutes --- app/frontend/templates/notify.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/frontend/templates/notify.html b/app/frontend/templates/notify.html index 4527d46b..060b9d8a 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 1 hour.") if (responseData.status === "ok") { updateAnnouncements(responseData.data) } else { From 9760ef60949f234c6176a355e23a44018f895ee5 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 20 Oct 2023 15:38:48 -0500 Subject: [PATCH 04/30] Fix console log --- app/frontend/templates/notify.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/frontend/templates/notify.html b/app/frontend/templates/notify.html index 060b9d8a..b7dd6dd9 100644 --- a/app/frontend/templates/notify.html +++ b/app/frontend/templates/notify.html @@ -139,7 +139,7 @@ setTimeout(function() { getAnnouncements(); }, 1800); - console.log("Registered annoucement fetch event in 1 hour.") + console.log("Registered annoucement fetch event in 30 minutes.") if (responseData.status === "ok") { updateAnnouncements(responseData.data) } else { From 9710d640724bb5b54b43fbf5f71d1451eb71fdd7 Mon Sep 17 00:00:00 2001 From: Andrew Date: Fri, 20 Oct 2023 15:41:39 -0500 Subject: [PATCH 05/30] Fix logical issue with get files perms check --- app/classes/web/routes/api/servers/server/files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ) From 46e6d4b06446fd441b04abe30abc23184d83b6ca Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 21 Oct 2023 12:18:35 +0100 Subject: [PATCH 06/30] Enable es_ES file, remove incomplete suffix --- app/translations/{es_ES_incomplete.json => es_ES.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename app/translations/{es_ES_incomplete.json => es_ES.json} (100%) diff --git a/app/translations/es_ES_incomplete.json b/app/translations/es_ES.json similarity index 100% rename from app/translations/es_ES_incomplete.json rename to app/translations/es_ES.json From 9692a9d16bcd6d3d2817a66566bf33eee36591fd Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 21 Oct 2023 12:22:44 +0100 Subject: [PATCH 07/30] Add missing keys from es_ES --- app/translations/es_ES.json | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/app/translations/es_ES.json b/app/translations/es_ES.json index 8f480d56..dac61e8d 100644 --- a/app/translations/es_ES.json +++ b/app/translations/es_ES.json @@ -217,7 +217,8 @@ "forgotPassword": "Olvidé mi contraseña", "login": "Iniciar Sesión", "password": "Contraseña", - "username": "Usuario" + "username": "Usuario", + "viewStatus": "View Public Status Page" }, "notify": { "activityLog": "Registros de actividad", @@ -240,12 +241,14 @@ "assignedRoles": "Grupos asignados", "cancel": "Cancelar", "clearComms": "Limpiar comandos sin ejecutar.", + "custom": "Personalizar Crafty", "delete": "Eliminar", "edit": "Editar", "enableLang": "Activar todos los Idiomas", "enabled": "Habilitado", "globalExplain": "Donde Crafty almacena todos los archivos de tu servidor. (Juntaremos la ruta con /servers/[uuid de servidor])", "globalServer": "Directorio Global de Servidores", + "json": "Config.json", "match": "Las contraseñas deben coincidir", "newRole": "Agregar nuevo Grupo", "newUser": "Agregar nuevo Usuario", @@ -282,6 +285,7 @@ "roleTitle": "Configuración de Grupos", "roleUserName": "Nombre de usuario", "roleUsers": "Usuarios del grupo: ", + "selectManager": "Seleccionar un administrador para este rol", "serverAccess": "¿Acceso?", "serverName": "Nombre del servidor", "serversDesc": "Servidores a los que este grupo puede acceder" @@ -521,6 +525,7 @@ "commandInput": "Introducir tu comando", "delay-explained": "El agente/servicio se inicio recientemente y está retrasando iniciar la instancia del servidor de Minecraft.", "downloading": "Descargando...", + "importing": "Importando...", "installing": "Instalando...", "restart": "Reiniciar", "sendCommand": "Enviar comando", @@ -557,6 +562,7 @@ "save": "Guardar", "selectRole": "Seleccionar Grupo(s)", "selectRoot": "Seleccione el directorio raíz del archivo.", + "selectServer": "Seleccionar un servidor", "selectType": "Tipo de servidor (Vanilla, Modificado, Mods, etc.)", "selectVersion": "Selecciona una versión", "selectZipDir": "Seleccione el directorio del archivo que quiere extraer el contenido.", @@ -564,6 +570,7 @@ "serverName": "Nombre del servidor", "serverPath": "Ruta del servidor", "serverPort": "Puerto del servidor", + "serverSelect": "Selección de servidor", "serverType": "Tipo de servidor", "serverUpload": "Subir servidor comprimido", "serverVersion": "Versión del servidor", @@ -621,5 +628,28 @@ "userSettings": "Configuración de Usuario.", "userTheme": "Tema de Interfaz", "uses": "Número de usos permitidos. (Sin límite: -1)" + }, + "webhooks": { + "areYouSureDel": "¿Estás seguro de que quieres eliminar este webhook?", + "areYouSureRun": "¿Estás seguro de que quieres probar este webhook?", + "backup_server": "Copia de seguridad del servidor completada", + "bot_name": "Nombre del bot", + "color": "Seleccionar color de resaltado", + "crash_detected": "Server Crashed", + "edit": "Editar", + "enabled": "Habilitado", + "jar_update": "Ejecutable del Servidor actualizado", + "kill": "Servidor detenido", + "name": "Nombre", + "new": "Nuevo Webhook", + "run": "Ejecutar prueba de Webhook", + "send_command": "Comando de servidor recibido", + "start_server": "Servidor iniciado", + "stop_server": "Servidor detenido", + "trigger": "Trigger", + "type": "Tipo de Webhook", + "url": "URL de Webhook", + "webhook_body": "Cuerpo del Webhook", + "webhooks": "Webhooks" } } From cab47542404c89f066e69b5db87a616264f7b48d Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 21 Oct 2023 12:23:58 +0100 Subject: [PATCH 08/30] Correct accuracy of proc kill function land --- app/translations/es_ES.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/translations/es_ES.json b/app/translations/es_ES.json index dac61e8d..b1cd2ff4 100644 --- a/app/translations/es_ES.json +++ b/app/translations/es_ES.json @@ -90,8 +90,8 @@ "delay-explained": "El agente/servicio inicio recientemente y está retrasando el inicio de la instancia del servidor de Minecraft.", "host": "Host", "installing": "Instalando...", - "kill": "Matar Proceso", - "killing": "Cerrando el proceso...", + "kill": "Detener Proceso", + "killing": "Deteniendo el proceso...", "lastBackup": "Último:", "max": "Máx", "memUsage": "Uso de memoria", From eb26b3a496640332dae66d6eb5c478d9a917c6f6 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 21 Oct 2023 12:30:45 +0100 Subject: [PATCH 09/30] Update changelog !652 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 773ea68c..a75e292e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ TBD ### Tweaks TBD ### 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 From 8d16816fae0c5e2b4c0bd163192e2745ddac3f45 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 21 Oct 2023 12:33:46 +0100 Subject: [PATCH 10/30] Update changelog !653 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 773ea68c..11c2c221 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ TBD ### Bug fixes TBD ### Tweaks -TBD +- Auto refresh Crafty Announcements on 30m interval ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/653)) ### Lang TBD

From 5164ada9322b6177322ceb12ab4316e8c0eb8b58 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sat, 21 Oct 2023 12:36:01 +0100 Subject: [PATCH 11/30] Update changelog !654 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 773ea68c..20ca081f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ### 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 ### Lang From 6a2d1fa61a4ebd19c913ab3f9a561e5f8bca308b Mon Sep 17 00:00:00 2001 From: Silversthorn Date: Sat, 21 Oct 2023 17:32:48 +0200 Subject: [PATCH 12/30] Improving Toggle buttons and Webhook page --- .../static/assets/css/crafty-toggle-btn.css | 447 ++++++++++++++++++ app/frontend/static/assets/css/crafty.css | 50 +- app/frontend/templates/base.html | 1 + .../templates/panel/server_schedules.html | 391 ++++++++------- .../templates/panel/server_webhooks.html | 266 ++++++----- app/translations/en_EN.json | 6 +- app/translations/fr_FR.json | 6 +- 7 files changed, 837 insertions(+), 330 deletions(-) create mode 100644 app/frontend/static/assets/css/crafty-toggle-btn.css diff --git a/app/frontend/static/assets/css/crafty-toggle-btn.css b/app/frontend/static/assets/css/crafty-toggle-btn.css new file mode 100644 index 00000000..94ccaa7b --- /dev/null +++ b/app/frontend/static/assets/css/crafty-toggle-btn.css @@ -0,0 +1,447 @@ +/**************************************************************/ +/* CSS for Toggle Buttons */ +/**************************************************************/ +.btn-toggle { + margin: 0 4rem; + padding: 0; + position: relative; + border: none; + height: 1.5rem; + width: 3rem; + border-radius: 1.5rem; + color: #6b7381; + background: #bdc1c8; +} + +.btn-toggle:focus, +.btn-toggle.focus, +.btn-toggle:focus.active, +.btn-toggle.focus.active { + outline: none; +} + +.btn-toggle:before, +.btn-toggle:after { + line-height: 1.5rem; + width: 4rem; + text-align: center; + font-weight: 600; + font-size: 0.75rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle:before { + content: 'Off'; + left: -4rem; +} + +.btn-toggle:after { + content: 'On'; + right: -4rem; + opacity: 0.5; +} + +.btn-toggle>.handle { + position: absolute; + top: 0.1875rem; + left: 0.1875rem; + width: 1.125rem; + height: 1.125rem; + border-radius: 1.125rem; + background: #fff; + transition: left 0.25s; +} + +.btn-toggle.active { + transition: background-color 0.25s; +} + +.btn-toggle.active>.handle { + left: 1.6875rem; + transition: left 0.25s; +} + +.btn-toggle.active:before { + opacity: 0.5; +} + +.btn-toggle.active:after { + opacity: 1; +} + +.btn-toggle.btn-sm:before, +.btn-toggle.btn-sm:after { + line-height: -0.5rem; + color: #fff; + letter-spacing: 0.75px; + left: 0.4125rem; + width: 2.325rem; +} + +.btn-toggle.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-xs:before, +.btn-toggle.btn-xs:after { + display: none; +} + +.btn-toggle:before, +.btn-toggle:after { + color: #6b7381; +} + +.btn-toggle.active { + background-color: #29b5a8; +} + +.btn-toggle.btn-lg { + margin: 0 5rem; + padding: 0; + position: relative; + border: none; + height: 2.5rem; + width: 5rem; + border-radius: 2.5rem; +} + +.btn-toggle.btn-lg:focus, +.btn-toggle.btn-lg.focus, +.btn-toggle.btn-lg:focus.active, +.btn-toggle.btn-lg.focus.active { + outline: none; +} + +.btn-toggle.btn-lg:before, +.btn-toggle.btn-lg:after { + line-height: 2.5rem; + width: 5rem; + text-align: center; + font-weight: 600; + font-size: 1rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle.btn-lg:before { + content: 'Off'; + left: -5rem; +} + +.btn-toggle.btn-lg:after { + content: 'On'; + right: -5rem; + opacity: 0.5; +} + +.btn-toggle.btn-lg>.handle { + position: absolute; + top: 0.3125rem; + left: 0.3125rem; + width: 1.875rem; + height: 1.875rem; + border-radius: 1.875rem; + background: #fff; + transition: left 0.25s; +} + +.btn-toggle.btn-lg.active { + transition: background-color 0.25s; +} + +.btn-toggle.btn-lg.active>.handle { + left: 2.8125rem; + transition: left 0.25s; +} + +.btn-toggle.btn-lg.active:before { + opacity: 0.5; +} + +.btn-toggle.btn-lg.active:after { + opacity: 1; +} + +.btn-toggle.btn-lg.btn-sm:before, +.btn-toggle.btn-lg.btn-sm:after { + line-height: 0.5rem; + color: #fff; + letter-spacing: 0.75px; + left: 0.6875rem; + width: 3.875rem; +} + +.btn-toggle.btn-lg.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-lg.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-lg.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-lg.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-lg.btn-xs:before, +.btn-toggle.btn-lg.btn-xs:after { + display: none; +} + +.btn-toggle.btn-sm { + margin: 0 0.5rem; + padding: 0; + position: relative; + border: none; + height: 1.5rem; + width: 3rem; + border-radius: 1.5rem; +} + +.btn-toggle.btn-sm:focus, +.btn-toggle.btn-sm.focus, +.btn-toggle.btn-sm:focus.active, +.btn-toggle.btn-sm.focus.active { + outline: none; +} + +.btn-toggle.btn-sm:before, +.btn-toggle.btn-sm:after { + line-height: 1.5rem; + width: 0.5rem; + text-align: center; + font-weight: 600; + font-size: 0.55rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle.btn-sm:before { + content: 'Off'; + left: -0.5rem; +} + +.btn-toggle.btn-sm:after { + content: 'On'; + right: -0.5rem; + opacity: 0.5; +} + +.btn-toggle.btn-sm>.handle { + position: absolute; + top: 0.1875rem; + left: 0.1875rem; + width: 1.125rem; + height: 1.125rem; + border-radius: 1.125rem; + background: #fff; + transition: left 0.25s; +} + +.btn-toggle.btn-sm.active { + transition: background-color 0.25s; +} + +.btn-toggle.btn-sm.active>.handle { + left: 1.6875rem; + transition: left 0.25s; +} + +.btn-toggle.btn-sm.active:before { + opacity: 0.5; +} + +.btn-toggle.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-sm.btn-sm:before, +.btn-toggle.btn-sm.btn-sm:after { + line-height: -0.5rem; + color: #fff; + letter-spacing: 0.75px; + left: 0.4125rem; + width: 2.325rem; +} + +.btn-toggle.btn-sm.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-sm.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-sm.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-sm.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-sm.btn-xs:before, +.btn-toggle.btn-sm.btn-xs:after { + display: none; +} + +.btn-toggle.btn-xs { + margin: 0 0; + padding: 0; + position: relative; + border: none; + height: 1rem; + width: 2rem; + border-radius: 1rem; +} + +.btn-toggle.btn-xs:focus, +.btn-toggle.btn-xs.focus, +.btn-toggle.btn-xs:focus.active, +.btn-toggle.btn-xs.focus.active { + outline: none; +} + +.btn-toggle.btn-xs:before, +.btn-toggle.btn-xs:after { + line-height: 1rem; + width: 0; + text-align: center; + font-weight: 600; + font-size: 0.75rem; + text-transform: uppercase; + letter-spacing: 2px; + position: absolute; + bottom: 0; + transition: opacity 0.25s; +} + +.btn-toggle.btn-xs:before { + content: 'Off'; + left: 0; +} + +.btn-toggle.btn-xs:after { + content: 'On'; + right: 0; + opacity: 0.5; +} + +.btn-toggle.btn-xs>.handle { + position: absolute; + top: 0.125rem; + left: 0.125rem; + width: 0.75rem; + height: 0.75rem; + border-radius: 0.75rem; + background: #fff; + transition: left 0.25s; +} + +.btn-toggle.btn-xs.active { + transition: background-color 0.25s; +} + +.btn-toggle.btn-xs.active>.handle { + left: 1.125rem; + transition: left 0.25s; +} + +.btn-toggle.btn-xs.active:before { + opacity: 0.5; +} + +.btn-toggle.btn-xs.active:after { + opacity: 1; +} + +.btn-toggle.btn-xs.btn-sm:before, +.btn-toggle.btn-xs.btn-sm:after { + line-height: -1rem; + color: #fff; + letter-spacing: 0.75px; + left: 0.275rem; + width: 1.55rem; +} + +.btn-toggle.btn-xs.btn-sm:before { + text-align: right; +} + +.btn-toggle.btn-xs.btn-sm:after { + text-align: left; + opacity: 0; +} + +.btn-toggle.btn-xs.btn-sm.active:before { + opacity: 0; +} + +.btn-toggle.btn-xs.btn-sm.active:after { + opacity: 1; +} + +.btn-toggle.btn-xs.btn-xs:before, +.btn-toggle.btn-xs.btn-xs:after { + display: none; +} + +.btn-toggle.btn-info { + color: var(--white); + background: var(--gray); +} + +.btn-toggle.btn-info:before, +.btn-toggle.btn-info:after { + color: #6b7381; +} + +.btn-toggle.btn-info.active { + background-color: var(--info); +} + +.btn-toggle.btn-secondary { + color: #6b7381; + background: #bdc1c8; +} + +.btn-toggle.btn-secondary:before, +.btn-toggle.btn-secondary:after { + color: #6b7381; +} + +.btn-toggle.btn-secondary.active { + background-color: #ff8300; +} + +/**************************************************************/ \ No newline at end of file diff --git a/app/frontend/static/assets/css/crafty.css b/app/frontend/static/assets/css/crafty.css index 6c29d4ed..cc1a8b82 100644 --- a/app/frontend/static/assets/css/crafty.css +++ b/app/frontend/static/assets/css/crafty.css @@ -182,11 +182,55 @@ div>.input-group>.form-control { } .no-scroll { - -ms-overflow-style: none; /* IE and Edge */ - scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; + /* IE and Edge */ + scrollbar-width: none; + /* Firefox */ } .no-scroll::-webkit-scrollbar { display: none; - } +} + +.custom-control-label::before, +.custom-control-label::after { + cursor: pointer; +} + +.custom-control-input:checked~.custom-control-label::before { + color: black !important; + background-color: blueviolet !important; + border-color: var(--outline) !important; +} + +.custom-control-label::before { + background-color: white !important; + top: calc(-0.2rem); +} + +.custom-switch .custom-control-label::after { + top: calc(-0.125rem + 1px); +} + +/**************************************************************/ + +/**************************************************************/ +/* CSS for Tables Displays */ +/**************************************************************/ +td>ul { + margin: auto; +} + +td p { + margin: auto; +} + +td.action { + white-space: normal; +} + +td.action .btn { + margin-bottom: 0.2rem; +} + /**************************************************************/ \ No newline at end of file diff --git a/app/frontend/templates/base.html b/app/frontend/templates/base.html index 9795da3a..40ee757b 100755 --- a/app/frontend/templates/base.html +++ b/app/frontend/templates/base.html @@ -17,6 +17,7 @@ + diff --git a/app/frontend/templates/panel/server_schedules.html b/app/frontend/templates/panel/server_schedules.html index eb43396b..3ab454a7 100644 --- a/app/frontend/templates/panel/server_schedules.html +++ b/app/frontend/templates/panel/server_schedules.html @@ -47,198 +47,184 @@

{{ translate('serverSchedules', 'scheduledTasks', data['lang']) }}

{% if data['user_data']['hints'] %} - + {% end %} -
- -
+
- - - - - - - - - - - - - - {% for schedule in data['schedules'] %} - - - - - - - - - - {% end %} - -
{{ translate('serverSchedules', 'name', data['lang']) }} - {{ translate('serverSchedules', 'action', data['lang']) - }}{{ translate('serverSchedules', 'command', - data['lang']) }}{{ translate('serverSchedules', 'interval', - data['lang']) }}{{ translate('serverSchedules', 'nextRun', - data['lang']) }}{{ translate('serverSchedules', 'enabled', - data['lang']) }}{{ translate('serverSchedules', 'edit', data['lang']) - }}
-

{{schedule.name}}

-
-

{{schedule.action}}

-
-

{{schedule.command}}

-
- {% if schedule.interval_type != '' and schedule.interval_type != 'reaction' %} -

{{ translate('serverSchedules', 'every', data['lang']) }}

-

{{schedule.interval}} {{schedule.interval_type}}

- {% elif schedule.interval_type == 'reaction' %} -

{{schedule.interval_type}}

{{ translate('serverSchedules', 'child', data['lang'])}}: - {{ schedule.parent }}

- {% else %} -

Cron String:

-

{{schedule.cron_string}}

- {% end %} -
-

{{schedule.next_run}}

-
- - - -
-
- -
-
- - - - - - - - - - {% for schedule in data['schedules'] %} - - - - - - -
{{ translate('serverSchedules', 'action', data['lang']) - }}{{ translate('serverSchedules', 'command', - data['lang']) }}{{ translate('serverSchedules', 'enabled', - data['lang']) }}
-

{{schedule.action}}

-
-

{{schedule.command}}

-
- {% if schedule.enabled %} - - {{ translate('serverSchedules', 'yes', data['lang']) }} - - {% else %} - - {{ translate('serverSchedules', 'no', data['lang']) }} - - {% end %} -
+ + + + + + + + + + + + + {% for schedule in data['schedules'] %} + + + + + + + + + + {% end %} + +
{{ translate('serverSchedules', 'enabled', + data['lang']) }}{{ translate('serverSchedules', 'name', data['lang']) }} + {{ translate('serverSchedules', 'action', data['lang']) + }}{{ translate('serverSchedules', 'command', + data['lang']) }}{{ translate('serverSchedules', 'interval', + data['lang']) }}{{ translate('serverSchedules', 'nextRun', + data['lang']) }}{{ translate('serverSchedules', 'edit', data['lang']) + }}
+ + +

{{schedule.name}}

+
+

{{schedule.action}}

+
+

{{schedule.command}}

+
+ {% if schedule.interval_type != '' and schedule.interval_type != 'reaction' %} +

{{ translate('serverSchedules', 'every', data['lang']) }}

+

{{schedule.interval}} {{schedule.interval_type}}

+ {% elif schedule.interval_type == 'reaction' %} +

{{schedule.interval_type}}

{{ translate('serverSchedules', 'child', data['lang'])}}: + {{ schedule.parent }}

+ {% else %} +

Cron String:

+

{{schedule.cron_string}}

+ {% end %} +
+

{{schedule.next_run}}

+
+ + +
+
+
+
+ + + + + + + + + + {% for schedule in data['schedules'] %} + + + + + + + - - {% end %} - -
{{ translate('serverSchedules', 'action', data['lang']) + }}{{ translate('serverSchedules', 'command', + data['lang']) }}{{ translate('serverSchedules', 'enabled', + data['lang']) }}
+

{{schedule.action}}

+
+

{{schedule.command}}

+
+ +
+ {% end %} + + +
+ {% end %} @@ -265,6 +251,16 @@ .toggle { height: 0px !important; } + + td.enabled { + vertical-align: middle; + border-collapse: collapse !important; + } + + .enabled .toggle-group .btn { + vertical-align: middle; + cursor: pointer; + } @@ -299,20 +295,21 @@ }; } - $(() => { - $('.schedule-enabled-toggle').bootstrapToggle({ - on: 'Yes', - off: 'No', - onstyle: 'success', - offstyle: 'danger', - }) - $('.schedule-enabled-toggle').each(function () { + $(document).ready(function () { + $('.schedule-custom-toggle').each(function () { const enabled = JSON.parse(this.getAttribute('data-schedule-enabled')); - $(this).bootstrapToggle(enabled ? 'on' : 'off') + if (enabled) { + this.classList.add("active"); + } + else { + this.classList.remove("active"); + } }) - $('.schedule-enabled-toggle').change(function () { + }); + $(() => { + $('.schedule-custom-toggle').click(function () { const id = this.getAttribute('data-schedule-id'); - const enabled = this.checked; + const enabled = !JSON.parse(this.getAttribute('data-schedule-enabled')); fetch(`/api/v2/servers/{{data['server_id']}}/tasks/${id}`, { method: 'PATCH', diff --git a/app/frontend/templates/panel/server_webhooks.html b/app/frontend/templates/panel/server_webhooks.html index 35d09c8b..25a61257 100644 --- a/app/frontend/templates/panel/server_webhooks.html +++ b/app/frontend/templates/panel/server_webhooks.html @@ -46,104 +46,107 @@

{{ translate('webhooks', 'webhooks', data['lang']) }}

{% if data['user_data']['hints'] %} - + {% end %} -
+
- - - - - - - - - - - - {% for webhook in data['webhooks'] %} - - - - - - - - {% end %} - -
{{ translate('webhooks', 'name', data['lang']) }} - {{ translate('webhooks', 'type', data['lang']) }}{{ translate('webhooks', 'trigger', data['lang']) }}{{ translate('webhooks', 'enabled', - data['lang']) }}{{ translate('webhooks', 'edit', data['lang']) - }}
-

{{webhook.name}}

-
-

{{webhook.webhook_type}}

-
-
    - {% for trigger in webhook.trigger.split(",") %} - {% if trigger in data["triggers"] %} -
  • {{translate('webhooks', trigger , data['lang'])}}
  • - {%end%} - {%end%} -
-
- - - -
-
- - -
- - - - - - - - - - {% for webhook in data['webhooks'] %} - - - - - - {% end %} - -
Name - {{ translate('webhooks', 'enabled', - data['lang']) }}{{ translate('webhooks', 'edit', data['lang']) - }}
-

{{webhook.name}}

-
- - - -
-
- - -
+ {% if len(data['webhooks']) == 0 %} +
+ {{ translate('webhooks', 'no-webhook', data['lang']) }} {{ translate('webhooks', 'newWebhook',data['lang']) }}. +
+ {% end %} + {% if len(data['webhooks']) > 0 %} +
+ + + + + + + + + + + + {% for webhook in data['webhooks'] %} + + + + + + + + {% end %} + +
{{ translate('webhooks', 'enabled', data['lang']) }}{{ translate('webhooks', 'name', data['lang']) }} {{ translate('webhooks', 'type', data['lang']) }}{{ translate('webhooks', 'trigger', data['lang']) }}{{ translate('webhooks', 'edit', data['lang']) }}
+ + +

{{webhook.name}}

+
+

{{webhook.webhook_type}}

+
+
    + {% for trigger in webhook.trigger.split(",") %} + {% if trigger in data["triggers"] %} +
  • {{translate('webhooks', trigger , data['lang'])}}
  • + {%end%} + {%end%} +
+
+ + + +
+
+
+ + + + + + + + + + {% for webhook in data['webhooks'] %} + + + + + + {% end %} + +
{{ translate('webhooks', 'enabled', + data['lang']) }}Name + {{ translate('webhooks', 'edit', data['lang']) + }}
+ + +

{{webhook.name}}

+
+ + + +
+
+ {% end %}
@@ -170,6 +173,16 @@ .toggle { height: 0px !important; } + + td.enabled { + vertical-align: middle; + border-collapse: collapse !important; + } + + .enabled .toggle-group .btn { + vertical-align: middle; + cursor: pointer; + } @@ -195,16 +208,12 @@ {% block js %} -{% end %} \ No newline at end of file +{% end %} diff --git a/app/translations/de_DE.json b/app/translations/de_DE.json index 1a2723f6..1a249313 100644 --- a/app/translations/de_DE.json +++ b/app/translations/de_DE.json @@ -499,10 +499,10 @@ "every": "Jede", "interval": "Intervall", "name": "Name", - "newShedule": "Neue Routine", + "newSchedule": "Neue Routine", "nextRun": "Nächster Durchlauf", "no": "Nein", - "no-shedule": "Derzeit gibt es keine Routinen für diesen Server. Hier kann eine angelegt werden", + "no-schedule": "Derzeit gibt es keine Routinen für diesen Server. Hier kann eine angelegt werden", "scheduledTasks": "Geplante Aufgaben", "yes": "Ja" }, diff --git a/app/translations/en_EN.json b/app/translations/en_EN.json index fb2fe925..6db96dfc 100644 --- a/app/translations/en_EN.json +++ b/app/translations/en_EN.json @@ -499,10 +499,10 @@ "every": "Every", "interval": "Interval", "name": "Name", - "newShedule": "New Schedule", + "newSchedule": "New Schedule", "nextRun": "Next Run", "no": "No", - "no-shedule": "There are currently no shedules for this server. To get started, click", + "no-schedule": "There are currently no schedules for this server. To get started, click", "scheduledTasks": "Scheduled Tasks", "yes": "Yes" }, diff --git a/app/translations/fr_FR.json b/app/translations/fr_FR.json index 155794f9..33ea5225 100644 --- a/app/translations/fr_FR.json +++ b/app/translations/fr_FR.json @@ -499,10 +499,10 @@ "every": "Toutes", "interval": "Intervalle", "name": "Nom", - "newShedule": "Nouvelle Tâche", + "newSchedule": "Nouvelle Tâche", "nextRun": "Exécution suivante", "no": "Non", - "no-shedule": "Il n'y a actuellement aucune tâche pour ce serveur. Pour commencer, clicke sur ", + "no-schedule": "Il n'y a actuellement aucune tâche pour ce serveur. Pour commencer, clicke sur ", "scheduledTasks": "Tâches Planifiées", "yes": "Oui" }, diff --git a/app/translations/lol_EN.json b/app/translations/lol_EN.json index f909d4f6..8c2436cb 100644 --- a/app/translations/lol_EN.json +++ b/app/translations/lol_EN.json @@ -499,10 +499,10 @@ "every": "EVERYZ", "interval": "GAPZ", "name": "NAMZ", - "newShedule": "NU SCHEDULE", + "newSchedule": "NU SCHEDULE", "nextRun": "NEXT RUNZ", "no": "NOPE", - "no-shedule": "THER BE NO SCHEDULEZ FOR DIS SERVER RIGHT MEOW. 2 GET STARTD, BOOP", + "no-schedule": "THER BE NO SCHEDULEZ FOR DIS SERVER RIGHT MEOW. 2 GET STARTD, BOOP", "scheduledTasks": "SCHEDULED TASKZ", "yes": "YESH" }, diff --git a/app/translations/lv_LV.json b/app/translations/lv_LV.json index 7a5df4a9..15ecf869 100644 --- a/app/translations/lv_LV.json +++ b/app/translations/lv_LV.json @@ -500,10 +500,10 @@ "every": "Katru", "interval": "Intervāls", "name": "Nosaukums", - "newShedule": "Jauns Grafiks", + "newSchedule": "Jauns Grafiks", "nextRun": "Nākamā Izpilde", "no": "Nē", - "no-shedule": "Pašlaik šim serverim nav grafiku. Lai sāktu, spied", + "no-schedule": "Pašlaik šim serverim nav grafiku. Lai sāktu, spied", "scheduledTasks": "Ieplānotie Notikumi", "yes": "Jā" }, diff --git a/app/translations/nl_BE.json b/app/translations/nl_BE.json index 9a0808e7..81d455ed 100644 --- a/app/translations/nl_BE.json +++ b/app/translations/nl_BE.json @@ -499,10 +499,10 @@ "every": "Elke", "interval": "Interval", "name": "Naam", - "newShedule": "Nieuw schema", + "newSchedule": "Nieuw schema", "nextRun": "Volgende uitvoering", "no": "Nee", - "no-shedule": "Er zijn momenteel geen schema's voor deze server. Klik om te beginnen op", + "no-schedule": "Er zijn momenteel geen schema's voor deze server. Klik om te beginnen op", "scheduledTasks": "Geplande taken", "yes": "Ja" }, diff --git a/app/translations/pl_PL.json b/app/translations/pl_PL.json index 4570ca80..828ec0b1 100644 --- a/app/translations/pl_PL.json +++ b/app/translations/pl_PL.json @@ -499,10 +499,10 @@ "every": "Co", "interval": "Regularność", "name": "Nazwa", - "newShedule": "Nowe zadanie", + "newSchedule": "Nowe zadanie", "nextRun": "Następne uruchomienie", "no": "Nie", - "no-shedule": "Nie posiadasz aktualnie żadnych zadań dla tego serwera. Aby dodać zadanie kliknij na", + "no-schedule": "Nie posiadasz aktualnie żadnych zadań dla tego serwera. Aby dodać zadanie kliknij na", "scheduledTasks": "Zaplanowane zadania", "yes": "Tak" }, diff --git a/app/translations/zh_CN.json b/app/translations/zh_CN.json index 3a7b3269..e905a406 100644 --- a/app/translations/zh_CN.json +++ b/app/translations/zh_CN.json @@ -499,10 +499,10 @@ "every": "每", "interval": "间隔", "name": "名称", - "newShedule": "新计划", + "newSchedule": "新计划", "nextRun": "下次运行", "no": "否", - "no-shedule": "此服务器当前没有计划。要开始使用计划,点击", + "no-schedule": "此服务器当前没有计划。要开始使用计划,点击", "scheduledTasks": "计划任务", "yes": "是" }, From a7556bd537031842edf54613523c5e917146ae8b Mon Sep 17 00:00:00 2001 From: Zedifus Date: Mon, 23 Oct 2023 20:28:38 +0100 Subject: [PATCH 16/30] Add minor wording correction for de_DE !656 --- app/translations/de_DE.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/translations/de_DE.json b/app/translations/de_DE.json index 1a249313..7ac4faa3 100644 --- a/app/translations/de_DE.json +++ b/app/translations/de_DE.json @@ -499,10 +499,10 @@ "every": "Jede", "interval": "Intervall", "name": "Name", - "newSchedule": "Neue Routine", + "newShedule": "Neuer Zeitplan", "nextRun": "Nächster Durchlauf", "no": "Nein", - "no-schedule": "Derzeit gibt es keine Routinen für diesen Server. Hier kann eine angelegt werden", + "no-shedule": "Derzeit gibt es keine Zeitpläne für diesen Server. Hier kann einer angelegt werden", "scheduledTasks": "Geplante Aufgaben", "yes": "Ja" }, From 5d29dee548d3ddaa3bdd5a7778fb622673119d6c Mon Sep 17 00:00:00 2001 From: Zedifus Date: Mon, 23 Oct 2023 20:52:48 +0100 Subject: [PATCH 17/30] Update changelog !656 Add missing CL entry !655 --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eca4116a..0447692d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,12 @@ TBD - Fix logic issue with `get_files` API permissions check ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/654)) ### Tweaks - Auto refresh Crafty Announcements on 30m interval ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/653)) +- Improve Crafty toggle buttons and Webhooks page ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/656)) ### Lang -- Update zh_CN lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/652)) +- Update `zh_CN` lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/652)) +- Update `es_ES` lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/655)) +- Clean up wording in `pl_PL` lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/656)) +- Add `de_DE`, `fr_FR`, `lol_EN`, `lv_LV`, `nl_BE` `pl_PL` & `zh_CN` translations for !656 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/656))

## --- [4.2.0] - 2023/10/18 From 27ef42e9c4fd22007351f6478ab32331dae018ec Mon Sep 17 00:00:00 2001 From: Zedifus Date: Mon, 23 Oct 2023 21:13:05 +0100 Subject: [PATCH 18/30] Fix 'Sch'edule key typo in de_DE --- app/translations/de_DE.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/translations/de_DE.json b/app/translations/de_DE.json index 7ac4faa3..ac18990d 100644 --- a/app/translations/de_DE.json +++ b/app/translations/de_DE.json @@ -499,10 +499,10 @@ "every": "Jede", "interval": "Intervall", "name": "Name", - "newShedule": "Neuer Zeitplan", + "newSchedule": "Neuer Zeitplan", "nextRun": "Nächster Durchlauf", "no": "Nein", - "no-shedule": "Derzeit gibt es keine Zeitpläne für diesen Server. Hier kann einer angelegt werden", + "no-schedule": "Derzeit gibt es keine Zeitpläne für diesen Server. Hier kann einer angelegt werden", "scheduledTasks": "Geplante Aufgaben", "yes": "Ja" }, From 58efe7ab9de484b3aa944f95d22801a3ef44aeed Mon Sep 17 00:00:00 2001 From: Zedifus Date: Mon, 23 Oct 2023 21:47:26 +0100 Subject: [PATCH 19/30] Pin pylint at 0.21.1 0.22.0 is crashing out F0002 --- .gitlab/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab/lint.yml b/.gitlab/lint.yml index f335dea8..101e26b2 100644 --- a/.gitlab/lint.yml +++ b/.gitlab/lint.yml @@ -44,7 +44,7 @@ black: # Code Climate/Quality Checking [https://pylint.pycqa.org/en/latest/] pylint: stage: lint - image: registry.gitlab.com/pipeline-components/pylint:latest + image: registry.gitlab.com/pipeline-components/pylint:0.21.1 tags: - docker rules: From d9dc16e1ecf7d4ac5c91145251ca7cb038312028 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Mon, 23 Oct 2023 23:21:21 +0100 Subject: [PATCH 20/30] Update es_ES for !656 --- CHANGELOG.md | 2 +- app/translations/es_ES.json | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0447692d..b225b497 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ TBD - Update `zh_CN` lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/652)) - Update `es_ES` lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/655)) - Clean up wording in `pl_PL` lang file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/656)) -- Add `de_DE`, `fr_FR`, `lol_EN`, `lv_LV`, `nl_BE` `pl_PL` & `zh_CN` translations for !656 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/656)) +- Add `de_DE`, `es_ES` `fr_FR`, `lol_EN`, `lv_LV`, `nl_BE` `pl_PL` & `zh_CN` translations for !656 ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/656))

## --- [4.2.0] - 2023/10/18 diff --git a/app/translations/es_ES.json b/app/translations/es_ES.json index b1cd2ff4..52819bf5 100644 --- a/app/translations/es_ES.json +++ b/app/translations/es_ES.json @@ -499,8 +499,10 @@ "every": "Cada", "interval": "Intervalo", "name": "Nombre", + "newShedule": "Nueva Tarea programada", "nextRun": "Siguiente ejecución", "no": "No", + "no-shedule": "Actualmente no hay programaciones para este servidor. Para comenzar, haz clic en", "scheduledTasks": "Tareas programadas", "yes": "Sí" }, @@ -642,6 +644,8 @@ "kill": "Servidor detenido", "name": "Nombre", "new": "Nuevo Webhook", + "newWebhook": "Nuevo Webhook", + "no-webhook": "Actualmente no hay webhooks para este servidor. Para comenzar, haz click en", "run": "Ejecutar prueba de Webhook", "send_command": "Comando de servidor recibido", "start_server": "Servidor iniciado", From 1d5965c1f5459bcb5a831608f6a2bbaac6f7127e Mon Sep 17 00:00:00 2001 From: Iain Powrie Date: Mon, 23 Oct 2023 23:39:17 +0000 Subject: [PATCH 21/30] Fix 'Sch'edule key naming in es_ES --- app/translations/es_ES.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/translations/es_ES.json b/app/translations/es_ES.json index 52819bf5..63f3da36 100644 --- a/app/translations/es_ES.json +++ b/app/translations/es_ES.json @@ -499,10 +499,10 @@ "every": "Cada", "interval": "Intervalo", "name": "Nombre", - "newShedule": "Nueva Tarea programada", + "newSchedule": "Nueva Tarea programada", "nextRun": "Siguiente ejecución", "no": "No", - "no-shedule": "Actualmente no hay programaciones para este servidor. Para comenzar, haz clic en", + "no-schedule": "Actualmente no hay programaciones para este servidor. Para comenzar, haz clic en", "scheduledTasks": "Tareas programadas", "yes": "Sí" }, From 170750466c316e7a7bb15e987f94b951fb320d02 Mon Sep 17 00:00:00 2001 From: Zedifus Date: Sun, 29 Oct 2023 13:45:03 +0000 Subject: [PATCH 22/30] Remove Custom from WebhookFactory Registry Wven when commented out, it's still present in front end selection --- app/classes/web/webhooks/webhook_factory.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app/classes/web/webhooks/webhook_factory.py b/app/classes/web/webhooks/webhook_factory.py index 608bf4e5..9fe2c752 100644 --- a/app/classes/web/webhooks/webhook_factory.py +++ b/app/classes/web/webhooks/webhook_factory.py @@ -21,7 +21,6 @@ class WebhookFactory: "Mattermost": MattermostWebhook, "Slack": SlackWebhook, "Teams": TeamsWebhook, - # "Custom", } @classmethod From 76e8b01335b8733fad96cc1090ee337c2c73252a Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 29 Oct 2023 18:37:30 -0400 Subject: [PATCH 23/30] Fix notifications not showing up/being reset --- app/classes/shared/helpers.py | 13 ++++++++----- .../web/routes/api/crafty/announcements/index.py | 16 ++++++++++++++++ app/frontend/templates/notify.html | 6 +++--- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index ba9c5a28..62ce8819 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -578,16 +578,19 @@ class Helpers: return version_data def get_announcements(self): - data = [] try: + data = [] response = requests.get("https://craftycontrol.com/notify", timeout=2) data = json.loads(response.content) + if self.update_available: + data.append(self.update_available) + return data except Exception as e: logger.error(f"Failed to fetch notifications with error: {e}") - - if self.update_available: - data.append(self.update_available) - return data + if self.update_available: + data = [self.update_available] + else: + return False def get_version_string(self): version_data = self.get_version() diff --git a/app/classes/web/routes/api/crafty/announcements/index.py b/app/classes/web/routes/api/crafty/announcements/index.py index 409aceed..b5286289 100644 --- a/app/classes/web/routes/api/crafty/announcements/index.py +++ b/app/classes/web/routes/api/crafty/announcements/index.py @@ -29,6 +29,14 @@ class ApiAnnounceIndexHandler(BaseApiHandler): ) = auth_data data = self.helper.get_announcements() + if not data: + return self.finish_json( + 418, + { + "status": "error", + "data": "Failed to get announcements", + }, + ) cleared = str( self.controller.users.get_user_by_id(auth_data[4]["user_id"])[ "cleared_notifs" @@ -84,6 +92,14 @@ class ApiAnnounceIndexHandler(BaseApiHandler): }, ) announcements = self.helper.get_announcements() + if not announcements: + return self.finish_json( + 418, + { + "status": "error", + "data": "Failed to get current announcements", + }, + ) res = [d.get("id", None) for d in announcements] cleared_notifs = str( self.controller.users.get_user_by_id(auth_data[4]["user_id"])[ diff --git a/app/frontend/templates/notify.html b/app/frontend/templates/notify.html index b7dd6dd9..83e80909 100644 --- a/app/frontend/templates/notify.html +++ b/app/frontend/templates/notify.html @@ -93,7 +93,7 @@ return true; } function updateAnnouncements(data) { - console.log(data) + console.log(data); let text = ""; for (let value of data) { text += `
  • ${value.title}

    ${value.date}

    ${value.desc}

  • ` @@ -138,12 +138,12 @@ console.log(responseData); setTimeout(function() { getAnnouncements(); - }, 1800); + }, 1800000); //Wait 30 minutes in miliseconds console.log("Registered annoucement fetch event in 30 minutes.") if (responseData.status === "ok") { updateAnnouncements(responseData.data) } else { - updateAnnouncements("
  • Trouble Getting Annoucements

  • ") + updateAnnouncements([]) } } async function send_clear(uuid) { From 645542b459639d502bea34fdd2e9aa3d3b48caf6 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 29 Oct 2023 18:49:31 -0400 Subject: [PATCH 24/30] Move from 418 (i am a teapot) to 424 missing dep --- app/classes/web/routes/api/crafty/announcements/index.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/classes/web/routes/api/crafty/announcements/index.py b/app/classes/web/routes/api/crafty/announcements/index.py index b5286289..75f00f16 100644 --- a/app/classes/web/routes/api/crafty/announcements/index.py +++ b/app/classes/web/routes/api/crafty/announcements/index.py @@ -31,7 +31,7 @@ class ApiAnnounceIndexHandler(BaseApiHandler): data = self.helper.get_announcements() if not data: return self.finish_json( - 418, + 424, { "status": "error", "data": "Failed to get announcements", @@ -94,7 +94,7 @@ class ApiAnnounceIndexHandler(BaseApiHandler): announcements = self.helper.get_announcements() if not announcements: return self.finish_json( - 418, + 424, { "status": "error", "data": "Failed to get current announcements", From bdb3e94f4178dc71d3a9cd45ab763b02e21efa9e Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Mon, 30 Oct 2023 12:13:14 -0400 Subject: [PATCH 25/30] Fix userId reference const declaration --- app/frontend/templates/panel/panel_edit_user.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/frontend/templates/panel/panel_edit_user.html b/app/frontend/templates/panel/panel_edit_user.html index 85a5ea46..87631219 100644 --- a/app/frontend/templates/panel/panel_edit_user.html +++ b/app/frontend/templates/panel/panel_edit_user.html @@ -363,6 +363,7 @@ data['lang']) }}{% end %} {% block js %}