@gameap/frontend 4.1.0-dev1 → 4.1.0-dev3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AdminClientCertificatesView-DQTMJ6LY.js +368 -0
- package/dist/AdminDaemonTaskListView-Bx3e0Miy.js +316 -0
- package/dist/AdminDaemonTaskOutputView-BJtLdoAq.js +87 -0
- package/dist/AdminGamesEdit-hDe3Pr-7.js +470 -0
- package/dist/AdminGamesList-CM1xADCW.js +500 -0
- package/dist/AdminModEdit-DDKd6Vga.js +526 -0
- package/dist/AdminNodeShowView-DMoEY2Cu.js +167 -0
- package/dist/AdminNodesCreateView-BXZDQIJ1.js +85 -0
- package/dist/AdminNodesEditView-xO7-szjJ.js +66 -0
- package/dist/AdminNodesView-ugTPiC4h.js +161 -0
- package/dist/AdminServersCreate-DOygFz_E.js +345 -0
- package/dist/AdminServersEdit-cZX6UGB1.js +400 -0
- package/dist/AdminServersList-CC50WRsv.js +165 -0
- package/dist/AdminUsersEditView-CXpMKFfI.js +305 -0
- package/dist/AdminUsersView-DGuGEHVR.js +443 -0
- package/dist/CreateModForm-CqhcrNFp.js +122 -0
- package/dist/CreateNodeModal-BvbJTKhD.js +93 -0
- package/dist/DsIpSelector-DN9IyT4L.js +90 -0
- package/dist/FileManager-8TWHezyM.js +31882 -0
- package/dist/GameModSelector-DRIaCbGY.js +94 -0
- package/dist/InputManyList-By5xECIK.js +110 -0
- package/dist/InputTextList-Bm2Ofq5J.js +63 -0
- package/dist/PluginPendingView-DHd_yijv.js +31 -0
- package/dist/RconConsole-DH9XeOu3.js +75 -0
- package/dist/RconPlayers-GrvCMJX3.js +420 -0
- package/dist/ServerConsole-BHHnpxJy.js +98 -0
- package/dist/ServerIdView-BfqrYuar.js +577 -0
- package/dist/ServerSelector-QMK1qiXa.js +52 -0
- package/dist/ServerSettings-Cz6C8Dlh.js +84 -0
- package/dist/ServerStatus-DBJW9C6H.js +63 -0
- package/dist/ServerTasks-Bs3iGYY3.js +854 -0
- package/dist/SettingsParameters-DCqhqxHk.js +87 -0
- package/dist/SmartPortSelector-DektJC6p.js +161 -0
- package/dist/UpdateNodeForm-CwirLUIK.js +648 -0
- package/dist/UserServerPrivileges-utyKdh7O.js +318 -0
- package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
- package/dist/_createCompounder-DSupx5mD.js +241 -0
- package/dist/camelCase-WcUYdRB3.js +8 -0
- package/dist/capitalize-DRKkBaYR.js +40 -0
- package/dist/clientCertificates-BsJdUHYw.js +53 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon-96x96.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/fonts/gicon.eot +0 -0
- package/dist/fonts/gicon.svg +33 -0
- package/dist/fonts/gicon.ttf +0 -0
- package/dist/fonts/gicon.woff +0 -0
- package/dist/fonts/gicon.woff2 +0 -0
- package/dist/frontend.css +14 -0
- package/dist/gameList-DpGDCxFE.js +115 -0
- package/dist/images/gap_logo_white.png +0 -0
- package/dist/images/gap_logo_white_mini.png +0 -0
- package/dist/images/gicon.svg +18 -0
- package/dist/images/icons/save-white.svg +1 -0
- package/dist/images/icons/save.svg +1 -0
- package/dist/index-60qEjGuU.js +5371 -0
- package/dist/index.js +1 -0
- package/dist/loader-CrZTMKcy.js +131 -0
- package/dist/mockServiceWorker.js +349 -0
- package/dist/snakeCase-CTCA7tap.js +7 -0
- package/package.json +2 -2
|
@@ -0,0 +1,420 @@
|
|
|
1
|
+
import { resolveComponent as k, createElementBlock as u, openBlock as m, createVNode as f, withCtx as h, createElementVNode as s, createCommentVNode as c, toDisplayString as o, Fragment as O, renderList as D, withDirectives as _, vModelText as w, ref as G } from "vue";
|
|
2
|
+
import { storeToRefs as L } from "pinia";
|
|
3
|
+
import { S as B, E as S, F as T, G as C, H as U, I as M, J as z, K, L as R, M as V, N as I, O as H, P as q, Q as J, R as Q, T as W, U as X, b as Y, _ as Z, n as P, e as E, u as x, V as v } from "./index-60qEjGuU.js";
|
|
4
|
+
import { u as $ } from "./ServerIdView-BfqrYuar.js";
|
|
5
|
+
import "naive-ui";
|
|
6
|
+
var j = 1, ee = 2;
|
|
7
|
+
function re(e, r, n, i) {
|
|
8
|
+
var a = n.length, t = a;
|
|
9
|
+
if (e == null)
|
|
10
|
+
return !t;
|
|
11
|
+
for (e = Object(e); a--; ) {
|
|
12
|
+
var d = n[a];
|
|
13
|
+
if (d[2] ? d[1] !== e[d[0]] : !(d[0] in e))
|
|
14
|
+
return !1;
|
|
15
|
+
}
|
|
16
|
+
for (; ++a < t; ) {
|
|
17
|
+
d = n[a];
|
|
18
|
+
var p = d[0], g = e[p], l = d[1];
|
|
19
|
+
if (d[2]) {
|
|
20
|
+
if (g === void 0 && !(p in e))
|
|
21
|
+
return !1;
|
|
22
|
+
} else {
|
|
23
|
+
var b = new B(), y;
|
|
24
|
+
if (!(y === void 0 ? S(l, g, j | ee, i, b) : y))
|
|
25
|
+
return !1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return !0;
|
|
29
|
+
}
|
|
30
|
+
function F(e) {
|
|
31
|
+
return e === e && !T(e);
|
|
32
|
+
}
|
|
33
|
+
function ne(e) {
|
|
34
|
+
for (var r = C(e), n = r.length; n--; ) {
|
|
35
|
+
var i = r[n], a = e[i];
|
|
36
|
+
r[n] = [i, a, F(a)];
|
|
37
|
+
}
|
|
38
|
+
return r;
|
|
39
|
+
}
|
|
40
|
+
function N(e, r) {
|
|
41
|
+
return function(n) {
|
|
42
|
+
return n == null ? !1 : n[e] === r && (r !== void 0 || e in Object(n));
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function se(e) {
|
|
46
|
+
var r = ne(e);
|
|
47
|
+
return r.length == 1 && r[0][2] ? N(r[0][0], r[0][1]) : function(n) {
|
|
48
|
+
return n === e || re(n, e, r);
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function te(e, r) {
|
|
52
|
+
return e != null && r in Object(e);
|
|
53
|
+
}
|
|
54
|
+
function oe(e, r, n) {
|
|
55
|
+
r = U(r, e);
|
|
56
|
+
for (var i = -1, a = r.length, t = !1; ++i < a; ) {
|
|
57
|
+
var d = M(r[i]);
|
|
58
|
+
if (!(t = e != null && n(e, d)))
|
|
59
|
+
break;
|
|
60
|
+
e = e[d];
|
|
61
|
+
}
|
|
62
|
+
return t || ++i != a ? t : (a = e == null ? 0 : e.length, !!a && z(a) && K(d, a) && (R(e) || V(e)));
|
|
63
|
+
}
|
|
64
|
+
function ie(e, r) {
|
|
65
|
+
return e != null && oe(e, r, te);
|
|
66
|
+
}
|
|
67
|
+
var ae = 1, le = 2;
|
|
68
|
+
function de(e, r) {
|
|
69
|
+
return I(e) && F(r) ? N(M(e), r) : function(n) {
|
|
70
|
+
var i = H(n, e);
|
|
71
|
+
return i === void 0 && i === r ? ie(n, e) : S(r, i, ae | le);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function ue(e) {
|
|
75
|
+
return function(r) {
|
|
76
|
+
return r?.[e];
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function me(e) {
|
|
80
|
+
return function(r) {
|
|
81
|
+
return q(r, e);
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function ce(e) {
|
|
85
|
+
return I(e) ? ue(M(e)) : me(e);
|
|
86
|
+
}
|
|
87
|
+
function he(e) {
|
|
88
|
+
return typeof e == "function" ? e : e == null ? J : typeof e == "object" ? R(e) ? de(e[0], e[1]) : se(e) : ce(e);
|
|
89
|
+
}
|
|
90
|
+
var fe = Q();
|
|
91
|
+
function pe(e, r) {
|
|
92
|
+
return e && fe(e, r, C);
|
|
93
|
+
}
|
|
94
|
+
var ge = W(pe);
|
|
95
|
+
function be(e, r) {
|
|
96
|
+
var n;
|
|
97
|
+
return ge(e, function(i, a, t) {
|
|
98
|
+
return n = r(i, a, t), !n;
|
|
99
|
+
}), !!n;
|
|
100
|
+
}
|
|
101
|
+
function A(e, r, n) {
|
|
102
|
+
var i = R(e) ? X : be;
|
|
103
|
+
return i(e, he(r));
|
|
104
|
+
}
|
|
105
|
+
const ye = {
|
|
106
|
+
name: "RconPlayers",
|
|
107
|
+
components: { GButton: Z },
|
|
108
|
+
props: {
|
|
109
|
+
serverId: Number
|
|
110
|
+
},
|
|
111
|
+
setup() {
|
|
112
|
+
const e = x(), r = $(), { players: n } = L(r);
|
|
113
|
+
return {
|
|
114
|
+
serverStore: e,
|
|
115
|
+
rconStore: r,
|
|
116
|
+
players: n
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
data: function() {
|
|
120
|
+
return {
|
|
121
|
+
dialogAction: null,
|
|
122
|
+
dialogPlayerIndex: null,
|
|
123
|
+
dialogPlayerName: null,
|
|
124
|
+
form: {
|
|
125
|
+
playerId: null,
|
|
126
|
+
player: {},
|
|
127
|
+
reason: null,
|
|
128
|
+
time: null,
|
|
129
|
+
message: null
|
|
130
|
+
},
|
|
131
|
+
errors: {
|
|
132
|
+
reason: null,
|
|
133
|
+
time: null,
|
|
134
|
+
message: null
|
|
135
|
+
},
|
|
136
|
+
modalEnabled: G(!1),
|
|
137
|
+
segmented: {
|
|
138
|
+
content: "soft",
|
|
139
|
+
footer: "soft"
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
},
|
|
143
|
+
methods: {
|
|
144
|
+
updatePlayers() {
|
|
145
|
+
this.rconStore.fetchPlayers();
|
|
146
|
+
},
|
|
147
|
+
openDialog(e, r) {
|
|
148
|
+
this.resetErrors(), this.resetForm(), this.dialogAction = e, this.dialogPlayerName = this.players[r].name, this.form.playerId = this.players[r].id, this.form.player = this.players[r], this.showModal();
|
|
149
|
+
},
|
|
150
|
+
showModal() {
|
|
151
|
+
this.modalEnabled = !0;
|
|
152
|
+
},
|
|
153
|
+
hideModal() {
|
|
154
|
+
this.modalEnabled = !1;
|
|
155
|
+
},
|
|
156
|
+
send() {
|
|
157
|
+
this.checkForm() && (this.dialogAction === "ban" && this.ban(), this.dialogAction === "kick" && this.kick(), this.dialogAction === "message" && this.sendMessage());
|
|
158
|
+
},
|
|
159
|
+
checkForm() {
|
|
160
|
+
this.resetErrors();
|
|
161
|
+
let e = !1;
|
|
162
|
+
switch (this.dialogAction) {
|
|
163
|
+
case "ban":
|
|
164
|
+
this.form.time || (e = !0, this.errors.time = "Empty time");
|
|
165
|
+
case "kick":
|
|
166
|
+
this.form.reason || (e = !0, this.errors.reason = "Empty reason");
|
|
167
|
+
break;
|
|
168
|
+
case "message":
|
|
169
|
+
this.form.message || (e = !0, this.errors.reason = "Empty message");
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
return !e;
|
|
173
|
+
},
|
|
174
|
+
resetErrors() {
|
|
175
|
+
this.errors = {
|
|
176
|
+
reason: null,
|
|
177
|
+
time: null,
|
|
178
|
+
message: null
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
resetForm() {
|
|
182
|
+
this.form = {
|
|
183
|
+
playerId: null,
|
|
184
|
+
reason: null,
|
|
185
|
+
time: null,
|
|
186
|
+
message: null
|
|
187
|
+
};
|
|
188
|
+
},
|
|
189
|
+
ban() {
|
|
190
|
+
this.rconStore.banPlayer(this.form.player, this.form.reason, this.form.time).then(() => {
|
|
191
|
+
this.hideModal(), P(this.trans("rcon.ban_msg_success"));
|
|
192
|
+
}).catch((e) => {
|
|
193
|
+
this.hideModal(), E(e);
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
kick() {
|
|
197
|
+
this.rconStore.kickPlayer(this.form.player, this.form.reason).then(() => {
|
|
198
|
+
this.hideModal(), P(this.trans("rcon.kick_msg_success"));
|
|
199
|
+
}).catch((e) => {
|
|
200
|
+
this.hideModal(), E(e);
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
sendMessage() {
|
|
204
|
+
this.rconStore.sendPlayerMessage(this.form.playerId, this.form.message).then(() => {
|
|
205
|
+
this.hideModal(), P(this.trans("rcon.message_msg_success"));
|
|
206
|
+
}).catch((e) => {
|
|
207
|
+
this.hideModal(), E(e);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
computed: {
|
|
212
|
+
dialogTitle() {
|
|
213
|
+
switch (this.dialogAction) {
|
|
214
|
+
case "ban":
|
|
215
|
+
return this.trans("rcon.modal_title_ban", { player: this.dialogPlayerName });
|
|
216
|
+
case "kick":
|
|
217
|
+
return this.trans("rcon.modal_title_kick", { player: this.dialogPlayerName });
|
|
218
|
+
case "message":
|
|
219
|
+
return this.trans("rcon.modal_title_msg", { player: this.dialogPlayerName });
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
ipRow() {
|
|
223
|
+
return A(this.players, (e) => !v(e.ip));
|
|
224
|
+
},
|
|
225
|
+
pingRow() {
|
|
226
|
+
return A(this.players, (e) => !v(e.ping));
|
|
227
|
+
},
|
|
228
|
+
scoreRow() {
|
|
229
|
+
return A(this.players, (e) => !v(e.score));
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
mounted() {
|
|
233
|
+
this.serverStore.setServerId(this.serverId), this.rconStore.fetchPlayers();
|
|
234
|
+
}
|
|
235
|
+
}, ke = { id: "rcon-players-component" }, _e = { key: 0 }, we = { key: 1 }, Pe = { key: 2 }, Ee = { key: 0 }, ve = { key: 1 }, Ae = { key: 2 }, Me = { class: "grid grid-cols-2 gap-x-4" }, Re = { class: "hidden lg:inline" }, Se = { class: "hidden lg:inline" }, Ce = {
|
|
236
|
+
key: 0,
|
|
237
|
+
class: "mb-3"
|
|
238
|
+
}, Ie = {
|
|
239
|
+
for: "input-reason",
|
|
240
|
+
class: "control-label"
|
|
241
|
+
}, Fe = {
|
|
242
|
+
key: 0,
|
|
243
|
+
class: "help-block"
|
|
244
|
+
}, Ne = { class: "text-red-600" }, Oe = {
|
|
245
|
+
key: 1,
|
|
246
|
+
class: "mb-3"
|
|
247
|
+
}, De = {
|
|
248
|
+
for: "input-time",
|
|
249
|
+
class: "control-label"
|
|
250
|
+
}, Ge = {
|
|
251
|
+
key: 0,
|
|
252
|
+
class: "help-block"
|
|
253
|
+
}, Le = { class: "text-red-600" }, Be = {
|
|
254
|
+
key: 2,
|
|
255
|
+
class: "mb-3"
|
|
256
|
+
}, Te = {
|
|
257
|
+
for: "input-mesage",
|
|
258
|
+
class: "control-label"
|
|
259
|
+
}, Ue = {
|
|
260
|
+
key: 0,
|
|
261
|
+
class: "help-block"
|
|
262
|
+
}, ze = { class: "text-red-600" };
|
|
263
|
+
function Ke(e, r, n, i, a, t) {
|
|
264
|
+
const d = k("GButton"), p = k("n-table"), g = k("n-modal");
|
|
265
|
+
return m(), u("div", ke, [
|
|
266
|
+
f(d, {
|
|
267
|
+
color: "green",
|
|
268
|
+
size: "small",
|
|
269
|
+
class: "mb-2",
|
|
270
|
+
onClick: t.updatePlayers
|
|
271
|
+
}, {
|
|
272
|
+
default: h(() => [...r[6] || (r[6] = [
|
|
273
|
+
s("i", { class: "fas fa-sync" }, null, -1)
|
|
274
|
+
])]),
|
|
275
|
+
_: 1
|
|
276
|
+
}, 8, ["onClick"]),
|
|
277
|
+
f(p, {
|
|
278
|
+
size: "small",
|
|
279
|
+
bordered: !1
|
|
280
|
+
}, {
|
|
281
|
+
default: h(() => [
|
|
282
|
+
s("thead", null, [
|
|
283
|
+
s("tr", null, [
|
|
284
|
+
s("th", null, o(e.trans("rcon.player_name")), 1),
|
|
285
|
+
t.scoreRow ? (m(), u("th", _e, o(e.trans("rcon.player_score")), 1)) : c("", !0),
|
|
286
|
+
t.pingRow ? (m(), u("th", we, o(e.trans("rcon.player_ping")), 1)) : c("", !0),
|
|
287
|
+
t.ipRow ? (m(), u("th", Pe, o(e.trans("rcon.player_ip")), 1)) : c("", !0),
|
|
288
|
+
s("th", null, o(e.trans("main.actions")), 1)
|
|
289
|
+
])
|
|
290
|
+
]),
|
|
291
|
+
(m(!0), u(O, null, D(i.players, (l, b) => (m(), u("tbody", null, [
|
|
292
|
+
s("tr", null, [
|
|
293
|
+
s("td", null, o(l.name), 1),
|
|
294
|
+
t.scoreRow ? (m(), u("td", Ee, o(l.score), 1)) : c("", !0),
|
|
295
|
+
t.pingRow ? (m(), u("td", ve, o(l.ping), 1)) : c("", !0),
|
|
296
|
+
t.ipRow ? (m(), u("td", Ae, o(l.ip), 1)) : c("", !0),
|
|
297
|
+
s("td", Me, [
|
|
298
|
+
f(d, {
|
|
299
|
+
color: "black",
|
|
300
|
+
size: "small",
|
|
301
|
+
class: "mb-2",
|
|
302
|
+
onClick: (y) => t.openDialog("kick", b)
|
|
303
|
+
}, {
|
|
304
|
+
default: h(() => [
|
|
305
|
+
r[7] || (r[7] = s("i", { class: "gicon gicon-kick mr-1" }, null, -1)),
|
|
306
|
+
s("span", Re, o(e.trans("rcon.kick")), 1)
|
|
307
|
+
]),
|
|
308
|
+
_: 1
|
|
309
|
+
}, 8, ["onClick"]),
|
|
310
|
+
f(d, {
|
|
311
|
+
color: "black",
|
|
312
|
+
size: "small",
|
|
313
|
+
class: "mb-2",
|
|
314
|
+
onClick: (y) => t.openDialog("ban", b)
|
|
315
|
+
}, {
|
|
316
|
+
default: h(() => [
|
|
317
|
+
r[8] || (r[8] = s("i", { class: "fas fa-ban mr-1" }, null, -1)),
|
|
318
|
+
s("span", Se, o(e.trans("rcon.ban")), 1)
|
|
319
|
+
]),
|
|
320
|
+
_: 1
|
|
321
|
+
}, 8, ["onClick"])
|
|
322
|
+
])
|
|
323
|
+
])
|
|
324
|
+
]))), 256))
|
|
325
|
+
]),
|
|
326
|
+
_: 1
|
|
327
|
+
}),
|
|
328
|
+
f(g, {
|
|
329
|
+
show: e.modalEnabled,
|
|
330
|
+
"onUpdate:show": r[5] || (r[5] = (l) => e.modalEnabled = l),
|
|
331
|
+
class: "custom-card",
|
|
332
|
+
preset: "card",
|
|
333
|
+
title: t.dialogTitle,
|
|
334
|
+
bordered: !1,
|
|
335
|
+
style: { width: "600px" },
|
|
336
|
+
segmented: e.segmented
|
|
337
|
+
}, {
|
|
338
|
+
footer: h(() => [
|
|
339
|
+
s("button", {
|
|
340
|
+
type: "button",
|
|
341
|
+
class: "inline-block align-middle text-center select-none border font-normal whitespace-no-wrap rounded py-2 px-3 leading-normal no-underline bg-blue-600 text-white hover:bg-blue-600 me-1",
|
|
342
|
+
onClick: r[3] || (r[3] = (...l) => t.send && t.send(...l))
|
|
343
|
+
}, o(e.trans("main.send")), 1),
|
|
344
|
+
s("button", {
|
|
345
|
+
type: "button",
|
|
346
|
+
class: "inline-block align-middle text-center select-none border font-normal whitespace-no-wrap rounded py-2 px-3 leading-normal no-underline bg-stone-600 text-white hover:bg-stone-700",
|
|
347
|
+
onClick: r[4] || (r[4] = (...l) => t.hideModal && t.hideModal(...l))
|
|
348
|
+
}, o(e.trans("main.close")), 1)
|
|
349
|
+
]),
|
|
350
|
+
default: h(() => [
|
|
351
|
+
s("div", null, [
|
|
352
|
+
s("form", null, [
|
|
353
|
+
e.dialogAction === "ban" || e.dialogAction === "kick" ? (m(), u("div", Ce, [
|
|
354
|
+
s("label", Ie, o(e.trans("rcon.reason")), 1),
|
|
355
|
+
_(s("input", {
|
|
356
|
+
"onUpdate:modelValue": r[0] || (r[0] = (l) => e.form.reason = l),
|
|
357
|
+
id: "input-reason",
|
|
358
|
+
type: "text",
|
|
359
|
+
class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded"
|
|
360
|
+
}, null, 512), [
|
|
361
|
+
[
|
|
362
|
+
w,
|
|
363
|
+
e.form.reason,
|
|
364
|
+
void 0,
|
|
365
|
+
{ number: !0 }
|
|
366
|
+
]
|
|
367
|
+
]),
|
|
368
|
+
e.errors.reason ? (m(), u("span", Fe, [
|
|
369
|
+
s("strong", Ne, o(e.errors.reason), 1)
|
|
370
|
+
])) : c("", !0)
|
|
371
|
+
])) : c("", !0),
|
|
372
|
+
e.dialogAction === "ban" ? (m(), u("div", Oe, [
|
|
373
|
+
s("label", De, o(e.trans("rcon.time")), 1),
|
|
374
|
+
_(s("input", {
|
|
375
|
+
"onUpdate:modelValue": r[1] || (r[1] = (l) => e.form.time = l),
|
|
376
|
+
id: "input-time",
|
|
377
|
+
type: "number",
|
|
378
|
+
class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded"
|
|
379
|
+
}, null, 512), [
|
|
380
|
+
[
|
|
381
|
+
w,
|
|
382
|
+
e.form.time,
|
|
383
|
+
void 0,
|
|
384
|
+
{ number: !0 }
|
|
385
|
+
]
|
|
386
|
+
]),
|
|
387
|
+
e.errors.time ? (m(), u("span", Ge, [
|
|
388
|
+
s("strong", Le, o(e.errors.time), 1)
|
|
389
|
+
])) : c("", !0)
|
|
390
|
+
])) : c("", !0),
|
|
391
|
+
e.dialogAction === "message" ? (m(), u("div", Be, [
|
|
392
|
+
s("label", Te, o(e.trans("rcon.message")), 1),
|
|
393
|
+
_(s("input", {
|
|
394
|
+
"onUpdate:modelValue": r[2] || (r[2] = (l) => e.form.message = l),
|
|
395
|
+
id: "input-mesage",
|
|
396
|
+
type: "text",
|
|
397
|
+
class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded"
|
|
398
|
+
}, null, 512), [
|
|
399
|
+
[
|
|
400
|
+
w,
|
|
401
|
+
e.form.message,
|
|
402
|
+
void 0,
|
|
403
|
+
{ number: !0 }
|
|
404
|
+
]
|
|
405
|
+
]),
|
|
406
|
+
e.errors.message ? (m(), u("span", Ue, [
|
|
407
|
+
s("strong", ze, o(e.errors.message), 1)
|
|
408
|
+
])) : c("", !0)
|
|
409
|
+
])) : c("", !0)
|
|
410
|
+
])
|
|
411
|
+
])
|
|
412
|
+
]),
|
|
413
|
+
_: 1
|
|
414
|
+
}, 8, ["show", "title", "segmented"])
|
|
415
|
+
]);
|
|
416
|
+
}
|
|
417
|
+
const We = /* @__PURE__ */ Y(ye, [["render", Ke]]);
|
|
418
|
+
export {
|
|
419
|
+
We as default
|
|
420
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ref as l, onMounted as C, onUnmounted as N, createElementBlock as t, openBlock as s, createElementVNode as o, createCommentVNode as k, createVNode as T, toDisplayString as v, withDirectives as I, withKeys as A, vModelText as V, unref as B, createTextVNode as R } from "vue";
|
|
2
|
+
import { a as _, r as S, e as D } from "./index-60qEjGuU.js";
|
|
3
|
+
import { NDivider as H } from "naive-ui";
|
|
4
|
+
const $ = { class: "w-full" }, E = { class: "coding inverse-toggle px-5 pt-4 shadow-lg text-stone-100 text-sm font-mono subpixel-antialiased bg-stone-800 dark:bg-stone-900 pb-6 pt-4 rounded-lg leading-normal overflow-hidden" }, K = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "bg-red-500 text-white dark:bg-red-800 dark:text-stone-200 font-bold rounded px-4 py-2 mt-6 mb-3"
|
|
7
|
+
}, M = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "mt-4"
|
|
10
|
+
}, U = { class: "relative flex items-stretch w-full" }, L = { class: "w-full" }, j = { class: "inline" }, q = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "fa-solid fa-gear fa-spin"
|
|
13
|
+
}, z = ["placeholder"], F = { key: 0 }, G = { key: 1 }, Q = {
|
|
14
|
+
__name: "ServerConsole",
|
|
15
|
+
props: {
|
|
16
|
+
serverId: Number,
|
|
17
|
+
consoleHostname: String,
|
|
18
|
+
serverActive: Boolean,
|
|
19
|
+
sendCommandAvailable: Boolean
|
|
20
|
+
},
|
|
21
|
+
setup(a) {
|
|
22
|
+
const h = a, r = l(), f = l(), g = l(null), i = l(null), d = l(!1), m = l(!1), u = l(!0), c = l(!0);
|
|
23
|
+
function x() {
|
|
24
|
+
c.value && r.value && r.value.scrollTo({ top: r.value.scrollHeight, behavior: "smooth" });
|
|
25
|
+
}
|
|
26
|
+
function p() {
|
|
27
|
+
u.value && _.get(`/api/servers/${h.serverId}/console`).then((e) => {
|
|
28
|
+
g.value = S(e.data.console, /(\r\n|\n|\r)/gm, `
|
|
29
|
+
`), setTimeout(x, 1e3);
|
|
30
|
+
}).catch((e) => {
|
|
31
|
+
console.log(e), u.value = !1;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function y() {
|
|
35
|
+
d.value || (d.value = !0, m.value = !0, _.post(`/api/servers/${h.serverId}/console`, { command: i.value }).then((e) => {
|
|
36
|
+
i.value = "", d.value = !1, u.value = !0, setTimeout(p, 1e3);
|
|
37
|
+
}).catch((e) => {
|
|
38
|
+
d.value = !1, console.log(e), D(e);
|
|
39
|
+
}).finally(() => {
|
|
40
|
+
m.value = !1, setTimeout(() => {
|
|
41
|
+
f.value && f.value.select();
|
|
42
|
+
}, 200);
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
let w;
|
|
46
|
+
return C(() => {
|
|
47
|
+
p(), w = setInterval(p, 1e4);
|
|
48
|
+
}), N(() => {
|
|
49
|
+
u.value = !1, clearInterval(w);
|
|
50
|
+
}), (e, n) => (s(), t("div", null, [
|
|
51
|
+
o("div", $, [
|
|
52
|
+
o("div", E, [
|
|
53
|
+
n[2] || (n[2] = o("div", { class: "top mb-2 flex" }, [
|
|
54
|
+
o("div", { class: "h-3 w-3 bg-red-500 rounded-full" }),
|
|
55
|
+
o("div", { class: "ml-2 h-3 w-3 bg-orange-300 rounded-full" }),
|
|
56
|
+
o("div", { class: "ml-2 h-3 w-3 bg-green-500 rounded-full" })
|
|
57
|
+
], -1)),
|
|
58
|
+
a.serverActive ? k("", !0) : (s(), t("div", K, v(e.trans("servers.offline_console_msg")), 1)),
|
|
59
|
+
o("div", {
|
|
60
|
+
ref_key: "consoleRef",
|
|
61
|
+
ref: r,
|
|
62
|
+
class: "break-all whitespace-pre-wrap mt-4 flex h-[60vh] overflow-y-scroll overscroll-contain"
|
|
63
|
+
}, v(g.value), 513),
|
|
64
|
+
a.serverActive && a.sendCommandAvailable ? (s(), t("div", M, [
|
|
65
|
+
o("div", U, [
|
|
66
|
+
o("div", L, [
|
|
67
|
+
o("div", j, v(a.consoleHostname) + ":> ", 1),
|
|
68
|
+
m.value ? (s(), t("i", q)) : I((s(), t("input", {
|
|
69
|
+
key: 1,
|
|
70
|
+
onKeyup: A(y, ["enter"]),
|
|
71
|
+
"onUpdate:modelValue": n[0] || (n[0] = (b) => i.value = b),
|
|
72
|
+
type: "text",
|
|
73
|
+
ref_key: "inputRef",
|
|
74
|
+
ref: f,
|
|
75
|
+
class: "terminal-input inline md:w-[40vw] lg:w-[50vw]",
|
|
76
|
+
placeholder: e.trans("servers.enter_command") + " ..."
|
|
77
|
+
}, null, 40, z)), [
|
|
78
|
+
[V, i.value]
|
|
79
|
+
])
|
|
80
|
+
])
|
|
81
|
+
])
|
|
82
|
+
])) : k("", !0),
|
|
83
|
+
T(B(H), { dashed: "" }),
|
|
84
|
+
o("div", {
|
|
85
|
+
class: "p-1 cursor-pointer inline",
|
|
86
|
+
onClick: n[1] || (n[1] = (b) => c.value = !c.value)
|
|
87
|
+
}, [
|
|
88
|
+
c.value ? (s(), t("span", F, "[x]")) : (s(), t("span", G, "[ ]")),
|
|
89
|
+
R(" " + v(e.trans("main.autoscroll")), 1)
|
|
90
|
+
])
|
|
91
|
+
])
|
|
92
|
+
])
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
export {
|
|
97
|
+
Q as default
|
|
98
|
+
};
|