Moved fields limit to gamedig widget
This commit is contained in:
parent
0fcfaea47e
commit
2f94c1ec2d
@ -296,13 +296,6 @@ export function cleanServiceGroups(groups) {
|
|||||||
} = cleanedService.widget;
|
} = cleanedService.widget;
|
||||||
|
|
||||||
let fieldsList = fields;
|
let fieldsList = fields;
|
||||||
|
|
||||||
const MAX_ALLOWED_FIELDS = 4;
|
|
||||||
// Limits max number of displayed fields
|
|
||||||
if (fieldsList != null && fieldsList.length > MAX_ALLOWED_FIELDS) {
|
|
||||||
fieldsList = fieldsList.slice(0, MAX_ALLOWED_FIELDS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof fields === 'string') {
|
if (typeof fields === 'string') {
|
||||||
try { JSON.parse(fields) }
|
try { JSON.parse(fields) }
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|||||||
@ -17,6 +17,11 @@ export default function Component({ service }) {
|
|||||||
if (widget.fields == null || widget.fields.length === 0) {
|
if (widget.fields == null || widget.fields.length === 0) {
|
||||||
widget.fields = ["map", "currentPlayers", "ping"];
|
widget.fields = ["map", "currentPlayers", "ping"];
|
||||||
}
|
}
|
||||||
|
const MAX_ALLOWED_FIELDS = 4;
|
||||||
|
// Limits max number of displayed fields
|
||||||
|
if (widget.fields != null && widget.fields.length > MAX_ALLOWED_FIELDS) {
|
||||||
|
widget.fields = widget.fields.slice(0, MAX_ALLOWED_FIELDS);
|
||||||
|
}
|
||||||
|
|
||||||
if (!serverData) {
|
if (!serverData) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user