@gameap/frontend 4.1.0-dev1 → 4.1.0-dev11
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-Bg8X_Ouc.js +370 -0
- package/dist/AdminDaemonTaskListView-DbJp0aqQ.js +316 -0
- package/dist/AdminDaemonTaskOutputView-DNCHQfxx.js +87 -0
- package/dist/AdminGamesEdit-jco7cBfk.js +473 -0
- package/dist/AdminGamesList-CMjsgEpx.js +518 -0
- package/dist/AdminModEdit-BlRu_09M.js +529 -0
- package/dist/AdminNodeShowView-BHxJkjYJ.js +175 -0
- package/dist/AdminNodesCreateView-DihmM46W.js +87 -0
- package/dist/AdminNodesEditView-CVACSido.js +65 -0
- package/dist/AdminNodesView-CHtiU6dZ.js +167 -0
- package/dist/AdminPluginsView-CRjF3BPs.js +984 -0
- package/dist/AdminServersCreate-5f8x6eZO.js +342 -0
- package/dist/AdminServersEdit-CA7711nJ.js +400 -0
- package/dist/AdminServersList-De5ZMEGZ.js +168 -0
- package/dist/AdminUsersEditView-DeYo98vi.js +308 -0
- package/dist/AdminUsersView-C8fKEhpr.js +446 -0
- package/dist/CreateModForm-CqkvVLfN.js +123 -0
- package/dist/CreateNodeModal-DOXVtVLQ.js +100 -0
- package/dist/DsIpSelector-C676Y19X.js +90 -0
- package/dist/EmptyView-Bf6zmQQt.js +9 -0
- package/dist/FileManager-DSa9v4Ex.js +5932 -0
- package/dist/GameIcon-DaYNlnur.js +87 -0
- package/dist/GameModSelector-CQBT8ZLu.js +95 -0
- package/dist/InputManyList-DUOtepb8.js +110 -0
- package/dist/InputTextList-lPhVIV04.js +63 -0
- package/dist/PluginPendingView-DaDaN30Q.js +34 -0
- package/dist/ProfileView-Dw2T3X8m.js +295 -0
- package/dist/RconConsole-CvxNBv0B.js +74 -0
- package/dist/RconPlayers-odUKa0Ps.js +424 -0
- package/dist/ServerConsole-B9v2PcWb.js +99 -0
- package/dist/ServerControlButton-D_zJbxr6.js +186 -0
- package/dist/ServerIdView-_vGQRk7y.js +609 -0
- package/dist/ServerSelector-6fCqL3e9.js +52 -0
- package/dist/ServerSettings-C6-tkLTH.js +84 -0
- package/dist/ServerStatus-CcqB0h1r.js +63 -0
- package/dist/ServerTasks-BcaZzvz7.js +857 -0
- package/dist/ServersView-S_G_kuGj.js +313 -0
- package/dist/SettingsParameters-u3Awy4Vf.js +89 -0
- package/dist/SmartPortSelector-BRSQFVqT.js +174 -0
- package/dist/TokensView-C1RFJSB5.js +392 -0
- package/dist/UpdateNodeForm-BAhzQLt-.js +652 -0
- package/dist/UserServerPrivileges-Q2wQMyHi.js +319 -0
- package/dist/_createCompounder-CXjx5-CF.js +241 -0
- package/dist/camelCase-CSrB2MWj.js +8 -0
- package/dist/capitalize-BZSBvd6d.js +40 -0
- package/dist/clientCertificates-C0FlDwsb.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 +6 -0
- package/dist/gameList-kucszmx0.js +115 -0
- package/dist/gameap.svg +3 -0
- package/dist/gameap_full.svg +9 -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-9fvX7FD-.js +3840 -0
- package/dist/index.js +1 -0
- package/dist/isEmpty-D0Z8Rneq.js +263 -0
- package/dist/join-CmlzL0H9.js +7 -0
- package/dist/loader-qtG-Lf6M.js +131 -0
- package/dist/mockServiceWorker.js +349 -0
- package/dist/snakeCase-nnM4dAra.js +7 -0
- package/dist/validators-ChBGsKft.js +65 -0
- package/package.json +6 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ref as v, computed as h, onMounted as g, createElementBlock as e, openBlock as o, createElementVNode as a, createCommentVNode as x, createVNode as c, unref as t, toDisplayString as d, Fragment as k, renderList as b, withKeys as y, withCtx as w } from "vue";
|
|
2
|
+
import { NInput as C } from "naive-ui";
|
|
3
|
+
import { l as R, _ as N, a as S, e as $ } from "./index-9fvX7FD-.js";
|
|
4
|
+
import { storeToRefs as V } from "pinia";
|
|
5
|
+
import { u as B } from "./ServerIdView-_vGQRk7y.js";
|
|
6
|
+
const E = { id: "rcon-console-component" }, F = { 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" }, I = {
|
|
7
|
+
ref: "consoleRef",
|
|
8
|
+
class: "whitespace-pre-wrap mt-4 flex h-[40vh] overflow-y-scroll overscroll-contain"
|
|
9
|
+
}, K = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "flex w-full items-center justify-center"
|
|
12
|
+
}, j = { key: 1 }, z = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "gap-x-2 mt-2"
|
|
15
|
+
}, A = ["onClick"], D = { class: "grid grid-cols-8 gap-x-2 mt-2" }, L = { class: "col-span-7 w-full" }, M = { class: "hidden lg:inline" }, P = {
|
|
16
|
+
__name: "RconConsole",
|
|
17
|
+
props: {
|
|
18
|
+
serverId: null
|
|
19
|
+
},
|
|
20
|
+
setup(T) {
|
|
21
|
+
const l = B(), { output: _, fastRcon: m } = V(l), n = v(""), u = h(() => l.loading), i = () => {
|
|
22
|
+
l.sendCommand(n.value).then(() => {
|
|
23
|
+
n.value = "";
|
|
24
|
+
}).catch((s) => {
|
|
25
|
+
$(s);
|
|
26
|
+
});
|
|
27
|
+
}, f = (s) => {
|
|
28
|
+
n.value = s, i();
|
|
29
|
+
};
|
|
30
|
+
return g(() => {
|
|
31
|
+
l.fetchFastRcon();
|
|
32
|
+
}), (s, p) => (o(), e("div", E, [
|
|
33
|
+
a("div", F, [
|
|
34
|
+
a("div", I, [
|
|
35
|
+
u.value ? (o(), e("div", K, [
|
|
36
|
+
c(t(R))
|
|
37
|
+
])) : (o(), e("div", j, d(t(_)), 1))
|
|
38
|
+
], 512)
|
|
39
|
+
]),
|
|
40
|
+
t(m) ? (o(), e("div", z, [
|
|
41
|
+
(o(!0), e(k, null, b(t(m), (r) => (o(), e("span", {
|
|
42
|
+
onClick: (U) => f(r.command),
|
|
43
|
+
class: "bg-stone-100 hover:bg-stone-200 text-stone-800 text-xs font-medium me-2 px-2.5 py-1 rounded dark:bg-stone-700 dark:text-stone-300 cursor-pointer"
|
|
44
|
+
}, d(r.info), 9, A))), 256))
|
|
45
|
+
])) : x("", !0),
|
|
46
|
+
a("div", D, [
|
|
47
|
+
a("div", L, [
|
|
48
|
+
c(t(C), {
|
|
49
|
+
value: n.value,
|
|
50
|
+
"onUpdate:value": p[0] || (p[0] = (r) => n.value = r),
|
|
51
|
+
onKeyup: y(i, ["enter"]),
|
|
52
|
+
disabled: u.value,
|
|
53
|
+
type: "text",
|
|
54
|
+
placeholder: ""
|
|
55
|
+
}, null, 8, ["value", "disabled"])
|
|
56
|
+
]),
|
|
57
|
+
c(N, {
|
|
58
|
+
color: "black",
|
|
59
|
+
size: "small",
|
|
60
|
+
onClick: i
|
|
61
|
+
}, {
|
|
62
|
+
default: w(() => [
|
|
63
|
+
c(t(S), { name: "terminal" }),
|
|
64
|
+
a("span", M, " " + d(s.trans("main.send")), 1)
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
})
|
|
68
|
+
])
|
|
69
|
+
]));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
export {
|
|
73
|
+
P as default
|
|
74
|
+
};
|
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { NTable as O, NModal as D } from "naive-ui";
|
|
2
|
+
import { resolveComponent as R, createElementBlock as u, openBlock as m, createVNode as h, withCtx as p, createElementVNode as t, createCommentVNode as c, toDisplayString as o, Fragment as L, renderList as B, withDirectives as k, vModelText as _, ref as T } from "vue";
|
|
3
|
+
import { storeToRefs as U } from "pinia";
|
|
4
|
+
import { W as z, H as S, X as H, Y as E, Z as K, $ as V, G as M, R as q, a0 as C, a1 as W, a2 as X, a3 as Y, a4 as Z, a5 as J, c as Q, a as $, _ as x, n as w, e as P, u as j } from "./index-9fvX7FD-.js";
|
|
5
|
+
import { u as ee } from "./ServerIdView-_vGQRk7y.js";
|
|
6
|
+
import { S as re, b as I, a as ne, i as v } from "./isEmpty-D0Z8Rneq.js";
|
|
7
|
+
var se = 1, te = 2;
|
|
8
|
+
function oe(e, r, n, a) {
|
|
9
|
+
var i = n.length, s = i;
|
|
10
|
+
if (e == null)
|
|
11
|
+
return !s;
|
|
12
|
+
for (e = Object(e); i--; ) {
|
|
13
|
+
var d = n[i];
|
|
14
|
+
if (d[2] ? d[1] !== e[d[0]] : !(d[0] in e))
|
|
15
|
+
return !1;
|
|
16
|
+
}
|
|
17
|
+
for (; ++i < s; ) {
|
|
18
|
+
d = n[i];
|
|
19
|
+
var f = d[0], b = e[f], y = d[1];
|
|
20
|
+
if (d[2]) {
|
|
21
|
+
if (b === void 0 && !(f in e))
|
|
22
|
+
return !1;
|
|
23
|
+
} else {
|
|
24
|
+
var l = new re(), g;
|
|
25
|
+
if (!(g === void 0 ? I(y, b, se | te, a, l) : g))
|
|
26
|
+
return !1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return !0;
|
|
30
|
+
}
|
|
31
|
+
function N(e) {
|
|
32
|
+
return e === e && !z(e);
|
|
33
|
+
}
|
|
34
|
+
function ae(e) {
|
|
35
|
+
for (var r = S(e), n = r.length; n--; ) {
|
|
36
|
+
var a = r[n], i = e[a];
|
|
37
|
+
r[n] = [a, i, N(i)];
|
|
38
|
+
}
|
|
39
|
+
return r;
|
|
40
|
+
}
|
|
41
|
+
function F(e, r) {
|
|
42
|
+
return function(n) {
|
|
43
|
+
return n == null ? !1 : n[e] === r && (r !== void 0 || e in Object(n));
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function ie(e) {
|
|
47
|
+
var r = ae(e);
|
|
48
|
+
return r.length == 1 && r[0][2] ? F(r[0][0], r[0][1]) : function(n) {
|
|
49
|
+
return n === e || oe(n, e, r);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function le(e, r) {
|
|
53
|
+
return e != null && r in Object(e);
|
|
54
|
+
}
|
|
55
|
+
function de(e, r, n) {
|
|
56
|
+
r = H(r, e);
|
|
57
|
+
for (var a = -1, i = r.length, s = !1; ++a < i; ) {
|
|
58
|
+
var d = E(r[a]);
|
|
59
|
+
if (!(s = e != null && n(e, d)))
|
|
60
|
+
break;
|
|
61
|
+
e = e[d];
|
|
62
|
+
}
|
|
63
|
+
return s || ++a != i ? s : (i = e == null ? 0 : e.length, !!i && K(i) && V(d, i) && (M(e) || q(e)));
|
|
64
|
+
}
|
|
65
|
+
function ue(e, r) {
|
|
66
|
+
return e != null && de(e, r, le);
|
|
67
|
+
}
|
|
68
|
+
var me = 1, ce = 2;
|
|
69
|
+
function he(e, r) {
|
|
70
|
+
return C(e) && N(r) ? F(E(e), r) : function(n) {
|
|
71
|
+
var a = W(n, e);
|
|
72
|
+
return a === void 0 && a === r ? ue(n, e) : I(r, a, me | ce);
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function fe(e) {
|
|
76
|
+
return function(r) {
|
|
77
|
+
return r?.[e];
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function pe(e) {
|
|
81
|
+
return function(r) {
|
|
82
|
+
return X(r, e);
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function ge(e) {
|
|
86
|
+
return C(e) ? fe(E(e)) : pe(e);
|
|
87
|
+
}
|
|
88
|
+
function be(e) {
|
|
89
|
+
return typeof e == "function" ? e : e == null ? Y : typeof e == "object" ? M(e) ? he(e[0], e[1]) : ie(e) : ge(e);
|
|
90
|
+
}
|
|
91
|
+
var ye = Z();
|
|
92
|
+
function ke(e, r) {
|
|
93
|
+
return e && ye(e, r, S);
|
|
94
|
+
}
|
|
95
|
+
var _e = J(ke);
|
|
96
|
+
function we(e, r) {
|
|
97
|
+
var n;
|
|
98
|
+
return _e(e, function(a, i, s) {
|
|
99
|
+
return n = r(a, i, s), !n;
|
|
100
|
+
}), !!n;
|
|
101
|
+
}
|
|
102
|
+
function A(e, r, n) {
|
|
103
|
+
var a = M(e) ? ne : we;
|
|
104
|
+
return a(e, be(r));
|
|
105
|
+
}
|
|
106
|
+
const Pe = {
|
|
107
|
+
name: "RconPlayers",
|
|
108
|
+
components: { GButton: x, GIcon: $ },
|
|
109
|
+
props: {
|
|
110
|
+
serverId: Number
|
|
111
|
+
},
|
|
112
|
+
setup() {
|
|
113
|
+
const e = j(), r = ee(), { players: n } = U(r);
|
|
114
|
+
return {
|
|
115
|
+
serverStore: e,
|
|
116
|
+
rconStore: r,
|
|
117
|
+
players: n
|
|
118
|
+
};
|
|
119
|
+
},
|
|
120
|
+
data: function() {
|
|
121
|
+
return {
|
|
122
|
+
dialogAction: null,
|
|
123
|
+
dialogPlayerIndex: null,
|
|
124
|
+
dialogPlayerName: null,
|
|
125
|
+
form: {
|
|
126
|
+
playerId: null,
|
|
127
|
+
player: {},
|
|
128
|
+
reason: null,
|
|
129
|
+
time: null,
|
|
130
|
+
message: null
|
|
131
|
+
},
|
|
132
|
+
errors: {
|
|
133
|
+
reason: null,
|
|
134
|
+
time: null,
|
|
135
|
+
message: null
|
|
136
|
+
},
|
|
137
|
+
modalEnabled: T(!1),
|
|
138
|
+
segmented: {
|
|
139
|
+
content: "soft",
|
|
140
|
+
footer: "soft"
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
methods: {
|
|
145
|
+
updatePlayers() {
|
|
146
|
+
this.rconStore.fetchPlayers();
|
|
147
|
+
},
|
|
148
|
+
openDialog(e, r) {
|
|
149
|
+
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();
|
|
150
|
+
},
|
|
151
|
+
showModal() {
|
|
152
|
+
this.modalEnabled = !0;
|
|
153
|
+
},
|
|
154
|
+
hideModal() {
|
|
155
|
+
this.modalEnabled = !1;
|
|
156
|
+
},
|
|
157
|
+
send() {
|
|
158
|
+
this.checkForm() && (this.dialogAction === "ban" && this.ban(), this.dialogAction === "kick" && this.kick(), this.dialogAction === "message" && this.sendMessage());
|
|
159
|
+
},
|
|
160
|
+
checkForm() {
|
|
161
|
+
this.resetErrors();
|
|
162
|
+
let e = !1;
|
|
163
|
+
switch (this.dialogAction) {
|
|
164
|
+
case "ban":
|
|
165
|
+
this.form.time || (e = !0, this.errors.time = "Empty time");
|
|
166
|
+
case "kick":
|
|
167
|
+
this.form.reason || (e = !0, this.errors.reason = "Empty reason");
|
|
168
|
+
break;
|
|
169
|
+
case "message":
|
|
170
|
+
this.form.message || (e = !0, this.errors.reason = "Empty message");
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
return !e;
|
|
174
|
+
},
|
|
175
|
+
resetErrors() {
|
|
176
|
+
this.errors = {
|
|
177
|
+
reason: null,
|
|
178
|
+
time: null,
|
|
179
|
+
message: null
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
resetForm() {
|
|
183
|
+
this.form = {
|
|
184
|
+
playerId: null,
|
|
185
|
+
reason: null,
|
|
186
|
+
time: null,
|
|
187
|
+
message: null
|
|
188
|
+
};
|
|
189
|
+
},
|
|
190
|
+
ban() {
|
|
191
|
+
this.rconStore.banPlayer(this.form.player, this.form.reason, this.form.time).then(() => {
|
|
192
|
+
this.hideModal(), w(this.trans("rcon.ban_msg_success"));
|
|
193
|
+
}).catch((e) => {
|
|
194
|
+
this.hideModal(), P(e);
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
kick() {
|
|
198
|
+
this.rconStore.kickPlayer(this.form.player, this.form.reason).then(() => {
|
|
199
|
+
this.hideModal(), w(this.trans("rcon.kick_msg_success"));
|
|
200
|
+
}).catch((e) => {
|
|
201
|
+
this.hideModal(), P(e);
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
sendMessage() {
|
|
205
|
+
this.rconStore.sendPlayerMessage(this.form.playerId, this.form.message).then(() => {
|
|
206
|
+
this.hideModal(), w(this.trans("rcon.message_msg_success"));
|
|
207
|
+
}).catch((e) => {
|
|
208
|
+
this.hideModal(), P(e);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
computed: {
|
|
213
|
+
dialogTitle() {
|
|
214
|
+
switch (this.dialogAction) {
|
|
215
|
+
case "ban":
|
|
216
|
+
return this.trans("rcon.modal_title_ban", { player: this.dialogPlayerName });
|
|
217
|
+
case "kick":
|
|
218
|
+
return this.trans("rcon.modal_title_kick", { player: this.dialogPlayerName });
|
|
219
|
+
case "message":
|
|
220
|
+
return this.trans("rcon.modal_title_msg", { player: this.dialogPlayerName });
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
ipRow() {
|
|
224
|
+
return A(this.players, (e) => !v(e.ip));
|
|
225
|
+
},
|
|
226
|
+
pingRow() {
|
|
227
|
+
return A(this.players, (e) => !v(e.ping));
|
|
228
|
+
},
|
|
229
|
+
scoreRow() {
|
|
230
|
+
return A(this.players, (e) => !v(e.score));
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
mounted() {
|
|
234
|
+
this.serverStore.setServerId(this.serverId), this.rconStore.fetchPlayers();
|
|
235
|
+
}
|
|
236
|
+
}, ve = { id: "rcon-players-component" }, Ae = { key: 0 }, Ee = { key: 1 }, Me = { key: 2 }, Re = { key: 0 }, Se = { key: 1 }, Ce = { key: 2 }, Ie = { class: "grid grid-cols-2 gap-x-4" }, Ne = { class: "hidden lg:inline" }, Fe = { class: "hidden lg:inline" }, Ge = {
|
|
237
|
+
key: 0,
|
|
238
|
+
class: "mb-3"
|
|
239
|
+
}, Oe = {
|
|
240
|
+
for: "input-reason",
|
|
241
|
+
class: "control-label"
|
|
242
|
+
}, De = {
|
|
243
|
+
key: 0,
|
|
244
|
+
class: "help-block"
|
|
245
|
+
}, Le = { class: "text-red-600" }, Be = {
|
|
246
|
+
key: 1,
|
|
247
|
+
class: "mb-3"
|
|
248
|
+
}, Te = {
|
|
249
|
+
for: "input-time",
|
|
250
|
+
class: "control-label"
|
|
251
|
+
}, Ue = {
|
|
252
|
+
key: 0,
|
|
253
|
+
class: "help-block"
|
|
254
|
+
}, ze = { class: "text-red-600" }, He = {
|
|
255
|
+
key: 2,
|
|
256
|
+
class: "mb-3"
|
|
257
|
+
}, Ke = {
|
|
258
|
+
for: "input-mesage",
|
|
259
|
+
class: "control-label"
|
|
260
|
+
}, Ve = {
|
|
261
|
+
key: 0,
|
|
262
|
+
class: "help-block"
|
|
263
|
+
}, qe = { class: "text-red-600" };
|
|
264
|
+
function We(e, r, n, a, i, s) {
|
|
265
|
+
const d = R("GIcon"), f = R("GButton"), b = O, y = D;
|
|
266
|
+
return m(), u("div", ve, [
|
|
267
|
+
h(f, {
|
|
268
|
+
color: "green",
|
|
269
|
+
size: "small",
|
|
270
|
+
class: "mb-2",
|
|
271
|
+
onClick: s.updatePlayers
|
|
272
|
+
}, {
|
|
273
|
+
default: p(() => [
|
|
274
|
+
h(d, { name: "sync" })
|
|
275
|
+
]),
|
|
276
|
+
_: 1
|
|
277
|
+
}, 8, ["onClick"]),
|
|
278
|
+
h(b, {
|
|
279
|
+
size: "small",
|
|
280
|
+
bordered: !1
|
|
281
|
+
}, {
|
|
282
|
+
default: p(() => [
|
|
283
|
+
t("thead", null, [
|
|
284
|
+
t("tr", null, [
|
|
285
|
+
t("th", null, o(e.trans("rcon.player_name")), 1),
|
|
286
|
+
s.scoreRow ? (m(), u("th", Ae, o(e.trans("rcon.player_score")), 1)) : c("", !0),
|
|
287
|
+
s.pingRow ? (m(), u("th", Ee, o(e.trans("rcon.player_ping")), 1)) : c("", !0),
|
|
288
|
+
s.ipRow ? (m(), u("th", Me, o(e.trans("rcon.player_ip")), 1)) : c("", !0),
|
|
289
|
+
t("th", null, o(e.trans("main.actions")), 1)
|
|
290
|
+
])
|
|
291
|
+
]),
|
|
292
|
+
(m(!0), u(L, null, B(a.players, (l, g) => (m(), u("tbody", null, [
|
|
293
|
+
t("tr", null, [
|
|
294
|
+
t("td", null, o(l.name), 1),
|
|
295
|
+
s.scoreRow ? (m(), u("td", Re, o(l.score), 1)) : c("", !0),
|
|
296
|
+
s.pingRow ? (m(), u("td", Se, o(l.ping), 1)) : c("", !0),
|
|
297
|
+
s.ipRow ? (m(), u("td", Ce, o(l.ip), 1)) : c("", !0),
|
|
298
|
+
t("td", Ie, [
|
|
299
|
+
h(f, {
|
|
300
|
+
color: "black",
|
|
301
|
+
size: "small",
|
|
302
|
+
class: "mb-2",
|
|
303
|
+
onClick: (G) => s.openDialog("kick", g)
|
|
304
|
+
}, {
|
|
305
|
+
default: p(() => [
|
|
306
|
+
r[6] || (r[6] = t("i", { class: "gicon gicon-kick mr-1" }, null, -1)),
|
|
307
|
+
t("span", Ne, o(e.trans("rcon.kick")), 1)
|
|
308
|
+
]),
|
|
309
|
+
_: 1
|
|
310
|
+
}, 8, ["onClick"]),
|
|
311
|
+
h(f, {
|
|
312
|
+
color: "black",
|
|
313
|
+
size: "small",
|
|
314
|
+
class: "mb-2",
|
|
315
|
+
onClick: (G) => s.openDialog("ban", g)
|
|
316
|
+
}, {
|
|
317
|
+
default: p(() => [
|
|
318
|
+
h(d, {
|
|
319
|
+
name: "ban",
|
|
320
|
+
class: "mr-1"
|
|
321
|
+
}),
|
|
322
|
+
t("span", Fe, o(e.trans("rcon.ban")), 1)
|
|
323
|
+
]),
|
|
324
|
+
_: 1
|
|
325
|
+
}, 8, ["onClick"])
|
|
326
|
+
])
|
|
327
|
+
])
|
|
328
|
+
]))), 256))
|
|
329
|
+
]),
|
|
330
|
+
_: 1
|
|
331
|
+
}),
|
|
332
|
+
h(y, {
|
|
333
|
+
show: e.modalEnabled,
|
|
334
|
+
"onUpdate:show": r[5] || (r[5] = (l) => e.modalEnabled = l),
|
|
335
|
+
class: "custom-card",
|
|
336
|
+
preset: "card",
|
|
337
|
+
title: s.dialogTitle,
|
|
338
|
+
bordered: !1,
|
|
339
|
+
style: { width: "600px" },
|
|
340
|
+
segmented: e.segmented
|
|
341
|
+
}, {
|
|
342
|
+
footer: p(() => [
|
|
343
|
+
t("button", {
|
|
344
|
+
type: "button",
|
|
345
|
+
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",
|
|
346
|
+
onClick: r[3] || (r[3] = (...l) => s.send && s.send(...l))
|
|
347
|
+
}, o(e.trans("main.send")), 1),
|
|
348
|
+
t("button", {
|
|
349
|
+
type: "button",
|
|
350
|
+
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",
|
|
351
|
+
onClick: r[4] || (r[4] = (...l) => s.hideModal && s.hideModal(...l))
|
|
352
|
+
}, o(e.trans("main.close")), 1)
|
|
353
|
+
]),
|
|
354
|
+
default: p(() => [
|
|
355
|
+
t("div", null, [
|
|
356
|
+
t("form", null, [
|
|
357
|
+
e.dialogAction === "ban" || e.dialogAction === "kick" ? (m(), u("div", Ge, [
|
|
358
|
+
t("label", Oe, o(e.trans("rcon.reason")), 1),
|
|
359
|
+
k(t("input", {
|
|
360
|
+
"onUpdate:modelValue": r[0] || (r[0] = (l) => e.form.reason = l),
|
|
361
|
+
id: "input-reason",
|
|
362
|
+
type: "text",
|
|
363
|
+
class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded"
|
|
364
|
+
}, null, 512), [
|
|
365
|
+
[
|
|
366
|
+
_,
|
|
367
|
+
e.form.reason,
|
|
368
|
+
void 0,
|
|
369
|
+
{ number: !0 }
|
|
370
|
+
]
|
|
371
|
+
]),
|
|
372
|
+
e.errors.reason ? (m(), u("span", De, [
|
|
373
|
+
t("strong", Le, o(e.errors.reason), 1)
|
|
374
|
+
])) : c("", !0)
|
|
375
|
+
])) : c("", !0),
|
|
376
|
+
e.dialogAction === "ban" ? (m(), u("div", Be, [
|
|
377
|
+
t("label", Te, o(e.trans("rcon.time")), 1),
|
|
378
|
+
k(t("input", {
|
|
379
|
+
"onUpdate:modelValue": r[1] || (r[1] = (l) => e.form.time = l),
|
|
380
|
+
id: "input-time",
|
|
381
|
+
type: "number",
|
|
382
|
+
class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded"
|
|
383
|
+
}, null, 512), [
|
|
384
|
+
[
|
|
385
|
+
_,
|
|
386
|
+
e.form.time,
|
|
387
|
+
void 0,
|
|
388
|
+
{ number: !0 }
|
|
389
|
+
]
|
|
390
|
+
]),
|
|
391
|
+
e.errors.time ? (m(), u("span", Ue, [
|
|
392
|
+
t("strong", ze, o(e.errors.time), 1)
|
|
393
|
+
])) : c("", !0)
|
|
394
|
+
])) : c("", !0),
|
|
395
|
+
e.dialogAction === "message" ? (m(), u("div", He, [
|
|
396
|
+
t("label", Ke, o(e.trans("rcon.message")), 1),
|
|
397
|
+
k(t("input", {
|
|
398
|
+
"onUpdate:modelValue": r[2] || (r[2] = (l) => e.form.message = l),
|
|
399
|
+
id: "input-mesage",
|
|
400
|
+
type: "text",
|
|
401
|
+
class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded"
|
|
402
|
+
}, null, 512), [
|
|
403
|
+
[
|
|
404
|
+
_,
|
|
405
|
+
e.form.message,
|
|
406
|
+
void 0,
|
|
407
|
+
{ number: !0 }
|
|
408
|
+
]
|
|
409
|
+
]),
|
|
410
|
+
e.errors.message ? (m(), u("span", Ve, [
|
|
411
|
+
t("strong", qe, o(e.errors.message), 1)
|
|
412
|
+
])) : c("", !0)
|
|
413
|
+
])) : c("", !0)
|
|
414
|
+
])
|
|
415
|
+
])
|
|
416
|
+
]),
|
|
417
|
+
_: 1
|
|
418
|
+
}, 8, ["show", "title", "segmented"])
|
|
419
|
+
]);
|
|
420
|
+
}
|
|
421
|
+
const xe = /* @__PURE__ */ Q(Pe, [["render", We]]);
|
|
422
|
+
export {
|
|
423
|
+
xe as default
|
|
424
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ref as l, onMounted as N, onUnmounted as T, createElementBlock as n, openBlock as t, createElementVNode as o, createCommentVNode as k, createVNode as I, toDisplayString as v, createBlock as A, withDirectives as B, unref as _, withKeys as V, vModelText as R, createTextVNode as S } from "vue";
|
|
2
|
+
import { a as $, b as x, r as D, e as H } from "./index-9fvX7FD-.js";
|
|
3
|
+
import { NDivider as E } from "naive-ui";
|
|
4
|
+
const K = { class: "w-full" }, M = { 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" }, U = {
|
|
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
|
+
}, L = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "mt-4"
|
|
10
|
+
}, j = { class: "relative flex items-stretch w-full" }, q = { class: "w-full" }, z = { class: "inline" }, F = ["placeholder"], G = { key: 0 }, J = { key: 1 }, W = {
|
|
11
|
+
__name: "ServerConsole",
|
|
12
|
+
props: {
|
|
13
|
+
serverId: Number,
|
|
14
|
+
consoleHostname: String,
|
|
15
|
+
serverActive: Boolean,
|
|
16
|
+
sendCommandAvailable: Boolean
|
|
17
|
+
},
|
|
18
|
+
setup(a) {
|
|
19
|
+
const g = a, r = l(), m = l(), h = l(null), i = l(null), d = l(!1), f = l(!1), c = l(!0), u = l(!0);
|
|
20
|
+
function y() {
|
|
21
|
+
u.value && r.value && r.value.scrollTo({ top: r.value.scrollHeight, behavior: "smooth" });
|
|
22
|
+
}
|
|
23
|
+
function p() {
|
|
24
|
+
c.value && x.get(`/api/servers/${g.serverId}/console`).then((e) => {
|
|
25
|
+
h.value = D(e.data.console, /(\r\n|\n|\r)/gm, `
|
|
26
|
+
`), setTimeout(y, 1e3);
|
|
27
|
+
}).catch((e) => {
|
|
28
|
+
console.log(e), c.value = !1;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function C() {
|
|
32
|
+
d.value || (d.value = !0, f.value = !0, x.post(`/api/servers/${g.serverId}/console`, { command: i.value }).then((e) => {
|
|
33
|
+
i.value = "", d.value = !1, c.value = !0, setTimeout(p, 1e3);
|
|
34
|
+
}).catch((e) => {
|
|
35
|
+
d.value = !1, console.log(e), H(e);
|
|
36
|
+
}).finally(() => {
|
|
37
|
+
f.value = !1, setTimeout(() => {
|
|
38
|
+
m.value && m.value.select();
|
|
39
|
+
}, 200);
|
|
40
|
+
}));
|
|
41
|
+
}
|
|
42
|
+
let b;
|
|
43
|
+
return N(() => {
|
|
44
|
+
p(), b = setInterval(p, 1e4);
|
|
45
|
+
}), T(() => {
|
|
46
|
+
c.value = !1, clearInterval(b);
|
|
47
|
+
}), (e, s) => (t(), n("div", null, [
|
|
48
|
+
o("div", K, [
|
|
49
|
+
o("div", M, [
|
|
50
|
+
s[2] || (s[2] = o("div", { class: "top mb-2 flex" }, [
|
|
51
|
+
o("div", { class: "h-3 w-3 bg-red-500 rounded-full" }),
|
|
52
|
+
o("div", { class: "ml-2 h-3 w-3 bg-orange-300 rounded-full" }),
|
|
53
|
+
o("div", { class: "ml-2 h-3 w-3 bg-green-500 rounded-full" })
|
|
54
|
+
], -1)),
|
|
55
|
+
a.serverActive ? k("", !0) : (t(), n("div", U, v(e.trans("servers.offline_console_msg")), 1)),
|
|
56
|
+
o("div", {
|
|
57
|
+
ref_key: "consoleRef",
|
|
58
|
+
ref: r,
|
|
59
|
+
class: "break-all whitespace-pre-wrap mt-4 flex h-[60vh] overflow-y-scroll overscroll-contain"
|
|
60
|
+
}, v(h.value), 513),
|
|
61
|
+
a.serverActive && a.sendCommandAvailable ? (t(), n("div", L, [
|
|
62
|
+
o("div", j, [
|
|
63
|
+
o("div", q, [
|
|
64
|
+
o("div", z, v(a.consoleHostname) + ":> ", 1),
|
|
65
|
+
f.value ? (t(), A(_($), {
|
|
66
|
+
key: 0,
|
|
67
|
+
name: "loading",
|
|
68
|
+
class: "animate-spin"
|
|
69
|
+
})) : B((t(), n("input", {
|
|
70
|
+
key: 1,
|
|
71
|
+
onKeyup: V(C, ["enter"]),
|
|
72
|
+
"onUpdate:modelValue": s[0] || (s[0] = (w) => i.value = w),
|
|
73
|
+
type: "text",
|
|
74
|
+
ref_key: "inputRef",
|
|
75
|
+
ref: m,
|
|
76
|
+
class: "terminal-input inline md:w-[40vw] lg:w-[50vw]",
|
|
77
|
+
placeholder: e.trans("servers.enter_command") + " ..."
|
|
78
|
+
}, null, 40, F)), [
|
|
79
|
+
[R, i.value]
|
|
80
|
+
])
|
|
81
|
+
])
|
|
82
|
+
])
|
|
83
|
+
])) : k("", !0),
|
|
84
|
+
I(_(E), { dashed: "" }),
|
|
85
|
+
o("div", {
|
|
86
|
+
class: "p-1 cursor-pointer inline",
|
|
87
|
+
onClick: s[1] || (s[1] = (w) => u.value = !u.value)
|
|
88
|
+
}, [
|
|
89
|
+
u.value ? (t(), n("span", G, "[x]")) : (t(), n("span", J, "[ ]")),
|
|
90
|
+
S(" " + v(e.trans("main.autoscroll")), 1)
|
|
91
|
+
])
|
|
92
|
+
])
|
|
93
|
+
])
|
|
94
|
+
]));
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
export {
|
|
98
|
+
W as default
|
|
99
|
+
};
|