@gameap/frontend 4.1.0-dev1 → 4.1.0-dev2

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 (61) hide show
  1. package/dist/AdminClientCertificatesView-DQTMJ6LY.js +368 -0
  2. package/dist/AdminDaemonTaskListView-Bx3e0Miy.js +316 -0
  3. package/dist/AdminDaemonTaskOutputView-BJtLdoAq.js +87 -0
  4. package/dist/AdminGamesEdit-hDe3Pr-7.js +470 -0
  5. package/dist/AdminGamesList-CM1xADCW.js +500 -0
  6. package/dist/AdminModEdit-DDKd6Vga.js +526 -0
  7. package/dist/AdminNodeShowView-DMoEY2Cu.js +167 -0
  8. package/dist/AdminNodesCreateView-BXZDQIJ1.js +85 -0
  9. package/dist/AdminNodesEditView-xO7-szjJ.js +66 -0
  10. package/dist/AdminNodesView-ugTPiC4h.js +161 -0
  11. package/dist/AdminServersCreate-DOygFz_E.js +345 -0
  12. package/dist/AdminServersEdit-cZX6UGB1.js +400 -0
  13. package/dist/AdminServersList-CC50WRsv.js +165 -0
  14. package/dist/AdminUsersEditView-CXpMKFfI.js +305 -0
  15. package/dist/AdminUsersView-DGuGEHVR.js +443 -0
  16. package/dist/CreateModForm-CqhcrNFp.js +122 -0
  17. package/dist/CreateNodeModal-BvbJTKhD.js +93 -0
  18. package/dist/DsIpSelector-DN9IyT4L.js +90 -0
  19. package/dist/FileManager-8TWHezyM.js +31882 -0
  20. package/dist/GameModSelector-DRIaCbGY.js +94 -0
  21. package/dist/InputManyList-By5xECIK.js +110 -0
  22. package/dist/InputTextList-Bm2Ofq5J.js +63 -0
  23. package/dist/PluginPendingView-DHd_yijv.js +31 -0
  24. package/dist/RconConsole-DH9XeOu3.js +75 -0
  25. package/dist/RconPlayers-GrvCMJX3.js +420 -0
  26. package/dist/ServerConsole-BHHnpxJy.js +98 -0
  27. package/dist/ServerIdView-BfqrYuar.js +577 -0
  28. package/dist/ServerSelector-QMK1qiXa.js +52 -0
  29. package/dist/ServerSettings-Cz6C8Dlh.js +84 -0
  30. package/dist/ServerStatus-DBJW9C6H.js +63 -0
  31. package/dist/ServerTasks-Bs3iGYY3.js +854 -0
  32. package/dist/SettingsParameters-DCqhqxHk.js +87 -0
  33. package/dist/SmartPortSelector-DektJC6p.js +161 -0
  34. package/dist/UpdateNodeForm-CwirLUIK.js +648 -0
  35. package/dist/UserServerPrivileges-utyKdh7O.js +318 -0
  36. package/dist/_commonjsHelpers-C6fGbg64.js +6 -0
  37. package/dist/_createCompounder-DSupx5mD.js +241 -0
  38. package/dist/camelCase-WcUYdRB3.js +8 -0
  39. package/dist/capitalize-DRKkBaYR.js +40 -0
  40. package/dist/clientCertificates-BsJdUHYw.js +53 -0
  41. package/dist/favicon-32x32.png +0 -0
  42. package/dist/favicon-96x96.png +0 -0
  43. package/dist/favicon.ico +0 -0
  44. package/dist/fonts/gicon.eot +0 -0
  45. package/dist/fonts/gicon.svg +33 -0
  46. package/dist/fonts/gicon.ttf +0 -0
  47. package/dist/fonts/gicon.woff +0 -0
  48. package/dist/fonts/gicon.woff2 +0 -0
  49. package/dist/frontend.css +14 -0
  50. package/dist/gameList-DpGDCxFE.js +115 -0
  51. package/dist/images/gap_logo_white.png +0 -0
  52. package/dist/images/gap_logo_white_mini.png +0 -0
  53. package/dist/images/gicon.svg +18 -0
  54. package/dist/images/icons/save-white.svg +1 -0
  55. package/dist/images/icons/save.svg +1 -0
  56. package/dist/index-60qEjGuU.js +5371 -0
  57. package/dist/index.js +1 -0
  58. package/dist/loader-CrZTMKcy.js +131 -0
  59. package/dist/mockServiceWorker.js +349 -0
  60. package/dist/snakeCase-CTCA7tap.js +7 -0
  61. package/package.json +1 -2
@@ -0,0 +1,526 @@
1
+ import { mergeModels as N, ref as T, useModel as W, resolveComponent as z, createElementBlock as H, openBlock as L, normalizeClass as I, createVNode as a, unref as e, withCtx as o, createElementVNode as n, createTextVNode as h, toDisplayString as g, computed as U, onMounted as j, Fragment as G, createBlock as S, createCommentVNode as E } from "vue";
2
+ import { GBreadcrumbs as B, Loading as F } from "@gameap/ui";
3
+ import { o as O, t, _ as q, a as R, q as $, e as k, n as A } from "./index-60qEjGuU.js";
4
+ import { NForm as P, NTabs as D, NTabPane as w, NCard as x, NFormItem as m, NInput as u } from "naive-ui";
5
+ import { defineStore as J, storeToRefs as V } from "pinia";
6
+ import { useRoute as K, useRouter as Q } from "vue-router";
7
+ import { c as X } from "./camelCase-WcUYdRB3.js";
8
+ import { s as Y } from "./snakeCase-CTCA7tap.js";
9
+ const Z = { class: "flex flex-wrap justify-center mt-2" }, ee = { class: "md:w-1/2" }, ae = { class: "flex flex-wrap mt-2" }, te = { class: "md:w-1/2 pr-8" }, le = { class: "md:w-1/2" }, se = { class: "flex flex-wrap mt-2" }, oe = { class: "md:w-full" }, de = { class: "flex flex-wrap mt-2" }, ne = { class: "md:w-full" }, me = { class: "flex grid grid-cols-2 gap-x-5 gap-y-4" }, ue = ["innerHTML"], re = ["innerHTML"], ie = ["innerHTML"], pe = ["innerHTML"], ce = ["innerHTML"], ve = ["innerHTML"], fe = { class: "hidden lg:inline" }, _e = {
10
+ __name: "UpdateModForm",
11
+ props: {
12
+ modelValue: {},
13
+ modelModifiers: {}
14
+ },
15
+ emits: /* @__PURE__ */ N(["update"], ["update:modelValue"]),
16
+ setup(i, { emit: f }) {
17
+ const y = T({}), l = W(i, "modelValue"), c = {
18
+ name: {
19
+ required: !0,
20
+ validator: O(t("labels.name"))
21
+ }
22
+ }, C = f, _ = () => {
23
+ y.value.validate().then(() => {
24
+ C("update");
25
+ });
26
+ };
27
+ return (b, s) => {
28
+ const v = z("InputManyList");
29
+ return L(), H("div", {
30
+ class: I(b.$attrs.class)
31
+ }, [
32
+ a(e(P), {
33
+ "label-placement": "top",
34
+ "label-width": "auto",
35
+ ref_key: "formRef",
36
+ ref: y,
37
+ model: l.value,
38
+ rules: c
39
+ }, {
40
+ default: o(() => [
41
+ a(e(D), {
42
+ type: "line",
43
+ class: "flex justify-between",
44
+ animated: ""
45
+ }, {
46
+ default: o(() => [
47
+ a(e(w), { name: "main" }, {
48
+ tab: o(() => [
49
+ h(g(e(t)("games.main")), 1)
50
+ ]),
51
+ default: o(() => [
52
+ n("div", Z, [
53
+ n("div", ee, [
54
+ a(e(x), {
55
+ title: e(t)("games.basic_info"),
56
+ size: "small",
57
+ class: "mb-3",
58
+ "header-class": "g-card-header",
59
+ segmented: {
60
+ content: !0,
61
+ footer: "soft"
62
+ }
63
+ }, {
64
+ default: o(() => [
65
+ a(e(m), {
66
+ label: e(t)("labels.name"),
67
+ path: "name"
68
+ }, {
69
+ default: o(() => [
70
+ a(e(u), {
71
+ value: l.value.name,
72
+ "onUpdate:value": s[0] || (s[0] = (d) => l.value.name = d),
73
+ type: "text"
74
+ }, null, 8, ["value"])
75
+ ]),
76
+ _: 1
77
+ }, 8, ["label"])
78
+ ]),
79
+ _: 1
80
+ }, 8, ["title"])
81
+ ])
82
+ ]),
83
+ n("div", ae, [
84
+ n("div", te, [
85
+ a(e(x), {
86
+ title: e(t)("games.repositories_local"),
87
+ size: "small",
88
+ class: "mb-3",
89
+ "header-class": "g-card-header",
90
+ segmented: {
91
+ content: !0,
92
+ footer: "soft"
93
+ }
94
+ }, {
95
+ default: o(() => [
96
+ a(e(m), {
97
+ label: e(t)("labels.local_repository_linux"),
98
+ path: "localRepositoryLinux"
99
+ }, {
100
+ default: o(() => [
101
+ a(e(u), {
102
+ value: l.value.localRepositoryLinux,
103
+ "onUpdate:value": s[1] || (s[1] = (d) => l.value.localRepositoryLinux = d),
104
+ type: "text"
105
+ }, null, 8, ["value"])
106
+ ]),
107
+ _: 1
108
+ }, 8, ["label"]),
109
+ a(e(m), {
110
+ label: e(t)("labels.local_repository_windows"),
111
+ path: "localRepositoryWindows"
112
+ }, {
113
+ default: o(() => [
114
+ a(e(u), {
115
+ value: l.value.localRepositoryWindows,
116
+ "onUpdate:value": s[2] || (s[2] = (d) => l.value.localRepositoryWindows = d),
117
+ type: "text"
118
+ }, null, 8, ["value"])
119
+ ]),
120
+ _: 1
121
+ }, 8, ["label"])
122
+ ]),
123
+ _: 1
124
+ }, 8, ["title"])
125
+ ]),
126
+ n("div", le, [
127
+ a(e(x), {
128
+ title: e(t)("games.repositories_remote"),
129
+ size: "small",
130
+ class: "mb-3",
131
+ "header-class": "g-card-header",
132
+ segmented: {
133
+ content: !0,
134
+ footer: "soft"
135
+ }
136
+ }, {
137
+ default: o(() => [
138
+ a(e(m), {
139
+ label: e(t)("labels.remote_repository_linux"),
140
+ path: "remoteRepositoryLinux"
141
+ }, {
142
+ default: o(() => [
143
+ a(e(u), {
144
+ value: l.value.remoteRepositoryLinux,
145
+ "onUpdate:value": s[3] || (s[3] = (d) => l.value.remoteRepositoryLinux = d),
146
+ type: "text"
147
+ }, null, 8, ["value"])
148
+ ]),
149
+ _: 1
150
+ }, 8, ["label"]),
151
+ a(e(m), {
152
+ label: e(t)("labels.remote_repository_windows"),
153
+ path: "remoteRepositoryWindows"
154
+ }, {
155
+ default: o(() => [
156
+ a(e(u), {
157
+ value: l.value.remoteRepositoryWindows,
158
+ "onUpdate:value": s[4] || (s[4] = (d) => l.value.remoteRepositoryWindows = d),
159
+ type: "text"
160
+ }, null, 8, ["value"])
161
+ ]),
162
+ _: 1
163
+ }, 8, ["label"])
164
+ ]),
165
+ _: 1
166
+ }, 8, ["title"])
167
+ ])
168
+ ]),
169
+ n("div", se, [
170
+ n("div", oe, [
171
+ a(e(x), {
172
+ title: e(t)("games.run_commands"),
173
+ size: "small",
174
+ class: "mb-3",
175
+ "header-class": "g-card-header",
176
+ segmented: {
177
+ content: !0,
178
+ footer: "soft"
179
+ }
180
+ }, {
181
+ default: o(() => [
182
+ a(e(m), {
183
+ label: e(t)("labels.start_cmd_linux"),
184
+ path: "startCmdLinux"
185
+ }, {
186
+ default: o(() => [
187
+ a(e(u), {
188
+ value: l.value.startCmdLinux,
189
+ "onUpdate:value": s[5] || (s[5] = (d) => l.value.startCmdLinux = d),
190
+ type: "textarea",
191
+ autosize: { minRows: 4 }
192
+ }, null, 8, ["value"])
193
+ ]),
194
+ _: 1
195
+ }, 8, ["label"]),
196
+ a(e(m), {
197
+ label: e(t)("labels.start_cmd_windows"),
198
+ path: "startCmdWindows"
199
+ }, {
200
+ default: o(() => [
201
+ a(e(u), {
202
+ value: l.value.startCmdWindows,
203
+ "onUpdate:value": s[6] || (s[6] = (d) => l.value.startCmdWindows = d),
204
+ type: "textarea",
205
+ autosize: { minRows: 4 }
206
+ }, null, 8, ["value"])
207
+ ]),
208
+ _: 1
209
+ }, 8, ["label"])
210
+ ]),
211
+ _: 1
212
+ }, 8, ["title"])
213
+ ])
214
+ ])
215
+ ]),
216
+ _: 1
217
+ }),
218
+ a(e(w), { name: "commands" }, {
219
+ tab: o(() => [
220
+ h(g(e(t)("games.servers_commands")), 1)
221
+ ]),
222
+ default: o(() => [
223
+ n("div", de, [
224
+ n("div", ne, [
225
+ a(e(x), {
226
+ title: e(t)("games.servers_commands"),
227
+ size: "small",
228
+ class: "mb-3",
229
+ "header-class": "g-card-header",
230
+ segmented: {
231
+ content: !0,
232
+ footer: "soft"
233
+ }
234
+ }, {
235
+ default: o(() => [
236
+ n("div", me, [
237
+ a(e(m), {
238
+ label: e(t)("labels.kick_cmd"),
239
+ path: "kickCmd"
240
+ }, {
241
+ feedback: o(() => [
242
+ n("small", {
243
+ innerHTML: e(t)("games.d_kick_cmd")
244
+ }, null, 8, ue)
245
+ ]),
246
+ default: o(() => [
247
+ a(e(u), {
248
+ value: l.value.kickCmd,
249
+ "onUpdate:value": s[7] || (s[7] = (d) => l.value.kickCmd = d),
250
+ type: "text"
251
+ }, null, 8, ["value"])
252
+ ]),
253
+ _: 1
254
+ }, 8, ["label"]),
255
+ a(e(m), {
256
+ label: e(t)("labels.ban_cmd"),
257
+ path: "banCmd"
258
+ }, {
259
+ feedback: o(() => [
260
+ n("small", {
261
+ innerHTML: e(t)("games.d_ban_cmd")
262
+ }, null, 8, re)
263
+ ]),
264
+ default: o(() => [
265
+ a(e(u), {
266
+ value: l.value.banCmd,
267
+ "onUpdate:value": s[8] || (s[8] = (d) => l.value.banCmd = d),
268
+ type: "text"
269
+ }, null, 8, ["value"])
270
+ ]),
271
+ _: 1
272
+ }, 8, ["label"]),
273
+ a(e(m), {
274
+ label: e(t)("labels.chname_cmd"),
275
+ path: "chnameCmd"
276
+ }, {
277
+ feedback: o(() => [
278
+ n("small", {
279
+ innerHTML: e(t)("games.d_chname_cmd")
280
+ }, null, 8, ie)
281
+ ]),
282
+ default: o(() => [
283
+ a(e(u), {
284
+ value: l.value.chnameCmd,
285
+ "onUpdate:value": s[9] || (s[9] = (d) => l.value.chnameCmd = d),
286
+ type: "text"
287
+ }, null, 8, ["value"])
288
+ ]),
289
+ _: 1
290
+ }, 8, ["label"]),
291
+ a(e(m), {
292
+ label: e(t)("labels.srestart_cmd"),
293
+ path: "srestartCmd"
294
+ }, {
295
+ default: o(() => [
296
+ a(e(u), {
297
+ value: l.value.srestartCmd,
298
+ "onUpdate:value": s[10] || (s[10] = (d) => l.value.srestartCmd = d),
299
+ type: "text"
300
+ }, null, 8, ["value"])
301
+ ]),
302
+ _: 1
303
+ }, 8, ["label"]),
304
+ a(e(m), {
305
+ label: e(t)("labels.chmap_cmd"),
306
+ path: "chmapCmd"
307
+ }, {
308
+ feedback: o(() => [
309
+ n("small", {
310
+ innerHTML: e(t)("games.d_chmap_cmd")
311
+ }, null, 8, pe)
312
+ ]),
313
+ default: o(() => [
314
+ a(e(u), {
315
+ value: l.value.chmapCmd,
316
+ "onUpdate:value": s[11] || (s[11] = (d) => l.value.chmapCmd = d),
317
+ type: "text"
318
+ }, null, 8, ["value"])
319
+ ]),
320
+ _: 1
321
+ }, 8, ["label"]),
322
+ a(e(m), {
323
+ label: e(t)("labels.sendmsg_cmd"),
324
+ path: "sendmsgCmd"
325
+ }, {
326
+ feedback: o(() => [
327
+ n("small", {
328
+ innerHTML: e(t)("games.d_sendmsg_cmd")
329
+ }, null, 8, ce)
330
+ ]),
331
+ default: o(() => [
332
+ a(e(u), {
333
+ value: l.value.sendmsgCmd,
334
+ "onUpdate:value": s[12] || (s[12] = (d) => l.value.sendmsgCmd = d),
335
+ type: "text"
336
+ }, null, 8, ["value"])
337
+ ]),
338
+ _: 1
339
+ }, 8, ["label"]),
340
+ a(e(m), {
341
+ label: e(t)("labels.passwd_cmd"),
342
+ path: "passwdCmd"
343
+ }, {
344
+ feedback: o(() => [
345
+ n("small", {
346
+ innerHTML: e(t)("games.d_passwd_cmd")
347
+ }, null, 8, ve)
348
+ ]),
349
+ default: o(() => [
350
+ a(e(u), {
351
+ value: l.value.passwdCmd,
352
+ "onUpdate:value": s[13] || (s[13] = (d) => l.value.passwdCmd = d),
353
+ type: "text"
354
+ }, null, 8, ["value"])
355
+ ]),
356
+ _: 1
357
+ }, 8, ["label"])
358
+ ])
359
+ ]),
360
+ _: 1
361
+ }, 8, ["title"])
362
+ ])
363
+ ])
364
+ ]),
365
+ _: 1
366
+ }),
367
+ a(e(w), { name: "vars" }, {
368
+ tab: o(() => [
369
+ h(g(e(t)("games.vars")), 1)
370
+ ]),
371
+ default: o(() => [
372
+ a(v, {
373
+ name: "vars",
374
+ modelValue: l.value.vars,
375
+ "onUpdate:modelValue": s[14] || (s[14] = (d) => l.value.vars = d),
376
+ class: "mb-4",
377
+ labels: [
378
+ e(t)("games.var"),
379
+ e(t)("games.default"),
380
+ e(t)("games.info"),
381
+ e(t)("games.admin_var")
382
+ ],
383
+ keys: ["var", "default", "info", "admin_var"],
384
+ "input-types": ["text", "text", "text", "checkbox"]
385
+ }, null, 8, ["modelValue", "labels"])
386
+ ]),
387
+ _: 1
388
+ }),
389
+ a(e(w), { name: "rcon" }, {
390
+ tab: o(() => [
391
+ h(g(e(t)("games.fast_rcon_commands")), 1)
392
+ ]),
393
+ default: o(() => [
394
+ a(v, {
395
+ name: "vars",
396
+ modelValue: l.value.fastRcon,
397
+ "onUpdate:modelValue": s[15] || (s[15] = (d) => l.value.fastRcon = d),
398
+ class: "mb-4",
399
+ labels: [
400
+ e(t)("games.description"),
401
+ e(t)("games.rcon_command")
402
+ ],
403
+ keys: ["info", "command"],
404
+ "input-types": ["text", "text"]
405
+ }, null, 8, ["modelValue", "labels"])
406
+ ]),
407
+ _: 1
408
+ })
409
+ ]),
410
+ _: 1
411
+ })
412
+ ]),
413
+ _: 1
414
+ }, 8, ["model"]),
415
+ a(q, {
416
+ color: "green",
417
+ onClick: _
418
+ }, {
419
+ default: o(() => [
420
+ s[16] || (s[16] = n("i", { class: "fa-regular fa-floppy-disk mr-0.5" }, null, -1)),
421
+ n("span", fe, " " + g(e(t)("main.save")), 1)
422
+ ]),
423
+ _: 1
424
+ })
425
+ ], 2);
426
+ };
427
+ }
428
+ }, be = J("gameMod", {
429
+ state: () => ({
430
+ loading: !1,
431
+ modId: "",
432
+ mod: {}
433
+ }),
434
+ actions: {
435
+ setModId(i) {
436
+ this.modId = i;
437
+ },
438
+ async fetchMod() {
439
+ this.loading = !0;
440
+ try {
441
+ const i = await R.get("/api/game_mods/" + this.modId);
442
+ this.mod = i.data;
443
+ } catch (i) {
444
+ throw i;
445
+ } finally {
446
+ this.loading = !1;
447
+ }
448
+ },
449
+ async saveMod(i) {
450
+ this.loading = !0;
451
+ try {
452
+ await R.put("/api/game_mods/" + this.modId, i);
453
+ } catch (f) {
454
+ throw f;
455
+ } finally {
456
+ this.loading = !1;
457
+ }
458
+ }
459
+ }
460
+ }), Le = {
461
+ __name: "AdminModEdit",
462
+ setup(i) {
463
+ const f = K(), y = Q(), l = $(), c = be(), C = U(() => {
464
+ let r = [
465
+ { route: "/", text: "GameAP", icon: "gicon gicon-gameap" },
466
+ { route: { name: "admin.games.index" }, text: t("games.games") }
467
+ ];
468
+ return _.value.name && r.push(
469
+ {
470
+ route: { name: "admin.games.edit", params: { code: _.value.code } },
471
+ text: _.value.name
472
+ }
473
+ ), b.value.name && r.push(
474
+ {
475
+ route: { name: "admin.games.mods.edit", params: { code: _.value.code, id: b.value.id } },
476
+ text: b.value.name
477
+ }
478
+ ), r;
479
+ }), { game: _ } = V(l), { mod: b } = V(c), s = U(() => l.loading || c.loading);
480
+ j(() => {
481
+ l.setGameCode(f.params.code), l.fetchGame().then(() => {
482
+ c.setModId(f.params.id), c.fetchMod().then(() => {
483
+ v.value = Object.fromEntries(
484
+ Object.entries(b.value).map(([r, p]) => [X(r), p])
485
+ );
486
+ }).catch((r) => {
487
+ k(r);
488
+ });
489
+ }).catch((r) => {
490
+ k(r);
491
+ });
492
+ });
493
+ const v = T({}), d = () => {
494
+ const r = Object.fromEntries(
495
+ Object.entries(v.value).map(([p, M]) => [Y(p), M])
496
+ );
497
+ c.saveMod(r).then(() => {
498
+ A({
499
+ content: t("games.mod_update_success_msg"),
500
+ type: "success"
501
+ }, () => {
502
+ y.push({ name: "admin.games.index" });
503
+ });
504
+ }).catch((p) => {
505
+ k(p);
506
+ });
507
+ };
508
+ return (r, p) => (L(), H(G, null, [
509
+ a(e(B), { items: C.value }, null, 8, ["items"]),
510
+ s.value ? (L(), S(e(F), { key: 0 })) : E("", !0),
511
+ n("div", {
512
+ class: I(s.value ? "hidden" : "")
513
+ }, [
514
+ a(_e, {
515
+ modelValue: v.value,
516
+ "onUpdate:modelValue": p[0] || (p[0] = (M) => v.value = M),
517
+ onUpdate: d,
518
+ loading: s.value
519
+ }, null, 8, ["modelValue", "loading"])
520
+ ], 2)
521
+ ], 64));
522
+ }
523
+ };
524
+ export {
525
+ Le as default
526
+ };
@@ -0,0 +1,167 @@
1
+ import { ref as w, computed as R, onMounted as B, createElementBlock as k, openBlock as m, Fragment as I, createVNode as r, createCommentVNode as D, unref as e, withCtx as u, createElementVNode as n, toDisplayString as t, createBlock as y } from "vue";
2
+ import { GBreadcrumbs as P, Progressbar as S, Loading as U } from "@gameap/ui";
3
+ import { h as V, t as s, e as N, _ as v, a as A } from "./index-60qEjGuU.js";
4
+ import { NCard as T, NTable as j } from "naive-ui";
5
+ import { storeToRefs as F } from "pinia";
6
+ import { useRoute as G } from "vue-router";
7
+ const M = {
8
+ key: 0,
9
+ class: "mb-5"
10
+ }, Q = {
11
+ __name: "AdminNodeShowView",
12
+ setup(O) {
13
+ const _ = G(), f = V(), { daemonInfo: o, loading: h } = F(f), i = w(!1), c = w(0);
14
+ async function b(a, d) {
15
+ i.value = !0, c.value = 0;
16
+ try {
17
+ const g = await A.get(a, {
18
+ responseType: "blob",
19
+ onDownloadProgress: (p) => {
20
+ p.total && (c.value = Math.round(p.loaded * 100 / p.total));
21
+ }
22
+ }), L = new Blob([g.data]), l = document.createElement("a");
23
+ l.href = window.URL.createObjectURL(L), l.setAttribute("download", d), document.body.appendChild(l), l.click(), document.body.removeChild(l), window.URL.revokeObjectURL(l.href);
24
+ } catch (g) {
25
+ N(g);
26
+ } finally {
27
+ i.value = !1, c.value = 0;
28
+ }
29
+ }
30
+ function x() {
31
+ b(`/api/dedicated_servers/${_.params.id}/logs.zip`, "logs.zip");
32
+ }
33
+ function z() {
34
+ b("/api/dedicated_servers/certificates.zip", "certificates.zip");
35
+ }
36
+ const C = R(() => {
37
+ let a = [
38
+ { route: "/", text: "GameAP", icon: "gicon gicon-gameap" },
39
+ { route: { name: "admin.nodes.index" }, text: s("dedicated_servers.dedicated_servers") }
40
+ ];
41
+ return o.value.name && a.push({ text: o.value.name }), a;
42
+ });
43
+ return B(() => {
44
+ f.setNodeId(_.params.id), f.fetchDaemonInfo().catch((a) => {
45
+ N(a);
46
+ });
47
+ }), (a, d) => (m(), k(I, null, [
48
+ r(e(P), { items: C.value }, null, 8, ["items"]),
49
+ r(v, {
50
+ color: "blue",
51
+ size: "middle",
52
+ class: "mb-5 mr-1",
53
+ route: { name: "admin.nodes.edit", params: { id: e(_).params.id } }
54
+ }, {
55
+ default: u(() => [
56
+ d[0] || (d[0] = n("i", { class: "fa-solid fa-edit mr-0.5" }, null, -1)),
57
+ n("span", null, t(e(s)("main.edit")), 1)
58
+ ]),
59
+ _: 1
60
+ }, 8, ["route"]),
61
+ r(v, {
62
+ color: "orange",
63
+ size: "middle",
64
+ class: "mb-5 mr-1",
65
+ disabled: i.value,
66
+ onClick: x
67
+ }, {
68
+ default: u(() => [
69
+ d[1] || (d[1] = n("i", { class: "fa-solid fa-download mr-0.5" }, null, -1)),
70
+ n("span", null, t(e(s)("dedicated_servers.download_logs")), 1)
71
+ ]),
72
+ _: 1
73
+ }, 8, ["disabled"]),
74
+ r(v, {
75
+ color: "green",
76
+ size: "middle",
77
+ class: "mb-5 mr-1",
78
+ disabled: i.value,
79
+ onClick: z
80
+ }, {
81
+ default: u(() => [
82
+ d[2] || (d[2] = n("i", { class: "fa-solid fa-download mr-0.5" }, null, -1)),
83
+ n("span", null, t(e(s)("dedicated_servers.download_certificates")), 1)
84
+ ]),
85
+ _: 1
86
+ }, 8, ["disabled"]),
87
+ i.value ? (m(), k("div", M, [
88
+ r(e(S), { progress: c.value }, null, 8, ["progress"])
89
+ ])) : D("", !0),
90
+ r(e(T), {
91
+ size: "small",
92
+ class: "mb-3",
93
+ "header-class": "g-card-header",
94
+ segmented: {
95
+ content: !0,
96
+ footer: "soft"
97
+ }
98
+ }, {
99
+ default: u(() => [
100
+ e(h) ? (m(), y(e(U), { key: 0 })) : (m(), y(e(j), {
101
+ key: 1,
102
+ bordered: !1,
103
+ "single-line": !0
104
+ }, {
105
+ default: u(() => [
106
+ n("tbody", null, [
107
+ n("tr", null, [
108
+ d[3] || (d[3] = n("td", null, [
109
+ n("strong", null, "ID:")
110
+ ], -1)),
111
+ n("td", null, t(e(o).id), 1)
112
+ ]),
113
+ n("tr", null, [
114
+ n("td", null, [
115
+ n("strong", null, t(e(s)("dedicated_servers.name")) + ":", 1)
116
+ ]),
117
+ n("td", null, t(e(o).name), 1)
118
+ ]),
119
+ n("tr", null, [
120
+ n("td", null, [
121
+ n("strong", null, t(e(s)("dedicated_servers.gdaemon_api_key")) + ":", 1)
122
+ ]),
123
+ n("td", null, t(e(o).api_key), 1)
124
+ ]),
125
+ n("tr", null, [
126
+ n("td", null, [
127
+ n("strong", null, t(e(s)("dedicated_servers.gdaemon_version")) + ":", 1)
128
+ ]),
129
+ n("td", null, t(e(o).version && e(o).version.version ? e(o).version.version + " (" + e(o).version.compile_date + ")" : e(s)("dedicated_servers.gdaemon_empty_info")), 1)
130
+ ]),
131
+ n("tr", null, [
132
+ n("td", null, [
133
+ n("strong", null, t(e(s)("dedicated_servers.gdaemon_uptime")) + ":", 1)
134
+ ]),
135
+ n("td", null, t(e(o).base_info && e(o).base_info.uptime ? e(o).base_info.uptime : e(s)("dedicated_servers.gdaemon_empty_info")), 1)
136
+ ]),
137
+ n("tr", null, [
138
+ n("td", null, [
139
+ n("strong", null, t(e(s)("dedicated_servers.gdaemon_online_servers_count")) + ":", 1)
140
+ ]),
141
+ n("td", null, t(e(o).base_info && e(o).base_info.online_servers_count ? e(o).base_info.online_servers_count : e(s)("dedicated_servers.gdaemon_empty_info")), 1)
142
+ ]),
143
+ n("tr", null, [
144
+ n("td", null, [
145
+ n("strong", null, t(e(s)("dedicated_servers.gdaemon_working_tasks_count")) + ":", 1)
146
+ ]),
147
+ n("td", null, t(e(o).base_info && e(o).base_info.working_tasks_count ? e(o).base_info.working_tasks_count : e(s)("dedicated_servers.gdaemon_empty_info")), 1)
148
+ ]),
149
+ n("tr", null, [
150
+ n("td", null, [
151
+ n("strong", null, t(e(s)("dedicated_servers.gdaemon_waiting_tasks_count")) + ":", 1)
152
+ ]),
153
+ n("td", null, t(e(o).base_info && e(o).base_info.waiting_tasks_count ? e(o).base_info.waiting_tasks_count : e(s)("dedicated_servers.gdaemon_empty_info")), 1)
154
+ ])
155
+ ])
156
+ ]),
157
+ _: 1
158
+ }))
159
+ ]),
160
+ _: 1
161
+ })
162
+ ], 64));
163
+ }
164
+ };
165
+ export {
166
+ Q as default
167
+ };