|
91 | 91 | }); |
92 | 92 | }; |
93 | 93 |
|
94 | | - /* |
| 94 | + |
95 | 95 | //服务器控制台 |
96 | 96 | MI.routeListener("server/console", function (data) { |
97 | 97 | if (data.obj == null) { |
98 | 98 | TOOLS.pushMsgWindow("您并不拥有这个服务器的所有权,需要管理员设定"); |
99 | 99 | VIEW_MODEL["ConsolePanel"].serverData.name = null; |
100 | 100 | } |
101 | 101 | MI.routeCopy("ConsolePanel", data.obj); |
102 | | - });*/ |
| 102 | + }); |
103 | 103 |
|
104 | 104 | // Minecraft 服务器终端换行替换符 |
105 | 105 | var terminalEncode = function (text) { |
|
145 | 145 | eleTerminal.innerHTML = text + eleTerminal.innerHTML; |
146 | 146 | } |
147 | 147 | }); |
148 | | - |
149 | | - // 普通用户主页 |
150 | | - MI.routeListener("genuser/home", function (data) { |
151 | | - MI.routeCopy("GenHome", data.obj); |
152 | | - }); |
153 | | - MI.routeListener("genuser/view", function (data) { |
154 | | - MI.routeCopy("GenRePassword", data.obj); |
155 | | - }); |
156 | | - MI.routeListener("genuser/banned", function (data) { |
157 | | - MI.routeCopy("BannedPanel", data.obj); |
158 | | - }); |
159 | | - |
160 | | - //分布式服务路由 |
161 | | - MI.routeListener("workers", function (data) { |
162 | | - MI.routeCopy("Workers", data.obj); |
163 | | - }); |
164 | | - MI.routeListener("workers/view", function (data) { |
165 | | - MI.routeCopy("WorkerView", data.obj); |
166 | | - }); |
167 | | - MI.routeListener("workers/center", function (data) { |
168 | | - MI.routeCopy("centerShow", data.obj); |
169 | | - }); |
170 | | - |
171 | | - // 配置项试图 |
172 | | - MI.routeListener("server/properties", function (data) { |
173 | | - MI.routeCopy("ServerProperties", data.obj); |
174 | | - }); |
175 | | - |
176 | | - // 计划任务列表 |
177 | | - MI.routeListener("schedule/list", function (data) { |
178 | | - MI.routeCopy("ServerSchedule", data.obj); |
179 | | - }); |
180 | | - |
181 | 148 | // 初始化终端 |
182 | 149 | function initTerminal() { |
183 | 150 | // 若终端未初始化则初始化终端与其方法 |
|
214 | 181 | // MCSERVER.term.prompt(); |
215 | 182 | }; |
216 | 183 |
|
217 | | - term.simpleLoadHistory = function () { |
218 | | - WS.sendMsg( |
219 | | - "server/console/history", |
220 | | - JSON.stringify({ |
221 | | - serverName: PAGE.serverName |
222 | | - }) |
223 | | - ); |
| 184 | + term.simpleLoadHistory = async function () { |
| 185 | + await WS.call("server/console/history", { serverName: PAGE.serverName }); |
224 | 186 | }; |
225 | 187 | } |
226 | 188 | // 清空屏幕并输出基本欢迎语 |
|
233 | 195 | command: "" |
234 | 196 | }, |
235 | 197 | methods: { |
236 | | - toOpenServer: function () { |
237 | | - WS.sendMsg("server/console/open", PAGE.serverName); |
| 198 | + toOpenServer: async function () { |
| 199 | + await WS.call("server/console/open", PAGE.serverName); |
238 | 200 | }, |
239 | | - toCommand: function (parCommand) { |
| 201 | + toCommand: async function (parCommand) { |
240 | 202 | if (parCommand && typeof parCommand == "string") this.command = parCommand; |
241 | 203 | MCSERVER.term.prompt(this.command); |
242 | 204 | console.log("发送命令:", this.command); |
|
246 | 208 | }; |
247 | 209 | if (this.command.length >= 1 || typeof parCommand == "string") { |
248 | 210 | //压入命令栈 并 发送 |
249 | | - WS.sendMsg("server/console/command", data); |
| 211 | + await WS.call("server/console/command", data); |
250 | 212 | } |
251 | 213 | this.command = ""; |
252 | 214 | }, |
253 | 215 | stopServer: function () { |
254 | 216 | this.toCommand("__stop__"); |
255 | 217 | }, |
256 | | - simpleLoadHistory: function () { |
257 | | - WS.sendMsg( |
| 218 | + simpleLoadHistory: async function () { |
| 219 | + await WS.call( |
258 | 220 | "server/console/history", |
259 | 221 | JSON.stringify({ |
260 | 222 | serverName: PAGE.serverName |
|
0 commit comments