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