@gameap/frontend 4.1.0-dev8 → 4.1.0-dev9

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.
Files changed (77) hide show
  1. package/dist/{AdminClientCertificatesView-BQyXmri1.js → AdminClientCertificatesView-rVNAX5Dl.js} +97 -94
  2. package/dist/AdminDaemonTaskListView-CoUVp9tK.js +316 -0
  3. package/dist/{AdminDaemonTaskOutputView-DRrZwAwW.js → AdminDaemonTaskOutputView-BJpuWCtc.js} +18 -17
  4. package/dist/{AdminGamesEdit-CDTCJu52.js → AdminGamesEdit-HKWU2C59.js} +121 -117
  5. package/dist/AdminGamesList-BwN_RFDY.js +518 -0
  6. package/dist/{AdminModEdit-P0crpkM3.js → AdminModEdit-CbVGlk5M.js} +123 -119
  7. package/dist/AdminNodeShowView-C7VsvwQo.js +175 -0
  8. package/dist/AdminNodesCreateView-BfEHhFn2.js +87 -0
  9. package/dist/{AdminNodesEditView-DdNciuMa.js → AdminNodesEditView-DE-zhVTd.js} +11 -11
  10. package/dist/AdminNodesView-QMdy3oJ1.js +167 -0
  11. package/dist/AdminPluginsView-BBALhxPk.js +984 -0
  12. package/dist/{AdminServersCreate-zGHHAEkO.js → AdminServersCreate-g_A290kz.js} +122 -124
  13. package/dist/{AdminServersEdit-BR6sRGlM.js → AdminServersEdit-D0RERbR5.js} +125 -124
  14. package/dist/{AdminServersList-DhUQ1zrt.js → AdminServersList-_ek_2u8B.js} +35 -31
  15. package/dist/{AdminUsersEditView-CqRLzCkV.js → AdminUsersEditView-CbZCH6eM.js} +89 -85
  16. package/dist/{AdminUsersView-TCHghzxY.js → AdminUsersView-D4WoRB5b.js} +145 -141
  17. package/dist/CreateModForm-CpbIOQNu.js +123 -0
  18. package/dist/CreateNodeModal-C96UVcAJ.js +99 -0
  19. package/dist/{DsIpSelector-EnBHsJLE.js → DsIpSelector-D_hc_JYQ.js} +1 -1
  20. package/dist/EmptyView-qkQQJ_OR.js +9 -0
  21. package/dist/FileManager-v-1ASSne.js +5931 -0
  22. package/dist/GameIcon-DaYNlnur.js +87 -0
  23. package/dist/{GameModSelector-bZsSGC6T.js → GameModSelector-CiI3H5Zq.js} +21 -20
  24. package/dist/InputManyList-C52f5V6l.js +110 -0
  25. package/dist/InputTextList-5KeNATa7.js +63 -0
  26. package/dist/PluginPendingView-CDR44QCG.js +34 -0
  27. package/dist/ProfileView-CC3KJ2gK.js +295 -0
  28. package/dist/RconConsole-DkRK7vz3.js +74 -0
  29. package/dist/{RconPlayers-CXL0bHlU.js → RconPlayers-CDRCp79f.js} +131 -127
  30. package/dist/ServerConsole-Bj0Zr1BS.js +99 -0
  31. package/dist/ServerControlButton-C4zWzA-d.js +185 -0
  32. package/dist/ServerIdView-BJS6wcMH.js +608 -0
  33. package/dist/{ServerSelector-D7O1thVu.js → ServerSelector-DPM5SjWO.js} +7 -7
  34. package/dist/{ServerSettings-Lk4lq5hI.js → ServerSettings-BYRSLaJk.js} +26 -26
  35. package/dist/{ServerStatus-CCFiPWXV.js → ServerStatus-BK8yKehx.js} +1 -1
  36. package/dist/{ServerTasks-gNFBkyv1.js → ServerTasks-DUC2DDcY.js} +304 -302
  37. package/dist/ServersView-BbLoOEEz.js +312 -0
  38. package/dist/SettingsParameters-C-TFWsJF.js +89 -0
  39. package/dist/SmartPortSelector-DCsuCDpV.js +174 -0
  40. package/dist/TokensView-B5D45QbV.js +392 -0
  41. package/dist/{UpdateNodeForm-BQDjp3CR.js → UpdateNodeForm-DmAoHURu.js} +131 -127
  42. package/dist/UserServerPrivileges-k-30v4ps.js +319 -0
  43. package/dist/{_createCompounder-NPjOAZm-.js → _createCompounder-DHQYnhTQ.js} +2 -2
  44. package/dist/{camelCase-BXg45SFI.js → camelCase-CE1GGhvX.js} +2 -2
  45. package/dist/{capitalize-BSQeiLff.js → capitalize-DnZmwhT4.js} +5 -5
  46. package/dist/{clientCertificates-Dm0Bh62v.js → clientCertificates-Dd9OqxGQ.js} +1 -1
  47. package/dist/frontend.css +6 -14
  48. package/dist/{gameList-CJAymSBL.js → gameList-BLdEusRA.js} +40 -40
  49. package/dist/gameap.svg +3 -0
  50. package/dist/gameap_full.svg +9 -0
  51. package/dist/index-BDKiNPpP.js +3840 -0
  52. package/dist/index.js +1 -1
  53. package/dist/isEmpty-lBntcFaB.js +263 -0
  54. package/dist/join-CmlzL0H9.js +7 -0
  55. package/dist/{loader-BGOXrNPF.js → loader-C49Def-j.js} +1 -1
  56. package/dist/{snakeCase-o1mQEFQr.js → snakeCase--wUVfLw4.js} +1 -1
  57. package/dist/validators-BVXTUmow.js +65 -0
  58. package/package.json +1 -1
  59. package/dist/AdminDaemonTaskListView-DTQbTpkt.js +0 -315
  60. package/dist/AdminGamesList-CU_RB7gu.js +0 -499
  61. package/dist/AdminNodeShowView-Col-7fyA.js +0 -166
  62. package/dist/AdminNodesCreateView-CZsMnSCJ.js +0 -84
  63. package/dist/AdminNodesView-DvuZ9haB.js +0 -160
  64. package/dist/CreateModForm-Byq8UvuW.js +0 -122
  65. package/dist/CreateNodeModal-BNV35RnR.js +0 -93
  66. package/dist/FileManager-X3FkHNzF.js +0 -31882
  67. package/dist/InputManyList-BFGIEnls.js +0 -110
  68. package/dist/InputTextList-D280D5fs.js +0 -63
  69. package/dist/PluginPendingView-Cp6KgA8z.js +0 -31
  70. package/dist/RconConsole-BxjHKC6E.js +0 -74
  71. package/dist/ServerConsole-Cr-BZJIC.js +0 -98
  72. package/dist/ServerIdView-wsnPfVUi.js +0 -576
  73. package/dist/SettingsParameters-BVpVg868.js +0 -87
  74. package/dist/SmartPortSelector-bubAEnvR.js +0 -161
  75. package/dist/UserServerPrivileges-CizE2EYl.js +0 -318
  76. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  77. package/dist/index-Fmomw6wi.js +0 -5750
@@ -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-BDKiNPpP.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-BVXTUmow.js";
6
+ import { i as ie } from "./isEmpty-lBntcFaB.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
+ };