@gameap/frontend 4.1.0-dev7 → 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,312 @@
1
+ import { ref as x, computed as d, onMounted as Q, resolveComponent as _, createElementBlock as L, openBlock as P, Fragment as G, createElementVNode as f, createVNode as l, withCtx as b, unref as c, toDisplayString as W, h as n } from "vue";
2
+ import { k as X, j as Y, e as Z, t as s, a as I, l as w, _ as ee, m as te } from "./index-BDKiNPpP.js";
3
+ import { defineStore as se, storeToRefs as ne } from "pinia";
4
+ import { _ as k } from "./GameIcon-DaYNlnur.js";
5
+ import { _ as h } from "./ServerControlButton-C4zWzA-d.js";
6
+ const re = se("serverFilters", {
7
+ state: () => ({
8
+ selectedGame: null,
9
+ selectedIP: null
10
+ }),
11
+ getters: {
12
+ hasFilters: (i) => i.selectedGame !== null || i.selectedIP !== null
13
+ },
14
+ actions: {
15
+ setGameFilter(i) {
16
+ this.selectedGame = i;
17
+ },
18
+ setIPFilter(i) {
19
+ this.selectedIP = i;
20
+ },
21
+ clearFilters() {
22
+ this.selectedGame = null, this.selectedIP = null;
23
+ }
24
+ }
25
+ }), le = { class: "flex flex-wrap mb-4" }, ae = { class: "flex flex-wrap" }, oe = { class: "md:w-1/4 pr-4 pl-4" }, ie = { class: "md:w-1/4 pr-4 pl-4" }, ce = { class: "md:w-1/4 pr-4 pl-4" }, ue = { class: "hidden lg:inline" }, de = 0, me = 1, pe = 2, ve = {
26
+ __name: "ServerMainList",
27
+ setup(i) {
28
+ const o = X(), u = re(), S = Y(), { servers: m } = ne(S), N = x([
29
+ {
30
+ title: s("servers.name"),
31
+ key: "name",
32
+ render(e) {
33
+ return n("div", { class: "flex items-center" }, [
34
+ n(k, { game: e.game.code, class: "mr-2" }),
35
+ n("span", { class: "" }, e.name)
36
+ ]);
37
+ }
38
+ },
39
+ {
40
+ title: s("servers.ip_port"),
41
+ render(e) {
42
+ return e.server_ip + ":" + e.server_port;
43
+ }
44
+ },
45
+ {
46
+ title: s("servers.status"),
47
+ key: "status",
48
+ render(e) {
49
+ return e.blocked ? n("span", { class: "badge-stone" }, s("servers.blocked")) : e.enabled ? e.installed ? e.installed === pe ? n("span", { class: "badge-orange" }, s("servers.installation")) : e.online ? n(
50
+ "span",
51
+ {
52
+ class: "badge-green"
53
+ },
54
+ s("servers.online")
55
+ ) : n(
56
+ "span",
57
+ {
58
+ class: "badge-red"
59
+ },
60
+ s("servers.offline")
61
+ ) : n("span", { class: "badge-stone" }, s("servers.not_installed")) : n("span", { class: "badge-stone" }, s("servers.disabled"));
62
+ }
63
+ },
64
+ {
65
+ title: s("servers.commands"),
66
+ render(e) {
67
+ if (!e.enabled || e.blocked)
68
+ return [];
69
+ if (e.installed === de && q(e.id))
70
+ return n(
71
+ h,
72
+ {
73
+ command: "install",
74
+ "button-color": "orange",
75
+ "button-size": "small",
76
+ icon: "download",
77
+ text: s("servers.install"),
78
+ "server-id": e.id
79
+ }
80
+ );
81
+ let t = [];
82
+ return e.installed === me && (e.online && V(e.id) && t.push(
83
+ n(
84
+ h,
85
+ {
86
+ command: "stop",
87
+ "button-color": "red",
88
+ "button-size": "small",
89
+ icon: "stop",
90
+ text: s("servers.stop"),
91
+ "server-id": e.id
92
+ }
93
+ ),
94
+ " "
95
+ ), !e.online && D(e.id) && t.push(
96
+ n(
97
+ h,
98
+ {
99
+ command: "start",
100
+ "button-color": "green",
101
+ "button-size": "small",
102
+ icon: "play",
103
+ text: s("servers.start"),
104
+ "server-id": e.id
105
+ }
106
+ ),
107
+ " "
108
+ ), j(e.id) && t.push(
109
+ n(
110
+ h,
111
+ {
112
+ command: "restart",
113
+ "button-color": "orange",
114
+ "button-size": "small",
115
+ icon: "restart",
116
+ text: s("servers.restart"),
117
+ "server-id": e.id
118
+ }
119
+ ),
120
+ " "
121
+ )), B(e.id) && t.push(
122
+ n(
123
+ ee,
124
+ {
125
+ color: "black",
126
+ size: "small",
127
+ route: "/servers/" + e.id
128
+ },
129
+ { default: () => [
130
+ n("span", { class: "hidden lg:inline" }, s("servers.control")),
131
+ " ",
132
+ n(I, { name: "chevron-double-right" })
133
+ ] }
134
+ )
135
+ ), t;
136
+ }
137
+ }
138
+ ]), C = {
139
+ pageSize: 20
140
+ }, A = x(!0), E = x(null), p = d({
141
+ get: () => u.selectedGame,
142
+ set: (e) => u.setGameFilter(e)
143
+ }), v = d({
144
+ get: () => u.selectedIP,
145
+ set: (e) => u.setIPFilter(e)
146
+ });
147
+ Q(() => {
148
+ S.fetchServersByNode().finally(() => {
149
+ A.value = !1;
150
+ }), o.isAdmin || o.fetchServersAbilities().catch((e) => {
151
+ Z(e);
152
+ });
153
+ });
154
+ const $ = d(() => m.value.filter((e) => {
155
+ let t = !1;
156
+ return p.value !== null && p.value !== "" && p.value.length > 0 && (t = !p.value.includes(e.game.code)), !t && v.value !== null && v.value !== "" && v.value.length > 0 && (t = !v.value.includes(e.server_ip)), !t;
157
+ })), z = (e) => [
158
+ n(k, { game: e.value, class: "mr-2" }),
159
+ e.label
160
+ ], T = d(() => {
161
+ const e = /* @__PURE__ */ new Map();
162
+ for (const r in m.value)
163
+ e.set(
164
+ m.value[r].game.code,
165
+ m.value[r].game.name
166
+ );
167
+ let t = [];
168
+ e.forEach((r, g) => {
169
+ t.push([g, r]);
170
+ }), t.sort((r, g) => r[1].localeCompare(g[1]));
171
+ let a = [];
172
+ return t.forEach((r) => {
173
+ a.push({
174
+ value: r[0],
175
+ label: r[1]
176
+ });
177
+ }), a;
178
+ }), O = d(() => {
179
+ var e = [];
180
+ for (const t of T.value)
181
+ e.push({ label: t.label, value: t.value });
182
+ return e;
183
+ }), R = d(() => {
184
+ const e = /* @__PURE__ */ new Set();
185
+ for (const a in m.value)
186
+ e.add(m.value[a].server_ip);
187
+ var t = [];
188
+ for (const a of Array.from(e).sort())
189
+ t.push({ label: a, value: a });
190
+ return t;
191
+ });
192
+ function F() {
193
+ }
194
+ function M() {
195
+ u.clearFilters();
196
+ }
197
+ function U() {
198
+ return u.hasFilters;
199
+ }
200
+ function B(e) {
201
+ return o.canServerAbility(e, "game-server-common");
202
+ }
203
+ function D(e) {
204
+ return o.canServerAbility(e, "game-server-start");
205
+ }
206
+ function V(e) {
207
+ return o.canServerAbility(e, "game-server-stop");
208
+ }
209
+ function j(e) {
210
+ return o.canServerAbility(e, "game-server-restart");
211
+ }
212
+ function q(e) {
213
+ return o.canServerAbility(e, "game-server-update");
214
+ }
215
+ return (e, t) => {
216
+ const a = _("n-select"), r = _("n-button"), g = _("n-collapse-item"), H = _("n-collapse"), J = _("n-empty"), K = _("n-data-table");
217
+ return P(), L(G, null, [
218
+ f("div", le, [
219
+ l(H, null, {
220
+ default: b(() => [
221
+ l(g, {
222
+ title: c(s)("servers.filters"),
223
+ name: "filters"
224
+ }, {
225
+ default: b(() => [
226
+ f("div", ae, [
227
+ f("div", oe, [
228
+ l(a, {
229
+ value: p.value,
230
+ "onUpdate:value": [
231
+ t[0] || (t[0] = (y) => p.value = y),
232
+ F
233
+ ],
234
+ options: O.value,
235
+ "render-label": z,
236
+ multiple: "",
237
+ placeholder: c(s)("servers.select_game_filter_placeholder")
238
+ }, null, 8, ["value", "options", "placeholder"])
239
+ ]),
240
+ f("div", ie, [
241
+ l(a, {
242
+ value: v.value,
243
+ "onUpdate:value": [
244
+ t[1] || (t[1] = (y) => v.value = y),
245
+ F
246
+ ],
247
+ options: R.value,
248
+ multiple: "",
249
+ placeholder: c(s)("servers.select_ip_filter_placeholder")
250
+ }, null, 8, ["value", "options", "placeholder"])
251
+ ]),
252
+ f("div", ce, [
253
+ l(r, {
254
+ onClick: M,
255
+ type: "error",
256
+ disabled: !U(),
257
+ ghost: ""
258
+ }, {
259
+ default: b(() => [
260
+ l(c(I), { name: "eraser" }),
261
+ f("span", ue, " " + W(c(s)("main.clear")), 1)
262
+ ]),
263
+ _: 1
264
+ }, 8, ["disabled"])
265
+ ])
266
+ ])
267
+ ]),
268
+ _: 1
269
+ }, 8, ["title"])
270
+ ]),
271
+ _: 1
272
+ })
273
+ ]),
274
+ l(K, {
275
+ ref_key: "tableRef",
276
+ ref: E,
277
+ bordered: !1,
278
+ "single-line": !0,
279
+ columns: N.value,
280
+ data: $.value,
281
+ loading: A.value,
282
+ pagination: C
283
+ }, {
284
+ loading: b(() => [
285
+ l(c(w))
286
+ ]),
287
+ empty: b(() => [
288
+ l(J, {
289
+ description: c(s)("servers.empty_list")
290
+ }, null, 8, ["description"])
291
+ ]),
292
+ _: 1
293
+ }, 8, ["columns", "data", "loading"])
294
+ ], 64);
295
+ };
296
+ }
297
+ }, ye = {
298
+ __name: "ServersView",
299
+ setup(i) {
300
+ const o = d(() => [
301
+ { route: "/", text: "GameAP", icon: "gicon gicon-gameap" },
302
+ { route: { name: "servers" }, text: s("servers.game_servers") }
303
+ ]);
304
+ return (u, S) => (P(), L(G, null, [
305
+ l(c(te), { items: o.value }, null, 8, ["items"]),
306
+ l(ve)
307
+ ], 64));
308
+ }
309
+ };
310
+ export {
311
+ ye as default
312
+ };
@@ -0,0 +1,89 @@
1
+ import { resolveComponent as _, createElementBlock as d, openBlock as m, createElementVNode as e, Fragment as f, renderList as g, withDirectives as u, toDisplayString as s, vModelText as p, withModifiers as b, createVNode as h, createTextVNode as v } from "vue";
2
+ import { c as w, a as x } from "./index-BDKiNPpP.js";
3
+ const k = {
4
+ name: "SettingsParameters",
5
+ components: { GIcon: x },
6
+ props: {
7
+ initialItems: Array,
8
+ inputName: String
9
+ },
10
+ data: function() {
11
+ return {
12
+ items: this.initialItems || []
13
+ };
14
+ },
15
+ methods: {
16
+ addItem: function() {
17
+ this.items.push({
18
+ name: "",
19
+ value: ""
20
+ });
21
+ },
22
+ removeItem: function(t) {
23
+ this.items.splice(t, 1);
24
+ }
25
+ }
26
+ }, N = { class: "flex flex-col min-w-0 rounded break-words border bg-white border-1 border-stone-300 mb-2" }, y = { class: "flex-auto p-6" }, V = { class: "mb-3" }, C = ["for"], I = ["name", "id", "onUpdate:modelValue"], S = { class: "mb-3" }, U = ["for"], E = ["name", "id", "onUpdate:modelValue", "rows"], G = ["onClick"], B = { class: "mt-2 text-center" };
27
+ function D(t, l, a, M, P, i) {
28
+ const c = _("GIcon");
29
+ return m(), d("div", null, [
30
+ e("div", N, [
31
+ e("div", y, [
32
+ (m(!0), d(f, null, g(t.items, (n, o) => (m(), d("div", null, [
33
+ e("div", V, [
34
+ e("label", {
35
+ for: a.inputName + "[" + o + "][name]",
36
+ class: "control-label"
37
+ }, s(t.trans("labels.name")), 9, C),
38
+ u(e("input", {
39
+ name: a.inputName + "[" + o + "][name]",
40
+ id: a.inputName + "[" + o + "][name]",
41
+ "onUpdate:modelValue": (r) => n.name = r,
42
+ type: "text",
43
+ class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded"
44
+ }, null, 8, I), [
45
+ [p, n.name]
46
+ ])
47
+ ]),
48
+ e("div", S, [
49
+ e("label", {
50
+ for: a.inputName + "[" + o + "][value]",
51
+ class: "control-label"
52
+ }, s(t.trans("labels.the_value")), 9, U),
53
+ u(e("textarea", {
54
+ name: a.inputName + "[" + o + "][value]",
55
+ id: a.inputName + "[" + o + "][value]",
56
+ "onUpdate:modelValue": (r) => n.value = r,
57
+ class: "block appearance-none w-full py-1 px-2 mb-1 leading-normal bg-white text-stone-800 border border-stone-200 rounded",
58
+ rows: (n.value.match(new RegExp(`
59
+ `, "g")) || []).length + 2
60
+ }, " ", 8, E), [
61
+ [p, n.value]
62
+ ])
63
+ ]),
64
+ e("button", {
65
+ class: "inline-block align-middle text-center select-none border font-normal whitespace-no-wrap rounded no-underline py-1.5 px-2 leading-tight text-xs bg-red-600 text-white hover:bg-red-700",
66
+ onClick: b((r) => i.removeItem(o), ["prevent"])
67
+ }, [
68
+ h(c, { name: "close" }),
69
+ v(" " + s(t.trans("main.delete")), 1)
70
+ ], 8, G),
71
+ l[1] || (l[1] = e("hr", null, null, -1))
72
+ ]))), 256)),
73
+ e("div", B, [
74
+ e("button", {
75
+ class: "inline-block align-middle text-center select-none border font-normal whitespace-no-wrap rounded no-underline py-1.5 px-2 leading-tight text-xs bg-lime-500 text-white hover:bg-lime-600",
76
+ onClick: l[0] || (l[0] = b((...n) => i.addItem && i.addItem(...n), ["prevent"]))
77
+ }, [
78
+ h(c, { name: "add" }),
79
+ v(" " + s(t.trans("main.add")), 1)
80
+ ])
81
+ ])
82
+ ])
83
+ ])
84
+ ]);
85
+ }
86
+ const F = /* @__PURE__ */ w(k, [["render", D]]);
87
+ export {
88
+ F as default
89
+ };
@@ -0,0 +1,174 @@
1
+ import { mergeModels as C, useModel as q, ref as T, onMounted as U, watch as s, createElementBlock as D, openBlock as M, createVNode as v, unref as o, withCtx as f, createCommentVNode as j, createElementVNode as G, toDisplayString as Q } from "vue";
2
+ import { storeToRefs as h } from "pinia";
3
+ import { i as A, h as L, u as W, t as P } from "./index-BDKiNPpP.js";
4
+ import { NFormItem as k, NInputNumber as g } from "naive-ui";
5
+ const z = {
6
+ key: 0,
7
+ class: "help-block"
8
+ }, Y = {
9
+ __name: "SmartPortSelector",
10
+ props: /* @__PURE__ */ C({
11
+ initialServerIp: String,
12
+ initialServerPort: Number,
13
+ initialQueryPort: Number,
14
+ initialRconPort: Number,
15
+ game: String,
16
+ serverPortPath: { type: String, default: "serverPort" },
17
+ rconPortPath: { type: String, default: "rconPort" },
18
+ queryPortPath: { type: String, default: "queryPort" }
19
+ }, {
20
+ serverPort: {},
21
+ serverPortModifiers: {},
22
+ queryPort: {},
23
+ queryPortModifiers: {},
24
+ rconPort: {},
25
+ rconPortModifiers: {}
26
+ }),
27
+ emits: /* @__PURE__ */ C(["update:serverPort", "update:rconPort", "update:queryPort"], ["update:serverPort", "update:queryPort", "update:rconPort"]),
28
+ setup(l, { emit: B }) {
29
+ const y = {
30
+ ark: 7777,
31
+ arma2: 2302,
32
+ arma2ao: 2302,
33
+ arma3: 2302,
34
+ cod4: 28960,
35
+ fivem: 30120,
36
+ hurtworld: 12871,
37
+ justcause: 7777,
38
+ minecraft: 25565,
39
+ mta: 22003,
40
+ rok: 7350,
41
+ rust: 28015,
42
+ samp: 7777,
43
+ teamspeak3: 9987,
44
+ quake: 26e3,
45
+ q1: 26e3,
46
+ quake2: 27910,
47
+ q2: 27910,
48
+ quake3: 27960,
49
+ q3: 27960,
50
+ quake4: 28004,
51
+ q4: 28004,
52
+ default: 27015
53
+ }, I = {
54
+ arma2: [0, 0],
55
+ arma2ao: [0, 0],
56
+ arma3: [0, 0],
57
+ cod4: [0, 0],
58
+ mta: [0, 2],
59
+ samp: [0, 0],
60
+ hurtworld: [10, 0],
61
+ justcause: [0, 0],
62
+ fivem: [0, 0],
63
+ ark: [0, 0],
64
+ rust: [0, 1],
65
+ minecraft: [0, 1],
66
+ rok: [0, 0],
67
+ teamspeak3: [24, 35],
68
+ default: [0, 0]
69
+ }, a = l, S = B, b = A(), O = L(), R = W(), { nodeId: _, busyPorts: N } = h(b), { gameCode: c } = h(O), { formIp: d } = h(R), t = q(l, "serverPort"), n = q(l, "queryPort"), i = q(l, "rconPort"), m = T("");
70
+ function w() {
71
+ const e = F();
72
+ if (a.initialServerIp === d.value) {
73
+ t.value = parseInt(a.initialServerPort) || 27015;
74
+ const u = x();
75
+ n.value = parseInt(a.initialQueryPort) || t.value + u[0], i.value = parseInt(a.initialRconPort) || t.value + u[1];
76
+ return;
77
+ }
78
+ let r = -1;
79
+ do
80
+ r++, t.value = y[e] + r;
81
+ while (V(d.value, y[e] + r));
82
+ }
83
+ function E() {
84
+ const e = x();
85
+ n.value = t.value + e[0], i.value = t.value + e[1];
86
+ }
87
+ function F() {
88
+ return y.hasOwnProperty(c.value) ? c.value : "default";
89
+ }
90
+ function x() {
91
+ return I[c.value] || I.default;
92
+ }
93
+ function V(e, r) {
94
+ return typeof a.initialServerIp < "u" && typeof a.initialServerPort < "u" && e === a.initialServerIp && r === a.initialServerPort ? !1 : N.value.hasOwnProperty(e) && N.value[e].indexOf(r) !== -1;
95
+ }
96
+ function p() {
97
+ d.value === a.initialServerIp && t.value === a.initialServerPort && (m.value = ""), V(d.value, t.value) ? m.value = P("validation.unique", { attribute: P("labels.server_port") }) : m.value = "";
98
+ }
99
+ return U(() => {
100
+ b.fetchBusyPorts(p);
101
+ }), s(_, () => {
102
+ b.fetchBusyPorts(p);
103
+ }), s(t, (e, r) => {
104
+ t.value = Number(t.value), E(), p(), S("update:serverPort", t.value);
105
+ }), s(i, (e) => {
106
+ S("update:rconPort", i.value);
107
+ }), s(n, (e) => {
108
+ S("update:queryPort", n.value);
109
+ }), s(d, (e, r) => {
110
+ e && w(), p();
111
+ }), s(c, () => {
112
+ w();
113
+ }), (e, r) => (M(), D("div", null, [
114
+ v(o(k), {
115
+ label: o(P)("labels.server_port"),
116
+ path: l.serverPortPath
117
+ }, {
118
+ feedback: f(() => [
119
+ m.value ? (M(), D("span", z, [
120
+ G("strong", null, Q(m.value), 1)
121
+ ])) : j("", !0)
122
+ ]),
123
+ default: f(() => [
124
+ v(o(g), {
125
+ name: "server_port",
126
+ id: "server_port",
127
+ min: 1024,
128
+ max: 65535,
129
+ value: t.value,
130
+ "onUpdate:value": r[0] || (r[0] = (u) => t.value = u)
131
+ }, null, 8, ["value"])
132
+ ]),
133
+ _: 1
134
+ }, 8, ["label", "path"]),
135
+ v(o(k), {
136
+ label: o(P)("labels.query_port"),
137
+ path: l.queryPortPath
138
+ }, {
139
+ default: f(() => [
140
+ v(o(g), {
141
+ name: "query_port",
142
+ type: "number",
143
+ id: "server_port",
144
+ min: 1024,
145
+ max: 65535,
146
+ value: n.value,
147
+ "onUpdate:value": r[1] || (r[1] = (u) => n.value = u)
148
+ }, null, 8, ["value"])
149
+ ]),
150
+ _: 1
151
+ }, 8, ["label", "path"]),
152
+ v(o(k), {
153
+ label: o(P)("labels.rcon_port"),
154
+ path: l.rconPortPath
155
+ }, {
156
+ default: f(() => [
157
+ v(o(g), {
158
+ name: "rcon_port",
159
+ type: "number",
160
+ id: "server_port",
161
+ min: 1024,
162
+ max: 65535,
163
+ value: i.value,
164
+ "onUpdate:value": r[2] || (r[2] = (u) => i.value = u)
165
+ }, null, 8, ["value"])
166
+ ]),
167
+ _: 1
168
+ }, 8, ["label", "path"])
169
+ ]));
170
+ }
171
+ };
172
+ export {
173
+ Y as default
174
+ };