@gameap/frontend 4.1.0-dev1 → 4.1.0-dev10
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,392 @@
|
|
|
1
|
+
import { mergeModels as S, ref as w, useModel as L, createElementBlock as y, openBlock as b, normalizeClass as D, createVNode as n, unref as a, withCtx as f, createBlock as O, createCommentVNode as H, createElementVNode as h, Fragment as q, renderList as F, createTextVNode as I, toDisplayString as V, computed as j, onMounted as J, h as m } from "vue";
|
|
2
|
+
import { b as x, t as s, l as z, _ as M, a as C, e as P, m as K, n as B } from "./index-9fvX7FD-.js";
|
|
3
|
+
import { defineStore as Q, storeToRefs as W } from "pinia";
|
|
4
|
+
import { NForm as X, NFormItem as E, NInput as R, NCheckbox as G, NCheckboxGroup as Y, NDataTable as Z, NModal as ee, NInputGroup as te, NButton as ae } from "naive-ui";
|
|
5
|
+
import { r as se } from "./validators-ChBGsKft.js";
|
|
6
|
+
import { i as ie } from "./isEmpty-D0Z8Rneq.js";
|
|
7
|
+
import { j as ne } from "./join-CmlzL0H9.js";
|
|
8
|
+
const le = Q("tokens", {
|
|
9
|
+
state: () => ({
|
|
10
|
+
tokens: [],
|
|
11
|
+
abilities: {},
|
|
12
|
+
apiProcesses: 0
|
|
13
|
+
}),
|
|
14
|
+
getters: {
|
|
15
|
+
loading: (t) => t.apiProcesses > 0
|
|
16
|
+
},
|
|
17
|
+
actions: {
|
|
18
|
+
async fetchTokens() {
|
|
19
|
+
this.apiProcesses++;
|
|
20
|
+
try {
|
|
21
|
+
const t = await x.get("/api/tokens");
|
|
22
|
+
this.tokens = Array.isArray(t.data) ? t.data : [];
|
|
23
|
+
} catch (t) {
|
|
24
|
+
throw t;
|
|
25
|
+
} finally {
|
|
26
|
+
this.apiProcesses--;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
async fetchAbilities() {
|
|
30
|
+
this.apiProcesses++;
|
|
31
|
+
try {
|
|
32
|
+
const t = await x.get("/api/tokens/abilities");
|
|
33
|
+
this.abilities = t.data;
|
|
34
|
+
} catch (t) {
|
|
35
|
+
throw t;
|
|
36
|
+
} finally {
|
|
37
|
+
this.apiProcesses--;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
async createToken(t, o) {
|
|
41
|
+
this.apiProcesses++;
|
|
42
|
+
try {
|
|
43
|
+
return (await x.post("/api/tokens", {
|
|
44
|
+
token_name: t,
|
|
45
|
+
abilities: o
|
|
46
|
+
})).data;
|
|
47
|
+
} catch (p) {
|
|
48
|
+
throw p;
|
|
49
|
+
} finally {
|
|
50
|
+
this.apiProcesses--;
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
async deleteToken(t) {
|
|
54
|
+
this.apiProcesses++;
|
|
55
|
+
try {
|
|
56
|
+
await x.delete("/api/tokens/" + t);
|
|
57
|
+
} catch (o) {
|
|
58
|
+
throw o;
|
|
59
|
+
} finally {
|
|
60
|
+
this.apiProcesses--;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}), oe = { class: "w-full mb-2" }, re = { class: "m-4" }, ce = { class: "ml-4 m-2" }, de = { class: "flex flex-wrap" }, ue = { class: "md:w-2/3" }, me = { class: "hidden lg:inline" }, fe = {
|
|
65
|
+
__name: "GenerateTokenForm",
|
|
66
|
+
props: /* @__PURE__ */ S({
|
|
67
|
+
loading: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
required: !1
|
|
70
|
+
},
|
|
71
|
+
abilities: {
|
|
72
|
+
type: Object,
|
|
73
|
+
required: !0
|
|
74
|
+
}
|
|
75
|
+
}, {
|
|
76
|
+
modelValue: {
|
|
77
|
+
name: "",
|
|
78
|
+
abilities: []
|
|
79
|
+
},
|
|
80
|
+
modelModifiers: {}
|
|
81
|
+
}),
|
|
82
|
+
emits: /* @__PURE__ */ S(["generate"], ["update:modelValue"]),
|
|
83
|
+
setup(t, { emit: o }) {
|
|
84
|
+
const p = t, N = w({}), l = L(t, "modelValue"), k = w({}), $ = {
|
|
85
|
+
name: {
|
|
86
|
+
required: !0,
|
|
87
|
+
validator: se(s("labels.name"))
|
|
88
|
+
},
|
|
89
|
+
abilities: {
|
|
90
|
+
required: !0,
|
|
91
|
+
validator: (r, i) => {
|
|
92
|
+
if (ie(i))
|
|
93
|
+
return new Error(
|
|
94
|
+
s("tokens.validation.abilities_required")
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, T = (r) => {
|
|
99
|
+
for (const [i] of Object.entries(p.abilities[r]))
|
|
100
|
+
k.value[r] ? l.value.abilities.includes(i) || l.value.abilities.push(i) : l.value.abilities = l.value.abilities.filter((c) => c !== i);
|
|
101
|
+
}, A = (r) => {
|
|
102
|
+
for (const [i] of Object.entries(p.abilities[r]))
|
|
103
|
+
if (!l.value.abilities.includes(i)) {
|
|
104
|
+
k.value[r] = !1;
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
k.value[r] = !0;
|
|
108
|
+
}, _ = o, U = () => {
|
|
109
|
+
N.value.validate().then(() => {
|
|
110
|
+
_("generate");
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
return (r, i) => (b(), y("div", {
|
|
114
|
+
class: D(r.$attrs.class)
|
|
115
|
+
}, [
|
|
116
|
+
n(a(X), {
|
|
117
|
+
"label-placement": "top",
|
|
118
|
+
"label-width": "auto",
|
|
119
|
+
ref_key: "formRef",
|
|
120
|
+
ref: N,
|
|
121
|
+
model: l.value,
|
|
122
|
+
rules: $
|
|
123
|
+
}, {
|
|
124
|
+
default: f(() => [
|
|
125
|
+
t.loading ? (b(), O(a(z), { key: 0 })) : H("", !0),
|
|
126
|
+
h("div", {
|
|
127
|
+
class: D(["mb-4", t.loading ? "hidden" : ""])
|
|
128
|
+
}, [
|
|
129
|
+
n(a(E), {
|
|
130
|
+
label: a(s)("labels.name"),
|
|
131
|
+
path: "name"
|
|
132
|
+
}, {
|
|
133
|
+
default: f(() => [
|
|
134
|
+
n(a(R), {
|
|
135
|
+
value: l.value.name,
|
|
136
|
+
"onUpdate:value": i[0] || (i[0] = (c) => l.value.name = c),
|
|
137
|
+
type: "text"
|
|
138
|
+
}, null, 8, ["value"])
|
|
139
|
+
]),
|
|
140
|
+
_: 1
|
|
141
|
+
}, 8, ["label"]),
|
|
142
|
+
n(a(E), {
|
|
143
|
+
label: a(s)("tokens.abilities"),
|
|
144
|
+
path: "abilities"
|
|
145
|
+
}, {
|
|
146
|
+
default: f(() => [
|
|
147
|
+
h("div", oe, [
|
|
148
|
+
(b(!0), y(q, null, F(t.abilities, (c, v) => (b(), y("div", re, [
|
|
149
|
+
n(a(G), {
|
|
150
|
+
checked: k.value[v],
|
|
151
|
+
"onUpdate:checked": [(u) => k.value[v] = u, (u) => T(v)]
|
|
152
|
+
}, {
|
|
153
|
+
default: f(() => [
|
|
154
|
+
I(V(v), 1)
|
|
155
|
+
]),
|
|
156
|
+
_: 2
|
|
157
|
+
}, 1032, ["checked", "onUpdate:checked"]),
|
|
158
|
+
n(a(Y), {
|
|
159
|
+
value: l.value.abilities,
|
|
160
|
+
"onUpdate:value": [
|
|
161
|
+
i[1] || (i[1] = (u) => l.value.abilities = u),
|
|
162
|
+
(u) => A(v)
|
|
163
|
+
]
|
|
164
|
+
}, {
|
|
165
|
+
default: f(() => [
|
|
166
|
+
h("ul", null, [
|
|
167
|
+
(b(!0), y(q, null, F(c, (u, e) => (b(), y("li", ce, [
|
|
168
|
+
h("div", de, [
|
|
169
|
+
n(a(G), {
|
|
170
|
+
class: "md:w-1/3",
|
|
171
|
+
value: e,
|
|
172
|
+
label: e
|
|
173
|
+
}, null, 8, ["value", "label"]),
|
|
174
|
+
h("div", ue, V(u), 1)
|
|
175
|
+
])
|
|
176
|
+
]))), 256))
|
|
177
|
+
])
|
|
178
|
+
]),
|
|
179
|
+
_: 2
|
|
180
|
+
}, 1032, ["value", "onUpdate:value"])
|
|
181
|
+
]))), 256))
|
|
182
|
+
])
|
|
183
|
+
]),
|
|
184
|
+
_: 1
|
|
185
|
+
}, 8, ["label"])
|
|
186
|
+
], 2)
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
}, 8, ["model"]),
|
|
190
|
+
n(M, {
|
|
191
|
+
color: "green",
|
|
192
|
+
onClick: U
|
|
193
|
+
}, {
|
|
194
|
+
default: f(() => [
|
|
195
|
+
n(a(C), { name: "add-square" }),
|
|
196
|
+
h("span", me, " " + V(a(s)("main.generate")), 1)
|
|
197
|
+
]),
|
|
198
|
+
_: 1
|
|
199
|
+
})
|
|
200
|
+
], 2));
|
|
201
|
+
}
|
|
202
|
+
}, pe = { class: "mb-5" }, we = {
|
|
203
|
+
__name: "TokensView",
|
|
204
|
+
setup(t) {
|
|
205
|
+
const o = le(), p = j(() => [
|
|
206
|
+
{ route: "/", text: "GameAP", icon: "gicon gicon-gameap" },
|
|
207
|
+
{ route: { name: "tokens" }, text: s("tokens.tokens") }
|
|
208
|
+
]), l = w([
|
|
209
|
+
{
|
|
210
|
+
title: s("tokens.name"),
|
|
211
|
+
key: "name"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
title: s("tokens.abilities"),
|
|
215
|
+
key: "abilities",
|
|
216
|
+
width: "30%"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
title: s("tokens.last_used"),
|
|
220
|
+
key: "lastUsedAt"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
title: s("main.actions"),
|
|
224
|
+
render(e) {
|
|
225
|
+
return [
|
|
226
|
+
m(M, {
|
|
227
|
+
color: "red",
|
|
228
|
+
size: "small",
|
|
229
|
+
text: s("main.delete"),
|
|
230
|
+
onClick: () => {
|
|
231
|
+
u(e.id);
|
|
232
|
+
}
|
|
233
|
+
}, { default: () => [
|
|
234
|
+
m(C, { name: "delete" }),
|
|
235
|
+
m("span", { class: "hidden lg:inline" }, s("main.delete"))
|
|
236
|
+
] })
|
|
237
|
+
];
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
]), k = {
|
|
241
|
+
pageSize: 30
|
|
242
|
+
}, { loading: $, tokens: T, abilities: A } = W(o);
|
|
243
|
+
J(() => {
|
|
244
|
+
_();
|
|
245
|
+
});
|
|
246
|
+
const _ = () => {
|
|
247
|
+
o.fetchTokens().catch((e) => {
|
|
248
|
+
P(e);
|
|
249
|
+
});
|
|
250
|
+
}, U = j(() => Array.isArray(T.value) ? T.value.map((e) => ({
|
|
251
|
+
id: e.id,
|
|
252
|
+
name: e.name,
|
|
253
|
+
abilities: ne(e.abilities, ", "),
|
|
254
|
+
createdAt: new Date(e.created_at).toLocaleString(),
|
|
255
|
+
lastUsedAt: e.last_used_at ? new Date(e.last_used_at).toLocaleString() : s("main.never")
|
|
256
|
+
})) : []), r = () => {
|
|
257
|
+
o.fetchAbilities().then(() => {
|
|
258
|
+
c.value = {
|
|
259
|
+
name: "",
|
|
260
|
+
abilities: []
|
|
261
|
+
}, i.value = !0;
|
|
262
|
+
}).catch((e) => {
|
|
263
|
+
P(e);
|
|
264
|
+
});
|
|
265
|
+
}, i = w(!1), c = w({
|
|
266
|
+
name: "",
|
|
267
|
+
abilities: []
|
|
268
|
+
}), v = () => {
|
|
269
|
+
o.createToken(
|
|
270
|
+
c.value.name,
|
|
271
|
+
c.value.abilities
|
|
272
|
+
).then((e) => {
|
|
273
|
+
const d = w(!1);
|
|
274
|
+
B({
|
|
275
|
+
content: () => [
|
|
276
|
+
m(
|
|
277
|
+
"div",
|
|
278
|
+
{ class: "my-2" },
|
|
279
|
+
s("tokens.token_created_notification")
|
|
280
|
+
),
|
|
281
|
+
m(te, {
|
|
282
|
+
class: "mt-2 mb-4"
|
|
283
|
+
}, [
|
|
284
|
+
m(R, {
|
|
285
|
+
value: e.token,
|
|
286
|
+
readonly: !0,
|
|
287
|
+
size: "small",
|
|
288
|
+
style: "width: 100%"
|
|
289
|
+
}),
|
|
290
|
+
m(ae, {
|
|
291
|
+
type: "primary",
|
|
292
|
+
onClick: () => {
|
|
293
|
+
navigator.clipboard.writeText(e.token).then(() => {
|
|
294
|
+
d.value = !0;
|
|
295
|
+
}, () => {
|
|
296
|
+
console.error("Failed to copy");
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
}, [
|
|
300
|
+
d.value ? m(C, { name: "check" }) : m(C, { name: "copy" })
|
|
301
|
+
])
|
|
302
|
+
])
|
|
303
|
+
],
|
|
304
|
+
style: {
|
|
305
|
+
width: "600px"
|
|
306
|
+
},
|
|
307
|
+
maskClosable: !1,
|
|
308
|
+
type: "success"
|
|
309
|
+
}, () => {
|
|
310
|
+
}), _(), i.value = !1, _();
|
|
311
|
+
}).catch((e) => {
|
|
312
|
+
P(e);
|
|
313
|
+
});
|
|
314
|
+
}, u = (e) => {
|
|
315
|
+
const d = () => {
|
|
316
|
+
o.deleteToken(e).then(() => {
|
|
317
|
+
B({
|
|
318
|
+
content: s("tokens.token_removed_msg"),
|
|
319
|
+
type: "success"
|
|
320
|
+
}), _();
|
|
321
|
+
}).catch((g) => {
|
|
322
|
+
P(g);
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
window.$dialog.success({
|
|
326
|
+
title: s("tokens.delete_confirm_msg"),
|
|
327
|
+
positiveText: s("main.yes"),
|
|
328
|
+
negativeText: s("main.no"),
|
|
329
|
+
closable: !1,
|
|
330
|
+
onPositiveClick: () => {
|
|
331
|
+
d();
|
|
332
|
+
},
|
|
333
|
+
onNegativeClick: () => {
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
};
|
|
337
|
+
return (e, d) => (b(), y(q, null, [
|
|
338
|
+
n(a(K), { items: p.value }, null, 8, ["items"]),
|
|
339
|
+
h("div", pe, [
|
|
340
|
+
n(M, {
|
|
341
|
+
class: "mr-1",
|
|
342
|
+
color: "green",
|
|
343
|
+
onClick: d[0] || (d[0] = (g) => r())
|
|
344
|
+
}, {
|
|
345
|
+
default: f(() => [
|
|
346
|
+
n(a(C), { name: "add-square" }),
|
|
347
|
+
I(" " + V(a(s)("tokens.generate_token")), 1)
|
|
348
|
+
]),
|
|
349
|
+
_: 1
|
|
350
|
+
})
|
|
351
|
+
]),
|
|
352
|
+
n(a(Z), {
|
|
353
|
+
remote: "",
|
|
354
|
+
ref: "tableRef",
|
|
355
|
+
bordered: !1,
|
|
356
|
+
"single-line": !0,
|
|
357
|
+
columns: l.value,
|
|
358
|
+
data: U.value,
|
|
359
|
+
loading: a($),
|
|
360
|
+
pagination: k
|
|
361
|
+
}, {
|
|
362
|
+
loading: f(() => [
|
|
363
|
+
n(a(z))
|
|
364
|
+
]),
|
|
365
|
+
_: 1
|
|
366
|
+
}, 8, ["columns", "data", "loading"]),
|
|
367
|
+
n(a(ee), {
|
|
368
|
+
show: i.value,
|
|
369
|
+
"onUpdate:show": d[2] || (d[2] = (g) => i.value = g),
|
|
370
|
+
class: "custom-card",
|
|
371
|
+
preset: "card",
|
|
372
|
+
title: a(s)("tokens.generate_token"),
|
|
373
|
+
bordered: !1,
|
|
374
|
+
style: { width: "800px" },
|
|
375
|
+
segmented: { content: "soft", footer: "soft" }
|
|
376
|
+
}, {
|
|
377
|
+
default: f(() => [
|
|
378
|
+
n(fe, {
|
|
379
|
+
abilities: a(A),
|
|
380
|
+
modelValue: c.value,
|
|
381
|
+
"onUpdate:modelValue": d[1] || (d[1] = (g) => c.value = g),
|
|
382
|
+
onGenerate: v
|
|
383
|
+
}, null, 8, ["abilities", "modelValue"])
|
|
384
|
+
]),
|
|
385
|
+
_: 1
|
|
386
|
+
}, 8, ["show", "title"])
|
|
387
|
+
], 64));
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
export {
|
|
391
|
+
we as default
|
|
392
|
+
};
|