Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 74e35e6

Browse files
authored
Merge pull request #108 from Bluemangoo/952
Feat: Use i18n on process config
2 parents acb082b + 31101b2 commit 74e35e6

18 files changed

+3666
-1297
lines changed

src/app/service/process_config.js

Lines changed: 132 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {
1919
TYPE_MINECRAFT_MOHIST,
2020
TYPE_MINECRAFT_MCDR
2121
} from "./instance_type";
22+
import i18n from "../i18n"
23+
const $t=i18n.global.t
2224

2325
export function getInstanceConfigByType(type) {
2426
let result = [];
@@ -32,35 +34,44 @@ export function getInstanceConfigByType(type) {
3234
// 所有配置文件列表
3335
export const INSTANCE_CONFIGS = [
3436
{
35-
// 配置文件显示名
36-
fileName: "[通用] server.properties",
37-
// 配置文件对应的实际路径(相对于实例根目录)
38-
path: "server.properties",
39-
// 配置文件用于显示界面的组件名(参考 ProcessConfigFile.vue 的 components 属性)
40-
redirect: "common/server.properties",
41-
// 配置文件解析类型,支持 yml,json,txt,properties
37+
fileName: $t("processConfig.introduction.bdsServerProperties.name"),
4238
type: "properties",
43-
// 配置文件中文解释
44-
info: `Minecraft 服务端极其重要的配置文件,几乎绝大部分常用配置(端口,人数,视距等)均在此文件中进行编辑`,
45-
// 配置文件适配模块作者名
46-
author: "Unitwk",
47-
// 配置文件 Github 地址(只能放置 Github 地址)
48-
github: "https://github.com/Unitwk",
49-
// 在哪些服务端类型下此配置文件可见
39+
info: $t("processConfig.introduction.bdsServerProperties.info"),
40+
path: "server.properties",
41+
redirect: "bds/server.properties",
42+
author: "Lazy",
43+
github: "https://github.com/LazyCreeper",
44+
category: [TYPE_MINECRAFT_BDS, TYPE_MINECRAFT_BEDROCK]
45+
},
46+
{
47+
fileName: $t("processConfig.introduction.bukkitYml.name"),
48+
type: "yml",
49+
info: $t("processConfig.introduction.bukkitYml.info"),
50+
path: "bukkit.yml",
51+
redirect: "bukkit/bukkit.yml",
52+
author: "AlexanderMC8533 & Lazy",
53+
github: "https://github.com/AlexanderMC8533/",
5054
category: [
5155
TYPE_MINECRAFT_SPIGOT,
5256
TYPE_MINECRAFT_PAPER,
5357
TYPE_MINECRAFT_JAVA,
54-
TYPE_MINECRAFT_BUKKIT,
55-
TYPE_MINECRAFT_FORGE,
56-
TYPE_MINECRAFT_FABRIC,
57-
TYPE_MINECRAFT_SPONGE
58+
TYPE_MINECRAFT_BUKKIT
5859
]
5960
},
6061
{
61-
fileName: "[通用] eula.txt",
62+
fileName: $t("processConfig.introduction.configYml.name"),
63+
type: "yml",
64+
info: $t("processConfig.introduction.configYml.info"),
65+
path: "config.yml",
66+
redirect: "bungeecord/config.yml",
67+
author: "Lazy",
68+
github: "https://github.com/LazyCreeper/",
69+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_BUNGEECORD]
70+
},
71+
{
72+
fileName: $t("processConfig.introduction.eulaTxt.name"),
6273
type: "properties",
63-
info: "软件最终用户协议,此协议必须设置同意,否则无法启用服务端软件",
74+
info: $t("processConfig.introduction.eulaTxt.info"),
6475
path: "eula.txt",
6576
redirect: "common/eula.txt",
6677
author: "Lazy",
@@ -75,11 +86,99 @@ export const INSTANCE_CONFIGS = [
7586
]
7687
},
7788
{
78-
fileName: "[Spigot] spigot.yml",
89+
fileName: $t("processConfig.introduction.geyserYml.name"),
90+
type: "yml",
91+
info: $t("processConfig.introduction.geyserYml.info"),
92+
path: "config.yml",
93+
redirect: "geyser/config.yml",
94+
author: "Lazy",
95+
github: "https://github.com/LazyCreeper",
96+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_GEYSER]
97+
},
98+
{
99+
fileName: $t("processConfig.introduction.mcdrConfigYml.name"),
100+
type: "yml",
101+
info: $t("processConfig.introduction.mcdrConfigYml.info"),
102+
path: "config.yml",
103+
redirect: "mcdr/config.yml",
104+
author: "Huaji_MUR233",
105+
github: "https://github.com/HuajiMUR233",
106+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_MCDR]
107+
},
108+
{
109+
fileName: $t("processConfig.introduction.mohistYml.name"),
110+
type: "yml",
111+
info: $t("processConfig.introduction.mohistYml.info"),
112+
path: "mohist.yml",
113+
redirect: "mohist/mohist.yml",
114+
author: "Unitwk",
115+
github: "https://github.com/LazyCreeper",
116+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_MOHIST]
117+
},
118+
{
119+
fileName: $t("processConfig.introduction.paperYml.name"),
120+
type: "yml",
121+
info: $t("processConfig.introduction.paperYml.info"),
122+
path: "paper.yml",
123+
redirect: "paper/paper.yml",
124+
author: "Lazy",
125+
github: "https://github.com/LazyCreeper",
126+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_PAPER]
127+
},
128+
{
129+
fileName: $t("processConfig.introduction.paperGlobalYml.name"),
130+
type: "yml",
131+
info: $t("processConfig.introduction.paperGlobalYml.info"),
132+
path: "config/paper-global.yml",
133+
redirect: "paper/paper-global.yml",
134+
author: "Lazy",
135+
github: "https://github.com/LazyCreeper",
136+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_PAPER]
137+
},
138+
{
139+
fileName: $t("processConfig.introduction.paperWorldDefaults.name"),
140+
type: "yml",
141+
info: $t("processConfig.introduction.paperWorldDefaults.info"),
142+
path: "config/paper-world-defaults.yml",
143+
redirect: "paper/paper-world-defaults.yml",
144+
author: "Lazy",
145+
github: "https://github.com/LazyCreeper",
146+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_PAPER]
147+
},
148+
{
149+
fileName: $t("processConfig.introduction.permissionYml.name"),
150+
type: "yml",
151+
info: $t("processConfig.introduction.permissionYml.info"),
152+
path: "permission.yml",
153+
redirect: "mcdr/permission.yml",
154+
author: "Huaji_MUR233",
155+
github: "https://github.com/HuajiMUR233",
156+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_MCDR]
157+
},
158+
{
159+
fileName: $t("processConfig.introduction.serverProperties.name"),
160+
type: "properties",
161+
info: $t("processConfig.introduction.serverProperties.info"),
162+
path: "server.properties",
163+
redirect: "common/server.properties",
164+
author: "Unitwk",
165+
github: "https://github.com/Unitwk",
166+
category: [
167+
TYPE_MINECRAFT_SPIGOT,
168+
TYPE_MINECRAFT_PAPER,
169+
TYPE_MINECRAFT_JAVA,
170+
TYPE_MINECRAFT_BUKKIT,
171+
TYPE_MINECRAFT_FORGE,
172+
TYPE_MINECRAFT_FABRIC,
173+
TYPE_MINECRAFT_SPONGE
174+
]
175+
},
176+
{
177+
fileName: $t("processConfig.introduction.spigotYml.name"),
178+
type: "yml",
179+
info: $t("processConfig.introduction.spigotYml.info"),
79180
path: "spigot.yml",
80181
redirect: "bukkit/spigot.yml",
81-
type: "yml",
82-
info: "Spigot 配置文件,能够进一步的控制服务器的行为和具体参数,一些更为高级的限制都在此配置文件中",
83182
author: "Unitwk",
84183
github: "https://github.com/Unitwk",
85184
category: [
@@ -89,6 +188,16 @@ export const INSTANCE_CONFIGS = [
89188
TYPE_MINECRAFT_BUKKIT
90189
]
91190
},
191+
{
192+
fileName: $t("processConfig.introduction.velocityToml.name"),
193+
type: "toml",
194+
info: $t("processConfig.introduction.velocityToml.info"),
195+
path: "velocity.toml",
196+
redirect: "velocity/velocity.toml",
197+
author: "WhitePaper233",
198+
github: "https://github.com/WhitePaper233/",
199+
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_VELOCITY]
200+
}
92201
// {
93202
// fileName: "[Bukkit] permissions.yml",
94203
// path: "permissions.yml",
@@ -109,21 +218,6 @@ export const INSTANCE_CONFIGS = [
109218
// github: "https://github.com/Unitwk",
110219
// category: [TYPE_MINECRAFT_SPIGOT, TYPE_MINECRAFT_PAPER, TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_BUKKIT]
111220
// },
112-
{
113-
fileName: "[Bukkit] bukkit.yml",
114-
path: "bukkit.yml",
115-
redirect: "bukkit/bukkit.yml",
116-
type: "yml",
117-
info: "Bukkit 原始配置文件",
118-
author: "AlexanderMC8533 & Lazy",
119-
github: "https://github.com/AlexanderMC8533/",
120-
category: [
121-
TYPE_MINECRAFT_SPIGOT,
122-
TYPE_MINECRAFT_PAPER,
123-
TYPE_MINECRAFT_JAVA,
124-
TYPE_MINECRAFT_BUKKIT
125-
]
126-
},
127221
// {
128222
// fileName: "[Bukkit] whitelist.json",
129223
// type: "json",
@@ -144,104 +238,4 @@ export const INSTANCE_CONFIGS = [
144238
// github: "https://github.com/Unitwk",
145239
// category: [TYPE_MINECRAFT_SPIGOT, TYPE_MINECRAFT_PAPER, TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_BUKKIT]
146240
// },
147-
{
148-
fileName: "[Bungeecord] config.yml",
149-
type: "yml",
150-
info: "Bungeecord 群组服务端的重要配置文件,可以进行分布式管理,节点控制等,但此配置文件较为复杂,此处仅供简单的配置和操作",
151-
path: "config.yml",
152-
redirect: "bungeecord/config.yml",
153-
author: "Lazy",
154-
github: "https://github.com/LazyCreeper/",
155-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_BUNGEECORD]
156-
},
157-
{
158-
fileName: "[Velocity] velocity.toml",
159-
type: "toml",
160-
info: "Velocity 群组服务端的重要配置文件,可以进行分布式管理,节点控制等,但此配置文件较为复杂,此处仅供简单的配置和操作",
161-
path: "velocity.toml",
162-
redirect: "velocity/velocity.toml",
163-
author: "WhitePaper233",
164-
github: "https://github.com/WhitePaper233/",
165-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_VELOCITY]
166-
},
167-
{
168-
fileName: "[Bedrock] server.properties",
169-
path: "server.properties",
170-
redirect: "bds/server.properties",
171-
type: "properties",
172-
info: `Minecraft Bedrock 服务端极其重要的配置文件,几乎绝大部分常用配置(端口,人数,视距等)均在此文件中进行编辑`,
173-
author: "Lazy",
174-
github: "https://github.com/LazyCreeper",
175-
category: [TYPE_MINECRAFT_BDS, TYPE_MINECRAFT_BEDROCK]
176-
},
177-
{
178-
fileName: "[Mohist] mohist.yml",
179-
path: "mohist.yml",
180-
redirect: "mohist/mohist.yml",
181-
type: "yml",
182-
info: "mohist.yml 服务端配置文件",
183-
author: "Unitwk",
184-
github: "https://github.com/LazyCreeper",
185-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_MOHIST]
186-
},
187-
{
188-
fileName: "[Paper] paper.yml",
189-
type: "yml",
190-
info: "PaperSpigot 服务端软件配置文件,能够进一步的配置高级参数以及更具体化的游戏设置,对整体性能有极大的决定效果",
191-
path: "paper.yml",
192-
redirect: "paper/paper.yml",
193-
author: "Lazy",
194-
github: "https://github.com/LazyCreeper",
195-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_PAPER]
196-
},
197-
{
198-
fileName: "[Paper] paper-global.yml",
199-
type: "yml",
200-
info: "PaperSpigot 服务端软件全局配置文件,能够进一步的配置高级参数以及更具体化的游戏设置,对整体性能有极大的决定效果",
201-
path: "config/paper-global.yml",
202-
redirect: "paper/paper-global.yml",
203-
author: "Lazy",
204-
github: "https://github.com/LazyCreeper",
205-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_PAPER]
206-
},
207-
{
208-
fileName: "[Paper] paper-world-defaults.yml",
209-
type: "yml",
210-
info: "PaperSpigot 服务端软件世界配置文件,能够进一步在每个世界的基础上进行配置",
211-
path: "config/paper-world-defaults.yml",
212-
redirect: "paper/paper-world-defaults.yml",
213-
author: "Lazy",
214-
github: "https://github.com/LazyCreeper",
215-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_PAPER]
216-
},
217-
{
218-
fileName: "[Geyser] config.yml",
219-
type: "yml",
220-
info: "Geyser 服务端软件配置文件,拥有基本的服务器参数设定(如端口,最大玩家数等)并且也可以设定服务端细节参数(区块缓存,线程数等)",
221-
path: "config.yml",
222-
redirect: "geyser/config.yml",
223-
author: "Lazy",
224-
github: "https://github.com/LazyCreeper",
225-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_GEYSER]
226-
},
227-
{
228-
fileName: "[MCDR] config.yml",
229-
type: "yml",
230-
info: "MCDReforged 服务端控制工具配置文件",
231-
path: "config.yml",
232-
redirect: "mcdr/config.yml",
233-
author: "Huaji_MUR233",
234-
github: "https://github.com/HuajiMUR233",
235-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_MCDR]
236-
},
237-
{
238-
fileName: "[MCDR] permission.yml",
239-
type: "yml",
240-
info: "MCDReforged 服务端控制工具权限配置文件",
241-
path: "permission.yml",
242-
redirect: "mcdr/permission.yml",
243-
author: "Huaji_MUR233",
244-
github: "https://github.com/HuajiMUR233",
245-
category: [TYPE_MINECRAFT_JAVA, TYPE_MINECRAFT_MCDR]
246-
}
247241
];

src/app/views/Terminal/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@
197197
<template #title>{{ $t("terminal.functionGroup") }}</template>
198198
<template #default>
199199
<el-row :gutter="10">
200-
<el-col :lg="24" :offset="0" class="row-mb" v-iszh v-if="isShowInstanceConfig">
200+
<el-col :lg="24" :offset="0" class="row-mb" v-if="isShowInstanceConfig">
201201
<el-button
202202
:disabled="!instanceInfo.config.type"
203203
icon="el-icon-s-operation"

0 commit comments

Comments
 (0)