From b656ab1b64b2dee575864f0d75fc3eef73ed8d60 Mon Sep 17 00:00:00 2001
From: mcchampions <1309635304@qq.com>
Date: Thu, 15 Aug 2024 11:19:24 +0800
Subject: [PATCH] Revert "Update config-editor.tsx"
This reverts commit 68dc70f216bb99359f2999548d6cf940675a2657.
---
src/pages/utilities/config-editor.tsx | 71 ++-------------------------
1 file changed, 3 insertions(+), 68 deletions(-)
diff --git a/src/pages/utilities/config-editor.tsx b/src/pages/utilities/config-editor.tsx
index 273513c..31d83e4 100644
--- a/src/pages/utilities/config-editor.tsx
+++ b/src/pages/utilities/config-editor.tsx
@@ -4,7 +4,6 @@ import HeroBackground from '@site/static/img/site/split-background.webp';
import Layout from '@theme/Layout';
import styles from './utilities.module.scss';
import { useRef, useState } from 'react';
-import {renderToString} from "react-dom/server";
const ConfigEditorPage: React.FC = () => {
const [config, setConfig] = useState('');
@@ -102,12 +101,11 @@ const ConfigEditorPage: React.FC = () => {
val += splitLine[j];
}
val = val.trim();
- /*
+
if (splitLine[0].includes('proxy-protocol-whitelisted-ips')) {
currentComment = '';
continue;
}
- */
if (commented) {
currentComment += 'Note: This option is commented on, and if you change it, it will be automatically uncommented.' + '
';
@@ -178,7 +176,7 @@ const ConfigEditorPage: React.FC = () => {
function getInput(name, value) {
const handleChange = (event) => {
- const {id, value, type, checked} = event.target;
+ const { id, value, type, checked } = event.target;
editedConfig.current = {
...editedConfig.current,
@@ -186,52 +184,6 @@ const ConfigEditorPage: React.FC = () => {
};
}
- const listInputIdMap = {
- 'bedrock.proxy-protocol-whitelisted-ips': 0
- }
-
- const addInput = (id) => {
- let parentNode = document.getElementById(id);
- const name = id.replace('listEditor_','');
- let index = listInputIdMap[name];
- let inputId = "listInput_" + name + index;
- index++;
- const node = document.createRange().createContextualFragment(
- renderToString(