From c106c307a16affa9b95fc5ec2f1ea18827ee6912 Mon Sep 17 00:00:00 2001 From: Smith Date: Sat, 5 Aug 2023 16:48:12 +0200 Subject: [PATCH] format new fields + styling --- public/game-server-config.schema.json | 163 ++++++++++++++------------ public/main.css | 15 +++ public/main.js | 15 +-- 3 files changed, 110 insertions(+), 83 deletions(-) diff --git a/public/game-server-config.schema.json b/public/game-server-config.schema.json index fec4ca4..d7be0e6 100644 --- a/public/game-server-config.schema.json +++ b/public/game-server-config.schema.json @@ -11,6 +11,7 @@ "name": { "title": "Name", "type": "string", + "minLength": 1, "options": { "grid_columns": 12 } @@ -19,6 +20,7 @@ "title": "Gamedig type", "description": "Look for the GameDig Type ID in the games list.", "type": "string", + "minLength": 1, "options": { "grid_columns": 6 } @@ -27,6 +29,7 @@ "title": "Steam App ID", "description": "Look for the AppID in the apps list.", "type": "integer", + "minimum": 1, "format": "number", "options": { "grid_columns": 6 @@ -35,13 +38,20 @@ "host": { "title": "Host name or IP", "type": "string", + "pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$|^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)+([A-Za-z]|[A-Za-z][A-Za-z0-9\\-]*[A-Za-z0-9])$", "options": { - "grid_columns": 6 + "grid_columns": 6, + "error_messages": { + "en": { + "error_pattern": "Value must be a valid host name or IP" + } + } } }, "port": { "title": "Port number", "type": "integer", + "default": 1, "minimum": 1, "maximum": 65535, "format": "number", @@ -49,81 +59,6 @@ "grid_columns": 6 } }, - "givenPortOnly": { - "title": "givenPortOnly", - "description": "Only attempt to query server on given port.", - "type": "boolean", - "format": "checkbox", - "options": { - "grid_columns": 6 - } - }, - "requestRules": { - "title": "requestRules (Valve)", - "description": "Additional 'rules' may be fetched into the raw field.", - "type": "boolean", - "format": "checkbox", - "options": { - "grid_columns": 6 - } - }, - "teamspeakQueryPort": { - "title": "teamspeakQueryPort (TeamSpeak 3)", - "type": "integer", - "options": { - "grid_columns": 6 - } - }, - "guildId": { - "title": "guildId (Discord)", - "type": "string", - "options": { - "grid_columns": 6 - } - }, - "login": { - "title": "login (Nadeo)", - "type": "string", - "options": { - "grid_columns": 6 - } - }, - "password": { - "title": "password (Nadeo)", - "type": "string", - "options": { - "grid_columns": 6 - } - }, - "token": { - "title": "token (Terraria)", - "type": "string", - "options": { - "grid_columns": 6 - } - }, - "graphHistoryHours": { - "title": "Graph history time span (hours)", - "type": "integer", - "default": 12, - "minimum": 1, - "maximum": 24, - "format": "range", - "options": { - "grid_columns": 12 - } - }, - "timezoneOffset": { - "title": "Time zone offset of the server", - "default": 0, - "type": "number", - "minimum": -12, - "maximum": 14, - "format": "range", - "options": { - "grid_columns": 6 - } - }, "discord": { "type": "array", "title": "Discord channels", @@ -171,6 +106,82 @@ "options": { "grid_columns": 12 } + }, + "graphHistoryHours": { + "title": "Graph history time span (hours)", + "type": "integer", + "default": 12, + "minimum": 1, + "maximum": 24, + "format": "range", + "options": { + "grid_columns": 12 + } + }, + "timezoneOffset": { + "title": "Time zone offset of the server", + "default": 0, + "type": "number", + "minimum": -12, + "maximum": 14, + "format": "range", + "options": { + "grid_columns": 6 + } + }, + "givenPortOnly": { + "title": "givenPortOnly", + "description": "Only attempt to query server on given port.", + "type": "boolean", + "options": { + "grid_columns": 6 + } + }, + "requestRules": { + "title": "requestRules (Valve)", + "description": "Additional server info may be fetched into the raw field.", + "type": "boolean", + "options": { + "grid_columns": 6 + } + }, + "teamspeakQueryPort": { + "title": "teamspeakQueryPort (TeamSpeak 3)", + "type": "integer", + "minimum": 1, + "maximum": 65535, + "format": "number", + "options": { + "grid_columns": 6 + } + }, + "guildId": { + "title": "guildId (Discord)", + "type": "string", + "options": { + "grid_columns": 6 + } + }, + "login": { + "title": "login (Nadeo)", + "type": "string", + "options": { + "grid_columns": 6 + } + }, + "password": { + "title": "password (Nadeo)", + "type": "string", + "options": { + "grid_columns": 6 + } + }, + "token": { + "title": "token (Terraria)", + "type": "string", + "options": { + "grid_columns": 6 + } } }, "format": "grid", diff --git a/public/main.css b/public/main.css index 0b6e216..e4f3230 100644 --- a/public/main.css +++ b/public/main.css @@ -89,11 +89,26 @@ body>nav { #config-form .json-editor-btn-add { background-color: darkgreen; } +#config-form .json-editor-btn-add span { + display: none; +} #config-form .json-editor-btn-delete { background-color: darkred; } +#config-form .json-editor-btn-delete span { + display: none; +} + +#config-form .json-editor-btn-copy { + background-color: darkblue; +} + +#config-form .json-editor-btn-copy span { + display: none; +} + footer>a>svg { fill: #c6cbd1; } diff --git a/public/main.js b/public/main.js index f97ee10..155adbd 100644 --- a/public/main.js +++ b/public/main.js @@ -33,21 +33,22 @@ $(async () => { "iconlib": "fontawesome5", "object_layout": "normal", "template": "mustache", + "compact": 0, "show_errors": "always", "required_by_default": 0, "no_additional_properties": 1, - "display_required_only": 1,//debug - "show_opt_in": 0,//debug - "remove_empty_properties": 0,//DEBUG2 - "keep_oneof_values": 0, - "ajax": 1,//debug + "display_required_only": 1, + "show_opt_in": 0, + "remove_empty_properties": 0, + "use_default_values": 1, + "ajax": 1, "ajaxCredentials": 0, "disable_edit_json": 0, "disable_collapse": 1, - "disable_properties": 0,//debug + "disable_properties": 0, "disable_array_add": 0, - "disable_array_reorder": 1, "disable_array_delete": 0, + "disable_array_reorder": 1, "enable_array_copy": 1, "array_controls_top": 0, "disable_array_delete_all_rows": 1,