@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,370 @@
|
|
|
1
|
+
import { mergeModels as U, ref as d, useModel as M, createElementBlock as q, openBlock as $, normalizeClass as T, createVNode as n, unref as t, withCtx as o, createBlock as H, createCommentVNode as J, createElementVNode as e, createTextVNode as B, toDisplayString as a, computed as E, onMounted as Q, Fragment as W, h as g } from "vue";
|
|
2
|
+
import { l as j, t as l, _ as k, a as x, e as z, m as X, n as S } from "./index-9fvX7FD-.js";
|
|
3
|
+
import { storeToRefs as Y } from "pinia";
|
|
4
|
+
import { u as Z } from "./clientCertificates-C0FlDwsb.js";
|
|
5
|
+
import { NForm as ee, NFormItem as P, NUpload as D, NButton as L, NInput as te, NDataTable as le, NModal as R, NTable as ie } from "naive-ui";
|
|
6
|
+
import { c as ae } from "./camelCase-CSrB2MWj.js";
|
|
7
|
+
const ne = { class: "hidden lg:inline" }, se = {
|
|
8
|
+
__name: "CreateCertificateForm",
|
|
9
|
+
props: /* @__PURE__ */ U({
|
|
10
|
+
loading: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
required: !1
|
|
13
|
+
}
|
|
14
|
+
}, {
|
|
15
|
+
modelValue: {
|
|
16
|
+
privateKeyPass: ""
|
|
17
|
+
},
|
|
18
|
+
modelModifiers: {},
|
|
19
|
+
certificateFile: {},
|
|
20
|
+
certificateFileModifiers: {},
|
|
21
|
+
privateKeyFile: {},
|
|
22
|
+
privateKeyFileModifiers: {}
|
|
23
|
+
}),
|
|
24
|
+
emits: /* @__PURE__ */ U(["create"], ["update:modelValue", "update:certificateFile", "update:privateKeyFile"]),
|
|
25
|
+
setup(m, { emit: p }) {
|
|
26
|
+
const h = d({}), C = M(m, "modelValue"), F = M(m, "certificateFile"), y = M(m, "privateKeyFile"), w = {}, K = (c) => {
|
|
27
|
+
c.fileList.length > 0 ? F.value = c.fileList[0].file : F.value = null;
|
|
28
|
+
}, b = (c) => {
|
|
29
|
+
c.fileList.length > 0 ? y.value = c.fileList[0].file : y.value = null;
|
|
30
|
+
}, N = p, v = () => {
|
|
31
|
+
h.value.validate().then(() => {
|
|
32
|
+
N("create");
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return (c, f) => ($(), q("div", {
|
|
36
|
+
class: T(c.$attrs.class)
|
|
37
|
+
}, [
|
|
38
|
+
n(t(ee), {
|
|
39
|
+
"label-placement": "top",
|
|
40
|
+
"label-width": "auto",
|
|
41
|
+
ref_key: "formRef",
|
|
42
|
+
ref: h,
|
|
43
|
+
model: C.value,
|
|
44
|
+
rules: w
|
|
45
|
+
}, {
|
|
46
|
+
default: o(() => [
|
|
47
|
+
m.loading ? ($(), H(t(j), { key: 0 })) : J("", !0),
|
|
48
|
+
e("div", {
|
|
49
|
+
class: T(["mb-4", m.loading ? "hidden" : ""])
|
|
50
|
+
}, [
|
|
51
|
+
n(t(P), {
|
|
52
|
+
label: t(l)("client_certificates.certificate"),
|
|
53
|
+
path: "certificate"
|
|
54
|
+
}, {
|
|
55
|
+
default: o(() => [
|
|
56
|
+
n(t(D), {
|
|
57
|
+
max: 1,
|
|
58
|
+
multiple: !1,
|
|
59
|
+
"default-upload": !1,
|
|
60
|
+
onChange: K
|
|
61
|
+
}, {
|
|
62
|
+
default: o(() => [
|
|
63
|
+
n(t(L), null, {
|
|
64
|
+
default: o(() => [
|
|
65
|
+
B(a(t(l)("main.upload_file")), 1)
|
|
66
|
+
]),
|
|
67
|
+
_: 1
|
|
68
|
+
})
|
|
69
|
+
]),
|
|
70
|
+
_: 1
|
|
71
|
+
})
|
|
72
|
+
]),
|
|
73
|
+
_: 1
|
|
74
|
+
}, 8, ["label"]),
|
|
75
|
+
n(t(P), {
|
|
76
|
+
label: t(l)("client_certificates.private_key"),
|
|
77
|
+
path: "privateKey"
|
|
78
|
+
}, {
|
|
79
|
+
default: o(() => [
|
|
80
|
+
n(t(D), {
|
|
81
|
+
max: 1,
|
|
82
|
+
multiple: !1,
|
|
83
|
+
"default-upload": !1,
|
|
84
|
+
onChange: b
|
|
85
|
+
}, {
|
|
86
|
+
default: o(() => [
|
|
87
|
+
n(t(L), null, {
|
|
88
|
+
default: o(() => [
|
|
89
|
+
B(a(t(l)("main.upload_file")), 1)
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
})
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
})
|
|
96
|
+
]),
|
|
97
|
+
_: 1
|
|
98
|
+
}, 8, ["label"]),
|
|
99
|
+
n(t(P), {
|
|
100
|
+
label: t(l)("client_certificates.private_key_pass"),
|
|
101
|
+
path: "privateKeyPass"
|
|
102
|
+
}, {
|
|
103
|
+
default: o(() => [
|
|
104
|
+
n(t(te), {
|
|
105
|
+
value: C.value.privateKeyPass,
|
|
106
|
+
"onUpdate:value": f[0] || (f[0] = (_) => C.value.privateKeyPass = _),
|
|
107
|
+
type: "password",
|
|
108
|
+
"show-password-on": "click",
|
|
109
|
+
"input-props": { autocomplete: "one-time-code" }
|
|
110
|
+
}, null, 8, ["value"])
|
|
111
|
+
]),
|
|
112
|
+
_: 1
|
|
113
|
+
}, 8, ["label"])
|
|
114
|
+
], 2)
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["model"]),
|
|
118
|
+
n(k, {
|
|
119
|
+
color: "green",
|
|
120
|
+
onClick: v
|
|
121
|
+
}, {
|
|
122
|
+
default: o(() => [
|
|
123
|
+
n(t(x), { name: "add-square" }),
|
|
124
|
+
e("span", ne, " " + a(t(l)("main.create")), 1)
|
|
125
|
+
]),
|
|
126
|
+
_: 1
|
|
127
|
+
})
|
|
128
|
+
], 2));
|
|
129
|
+
}
|
|
130
|
+
}, me = {
|
|
131
|
+
__name: "AdminClientCertificatesView",
|
|
132
|
+
setup(m) {
|
|
133
|
+
const p = Z(), h = E(() => [
|
|
134
|
+
{ route: "/", text: "GameAP", icon: "gicon gicon-gameap" },
|
|
135
|
+
{ route: { name: "admin.nodes.index" }, text: l("sidebar.dedicated_servers") },
|
|
136
|
+
{ route: { name: "admin.client_certificates.index" }, text: l("client_certificates.client_certificates") }
|
|
137
|
+
]), C = () => [
|
|
138
|
+
{
|
|
139
|
+
title: l("client_certificates.fingerprint"),
|
|
140
|
+
key: "fingerprint"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
title: l("client_certificates.expires"),
|
|
144
|
+
key: "expires"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
title: l("main.actions"),
|
|
148
|
+
render(s) {
|
|
149
|
+
return [
|
|
150
|
+
g(k, {
|
|
151
|
+
color: "green",
|
|
152
|
+
size: "small",
|
|
153
|
+
class: "mr-0.5",
|
|
154
|
+
onClick: () => {
|
|
155
|
+
O(s.id);
|
|
156
|
+
}
|
|
157
|
+
}, { default: () => [
|
|
158
|
+
g(x, { name: "view" }),
|
|
159
|
+
g("span", { class: "hidden lg:inline" }, l("main.view"))
|
|
160
|
+
] }),
|
|
161
|
+
g(k, {
|
|
162
|
+
color: "red",
|
|
163
|
+
size: "small",
|
|
164
|
+
text: l("main.delete"),
|
|
165
|
+
onClick: () => {
|
|
166
|
+
G(s.id);
|
|
167
|
+
}
|
|
168
|
+
}, { default: () => [
|
|
169
|
+
g(x, { name: "delete" }),
|
|
170
|
+
g("span", { class: "hidden lg:inline" }, l("main.delete"))
|
|
171
|
+
] })
|
|
172
|
+
];
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
], { loading: F, certificates: y } = Y(p), w = d(C()), K = {
|
|
176
|
+
pageSize: 20
|
|
177
|
+
};
|
|
178
|
+
Q(() => {
|
|
179
|
+
b();
|
|
180
|
+
});
|
|
181
|
+
const b = () => {
|
|
182
|
+
p.fetchClientCertificates().catch((s) => {
|
|
183
|
+
z(s);
|
|
184
|
+
});
|
|
185
|
+
}, N = E(() => y.value.map(
|
|
186
|
+
(s) => ({
|
|
187
|
+
id: s.id,
|
|
188
|
+
fingerprint: s.fingerprint,
|
|
189
|
+
expires: s.expires,
|
|
190
|
+
info: Object.fromEntries(
|
|
191
|
+
Object.entries(s.info).map(([i, r]) => [ae(i), r])
|
|
192
|
+
)
|
|
193
|
+
})
|
|
194
|
+
)), v = d(!1), c = d({}), f = d(), _ = d(), A = () => {
|
|
195
|
+
c.value = {}, f.value = {}, _.value = {}, v.value = !0;
|
|
196
|
+
}, I = () => {
|
|
197
|
+
const s = {
|
|
198
|
+
certificate: f.value,
|
|
199
|
+
private_key: _.value,
|
|
200
|
+
private_key_pass: c.value.privateKeyPass ?? ""
|
|
201
|
+
};
|
|
202
|
+
p.createClientCertificate(s).then(() => {
|
|
203
|
+
S({
|
|
204
|
+
content: l("client_certificates.upload_success_msg"),
|
|
205
|
+
type: "success"
|
|
206
|
+
}, () => {
|
|
207
|
+
v.value = !1, b();
|
|
208
|
+
});
|
|
209
|
+
}).catch((i) => {
|
|
210
|
+
z(i);
|
|
211
|
+
});
|
|
212
|
+
}, V = d(!1), u = d({}), O = (s) => {
|
|
213
|
+
V.value = !0, u.value = y.value.find((i) => i.id === s);
|
|
214
|
+
}, G = (s) => {
|
|
215
|
+
const i = () => {
|
|
216
|
+
p.deleteClientCertificate(s).then(() => {
|
|
217
|
+
S({
|
|
218
|
+
content: l("client_certificates.delete_success_msg"),
|
|
219
|
+
type: "success"
|
|
220
|
+
}, () => {
|
|
221
|
+
b();
|
|
222
|
+
});
|
|
223
|
+
}).catch((r) => {
|
|
224
|
+
z(r);
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
window.$dialog.success({
|
|
228
|
+
title: l("client_certificates.delete_confirm_msg"),
|
|
229
|
+
positiveText: l("main.yes"),
|
|
230
|
+
negativeText: l("main.no"),
|
|
231
|
+
closable: !1,
|
|
232
|
+
onPositiveClick: () => {
|
|
233
|
+
i();
|
|
234
|
+
},
|
|
235
|
+
onNegativeClick: () => {
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
return (s, i) => ($(), q(W, null, [
|
|
240
|
+
n(t(X), { items: h.value }, null, 8, ["items"]),
|
|
241
|
+
n(k, {
|
|
242
|
+
color: "green",
|
|
243
|
+
size: "middle",
|
|
244
|
+
class: "mb-5 mr-1",
|
|
245
|
+
onClick: i[0] || (i[0] = (r) => A())
|
|
246
|
+
}, {
|
|
247
|
+
default: o(() => [
|
|
248
|
+
n(t(x), {
|
|
249
|
+
name: "add-square",
|
|
250
|
+
class: "mr-0.5"
|
|
251
|
+
}),
|
|
252
|
+
e("span", null, a(t(l)("client_certificates.upload")), 1)
|
|
253
|
+
]),
|
|
254
|
+
_: 1
|
|
255
|
+
}),
|
|
256
|
+
n(t(le), {
|
|
257
|
+
ref: "tableRef",
|
|
258
|
+
bordered: !1,
|
|
259
|
+
"single-line": !0,
|
|
260
|
+
columns: w.value,
|
|
261
|
+
data: N.value,
|
|
262
|
+
loading: t(F),
|
|
263
|
+
pagination: K
|
|
264
|
+
}, {
|
|
265
|
+
loading: o(() => [
|
|
266
|
+
n(t(j))
|
|
267
|
+
]),
|
|
268
|
+
_: 1
|
|
269
|
+
}, 8, ["columns", "data", "loading"]),
|
|
270
|
+
n(t(R), {
|
|
271
|
+
show: v.value,
|
|
272
|
+
"onUpdate:show": i[4] || (i[4] = (r) => v.value = r),
|
|
273
|
+
class: "custom-card",
|
|
274
|
+
preset: "card",
|
|
275
|
+
title: t(l)("client_certificates.title_upload"),
|
|
276
|
+
bordered: !1,
|
|
277
|
+
style: { width: "600px" },
|
|
278
|
+
segmented: { content: "soft", footer: "soft" }
|
|
279
|
+
}, {
|
|
280
|
+
default: o(() => [
|
|
281
|
+
n(se, {
|
|
282
|
+
modelValue: c.value,
|
|
283
|
+
"onUpdate:modelValue": i[1] || (i[1] = (r) => c.value = r),
|
|
284
|
+
certificateFile: f.value,
|
|
285
|
+
"onUpdate:certificateFile": i[2] || (i[2] = (r) => f.value = r),
|
|
286
|
+
privateKeyFile: _.value,
|
|
287
|
+
"onUpdate:privateKeyFile": i[3] || (i[3] = (r) => _.value = r),
|
|
288
|
+
onCreate: I
|
|
289
|
+
}, null, 8, ["modelValue", "certificateFile", "privateKeyFile"])
|
|
290
|
+
]),
|
|
291
|
+
_: 1
|
|
292
|
+
}, 8, ["show", "title"]),
|
|
293
|
+
n(t(R), {
|
|
294
|
+
show: V.value,
|
|
295
|
+
"onUpdate:show": i[5] || (i[5] = (r) => V.value = r),
|
|
296
|
+
class: "custom-card",
|
|
297
|
+
preset: "card",
|
|
298
|
+
title: t(l)("client_certificates.title_view"),
|
|
299
|
+
bordered: !1,
|
|
300
|
+
style: { width: "800px" },
|
|
301
|
+
segmented: { content: "soft", footer: "soft" }
|
|
302
|
+
}, {
|
|
303
|
+
default: o(() => [
|
|
304
|
+
n(t(ie), {
|
|
305
|
+
bordered: !1,
|
|
306
|
+
"single-line": !0
|
|
307
|
+
}, {
|
|
308
|
+
default: o(() => [
|
|
309
|
+
e("tbody", null, [
|
|
310
|
+
e("tr", null, [
|
|
311
|
+
e("td", null, [
|
|
312
|
+
e("strong", null, a(t(l)("client_certificates.fingerprint")) + ":", 1)
|
|
313
|
+
]),
|
|
314
|
+
e("td", null, a(u.value.fingerprint), 1)
|
|
315
|
+
]),
|
|
316
|
+
e("tr", null, [
|
|
317
|
+
e("td", null, [
|
|
318
|
+
e("strong", null, a(t(l)("client_certificates.signature_type")) + ":", 1)
|
|
319
|
+
]),
|
|
320
|
+
e("td", null, a(u.value.info.signature_type), 1)
|
|
321
|
+
]),
|
|
322
|
+
e("tr", null, [
|
|
323
|
+
e("td", null, [
|
|
324
|
+
e("strong", null, a(t(l)("client_certificates.common_name")) + ":", 1)
|
|
325
|
+
]),
|
|
326
|
+
e("td", null, a(u.value.info.common_name), 1)
|
|
327
|
+
]),
|
|
328
|
+
e("tr", null, [
|
|
329
|
+
e("td", null, [
|
|
330
|
+
e("strong", null, a(t(l)("client_certificates.country")) + ":", 1)
|
|
331
|
+
]),
|
|
332
|
+
e("td", null, a(u.value.info.country), 1)
|
|
333
|
+
]),
|
|
334
|
+
e("tr", null, [
|
|
335
|
+
e("td", null, [
|
|
336
|
+
e("strong", null, a(t(l)("client_certificates.organization")) + ":", 1)
|
|
337
|
+
]),
|
|
338
|
+
e("td", null, a(u.value.info.organization), 1)
|
|
339
|
+
]),
|
|
340
|
+
e("tr", null, [
|
|
341
|
+
e("td", null, [
|
|
342
|
+
e("strong", null, a(t(l)("client_certificates.organizational_unit")) + ":", 1)
|
|
343
|
+
]),
|
|
344
|
+
e("td", null, a(u.value.info.organizational_unit), 1)
|
|
345
|
+
]),
|
|
346
|
+
e("tr", null, [
|
|
347
|
+
e("td", null, [
|
|
348
|
+
e("strong", null, a(t(l)("client_certificates.email")) + ":", 1)
|
|
349
|
+
]),
|
|
350
|
+
e("td", null, a(u.value.info.email), 1)
|
|
351
|
+
]),
|
|
352
|
+
e("tr", null, [
|
|
353
|
+
e("td", null, [
|
|
354
|
+
e("strong", null, a(t(l)("client_certificates.expires")) + ":", 1)
|
|
355
|
+
]),
|
|
356
|
+
e("td", null, a(u.value.info.expires), 1)
|
|
357
|
+
])
|
|
358
|
+
])
|
|
359
|
+
]),
|
|
360
|
+
_: 1
|
|
361
|
+
})
|
|
362
|
+
]),
|
|
363
|
+
_: 1
|
|
364
|
+
}, 8, ["show", "title"])
|
|
365
|
+
], 64));
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
export {
|
|
369
|
+
me as default
|
|
370
|
+
};
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { computed as v, ref as F, reactive as J, onMounted as K, createElementBlock as Q, openBlock as X, Fragment as Y, createVNode as d, createElementVNode as I, unref as r, withCtx as h, toDisplayString as Z, h as n } from "vue";
|
|
2
|
+
import { b as ee, x as se, j as ae, t as s, e as S, m as te, a as i, l as re, y as x, _ as ne } from "./index-9fvX7FD-.js";
|
|
3
|
+
import { NInputGroup as le, NSelect as _, NButton as oe, NDataTable as ue } from "naive-ui";
|
|
4
|
+
import { defineStore as de, storeToRefs as L } from "pinia";
|
|
5
|
+
import { j as k } from "./join-CmlzL0H9.js";
|
|
6
|
+
import { RouterLink as ie } from "vue-router";
|
|
7
|
+
const ce = de("daemonTaskList", {
|
|
8
|
+
state: () => ({
|
|
9
|
+
daemonTaskList: [],
|
|
10
|
+
currentPage: 1,
|
|
11
|
+
total: 0,
|
|
12
|
+
lastPage: 1,
|
|
13
|
+
// This is a counter to keep track of how many API processes are running
|
|
14
|
+
apiProcesses: 0
|
|
15
|
+
}),
|
|
16
|
+
getters: {
|
|
17
|
+
loading: (l) => l.apiProcesses > 0
|
|
18
|
+
},
|
|
19
|
+
actions: {
|
|
20
|
+
async fetchTasksByFilter(l) {
|
|
21
|
+
this.apiProcesses++;
|
|
22
|
+
try {
|
|
23
|
+
let o = {
|
|
24
|
+
sort: "-id"
|
|
25
|
+
};
|
|
26
|
+
l.page && (o["page[number]"] = l.page), l.tasks && (o["filter[task]"] = k(l.tasks, ",")), l.statuses && (o["filter[status]"] = k(l.statuses, ",")), l.nodes && (o["filter[dedicated_server_id]"] = k(l.nodes, ",")), l.servers && (o["filter[server_id]"] = k(l.servers, ","));
|
|
27
|
+
const c = await ee.get("/api/gdaemon_tasks", {
|
|
28
|
+
params: o
|
|
29
|
+
});
|
|
30
|
+
this.daemonTaskList = c.data.data, this.currentPage = c.data.current_page, this.total = c.data.total, this.lastPage = c.data.last_page;
|
|
31
|
+
} catch (o) {
|
|
32
|
+
throw o;
|
|
33
|
+
} finally {
|
|
34
|
+
this.apiProcesses--;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}), me = { class: "mb-1 w-2/3" }, ve = { class: "hidden lg:inline" }, he = {
|
|
39
|
+
__name: "AdminDaemonTaskListView",
|
|
40
|
+
setup(l) {
|
|
41
|
+
const o = ce(), c = se(), f = ae(), B = v(() => [
|
|
42
|
+
{ route: "/", text: "GameAP", icon: "gicon gicon-gameap" },
|
|
43
|
+
{ route: { name: "admin.gdaemon_tasks.index" }, text: s("gdaemon_tasks.gdaemon_tasks") }
|
|
44
|
+
]), D = () => [
|
|
45
|
+
{
|
|
46
|
+
title: s("gdaemon_tasks.task"),
|
|
47
|
+
key: "task",
|
|
48
|
+
render(e) {
|
|
49
|
+
return P(e.task, s("gdaemon_tasks." + e.task));
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: s("gdaemon_tasks.status"),
|
|
54
|
+
key: "status",
|
|
55
|
+
render(e) {
|
|
56
|
+
return n(x, { status: e.status, text: s("gdaemon_tasks.status_" + e.status) });
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: s("servers.game_server"),
|
|
61
|
+
render(e) {
|
|
62
|
+
if (!e.serverId)
|
|
63
|
+
return "";
|
|
64
|
+
let a = w.value.find((u) => u.id === e.serverId);
|
|
65
|
+
return a ? n(
|
|
66
|
+
ie,
|
|
67
|
+
{
|
|
68
|
+
to: { name: "servers.control", params: { id: a.id } },
|
|
69
|
+
class: "text-blue-600 underline dark:text-blue-500 hover:no-underline"
|
|
70
|
+
},
|
|
71
|
+
{ default: () => a.name }
|
|
72
|
+
) : "";
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
title: s("servers.dedicated_server"),
|
|
77
|
+
render(e) {
|
|
78
|
+
let a = T.value.find((u) => u.id === e.nodeId);
|
|
79
|
+
return a ? a.name : "";
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: s("gdaemon_tasks.created"),
|
|
84
|
+
key: "createdAt"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: s("gdaemon_tasks.updated"),
|
|
88
|
+
key: "updatedAt"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
title: s("main.actions"),
|
|
92
|
+
render(e) {
|
|
93
|
+
return [
|
|
94
|
+
n(ne, {
|
|
95
|
+
color: "green",
|
|
96
|
+
size: "small",
|
|
97
|
+
class: "mr-0.5",
|
|
98
|
+
route: { name: "admin.gdaemon_tasks.output", params: { id: e.id } }
|
|
99
|
+
}, { default: () => [
|
|
100
|
+
n(i, { name: "view" }),
|
|
101
|
+
n("span", { class: "hidden lg:inline" }, s("main.view"))
|
|
102
|
+
] })
|
|
103
|
+
];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
], { daemonTaskList: O, currentPage: m, total: y } = L(o), { nodes: T } = L(c), { servers: w } = L(f), A = F(D()), b = J({
|
|
107
|
+
page: m,
|
|
108
|
+
pageSize: 30
|
|
109
|
+
}), C = v(() => o.loading || c.loading || f.loading);
|
|
110
|
+
K(() => {
|
|
111
|
+
m.value = 1, g(), U(), $();
|
|
112
|
+
});
|
|
113
|
+
const g = () => {
|
|
114
|
+
let e = {
|
|
115
|
+
page: m.value
|
|
116
|
+
};
|
|
117
|
+
t.value.tasks && (e.tasks = t.value.tasks), t.value.statuses && (e.statuses = t.value.statuses), t.value.servers && (e.servers = t.value.servers), t.value.nodes && (e.nodes = t.value.nodes), o.fetchTasksByFilter(e).then(() => {
|
|
118
|
+
b.pageCount = y.lastPage, b.itemCount = y.value;
|
|
119
|
+
}).catch((a) => {
|
|
120
|
+
S(a);
|
|
121
|
+
});
|
|
122
|
+
}, U = () => {
|
|
123
|
+
c.fetchNodesByFilter([]).catch((e) => {
|
|
124
|
+
S(e);
|
|
125
|
+
});
|
|
126
|
+
}, $ = () => {
|
|
127
|
+
f.fetchServersByFilter([]).catch((e) => {
|
|
128
|
+
S(e);
|
|
129
|
+
});
|
|
130
|
+
}, j = v(() => O.value.map((e) => ({
|
|
131
|
+
id: e.id,
|
|
132
|
+
task: e.task,
|
|
133
|
+
status: e.status,
|
|
134
|
+
serverId: e.server_id,
|
|
135
|
+
nodeId: e.dedicated_server_id,
|
|
136
|
+
createdAt: new Date(e.created_at).toLocaleString(),
|
|
137
|
+
updatedAt: new Date(e.updated_at).toLocaleString()
|
|
138
|
+
}))), t = F({
|
|
139
|
+
tasks: null,
|
|
140
|
+
statuses: null,
|
|
141
|
+
servers: null,
|
|
142
|
+
nodes: null
|
|
143
|
+
}), N = [
|
|
144
|
+
{
|
|
145
|
+
label: s("gdaemon_tasks.gsstart"),
|
|
146
|
+
value: "gsstart"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: s("gdaemon_tasks.gsstop"),
|
|
150
|
+
value: "gsstop"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
label: s("gdaemon_tasks.gsrest"),
|
|
154
|
+
value: "gsrest"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
label: s("gdaemon_tasks.gsupd"),
|
|
158
|
+
value: "gsupd"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
label: s("gdaemon_tasks.gsinst"),
|
|
162
|
+
value: "gsinst"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
label: s("gdaemon_tasks.gsdel"),
|
|
166
|
+
value: "gsdel"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: s("gdaemon_tasks.gsmove"),
|
|
170
|
+
value: "gsmove"
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
label: s("gdaemon_tasks.cmdexec"),
|
|
174
|
+
value: "cmdexec"
|
|
175
|
+
}
|
|
176
|
+
], R = [
|
|
177
|
+
{
|
|
178
|
+
label: s("gdaemon_tasks.status_waiting"),
|
|
179
|
+
value: "waiting"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: s("gdaemon_tasks.status_working"),
|
|
183
|
+
value: "working"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
label: s("gdaemon_tasks.status_error"),
|
|
187
|
+
value: "error"
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
label: s("gdaemon_tasks.status_success"),
|
|
191
|
+
value: "success"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
label: s("gdaemon_tasks.status_canceled"),
|
|
195
|
+
value: "canceled"
|
|
196
|
+
}
|
|
197
|
+
], V = (e) => P(e.value, e.label), P = (e, a) => {
|
|
198
|
+
switch (e) {
|
|
199
|
+
case "gsstart":
|
|
200
|
+
return [n(i, { name: "play", class: "mr-2" }), a];
|
|
201
|
+
case "gsstop":
|
|
202
|
+
return [n(i, { name: "stop", class: "mr-2" }), a];
|
|
203
|
+
case "gsrest":
|
|
204
|
+
return [n(i, { name: "restart", class: "mr-2" }), a];
|
|
205
|
+
case "gsupd":
|
|
206
|
+
return [n(i, { name: "refresh", class: "mr-2" }), a];
|
|
207
|
+
case "gsinst":
|
|
208
|
+
return [n(i, { name: "download", class: "mr-2" }), a];
|
|
209
|
+
case "gsdel":
|
|
210
|
+
return [n(i, { name: "delete", class: "mr-2" }), a];
|
|
211
|
+
case "gsmove":
|
|
212
|
+
return [n(i, { name: "move", class: "mr-2" }), a];
|
|
213
|
+
case "cmdexec":
|
|
214
|
+
return [n(i, { name: "terminal", class: "mr-2" }), a];
|
|
215
|
+
default:
|
|
216
|
+
return a;
|
|
217
|
+
}
|
|
218
|
+
}, z = (e) => n(x, { status: e.value, text: e.label }), E = (e) => n(x, { status: e.option.value, text: e.option.label }), G = v(() => T.value.map((e) => ({
|
|
219
|
+
label: e.name,
|
|
220
|
+
value: e.id
|
|
221
|
+
}))), M = v(() => w.value.map((e) => ({
|
|
222
|
+
label: e.name,
|
|
223
|
+
value: e.id
|
|
224
|
+
}))), W = (e) => {
|
|
225
|
+
m.value = e, g();
|
|
226
|
+
}, p = () => {
|
|
227
|
+
m.value = 1, g();
|
|
228
|
+
}, q = () => t.value.tasks || t.value.statuses || t.value.servers || t.value.nodes, H = () => {
|
|
229
|
+
t.value.tasks = null, t.value.statuses = null, t.value.servers = null, t.value.nodes = null, m.value = 1, g();
|
|
230
|
+
};
|
|
231
|
+
return (e, a) => (X(), Q(Y, null, [
|
|
232
|
+
d(r(te), { items: B.value }, null, 8, ["items"]),
|
|
233
|
+
I("div", me, [
|
|
234
|
+
d(r(le), null, {
|
|
235
|
+
default: h(() => [
|
|
236
|
+
d(r(_), {
|
|
237
|
+
multiple: "",
|
|
238
|
+
value: t.value.tasks,
|
|
239
|
+
"onUpdate:value": [
|
|
240
|
+
a[0] || (a[0] = (u) => t.value.tasks = u),
|
|
241
|
+
p
|
|
242
|
+
],
|
|
243
|
+
options: N,
|
|
244
|
+
placeholder: r(s)("gdaemon_tasks.task"),
|
|
245
|
+
"render-label": V
|
|
246
|
+
}, null, 8, ["value", "placeholder"]),
|
|
247
|
+
d(r(_), {
|
|
248
|
+
multiple: "",
|
|
249
|
+
value: t.value.statuses,
|
|
250
|
+
"onUpdate:value": [
|
|
251
|
+
a[1] || (a[1] = (u) => t.value.statuses = u),
|
|
252
|
+
p
|
|
253
|
+
],
|
|
254
|
+
options: R,
|
|
255
|
+
placeholder: r(s)("gdaemon_tasks.status"),
|
|
256
|
+
"render-label": z,
|
|
257
|
+
"render-tag": E
|
|
258
|
+
}, null, 8, ["value", "placeholder"]),
|
|
259
|
+
d(r(_), {
|
|
260
|
+
multiple: "",
|
|
261
|
+
value: t.value.servers,
|
|
262
|
+
"onUpdate:value": [
|
|
263
|
+
a[2] || (a[2] = (u) => t.value.servers = u),
|
|
264
|
+
p
|
|
265
|
+
],
|
|
266
|
+
options: M.value,
|
|
267
|
+
placeholder: r(s)("servers.game_servers")
|
|
268
|
+
}, null, 8, ["value", "options", "placeholder"]),
|
|
269
|
+
d(r(_), {
|
|
270
|
+
multiple: "",
|
|
271
|
+
value: t.value.nodes,
|
|
272
|
+
"onUpdate:value": [
|
|
273
|
+
a[3] || (a[3] = (u) => t.value.nodes = u),
|
|
274
|
+
p
|
|
275
|
+
],
|
|
276
|
+
options: G.value,
|
|
277
|
+
placeholder: r(s)("dedicated_servers.dedicated_servers")
|
|
278
|
+
}, null, 8, ["value", "options", "placeholder"]),
|
|
279
|
+
d(r(oe), {
|
|
280
|
+
onClick: H,
|
|
281
|
+
type: "error",
|
|
282
|
+
disabled: !q(),
|
|
283
|
+
ghost: ""
|
|
284
|
+
}, {
|
|
285
|
+
default: h(() => [
|
|
286
|
+
d(r(i), { name: "eraser" }),
|
|
287
|
+
I("span", ve, " " + Z(r(s)("main.clear")), 1)
|
|
288
|
+
]),
|
|
289
|
+
_: 1
|
|
290
|
+
}, 8, ["disabled"])
|
|
291
|
+
]),
|
|
292
|
+
_: 1
|
|
293
|
+
})
|
|
294
|
+
]),
|
|
295
|
+
d(r(ue), {
|
|
296
|
+
remote: "",
|
|
297
|
+
ref: "tableRef",
|
|
298
|
+
bordered: !1,
|
|
299
|
+
"single-line": !0,
|
|
300
|
+
columns: A.value,
|
|
301
|
+
data: j.value,
|
|
302
|
+
loading: C.value,
|
|
303
|
+
pagination: b,
|
|
304
|
+
"onUpdate:page": W
|
|
305
|
+
}, {
|
|
306
|
+
loading: h(() => [
|
|
307
|
+
d(r(re))
|
|
308
|
+
]),
|
|
309
|
+
_: 1
|
|
310
|
+
}, 8, ["columns", "data", "loading", "pagination"])
|
|
311
|
+
], 64));
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
export {
|
|
315
|
+
he as default
|
|
316
|
+
};
|