@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,984 @@
|
|
|
1
|
+
import { ref as y, computed as z, onMounted as le, onUnmounted as ce, watch as he, createElementBlock as m, openBlock as o, createCommentVNode as x, createVNode as r, unref as t, createElementVNode as u, createBlock as T, toDisplayString as a, Fragment as ae, renderList as ye, normalizeStyle as _e, normalizeClass as oe, withCtx as k, createTextVNode as I, h as i } from "vue";
|
|
2
|
+
import { b as E, q as be, l as X, a as p, t as s, _ as $, e as q, m as ke, n as Q } from "./index-9fvX7FD-.js";
|
|
3
|
+
import { defineStore as we, storeToRefs as Pe } from "pinia";
|
|
4
|
+
import { NSelect as Ce, NModal as de, NTabs as Se, NTabPane as ue, NDataTable as se, NEmpty as re, NPagination as $e, NSpin as ze } from "naive-ui";
|
|
5
|
+
const Ue = we("pluginStore", () => {
|
|
6
|
+
const n = y([]), b = y(1), h = y(0), w = y(1), v = y(15), V = y([]), C = y([]), U = y(null), D = y([]), F = y(1), j = y(1), f = y(0), N = z(() => f.value > 0), c = z(
|
|
7
|
+
() => n.value.filter((l) => l.installed === !0)
|
|
8
|
+
), d = z(
|
|
9
|
+
() => n.value.filter(
|
|
10
|
+
(l) => l.installed === !0 && l.installed_version && l.latest_version && l.installed_version !== l.latest_version
|
|
11
|
+
)
|
|
12
|
+
), _ = z(
|
|
13
|
+
() => V.value.map((l) => ({
|
|
14
|
+
label: l.name,
|
|
15
|
+
value: l.slug
|
|
16
|
+
}))
|
|
17
|
+
), B = z(
|
|
18
|
+
() => C.value.map((l) => ({
|
|
19
|
+
label: l.name,
|
|
20
|
+
value: l.slug,
|
|
21
|
+
color: l.color
|
|
22
|
+
}))
|
|
23
|
+
), M = (l = {}) => ({
|
|
24
|
+
...l,
|
|
25
|
+
lang: be()
|
|
26
|
+
});
|
|
27
|
+
async function Y() {
|
|
28
|
+
f.value++;
|
|
29
|
+
try {
|
|
30
|
+
const l = await E.get("/api/plugin-store/categories", {
|
|
31
|
+
params: M()
|
|
32
|
+
});
|
|
33
|
+
V.value = l.data;
|
|
34
|
+
} finally {
|
|
35
|
+
f.value--;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function Z() {
|
|
39
|
+
f.value++;
|
|
40
|
+
try {
|
|
41
|
+
const l = await E.get("/api/plugin-store/labels", {
|
|
42
|
+
params: M()
|
|
43
|
+
});
|
|
44
|
+
C.value = l.data;
|
|
45
|
+
} finally {
|
|
46
|
+
f.value--;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
async function ee(l = {}) {
|
|
50
|
+
f.value++;
|
|
51
|
+
try {
|
|
52
|
+
const P = M({
|
|
53
|
+
page: l.page || b.value,
|
|
54
|
+
per_page: l.perPage || v.value
|
|
55
|
+
});
|
|
56
|
+
l.category && (P.category = l.category), l.label && (P.label = l.label), l.search && (P.search = l.search);
|
|
57
|
+
const S = await E.get("/api/plugin-store/plugins", { params: P });
|
|
58
|
+
n.value = S.data.data, b.value = S.data.current_page, h.value = S.data.total, w.value = S.data.last_page;
|
|
59
|
+
} finally {
|
|
60
|
+
f.value--;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function te(l) {
|
|
64
|
+
f.value++;
|
|
65
|
+
try {
|
|
66
|
+
const P = await E.get(`/api/plugin-store/plugins/${l}`, {
|
|
67
|
+
params: M()
|
|
68
|
+
});
|
|
69
|
+
U.value = P.data;
|
|
70
|
+
} finally {
|
|
71
|
+
f.value--;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function O(l, P = 1) {
|
|
75
|
+
f.value++;
|
|
76
|
+
try {
|
|
77
|
+
const S = await E.get(`/api/plugin-store/plugins/${l}/versions`, {
|
|
78
|
+
params: M({
|
|
79
|
+
page: P,
|
|
80
|
+
per_page: 20
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
D.value = S.data.data, F.value = S.data.current_page, j.value = S.data.last_page;
|
|
84
|
+
} finally {
|
|
85
|
+
f.value--;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function ne(l, P = null) {
|
|
89
|
+
f.value++;
|
|
90
|
+
try {
|
|
91
|
+
const S = P ? { version: P } : {};
|
|
92
|
+
return (await E.post(`/api/plugin-store/plugins/${l}/install`, S, {
|
|
93
|
+
params: M()
|
|
94
|
+
})).data;
|
|
95
|
+
} finally {
|
|
96
|
+
f.value--;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function W(l, P = null) {
|
|
100
|
+
f.value++;
|
|
101
|
+
try {
|
|
102
|
+
const S = P ? { version: P } : {};
|
|
103
|
+
return (await E.post(`/api/plugin-store/plugins/${l}/update`, S, {
|
|
104
|
+
params: M()
|
|
105
|
+
})).data;
|
|
106
|
+
} finally {
|
|
107
|
+
f.value--;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async function A(l) {
|
|
111
|
+
f.value++;
|
|
112
|
+
try {
|
|
113
|
+
return (await E.delete(`/api/plugin-store/plugins/${l}`, {
|
|
114
|
+
params: M()
|
|
115
|
+
})).data;
|
|
116
|
+
} finally {
|
|
117
|
+
f.value--;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
function R() {
|
|
121
|
+
U.value = null, D.value = [], F.value = 1, j.value = 1;
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
// State
|
|
125
|
+
plugins: n,
|
|
126
|
+
currentPage: b,
|
|
127
|
+
total: h,
|
|
128
|
+
lastPage: w,
|
|
129
|
+
perPage: v,
|
|
130
|
+
categories: V,
|
|
131
|
+
labels: C,
|
|
132
|
+
currentPlugin: U,
|
|
133
|
+
currentPluginVersions: D,
|
|
134
|
+
versionsCurrentPage: F,
|
|
135
|
+
versionsLastPage: j,
|
|
136
|
+
apiProcesses: f,
|
|
137
|
+
// Getters
|
|
138
|
+
loading: N,
|
|
139
|
+
installedPlugins: c,
|
|
140
|
+
updatablePlugins: d,
|
|
141
|
+
categoryOptions: _,
|
|
142
|
+
labelOptions: B,
|
|
143
|
+
// Actions
|
|
144
|
+
fetchCategories: Y,
|
|
145
|
+
fetchLabels: Z,
|
|
146
|
+
fetchPlugins: ee,
|
|
147
|
+
fetchPluginDetails: te,
|
|
148
|
+
fetchPluginVersions: O,
|
|
149
|
+
installPlugin: ne,
|
|
150
|
+
updatePlugin: W,
|
|
151
|
+
uninstallPlugin: A,
|
|
152
|
+
clearCurrentPlugin: R
|
|
153
|
+
};
|
|
154
|
+
}), Ne = { class: "plugin-details" }, De = {
|
|
155
|
+
key: 0,
|
|
156
|
+
class: "flex justify-center py-8"
|
|
157
|
+
}, Me = { key: 1 }, Ve = { class: "flex items-start gap-4 mb-4" }, Le = ["src", "alt"], Te = { class: "flex-1" }, qe = { class: "flex items-center gap-2 flex-wrap" }, je = { class: "text-xl font-bold whitespace-nowrap" }, Ee = ["href"], Fe = {
|
|
158
|
+
key: 2,
|
|
159
|
+
class: "hidden md:inline px-2 py-0.5 text-xs font-medium rounded-full bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-300 whitespace-nowrap"
|
|
160
|
+
}, Be = {
|
|
161
|
+
key: 0,
|
|
162
|
+
class: "mb-4 text-stone-600 dark:text-stone-400"
|
|
163
|
+
}, Ie = {
|
|
164
|
+
key: 1,
|
|
165
|
+
class: "hidden md:flex gap-1 mt-1"
|
|
166
|
+
}, Oe = { class: "flex items-center gap-2 mt-2" }, We = { class: "text-orange-500 text-lg" }, Ae = ["href"], Re = {
|
|
167
|
+
key: 1,
|
|
168
|
+
class: "text-stone-500"
|
|
169
|
+
}, Ge = { class: "flex flex-col md:flex-row items-end md:items-center gap-2" }, He = { class: "flex justify-around py-4 border-t border-b border-stone-200 dark:border-stone-700 mb-4 divide-x divide-stone-100 dark:divide-stone-700" }, Ke = {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: "flex flex-col items-center text-center px-4"
|
|
172
|
+
}, Je = { class: "text-sm font-medium whitespace-nowrap" }, Qe = { class: "text-xs text-stone-500" }, Xe = {
|
|
173
|
+
key: 1,
|
|
174
|
+
class: "flex flex-col items-center text-center px-4"
|
|
175
|
+
}, Ye = { class: "text-sm font-medium whitespace-nowrap" }, Ze = { class: "text-xs text-stone-500" }, et = {
|
|
176
|
+
key: 2,
|
|
177
|
+
class: "flex flex-col items-center text-center px-4"
|
|
178
|
+
}, tt = { class: "text-sm font-medium whitespace-nowrap" }, nt = { class: "text-xs text-stone-500" }, st = {
|
|
179
|
+
key: 3,
|
|
180
|
+
class: "hidden md:flex flex-col items-center text-center px-4"
|
|
181
|
+
}, lt = { class: "text-sm font-medium whitespace-nowrap" }, at = { class: "text-xs text-stone-500" }, it = {
|
|
182
|
+
key: 4,
|
|
183
|
+
class: "hidden md:flex flex-col items-center text-center px-4"
|
|
184
|
+
}, ot = { class: "text-sm font-medium whitespace-nowrap" }, ut = { class: "text-xs text-stone-500" }, rt = {
|
|
185
|
+
key: 5,
|
|
186
|
+
class: "flex flex-col items-center text-center px-4"
|
|
187
|
+
}, ct = { class: "text-sm font-medium whitespace-nowrap" }, dt = { class: "text-xs text-stone-500" }, gt = {
|
|
188
|
+
key: 6,
|
|
189
|
+
class: "flex flex-col items-center text-center px-4"
|
|
190
|
+
}, pt = { class: "text-sm font-medium whitespace-nowrap" }, mt = { class: "text-xs text-stone-500" }, ft = ["href"], xt = { class: "text-sm font-medium text-blue-500" }, vt = {
|
|
191
|
+
key: 0,
|
|
192
|
+
class: "mb-4"
|
|
193
|
+
}, ht = { class: "font-semibold mb-2" }, yt = { class: "text-sm whitespace-pre-wrap" }, _t = {
|
|
194
|
+
key: 1,
|
|
195
|
+
class: "flex justify-center gap-6 mb-4 p-3 bg-stone-100 dark:bg-stone-800 rounded-lg"
|
|
196
|
+
}, bt = { class: "flex flex-col items-center text-center" }, kt = { class: "text-sm font-medium whitespace-nowrap" }, wt = { class: "text-xs text-stone-500" }, Pt = { class: "flex flex-col items-center text-center" }, Ct = { class: "text-sm font-medium whitespace-nowrap" }, St = { class: "text-xs text-stone-500" }, $t = {
|
|
197
|
+
key: 0,
|
|
198
|
+
class: "self-center px-2 py-0.5 text-xs font-medium rounded-full bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-300"
|
|
199
|
+
}, zt = {
|
|
200
|
+
__name: "PluginDetailsModal",
|
|
201
|
+
props: {
|
|
202
|
+
plugin: {
|
|
203
|
+
type: Object,
|
|
204
|
+
default: null
|
|
205
|
+
},
|
|
206
|
+
versions: {
|
|
207
|
+
type: Array,
|
|
208
|
+
default: () => []
|
|
209
|
+
},
|
|
210
|
+
loading: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: !1
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
emits: ["install", "update", "uninstall"],
|
|
216
|
+
setup(n, { emit: b }) {
|
|
217
|
+
const h = n, w = y(null), v = y(window.innerWidth < 768), V = () => {
|
|
218
|
+
v.value = window.innerWidth < 768;
|
|
219
|
+
};
|
|
220
|
+
le(() => {
|
|
221
|
+
window.addEventListener("resize", V);
|
|
222
|
+
}), ce(() => {
|
|
223
|
+
window.removeEventListener("resize", V);
|
|
224
|
+
});
|
|
225
|
+
const C = z(() => h.plugin?.installed ? h.plugin.installed_version !== h.plugin.latest_version : !1), U = z(() => h.plugin?.requires_subscription && h.plugin?.has_subscription !== !0);
|
|
226
|
+
function D() {
|
|
227
|
+
h.plugin?.subscription_url && window.open(h.plugin.subscription_url, "_blank");
|
|
228
|
+
}
|
|
229
|
+
const F = z(() => h.versions.map((c) => ({
|
|
230
|
+
label: c.version,
|
|
231
|
+
value: c.version
|
|
232
|
+
})));
|
|
233
|
+
z(() => w.value ? h.versions.find((c) => c.version === w.value) : null), he([() => h.versions, () => h.plugin], ([c, d]) => {
|
|
234
|
+
d?.latest_version ? w.value = d.latest_version : c?.length > 0 && (w.value = c[0].version);
|
|
235
|
+
}, { immediate: !0 });
|
|
236
|
+
function j(c) {
|
|
237
|
+
const d = Math.floor(c || 0), _ = (c || 0) - d >= 0.5, B = 5 - d - (_ ? 1 : 0);
|
|
238
|
+
return "★".repeat(d) + (_ ? "½" : "") + "☆".repeat(B);
|
|
239
|
+
}
|
|
240
|
+
function f(c) {
|
|
241
|
+
return c ? c >= 1e6 ? (c / 1e6).toFixed(1) + "M" : c >= 1e3 ? (c / 1e3).toFixed(1) + "K" : c.toString() : "0";
|
|
242
|
+
}
|
|
243
|
+
function N(c) {
|
|
244
|
+
return c ? new Date(c).toLocaleDateString() : "";
|
|
245
|
+
}
|
|
246
|
+
return (c, d) => (o(), m("div", Ne, [
|
|
247
|
+
n.loading && !n.plugin ? (o(), m("div", De, [
|
|
248
|
+
r(t(X))
|
|
249
|
+
])) : n.plugin ? (o(), m("div", Me, [
|
|
250
|
+
u("div", Ve, [
|
|
251
|
+
n.plugin.icon_url ? (o(), m("img", {
|
|
252
|
+
key: 0,
|
|
253
|
+
src: n.plugin.icon_url,
|
|
254
|
+
alt: n.plugin.name,
|
|
255
|
+
class: "w-16 h-16 rounded-lg"
|
|
256
|
+
}, null, 8, Le)) : (o(), T(t(p), {
|
|
257
|
+
key: 1,
|
|
258
|
+
name: "puzzle-piece",
|
|
259
|
+
class: "text-5xl text-stone-400"
|
|
260
|
+
})),
|
|
261
|
+
u("div", Te, [
|
|
262
|
+
u("div", qe, [
|
|
263
|
+
u("h2", je, a(n.plugin.name), 1),
|
|
264
|
+
n.plugin.requires_subscription ? (o(), T(t(p), {
|
|
265
|
+
key: 0,
|
|
266
|
+
name: "star",
|
|
267
|
+
class: "text-yellow-500"
|
|
268
|
+
})) : x("", !0),
|
|
269
|
+
n.plugin.url ? (o(), m("a", {
|
|
270
|
+
key: 1,
|
|
271
|
+
href: n.plugin.url,
|
|
272
|
+
target: "_blank",
|
|
273
|
+
class: "text-blue-500 hover:text-blue-600"
|
|
274
|
+
}, [
|
|
275
|
+
r(t(p), { name: "external-link" })
|
|
276
|
+
], 8, Ee)) : x("", !0),
|
|
277
|
+
n.plugin.installed ? (o(), m("span", Fe, a(t(s)("plugins.already_installed")), 1)) : x("", !0)
|
|
278
|
+
]),
|
|
279
|
+
n.plugin.summary ? (o(), m("div", Be, a(n.plugin.summary), 1)) : x("", !0),
|
|
280
|
+
n.plugin.labels?.length > 0 ? (o(), m("div", Ie, [
|
|
281
|
+
(o(!0), m(ae, null, ye(n.plugin.labels, (_) => (o(), m("span", {
|
|
282
|
+
key: _.id,
|
|
283
|
+
class: oe(["px-2 py-0.5 text-xs font-medium rounded-full", _.color ? "" : "bg-stone-100 text-stone-800 dark:bg-stone-700 dark:text-stone-300"]),
|
|
284
|
+
style: _e(_.color ? { backgroundColor: _.color, color: "#fff" } : {})
|
|
285
|
+
}, a(_.name), 7))), 128))
|
|
286
|
+
])) : x("", !0),
|
|
287
|
+
u("div", Oe, [
|
|
288
|
+
u("span", We, a(j(n.plugin.rating_avg)), 1),
|
|
289
|
+
n.plugin.url ? (o(), m("a", {
|
|
290
|
+
key: 0,
|
|
291
|
+
href: n.plugin.url + "/reviews",
|
|
292
|
+
target: "_blank",
|
|
293
|
+
class: "text-stone-500 hover:text-blue-500 hover:underline"
|
|
294
|
+
}, " (" + a(n.plugin.rating_count || 0) + " " + a(t(s)("plugins.reviews")) + ") ", 9, Ae)) : (o(), m("span", Re, "(" + a(n.plugin.rating_count || 0) + " " + a(t(s)("plugins.reviews")) + ")", 1))
|
|
295
|
+
])
|
|
296
|
+
]),
|
|
297
|
+
u("div", Ge, [
|
|
298
|
+
!n.plugin.installed && U.value ? (o(), T($, {
|
|
299
|
+
key: 0,
|
|
300
|
+
color: "orange",
|
|
301
|
+
size: v.value ? "small" : "medium",
|
|
302
|
+
onClick: D
|
|
303
|
+
}, {
|
|
304
|
+
default: k(() => [
|
|
305
|
+
r(t(p), {
|
|
306
|
+
name: "external-link",
|
|
307
|
+
class: "mr-1"
|
|
308
|
+
}),
|
|
309
|
+
I(" " + a(t(s)("plugins.get_subscription")), 1)
|
|
310
|
+
]),
|
|
311
|
+
_: 1
|
|
312
|
+
}, 8, ["size"])) : (o(), m(ae, { key: 1 }, [
|
|
313
|
+
!n.plugin.installed || C.value ? (o(), T(t(Ce), {
|
|
314
|
+
key: 0,
|
|
315
|
+
value: w.value,
|
|
316
|
+
"onUpdate:value": d[0] || (d[0] = (_) => w.value = _),
|
|
317
|
+
options: F.value,
|
|
318
|
+
placeholder: t(s)("plugins.select_version"),
|
|
319
|
+
style: { width: "120px" },
|
|
320
|
+
size: v.value ? "small" : "large"
|
|
321
|
+
}, null, 8, ["value", "options", "placeholder", "size"])) : x("", !0),
|
|
322
|
+
n.plugin.installed ? x("", !0) : (o(), T($, {
|
|
323
|
+
key: 1,
|
|
324
|
+
color: "green",
|
|
325
|
+
size: v.value ? "small" : "medium",
|
|
326
|
+
onClick: d[1] || (d[1] = (_) => c.$emit("install", w.value))
|
|
327
|
+
}, {
|
|
328
|
+
default: k(() => [
|
|
329
|
+
r(t(p), {
|
|
330
|
+
name: "download",
|
|
331
|
+
class: "mr-1"
|
|
332
|
+
}),
|
|
333
|
+
I(" " + a(t(s)("plugins.install")), 1)
|
|
334
|
+
]),
|
|
335
|
+
_: 1
|
|
336
|
+
}, 8, ["size"]))
|
|
337
|
+
], 64)),
|
|
338
|
+
n.plugin.installed && C.value ? (o(), T($, {
|
|
339
|
+
key: 2,
|
|
340
|
+
color: "blue",
|
|
341
|
+
size: v.value ? "small" : "medium",
|
|
342
|
+
onClick: d[2] || (d[2] = (_) => c.$emit("update", w.value))
|
|
343
|
+
}, {
|
|
344
|
+
default: k(() => [
|
|
345
|
+
r(t(p), {
|
|
346
|
+
name: "sync",
|
|
347
|
+
class: "mr-1"
|
|
348
|
+
}),
|
|
349
|
+
I(" " + a(t(s)("plugins.update")), 1)
|
|
350
|
+
]),
|
|
351
|
+
_: 1
|
|
352
|
+
}, 8, ["size"])) : x("", !0),
|
|
353
|
+
n.plugin.installed ? (o(), T($, {
|
|
354
|
+
key: 3,
|
|
355
|
+
color: "red",
|
|
356
|
+
size: v.value ? "small" : "medium",
|
|
357
|
+
onClick: d[3] || (d[3] = (_) => c.$emit("uninstall"))
|
|
358
|
+
}, {
|
|
359
|
+
default: k(() => [
|
|
360
|
+
r(t(p), {
|
|
361
|
+
name: "close",
|
|
362
|
+
class: "mr-1"
|
|
363
|
+
}),
|
|
364
|
+
I(" " + a(t(s)("plugins.uninstall")), 1)
|
|
365
|
+
]),
|
|
366
|
+
_: 1
|
|
367
|
+
}, 8, ["size"])) : x("", !0)
|
|
368
|
+
])
|
|
369
|
+
]),
|
|
370
|
+
u("div", He, [
|
|
371
|
+
n.plugin.author ? (o(), m("div", Ke, [
|
|
372
|
+
r(t(p), {
|
|
373
|
+
name: "user",
|
|
374
|
+
class: "text-xl text-stone-500 dark:text-stone-400 mb-1"
|
|
375
|
+
}),
|
|
376
|
+
u("span", Je, a(n.plugin.author.username), 1),
|
|
377
|
+
u("span", Qe, a(t(s)("plugins.author")), 1)
|
|
378
|
+
])) : x("", !0),
|
|
379
|
+
n.plugin.category ? (o(), m("div", Xe, [
|
|
380
|
+
r(t(p), {
|
|
381
|
+
name: "folder",
|
|
382
|
+
class: "text-xl text-stone-500 dark:text-stone-400 mb-1"
|
|
383
|
+
}),
|
|
384
|
+
u("span", Ye, a(n.plugin.category.name), 1),
|
|
385
|
+
u("span", Ze, a(t(s)("plugins.category")), 1)
|
|
386
|
+
])) : x("", !0),
|
|
387
|
+
n.plugin.license ? (o(), m("div", et, [
|
|
388
|
+
r(t(p), {
|
|
389
|
+
name: "scale-balanced",
|
|
390
|
+
class: "text-xl text-stone-500 dark:text-stone-400 mb-1"
|
|
391
|
+
}),
|
|
392
|
+
u("span", tt, a(n.plugin.license), 1),
|
|
393
|
+
u("span", nt, a(t(s)("plugins.license")), 1)
|
|
394
|
+
])) : x("", !0),
|
|
395
|
+
n.plugin.download_count !== void 0 ? (o(), m("div", st, [
|
|
396
|
+
r(t(p), {
|
|
397
|
+
name: "download",
|
|
398
|
+
class: "text-xl text-stone-500 dark:text-stone-400 mb-1"
|
|
399
|
+
}),
|
|
400
|
+
u("span", lt, a(f(n.plugin.download_count)), 1),
|
|
401
|
+
u("span", at, a(t(s)("plugins.downloads")), 1)
|
|
402
|
+
])) : x("", !0),
|
|
403
|
+
n.plugin.published_at ? (o(), m("div", it, [
|
|
404
|
+
r(t(p), {
|
|
405
|
+
name: "calendar",
|
|
406
|
+
class: "text-xl text-stone-500 dark:text-stone-400 mb-1"
|
|
407
|
+
}),
|
|
408
|
+
u("span", ot, a(N(n.plugin.published_at)), 1),
|
|
409
|
+
u("span", ut, a(t(s)("plugins.published_at")), 1)
|
|
410
|
+
])) : x("", !0),
|
|
411
|
+
n.plugin.has_subscription && n.plugin.subscription_expires_at ? (o(), m("div", rt, [
|
|
412
|
+
r(t(p), {
|
|
413
|
+
name: "star",
|
|
414
|
+
class: "text-xl text-yellow-500 mb-1"
|
|
415
|
+
}),
|
|
416
|
+
u("span", ct, a(N(n.plugin.subscription_expires_at)), 1),
|
|
417
|
+
u("span", dt, a(t(s)("plugins.subscription_expires")), 1)
|
|
418
|
+
])) : x("", !0),
|
|
419
|
+
n.plugin.min_gameap_version ? (o(), m("div", gt, [
|
|
420
|
+
r(t(p), {
|
|
421
|
+
name: "gamepad",
|
|
422
|
+
class: "text-xl text-stone-500 dark:text-stone-400 mb-1"
|
|
423
|
+
}),
|
|
424
|
+
u("span", pt, a(n.plugin.min_gameap_version), 1),
|
|
425
|
+
u("span", mt, a(t(s)("plugins.min_gameap_version")), 1)
|
|
426
|
+
])) : x("", !0),
|
|
427
|
+
n.plugin.url ? (o(), m("a", {
|
|
428
|
+
key: 7,
|
|
429
|
+
href: n.plugin.url,
|
|
430
|
+
target: "_blank",
|
|
431
|
+
class: "flex flex-col items-center text-center px-4 hover:text-blue-500 transition-colors"
|
|
432
|
+
}, [
|
|
433
|
+
r(t(p), {
|
|
434
|
+
name: "external-link",
|
|
435
|
+
class: "text-xl text-blue-500 mb-1"
|
|
436
|
+
}),
|
|
437
|
+
u("span", xt, a(t(s)("plugins.plugin_page")), 1)
|
|
438
|
+
], 8, ft)) : x("", !0)
|
|
439
|
+
]),
|
|
440
|
+
n.plugin.description ? (o(), m("div", vt, [
|
|
441
|
+
u("h3", ht, a(t(s)("plugins.description")), 1),
|
|
442
|
+
u("div", yt, a(n.plugin.description), 1)
|
|
443
|
+
])) : x("", !0),
|
|
444
|
+
n.plugin.installed ? (o(), m("div", _t, [
|
|
445
|
+
u("div", bt, [
|
|
446
|
+
r(t(p), {
|
|
447
|
+
name: "box",
|
|
448
|
+
class: "text-xl text-lime-500 mb-1"
|
|
449
|
+
}),
|
|
450
|
+
u("span", kt, a(n.plugin.installed_version), 1),
|
|
451
|
+
u("span", wt, a(t(s)("plugins.installed_version")), 1)
|
|
452
|
+
]),
|
|
453
|
+
u("div", Pt, [
|
|
454
|
+
r(t(p), {
|
|
455
|
+
name: "arrow-up",
|
|
456
|
+
class: oe(["text-xl mb-1", C.value ? "text-orange-500" : "text-stone-400"])
|
|
457
|
+
}, null, 8, ["class"]),
|
|
458
|
+
u("span", Ct, a(n.plugin.latest_version), 1),
|
|
459
|
+
u("span", St, a(t(s)("plugins.latest_version")), 1)
|
|
460
|
+
]),
|
|
461
|
+
C.value ? (o(), m("span", $t, a(t(s)("plugins.update")), 1)) : x("", !0)
|
|
462
|
+
])) : x("", !0)
|
|
463
|
+
])) : x("", !0)
|
|
464
|
+
]));
|
|
465
|
+
}
|
|
466
|
+
}, Ut = { class: "space-y-4" }, Nt = { class: "text-stone-600 dark:text-stone-400" }, Dt = {
|
|
467
|
+
key: 0,
|
|
468
|
+
class: "flex items-center gap-3 p-3 bg-stone-50 dark:bg-stone-800 rounded-lg"
|
|
469
|
+
}, Mt = ["src", "alt"], Vt = { class: "font-medium" }, Lt = { class: "text-sm text-stone-500" }, Tt = { class: "flex justify-end gap-2" }, qt = {
|
|
470
|
+
__name: "SubscriptionModal",
|
|
471
|
+
props: {
|
|
472
|
+
show: {
|
|
473
|
+
type: Boolean,
|
|
474
|
+
default: !1
|
|
475
|
+
},
|
|
476
|
+
plugin: {
|
|
477
|
+
type: Object,
|
|
478
|
+
default: null
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
emits: ["update:show", "get-subscription"],
|
|
482
|
+
setup(n, { emit: b }) {
|
|
483
|
+
const h = n, w = b, v = z({
|
|
484
|
+
get: () => h.show,
|
|
485
|
+
set: (C) => w("update:show", C)
|
|
486
|
+
});
|
|
487
|
+
function V() {
|
|
488
|
+
h.plugin?.subscription_url && window.open(h.plugin.subscription_url, "_blank"), w("get-subscription"), v.value = !1;
|
|
489
|
+
}
|
|
490
|
+
return (C, U) => (o(), T(t(de), {
|
|
491
|
+
show: v.value,
|
|
492
|
+
"onUpdate:show": U[1] || (U[1] = (D) => v.value = D),
|
|
493
|
+
preset: "card",
|
|
494
|
+
title: t(s)("plugins.subscription_required"),
|
|
495
|
+
bordered: !1,
|
|
496
|
+
style: { width: "500px", "max-width": "90vw" }
|
|
497
|
+
}, {
|
|
498
|
+
footer: k(() => [
|
|
499
|
+
u("div", Tt, [
|
|
500
|
+
r($, {
|
|
501
|
+
color: "gray",
|
|
502
|
+
onClick: U[0] || (U[0] = (D) => v.value = !1)
|
|
503
|
+
}, {
|
|
504
|
+
default: k(() => [
|
|
505
|
+
I(a(t(s)("main.close")), 1)
|
|
506
|
+
]),
|
|
507
|
+
_: 1
|
|
508
|
+
}),
|
|
509
|
+
r($, {
|
|
510
|
+
color: "orange",
|
|
511
|
+
onClick: V
|
|
512
|
+
}, {
|
|
513
|
+
default: k(() => [
|
|
514
|
+
r(t(p), {
|
|
515
|
+
name: "external-link",
|
|
516
|
+
class: "mr-1"
|
|
517
|
+
}),
|
|
518
|
+
I(" " + a(t(s)("plugins.get_subscription")), 1)
|
|
519
|
+
]),
|
|
520
|
+
_: 1
|
|
521
|
+
})
|
|
522
|
+
])
|
|
523
|
+
]),
|
|
524
|
+
default: k(() => [
|
|
525
|
+
u("div", Ut, [
|
|
526
|
+
u("p", Nt, a(t(s)("plugins.subscription_info")), 1),
|
|
527
|
+
n.plugin ? (o(), m("div", Dt, [
|
|
528
|
+
n.plugin.icon_url ? (o(), m("img", {
|
|
529
|
+
key: 0,
|
|
530
|
+
src: n.plugin.icon_url,
|
|
531
|
+
alt: n.plugin.name,
|
|
532
|
+
class: "w-12 h-12 rounded"
|
|
533
|
+
}, null, 8, Mt)) : (o(), T(t(p), {
|
|
534
|
+
key: 1,
|
|
535
|
+
name: "plugin",
|
|
536
|
+
class: "text-4xl text-stone-400"
|
|
537
|
+
})),
|
|
538
|
+
u("div", null, [
|
|
539
|
+
u("div", Vt, a(n.plugin.name), 1),
|
|
540
|
+
u("div", Lt, a(n.plugin.summary), 1)
|
|
541
|
+
])
|
|
542
|
+
])) : x("", !0)
|
|
543
|
+
])
|
|
544
|
+
]),
|
|
545
|
+
_: 1
|
|
546
|
+
}, 8, ["show", "title"]));
|
|
547
|
+
}
|
|
548
|
+
}, jt = {
|
|
549
|
+
key: 0,
|
|
550
|
+
class: "mb-6"
|
|
551
|
+
}, Et = { class: "text-lg font-semibold mb-2" }, Ft = {
|
|
552
|
+
key: 0,
|
|
553
|
+
class: "flex justify-center mt-4"
|
|
554
|
+
}, At = {
|
|
555
|
+
__name: "AdminPluginsView",
|
|
556
|
+
setup(n) {
|
|
557
|
+
const b = Ue(), {
|
|
558
|
+
plugins: h,
|
|
559
|
+
lastPage: w,
|
|
560
|
+
currentPlugin: v,
|
|
561
|
+
currentPluginVersions: V,
|
|
562
|
+
loading: C,
|
|
563
|
+
installedPlugins: U,
|
|
564
|
+
updatablePlugins: D
|
|
565
|
+
} = Pe(b), F = z(() => [
|
|
566
|
+
{ route: "/", text: "GameAP", icon: "gicon gicon-gameap" },
|
|
567
|
+
{ route: { name: "admin.plugins.index" }, text: s("plugins.plugins") }
|
|
568
|
+
]), j = y("installed"), f = y(!1), N = y(!1), c = y(1), d = y(window.innerWidth < 768), _ = y(!1), B = y(null), M = () => {
|
|
569
|
+
d.value = window.innerWidth < 768;
|
|
570
|
+
};
|
|
571
|
+
le(() => {
|
|
572
|
+
window.addEventListener("resize", M);
|
|
573
|
+
}), ce(() => {
|
|
574
|
+
window.removeEventListener("resize", M);
|
|
575
|
+
});
|
|
576
|
+
const Y = z(() => [...U.value].sort((e, g) => e.name.localeCompare(g.name))), Z = {
|
|
577
|
+
pageSize: 15
|
|
578
|
+
}, ee = () => [
|
|
579
|
+
{
|
|
580
|
+
title: s("plugins.name"),
|
|
581
|
+
key: "name",
|
|
582
|
+
render(e) {
|
|
583
|
+
return i("div", {
|
|
584
|
+
class: "flex items-center gap-2 cursor-pointer hover:opacity-80",
|
|
585
|
+
onClick: () => H(e.id)
|
|
586
|
+
}, [
|
|
587
|
+
e.icon_url ? i("img", { src: e.icon_url, class: "w-8 h-8 rounded", alt: e.name }) : i(p, { name: "plugin", class: "text-2xl text-stone-400" }),
|
|
588
|
+
i("div", { class: "flex flex-col" }, [
|
|
589
|
+
i("span", { class: "font-medium text-blue-600 dark:text-blue-400 hover:underline whitespace-nowrap" }, e.name),
|
|
590
|
+
!d.value && e.labels?.length > 0 ? i(
|
|
591
|
+
"div",
|
|
592
|
+
{ class: "flex gap-1 mt-1" },
|
|
593
|
+
e.labels.map(
|
|
594
|
+
(g) => i("span", {
|
|
595
|
+
class: "px-2 py-0.5 text-xs font-medium rounded-full" + (g.color ? "" : " bg-stone-100 text-stone-800 dark:bg-stone-700 dark:text-stone-300"),
|
|
596
|
+
style: g.color ? { backgroundColor: g.color, color: "#fff" } : {}
|
|
597
|
+
}, g.name)
|
|
598
|
+
)
|
|
599
|
+
) : null
|
|
600
|
+
])
|
|
601
|
+
]);
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
title: s("plugins.category"),
|
|
606
|
+
key: "category",
|
|
607
|
+
width: 120,
|
|
608
|
+
render(e) {
|
|
609
|
+
return e.category?.name || "";
|
|
610
|
+
}
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
title: s("plugins.rating"),
|
|
614
|
+
key: "rating_avg",
|
|
615
|
+
width: 140,
|
|
616
|
+
render(e) {
|
|
617
|
+
return i("div", { class: "flex items-center gap-1" }, [
|
|
618
|
+
i("span", { class: "text-orange-500" }, W(e.rating_avg)),
|
|
619
|
+
i("span", { class: "text-sm text-stone-500" }, `(${e.rating_count || 0})`)
|
|
620
|
+
]);
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
title: s("plugins.downloads"),
|
|
625
|
+
key: "download_count",
|
|
626
|
+
width: 100,
|
|
627
|
+
render(e) {
|
|
628
|
+
return A(e.download_count);
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
title: s("plugins.version"),
|
|
633
|
+
key: "installed_version",
|
|
634
|
+
width: 100
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
title: s("main.actions"),
|
|
638
|
+
key: "actions",
|
|
639
|
+
width: d.value ? 80 : 180,
|
|
640
|
+
render(e) {
|
|
641
|
+
const g = e.installed_version && e.latest_version && e.installed_version !== e.latest_version;
|
|
642
|
+
return i("div", { class: "flex gap-1" }, [
|
|
643
|
+
g ? i($, {
|
|
644
|
+
color: "blue",
|
|
645
|
+
size: "small",
|
|
646
|
+
onClick: () => ge(e.id)
|
|
647
|
+
}, () => [i(p, { name: "sync" })]) : null,
|
|
648
|
+
i($, {
|
|
649
|
+
color: "red",
|
|
650
|
+
size: "small",
|
|
651
|
+
onClick: () => xe(e.id, e.name)
|
|
652
|
+
}, () => d.value ? [i(p, { name: "close" })] : [i(p, { name: "close", class: "mr-1" }), s("plugins.uninstall")])
|
|
653
|
+
]);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
], te = () => [
|
|
657
|
+
{
|
|
658
|
+
title: s("plugins.name"),
|
|
659
|
+
key: "name",
|
|
660
|
+
render(e) {
|
|
661
|
+
return i("div", {
|
|
662
|
+
class: "flex items-center gap-2 cursor-pointer hover:opacity-80",
|
|
663
|
+
onClick: () => H(e.id)
|
|
664
|
+
}, [
|
|
665
|
+
e.icon_url ? i("img", { src: e.icon_url, class: "w-8 h-8 rounded", alt: e.name }) : i(p, { name: "plugin", class: "text-2xl text-stone-400" }),
|
|
666
|
+
i("div", { class: "flex flex-col" }, [
|
|
667
|
+
i("div", { class: "flex items-center gap-2" }, [
|
|
668
|
+
i("span", { class: "font-medium text-blue-600 dark:text-blue-400 hover:underline whitespace-nowrap" }, e.name),
|
|
669
|
+
e.requires_subscription ? i(p, { name: "star", class: "text-yellow-500" }) : null,
|
|
670
|
+
!d.value && e.installed ? i("span", { class: "px-2 py-0.5 text-xs font-medium rounded-full bg-lime-100 text-lime-800 dark:bg-lime-900 dark:text-lime-300 whitespace-nowrap" }, s("plugins.already_installed")) : null
|
|
671
|
+
]),
|
|
672
|
+
!d.value && e.labels?.length > 0 ? i(
|
|
673
|
+
"div",
|
|
674
|
+
{ class: "flex gap-1 mt-1" },
|
|
675
|
+
e.labels.map(
|
|
676
|
+
(g) => i("span", {
|
|
677
|
+
class: "px-2 py-0.5 text-xs font-medium rounded-full" + (g.color ? "" : " bg-stone-100 text-stone-800 dark:bg-stone-700 dark:text-stone-300"),
|
|
678
|
+
style: g.color ? { backgroundColor: g.color, color: "#fff" } : {}
|
|
679
|
+
}, g.name)
|
|
680
|
+
)
|
|
681
|
+
) : null
|
|
682
|
+
])
|
|
683
|
+
]);
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
title: s("plugins.category"),
|
|
688
|
+
key: "category",
|
|
689
|
+
width: 120,
|
|
690
|
+
render(e) {
|
|
691
|
+
return e.category?.name || "";
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
title: s("plugins.rating"),
|
|
696
|
+
key: "rating_avg",
|
|
697
|
+
width: 140,
|
|
698
|
+
render(e) {
|
|
699
|
+
return i("div", { class: "flex items-center gap-1" }, [
|
|
700
|
+
i("span", { class: "text-orange-500" }, W(e.rating_avg)),
|
|
701
|
+
i("span", { class: "text-sm text-stone-500" }, `(${e.rating_count || 0})`)
|
|
702
|
+
]);
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
{
|
|
706
|
+
title: s("plugins.downloads"),
|
|
707
|
+
key: "download_count",
|
|
708
|
+
width: 100,
|
|
709
|
+
render(e) {
|
|
710
|
+
return A(e.download_count);
|
|
711
|
+
}
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
title: s("plugins.version"),
|
|
715
|
+
key: "latest_version",
|
|
716
|
+
width: 100
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
title: s("main.actions"),
|
|
720
|
+
key: "actions",
|
|
721
|
+
width: d.value ? 80 : 150,
|
|
722
|
+
render(e) {
|
|
723
|
+
return e.installed ? d.value ? i($, {
|
|
724
|
+
color: "gray",
|
|
725
|
+
size: "small",
|
|
726
|
+
disabled: !0
|
|
727
|
+
}, () => [i(p, { name: "check" })]) : i($, {
|
|
728
|
+
color: "gray",
|
|
729
|
+
size: "small",
|
|
730
|
+
disabled: !0
|
|
731
|
+
}, () => s("plugins.already_installed")) : l(e) ? d.value ? i($, {
|
|
732
|
+
color: "orange",
|
|
733
|
+
size: "small",
|
|
734
|
+
onClick: () => R(e)
|
|
735
|
+
}, () => [i(p, { name: "star" })]) : i($, {
|
|
736
|
+
color: "orange",
|
|
737
|
+
size: "small",
|
|
738
|
+
onClick: () => R(e)
|
|
739
|
+
}, () => [i(p, { name: "star", class: "mr-1" }), s("plugins.purchase")]) : d.value ? i($, {
|
|
740
|
+
color: "blue",
|
|
741
|
+
size: "small",
|
|
742
|
+
onClick: () => ie(e.id)
|
|
743
|
+
}, () => [i(p, { name: "download" })]) : i($, {
|
|
744
|
+
color: "blue",
|
|
745
|
+
size: "small",
|
|
746
|
+
onClick: () => ie(e.id)
|
|
747
|
+
}, () => [i(p, { name: "download", class: "mr-1" }), s("plugins.install")]);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
], O = z(() => {
|
|
751
|
+
const e = ee();
|
|
752
|
+
return d.value ? e.filter((g) => !["installed_version", "download_count"].includes(g.key)) : e;
|
|
753
|
+
}), ne = z(() => {
|
|
754
|
+
const e = te();
|
|
755
|
+
return d.value ? e.filter((g) => !["latest_version", "download_count"].includes(g.key)) : e;
|
|
756
|
+
});
|
|
757
|
+
function W(e) {
|
|
758
|
+
const g = Math.floor(e || 0), L = (e || 0) - g >= 0.5, ve = 5 - g - (L ? 1 : 0);
|
|
759
|
+
return "★".repeat(g) + (L ? "½" : "") + "☆".repeat(ve);
|
|
760
|
+
}
|
|
761
|
+
function A(e) {
|
|
762
|
+
return e ? e >= 1e6 ? (e / 1e6).toFixed(1) + "M" : e >= 1e3 ? (e / 1e3).toFixed(1) + "K" : e.toString() : "0";
|
|
763
|
+
}
|
|
764
|
+
function R(e) {
|
|
765
|
+
B.value = e, _.value = !0;
|
|
766
|
+
}
|
|
767
|
+
function l(e) {
|
|
768
|
+
return e.requires_subscription && e.has_subscription !== !0 && !e.installed;
|
|
769
|
+
}
|
|
770
|
+
function P(e) {
|
|
771
|
+
e === "store" && h.value.length === 0 && G();
|
|
772
|
+
}
|
|
773
|
+
function S(e) {
|
|
774
|
+
c.value = e, G();
|
|
775
|
+
}
|
|
776
|
+
function G() {
|
|
777
|
+
b.fetchPlugins({
|
|
778
|
+
page: c.value
|
|
779
|
+
}).catch(q);
|
|
780
|
+
}
|
|
781
|
+
function H(e) {
|
|
782
|
+
b.fetchPluginDetails(e).catch(q), b.fetchPluginVersions(e).catch(q), f.value = !0;
|
|
783
|
+
}
|
|
784
|
+
function ie(e) {
|
|
785
|
+
H(e);
|
|
786
|
+
}
|
|
787
|
+
function ge(e) {
|
|
788
|
+
H(e);
|
|
789
|
+
}
|
|
790
|
+
function K() {
|
|
791
|
+
f.value = !1, b.clearCurrentPlugin();
|
|
792
|
+
}
|
|
793
|
+
function pe(e) {
|
|
794
|
+
v.value && (N.value = !0, b.installPlugin(v.value.id, e).then(() => {
|
|
795
|
+
Q({
|
|
796
|
+
content: s("plugins.install_success_msg"),
|
|
797
|
+
type: "success"
|
|
798
|
+
}), K(), J();
|
|
799
|
+
}).catch(q).finally(() => {
|
|
800
|
+
N.value = !1;
|
|
801
|
+
}));
|
|
802
|
+
}
|
|
803
|
+
function me(e) {
|
|
804
|
+
v.value && (N.value = !0, b.updatePlugin(v.value.id, e).then(() => {
|
|
805
|
+
Q({
|
|
806
|
+
content: s("plugins.update_success_msg"),
|
|
807
|
+
type: "success"
|
|
808
|
+
}), K(), J();
|
|
809
|
+
}).catch(q).finally(() => {
|
|
810
|
+
N.value = !1;
|
|
811
|
+
}));
|
|
812
|
+
}
|
|
813
|
+
function fe() {
|
|
814
|
+
v.value && window.$dialog.warning({
|
|
815
|
+
title: s("plugins.uninstall_confirm_msg"),
|
|
816
|
+
positiveText: s("main.yes"),
|
|
817
|
+
negativeText: s("main.no"),
|
|
818
|
+
closable: !1,
|
|
819
|
+
onPositiveClick: () => {
|
|
820
|
+
N.value = !0, b.uninstallPlugin(v.value.id).then(() => {
|
|
821
|
+
Q({
|
|
822
|
+
content: s("plugins.uninstall_success_msg"),
|
|
823
|
+
type: "success"
|
|
824
|
+
}), K(), J();
|
|
825
|
+
}).catch(q).finally(() => {
|
|
826
|
+
N.value = !1;
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
function xe(e, g) {
|
|
832
|
+
window.$dialog.warning({
|
|
833
|
+
title: s("plugins.uninstall_confirm_msg"),
|
|
834
|
+
positiveText: s("main.yes"),
|
|
835
|
+
negativeText: s("main.no"),
|
|
836
|
+
closable: !1,
|
|
837
|
+
onPositiveClick: () => {
|
|
838
|
+
b.uninstallPlugin(e).then(() => {
|
|
839
|
+
Q({
|
|
840
|
+
content: s("plugins.uninstall_success_msg"),
|
|
841
|
+
type: "success"
|
|
842
|
+
}), J();
|
|
843
|
+
}).catch(q);
|
|
844
|
+
}
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
function J() {
|
|
848
|
+
b.fetchPlugins({ page: 1, perPage: 100 }).catch(q);
|
|
849
|
+
}
|
|
850
|
+
return le(() => {
|
|
851
|
+
b.fetchPlugins({ page: 1, perPage: 100 }).catch(q);
|
|
852
|
+
}), (e, g) => (o(), m(ae, null, [
|
|
853
|
+
r(t(ke), { items: F.value }, null, 8, ["items"]),
|
|
854
|
+
r(t(Se), {
|
|
855
|
+
value: j.value,
|
|
856
|
+
"onUpdate:value": [
|
|
857
|
+
g[1] || (g[1] = (L) => j.value = L),
|
|
858
|
+
P
|
|
859
|
+
],
|
|
860
|
+
type: "line",
|
|
861
|
+
animated: ""
|
|
862
|
+
}, {
|
|
863
|
+
default: k(() => [
|
|
864
|
+
r(t(ue), {
|
|
865
|
+
name: "installed",
|
|
866
|
+
tab: t(s)("plugins.installed")
|
|
867
|
+
}, {
|
|
868
|
+
default: k(() => [
|
|
869
|
+
t(D).length > 0 ? (o(), m("div", jt, [
|
|
870
|
+
u("h3", Et, a(t(s)("plugins.updates_available")), 1),
|
|
871
|
+
r(t(se), {
|
|
872
|
+
bordered: !1,
|
|
873
|
+
"single-line": !0,
|
|
874
|
+
columns: O.value,
|
|
875
|
+
data: t(D),
|
|
876
|
+
loading: t(C),
|
|
877
|
+
size: "small"
|
|
878
|
+
}, {
|
|
879
|
+
loading: k(() => [
|
|
880
|
+
r(t(X))
|
|
881
|
+
]),
|
|
882
|
+
_: 1
|
|
883
|
+
}, 8, ["columns", "data", "loading"])
|
|
884
|
+
])) : x("", !0),
|
|
885
|
+
r(t(se), {
|
|
886
|
+
bordered: !1,
|
|
887
|
+
"single-line": !0,
|
|
888
|
+
columns: O.value,
|
|
889
|
+
data: Y.value,
|
|
890
|
+
loading: t(C),
|
|
891
|
+
pagination: Z
|
|
892
|
+
}, {
|
|
893
|
+
loading: k(() => [
|
|
894
|
+
r(t(X))
|
|
895
|
+
]),
|
|
896
|
+
empty: k(() => [
|
|
897
|
+
r(t(re), {
|
|
898
|
+
description: t(s)("plugins.no_plugins")
|
|
899
|
+
}, null, 8, ["description"])
|
|
900
|
+
]),
|
|
901
|
+
_: 1
|
|
902
|
+
}, 8, ["columns", "data", "loading"])
|
|
903
|
+
]),
|
|
904
|
+
_: 1
|
|
905
|
+
}, 8, ["tab"]),
|
|
906
|
+
r(t(ue), {
|
|
907
|
+
name: "store",
|
|
908
|
+
tab: t(s)("plugins.store")
|
|
909
|
+
}, {
|
|
910
|
+
default: k(() => [
|
|
911
|
+
r(t(se), {
|
|
912
|
+
bordered: !1,
|
|
913
|
+
"single-line": !0,
|
|
914
|
+
columns: ne.value,
|
|
915
|
+
data: t(h),
|
|
916
|
+
loading: t(C),
|
|
917
|
+
pagination: !1
|
|
918
|
+
}, {
|
|
919
|
+
loading: k(() => [
|
|
920
|
+
r(t(X))
|
|
921
|
+
]),
|
|
922
|
+
empty: k(() => [
|
|
923
|
+
r(t(re), {
|
|
924
|
+
description: t(s)("plugins.no_plugins")
|
|
925
|
+
}, null, 8, ["description"])
|
|
926
|
+
]),
|
|
927
|
+
_: 1
|
|
928
|
+
}, 8, ["columns", "data", "loading"]),
|
|
929
|
+
t(w) > 1 ? (o(), m("div", Ft, [
|
|
930
|
+
r(t($e), {
|
|
931
|
+
page: c.value,
|
|
932
|
+
"onUpdate:page": [
|
|
933
|
+
g[0] || (g[0] = (L) => c.value = L),
|
|
934
|
+
S
|
|
935
|
+
],
|
|
936
|
+
"page-count": t(w)
|
|
937
|
+
}, null, 8, ["page", "page-count"])
|
|
938
|
+
])) : x("", !0)
|
|
939
|
+
]),
|
|
940
|
+
_: 1
|
|
941
|
+
}, 8, ["tab"])
|
|
942
|
+
]),
|
|
943
|
+
_: 1
|
|
944
|
+
}, 8, ["value"]),
|
|
945
|
+
r(t(de), {
|
|
946
|
+
show: f.value,
|
|
947
|
+
"onUpdate:show": g[2] || (g[2] = (L) => f.value = L),
|
|
948
|
+
class: "custom-card",
|
|
949
|
+
preset: "card",
|
|
950
|
+
title: t(v)?.name || "",
|
|
951
|
+
bordered: !1,
|
|
952
|
+
style: { width: "900px", "max-width": "90vw" },
|
|
953
|
+
segmented: { content: "soft", footer: "soft" }
|
|
954
|
+
}, {
|
|
955
|
+
default: k(() => [
|
|
956
|
+
r(t(ze), { show: N.value }, {
|
|
957
|
+
default: k(() => [
|
|
958
|
+
t(v) ? (o(), T(zt, {
|
|
959
|
+
key: 0,
|
|
960
|
+
plugin: t(v),
|
|
961
|
+
versions: t(V),
|
|
962
|
+
loading: t(C),
|
|
963
|
+
onInstall: pe,
|
|
964
|
+
onUpdate: me,
|
|
965
|
+
onUninstall: fe,
|
|
966
|
+
onClose: K
|
|
967
|
+
}, null, 8, ["plugin", "versions", "loading"])) : x("", !0)
|
|
968
|
+
]),
|
|
969
|
+
_: 1
|
|
970
|
+
}, 8, ["show"])
|
|
971
|
+
]),
|
|
972
|
+
_: 1
|
|
973
|
+
}, 8, ["show", "title"]),
|
|
974
|
+
r(qt, {
|
|
975
|
+
show: _.value,
|
|
976
|
+
"onUpdate:show": g[3] || (g[3] = (L) => _.value = L),
|
|
977
|
+
plugin: B.value
|
|
978
|
+
}, null, 8, ["show", "plugin"])
|
|
979
|
+
], 64));
|
|
980
|
+
}
|
|
981
|
+
};
|
|
982
|
+
export {
|
|
983
|
+
At as default
|
|
984
|
+
};
|