@kong-ui-public/entities-data-plane-nodes 0.8.10 → 1.1.1
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/README.md +1 -17
- package/dist/entities-data-plane-nodes.es.js +117 -406
- package/dist/entities-data-plane-nodes.umd.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types/components/ChangeLogLevelModal.vue.d.ts +7 -10
- package/dist/types/components/ChangeLogLevelModal.vue.d.ts.map +1 -1
- package/dist/types/composables/index.d.ts +0 -23
- package/dist/types/composables/index.d.ts.map +1 -1
- package/dist/types/data-plane-nodes-endpoints.d.ts +12 -0
- package/dist/types/data-plane-nodes-endpoints.d.ts.map +1 -0
- package/dist/types/types/config.d.ts +15 -0
- package/dist/types/types/config.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/types/log-level.d.ts +9 -1
- package/dist/types/types/log-level.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/types/components/CLLModalNodeRow.vue.d.ts +0 -16
- package/dist/types/components/CLLModalNodeRow.vue.d.ts.map +0 -1
- package/dist/types/composables/useAsyncScheduler.d.ts +0 -14
- package/dist/types/composables/useAsyncScheduler.d.ts.map +0 -1
- package/dist/types/composables/useLogLevels.d.ts +0 -30
- package/dist/types/composables/useLogLevels.d.ts.map +0 -1
- package/dist/types/fixtures/data-planes.d.ts +0 -3
- package/dist/types/fixtures/data-planes.d.ts.map +0 -1
- package/dist/types/types/data-plane-node.d.ts +0 -59
- package/dist/types/types/data-plane-node.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -5,12 +5,10 @@ Data Plane entity components.
|
|
|
5
5
|
- [Requirements](#requirements)
|
|
6
6
|
- [Included types](#included-types)
|
|
7
7
|
- [Included components](#included-components)
|
|
8
|
-
- [Included composables](#included-composables)
|
|
9
8
|
- [Usage](#usage)
|
|
10
9
|
- [Install](#install)
|
|
11
10
|
- [Registration](#registration)
|
|
12
11
|
- [Individual component documentation](#individual-component-documentation)
|
|
13
|
-
- [Individual composables documentation](#individual-composables-documentation)
|
|
14
12
|
|
|
15
13
|
## Requirements
|
|
16
14
|
|
|
@@ -19,6 +17,7 @@ Check the [individual component docs](#individual-component-documentation) for m
|
|
|
19
17
|
## Included types
|
|
20
18
|
|
|
21
19
|
- `LogLevel` - An enum representing the log levels available for Data Plane nodes.
|
|
20
|
+
- `ChangeLogLevelConfig` - The config union (`konnect` / `kongManager`) accepted by `ChangeLogLevelModal`.
|
|
22
21
|
|
|
23
22
|
## Included components
|
|
24
23
|
|
|
@@ -26,13 +25,6 @@ Check the [individual component docs](#individual-component-documentation) for m
|
|
|
26
25
|
|
|
27
26
|
Reference the [individual component docs](#individual-component-documentation) for more info.
|
|
28
27
|
|
|
29
|
-
## Included composables
|
|
30
|
-
|
|
31
|
-
- `useDataPlaneLogLevelChecker`
|
|
32
|
-
- `useAsyncScheduler`
|
|
33
|
-
|
|
34
|
-
Reference the [individual composables docs](#individual-composables-documentation) for more info.
|
|
35
|
-
|
|
36
28
|
## Usage
|
|
37
29
|
|
|
38
30
|
### Install
|
|
@@ -50,16 +42,8 @@ Import the component(s) in your host application as well as the package styles
|
|
|
50
42
|
```ts
|
|
51
43
|
import { ChangeLogLevelModal, composables } from '@kong-ui-public/entities-data-plane-nodes'
|
|
52
44
|
import '@kong-ui-public/entities-data-plane-nodes/dist/style.css'
|
|
53
|
-
|
|
54
|
-
import type { LogLevel } from '@kong-ui-public/entities-data-plane-nodes'
|
|
55
45
|
```
|
|
56
46
|
|
|
57
47
|
## Individual component documentation
|
|
58
48
|
|
|
59
49
|
- [`<ChangeLogLevelModal.vue />`](docs/change-log-level-modal.md)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
## Individual composables documentation
|
|
63
|
-
|
|
64
|
-
- [`useDataPlaneLogLevelChecker`](docs/use-data-plane-log-level-checker.md)
|
|
65
|
-
- [`useAsyncScheduler`](docs/use-async-scheduler.md)
|
|
@@ -1,432 +1,143 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
log_level: ge
|
|
1
|
+
import { defineComponent as S, useModel as D, ref as p, computed as x, resolveComponent as g, openBlock as w, createBlock as C, unref as a, withCtx as P, createElementVNode as I, toDisplayString as $, createVNode as f, createCommentVNode as O, mergeModels as y } from "vue";
|
|
2
|
+
import { useAxios as F, useErrors as G } from "@kong-ui-public/entities-shared";
|
|
3
|
+
import { createI18n as W, i18nTComponent as R } from "@kong-ui-public/i18n";
|
|
4
|
+
const q = { title: "Change log level temporarily", description: "Choose how much information Kong Gateway writes to its logs. Changes automatically revert when the TTL expires.", log_level_label: "Log level", expiration: { label: "Expiration", tooltip: "The duration (in seconds) before the log level automatically reverts to its default value.", help: "Enter a value between 1 second and 1 hour (3,600 seconds)." }, warning: "Higher log levels can significantly increase log volume and disk usage. Use them only while troubleshooting.", save: "Save", cancel: "Cancel" }, H = { debug: "Debug", info: "Info", notice: "Notice", warn: "Warn", error: "Error", crit: "Critical" }, X = {
|
|
5
|
+
modal: q,
|
|
6
|
+
log_level: H
|
|
8
7
|
};
|
|
9
|
-
function
|
|
10
|
-
const
|
|
8
|
+
function j() {
|
|
9
|
+
const e = W("en-us", X);
|
|
11
10
|
return {
|
|
12
|
-
i18n:
|
|
13
|
-
i18nT:
|
|
11
|
+
i18n: e,
|
|
12
|
+
i18nT: R(e)
|
|
14
13
|
// Translation component <i18n-t>
|
|
15
14
|
};
|
|
16
15
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return this.concurrentTokenSet.size > 0;
|
|
27
|
-
}
|
|
28
|
-
borrowConcurrentToken() {
|
|
29
|
-
if (this.concurrentTokenSet.size > 0) {
|
|
30
|
-
const e = this.concurrentTokenSet.values().next().value;
|
|
31
|
-
if (e)
|
|
32
|
-
return this.concurrentTokenSet.delete(e), () => {
|
|
33
|
-
this.returnConcurrentToken(e);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
throw new Error("BUG: No available token to borrow");
|
|
37
|
-
}
|
|
38
|
-
returnConcurrentToken(e) {
|
|
39
|
-
if (this.concurrentTokenSet.has(e))
|
|
40
|
-
throw new Error("Token already returned");
|
|
41
|
-
const t = this.concurrentTokenBorrowQueue.shift();
|
|
42
|
-
t ? t[0](() => this.returnConcurrentToken(e)) : this.concurrentTokenSet.add(e);
|
|
43
|
-
}
|
|
44
|
-
async borrowToken() {
|
|
45
|
-
return this.hasAvailableConcurrentToken() ? this.borrowConcurrentToken() : new Promise((e, t) => {
|
|
46
|
-
this.concurrentTokenBorrowQueue.push([e, t]);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
clearWaitingQueue(e) {
|
|
50
|
-
for (; this.concurrentTokenBorrowQueue.length > 0; ) {
|
|
51
|
-
const [, t] = this.concurrentTokenBorrowQueue.shift();
|
|
52
|
-
t(e);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
class q extends Error {
|
|
57
|
-
constructor(e, t) {
|
|
58
|
-
super(e, t), this.name = "AsyncAbortException";
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
class D {
|
|
62
|
-
tokenBucket = null;
|
|
63
|
-
constructor(e) {
|
|
64
|
-
e.maxConcurrentAsyncs > 0 && (this.tokenBucket = new me(e.maxConcurrentAsyncs));
|
|
65
|
-
}
|
|
66
|
-
schedule = async (e) => {
|
|
67
|
-
let t;
|
|
68
|
-
this.tokenBucket && (t = await this.tokenBucket.borrowToken());
|
|
69
|
-
try {
|
|
70
|
-
const o = await e();
|
|
71
|
-
return t?.(), o;
|
|
72
|
-
} catch (o) {
|
|
73
|
-
throw t?.(), o;
|
|
16
|
+
const z = {
|
|
17
|
+
useI18n: j
|
|
18
|
+
}, J = "/v2/control-planes/{controlPlaneId}", Q = "/debug/cluster", Y = {
|
|
19
|
+
logLevel: {
|
|
20
|
+
konnect: {
|
|
21
|
+
update: `${J}/nodes/log-level-operations`
|
|
22
|
+
},
|
|
23
|
+
kongManager: {
|
|
24
|
+
update: `${Q}/data-planes/log-level-operations`
|
|
74
25
|
}
|
|
75
|
-
};
|
|
76
|
-
cancelAll = (e, t) => {
|
|
77
|
-
this.tokenBucket?.clearWaitingQueue(new q(e, t));
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
const pe = (n) => n instanceof D ? n : n === null ? new D({ maxConcurrentAsyncs: 0 }) : new D(n), _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
81
|
-
__proto__: null,
|
|
82
|
-
AsyncAbortException: q,
|
|
83
|
-
AsyncScheduler: D,
|
|
84
|
-
useAsyncScheduler: pe
|
|
85
|
-
}, Symbol.toStringTag, { value: "Module" })), O = [
|
|
86
|
-
b.Debug,
|
|
87
|
-
b.Info,
|
|
88
|
-
b.Notice,
|
|
89
|
-
b.Warn,
|
|
90
|
-
b.Error,
|
|
91
|
-
b.Critical
|
|
92
|
-
], he = (n) => {
|
|
93
|
-
const { i18n: e } = B();
|
|
94
|
-
return h(() => {
|
|
95
|
-
const t = $(n?.disabled) ?? [];
|
|
96
|
-
return O.map((o) => ({
|
|
97
|
-
label: e.t(`log_level.${o}`),
|
|
98
|
-
value: o,
|
|
99
|
-
selected: n?.initialSelected === o,
|
|
100
|
-
disabled: t.includes(o)
|
|
101
|
-
}));
|
|
102
|
-
});
|
|
103
|
-
}, fe = (n) => {
|
|
104
|
-
const e = [b.Debug], { i18n: t } = B();
|
|
105
|
-
return h(() => {
|
|
106
|
-
const o = $(n);
|
|
107
|
-
return {
|
|
108
|
-
explanation: t.t(`modal.log_level_explanation.${o}`),
|
|
109
|
-
warning: e.includes(o) ? t.t("modal.log_level_disk_space_warning") : void 0
|
|
110
|
-
};
|
|
111
|
-
});
|
|
112
|
-
}, be = (n) => {
|
|
113
|
-
const { i18n: e } = B();
|
|
114
|
-
return h(() => {
|
|
115
|
-
const t = $(n);
|
|
116
|
-
if (isNaN(t) || t <= 0)
|
|
117
|
-
return "";
|
|
118
|
-
let o = "";
|
|
119
|
-
const a = t % 60;
|
|
120
|
-
a !== 0 && (o += `${a} ${e.t("modal.revert_to_default_after.seconds")}`);
|
|
121
|
-
const r = Math.floor(t / 60) % 60;
|
|
122
|
-
r !== 0 && (o = `${r} ${e.t("modal.revert_to_default_after.minutes")} ${o}`);
|
|
123
|
-
const s = Math.floor(t / 3600);
|
|
124
|
-
return s !== 0 && (o = `${s} ${e.t("modal.revert_to_default_after.hours")} ${o}`), o;
|
|
125
|
-
});
|
|
126
|
-
}, Le = (n) => {
|
|
127
|
-
const e = n.requestExecutor ?? ((s) => s()), { getDataPlaneLogLevel: t, setDataPlaneLogLevel: o } = n, { getMessageFromError: a } = se();
|
|
128
|
-
return { checkDataPlaneLogLevel: (s, m) => {
|
|
129
|
-
const c = L($(m?.currentLogLevelHint) ?? null);
|
|
130
|
-
c.value === null && e(async () => {
|
|
131
|
-
c.value = await t(s);
|
|
132
|
-
}).catch((g) => {
|
|
133
|
-
g instanceof q || console.error("Failed to get data plane log level", g);
|
|
134
|
-
}), m?.currentLogLevelHint && ee(() => $(m.currentLogLevelHint), (g) => {
|
|
135
|
-
g && (c.value = g);
|
|
136
|
-
});
|
|
137
|
-
const v = L("pending"), k = L(null);
|
|
138
|
-
return {
|
|
139
|
-
currentLogLevel: c,
|
|
140
|
-
updateStatus: v,
|
|
141
|
-
updateErrorMessage: k,
|
|
142
|
-
updateLogLevel: async (g, C) => {
|
|
143
|
-
v.value = "loading", k.value = null;
|
|
144
|
-
try {
|
|
145
|
-
await e(() => o(s, g, C)), c.value = g, v.value = "success";
|
|
146
|
-
} catch (T) {
|
|
147
|
-
k.value = a(T), v.value = "error";
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
} };
|
|
152
|
-
}, ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
153
|
-
__proto__: null,
|
|
154
|
-
supportedLevels: O,
|
|
155
|
-
useDataPlaneLogLevelChecker: Le,
|
|
156
|
-
useFriendlyRevertTime: be,
|
|
157
|
-
useLogLevelCandidateSelectItems: he,
|
|
158
|
-
useLogLevelExplanation: fe
|
|
159
|
-
}, Symbol.toStringTag, { value: "Module" })), x = {
|
|
160
|
-
useI18n: B,
|
|
161
|
-
...ke,
|
|
162
|
-
..._e
|
|
163
|
-
}, ye = { "data-testid": "log-change-action" }, we = { key: 0 }, Ce = { "data-testid": "log-change-action-current-level" }, xe = { key: 0 }, Se = { "data-testid": "log-change-action-target-level" }, Te = { "data-testid": "log-change-status" }, Ie = /* @__PURE__ */ F({
|
|
164
|
-
__name: "CLLModalNodeRow",
|
|
165
|
-
props: {
|
|
166
|
-
dataPlaneId: {},
|
|
167
|
-
hostname: {},
|
|
168
|
-
hasDllCapability: { type: Boolean },
|
|
169
|
-
targetLogLevel: {},
|
|
170
|
-
checkLogLevel: {},
|
|
171
|
-
logLevelHint: {}
|
|
172
|
-
},
|
|
173
|
-
setup(n, { expose: e }) {
|
|
174
|
-
const t = n, { i18n: o } = x.useI18n();
|
|
175
|
-
let a = L("not_supported"), r = L("not_supported"), s = L(null), m = async () => {
|
|
176
|
-
};
|
|
177
|
-
t.hasDllCapability && ({
|
|
178
|
-
currentLogLevel: a,
|
|
179
|
-
updateStatus: r,
|
|
180
|
-
updateErrorMessage: s,
|
|
181
|
-
updateLogLevel: m
|
|
182
|
-
} = t.checkLogLevel(t.dataPlaneId, {
|
|
183
|
-
currentLogLevelHint: () => t.logLevelHint ?? null
|
|
184
|
-
})), e({
|
|
185
|
-
updateLogLevel: m
|
|
186
|
-
});
|
|
187
|
-
const c = h(() => {
|
|
188
|
-
switch (r.value) {
|
|
189
|
-
case "success":
|
|
190
|
-
return "success";
|
|
191
|
-
case "error":
|
|
192
|
-
return "danger";
|
|
193
|
-
case "loading":
|
|
194
|
-
case "pending":
|
|
195
|
-
return "warning";
|
|
196
|
-
default:
|
|
197
|
-
return "neutral";
|
|
198
|
-
}
|
|
199
|
-
}), v = h(() => {
|
|
200
|
-
switch (r.value) {
|
|
201
|
-
case "success":
|
|
202
|
-
return o.t("modal.dp_list.status.succeed");
|
|
203
|
-
case "error":
|
|
204
|
-
return o.t("modal.dp_list.status.failed");
|
|
205
|
-
case "pending":
|
|
206
|
-
return o.t("modal.dp_list.status.pending");
|
|
207
|
-
case "loading":
|
|
208
|
-
return o.t("modal.dp_list.status.loading");
|
|
209
|
-
default:
|
|
210
|
-
return o.t("modal.dp_list.status.not_supported");
|
|
211
|
-
}
|
|
212
|
-
}), k = h(() => {
|
|
213
|
-
switch (r.value) {
|
|
214
|
-
case "success":
|
|
215
|
-
return ue;
|
|
216
|
-
case "error":
|
|
217
|
-
case "not_supported":
|
|
218
|
-
return ce;
|
|
219
|
-
case "loading":
|
|
220
|
-
return ie;
|
|
221
|
-
default:
|
|
222
|
-
return re;
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
return (E, g) => {
|
|
226
|
-
const C = S("KSkeleton"), T = S("KBadge"), P = S("KTooltip");
|
|
227
|
-
return d(), I("tr", null, [
|
|
228
|
-
i("td", null, u(n.hostname), 1),
|
|
229
|
-
i("td", ye, [
|
|
230
|
-
l(a) === "not_supported" ? (d(), I("span", we, u(l(o).t("log_level.not_applicable")), 1)) : l(a) ? (d(), I(Q, { key: 2 }, [
|
|
231
|
-
i("span", Ce, u(l(o).t(`log_level.${l(a)}`)), 1),
|
|
232
|
-
l(a) !== n.targetLogLevel ? (d(), I("span", xe, [
|
|
233
|
-
g[0] || (g[0] = N(" → ", -1)),
|
|
234
|
-
i("span", Se, u(l(o).t(`log_level.${n.targetLogLevel}`)), 1)
|
|
235
|
-
])) : K("", !0)
|
|
236
|
-
], 64)) : (d(), y(C, {
|
|
237
|
-
key: 1,
|
|
238
|
-
type: "spinner"
|
|
239
|
-
}))
|
|
240
|
-
]),
|
|
241
|
-
i("td", Te, [
|
|
242
|
-
l(s) ? (d(), y(P, {
|
|
243
|
-
key: 0,
|
|
244
|
-
text: l(s)
|
|
245
|
-
}, {
|
|
246
|
-
default: w(() => [
|
|
247
|
-
A(T, {
|
|
248
|
-
appearance: c.value,
|
|
249
|
-
class: "badge-cell"
|
|
250
|
-
}, {
|
|
251
|
-
icon: w(() => [
|
|
252
|
-
(d(), y(R(k.value)))
|
|
253
|
-
]),
|
|
254
|
-
default: w(() => [
|
|
255
|
-
N(" " + u(v.value), 1)
|
|
256
|
-
]),
|
|
257
|
-
_: 1
|
|
258
|
-
}, 8, ["appearance"])
|
|
259
|
-
]),
|
|
260
|
-
_: 1
|
|
261
|
-
}, 8, ["text"])) : (d(), y(T, {
|
|
262
|
-
key: 1,
|
|
263
|
-
appearance: c.value,
|
|
264
|
-
class: "badge-cell"
|
|
265
|
-
}, {
|
|
266
|
-
icon: w(() => [
|
|
267
|
-
(d(), y(R(k.value)))
|
|
268
|
-
]),
|
|
269
|
-
default: w(() => [
|
|
270
|
-
N(" " + u(v.value), 1)
|
|
271
|
-
]),
|
|
272
|
-
_: 1
|
|
273
|
-
}, 8, ["appearance"]))
|
|
274
|
-
])
|
|
275
|
-
]);
|
|
276
|
-
};
|
|
277
26
|
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
"
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
"data-testid": "log-level-timeout-formatted"
|
|
290
|
-
}, Me = {
|
|
291
|
-
class: "data-plane-node-list",
|
|
292
|
-
"data-testid": "data-plane-node-list"
|
|
293
|
-
}, Ke = { class: "data-plane-node-col" }, qe = { class: "data-plane-node-col" }, Ve = /* @__PURE__ */ F({
|
|
27
|
+
};
|
|
28
|
+
var M = /* @__PURE__ */ ((e) => (e.Debug = "debug", e.Info = "info", e.Notice = "notice", e.Warn = "warn", e.Error = "error", e.Critical = "crit", e))(M || {});
|
|
29
|
+
const Z = [
|
|
30
|
+
"debug",
|
|
31
|
+
"info",
|
|
32
|
+
"notice",
|
|
33
|
+
"warn",
|
|
34
|
+
"error",
|
|
35
|
+
"crit"
|
|
36
|
+
/* Critical */
|
|
37
|
+
], ee = { class: "change-log-level-modal-content" }, te = { class: "description" }, E = 600, oe = /* @__PURE__ */ S({
|
|
294
38
|
name: "ChangeLogLevelModal",
|
|
295
39
|
__name: "ChangeLogLevelModal",
|
|
296
|
-
props: /* @__PURE__ */
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
requests: {}
|
|
40
|
+
props: /* @__PURE__ */ y({
|
|
41
|
+
config: {},
|
|
42
|
+
nodes: {}
|
|
300
43
|
}, {
|
|
301
44
|
visible: { type: Boolean },
|
|
302
45
|
visibleModifiers: {}
|
|
303
46
|
}),
|
|
304
|
-
emits: ["update:visible"],
|
|
305
|
-
setup(
|
|
306
|
-
const e =
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}),
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
getDataPlaneLogLevel: e.requests.getDataPlaneLogLevel,
|
|
315
|
-
setDataPlaneLogLevel: e.requests.setDataPlaneLogLevel,
|
|
316
|
-
requestExecutor: P.schedule
|
|
317
|
-
}), M = /* @__PURE__ */ new Map(), z = (f, p) => {
|
|
318
|
-
p === null ? M.delete(f) : M.set(f, p);
|
|
319
|
-
}, U = async () => {
|
|
320
|
-
if (r.value !== "edit") {
|
|
321
|
-
V();
|
|
322
|
-
return;
|
|
323
|
-
}
|
|
324
|
-
r.value = "submitting";
|
|
325
|
-
const f = Array.from(M.values()).map((p) => p.updateLogLevel(s.value, c.value));
|
|
47
|
+
emits: /* @__PURE__ */ y(["success"], ["update:visible"]),
|
|
48
|
+
setup(e, { emit: v }) {
|
|
49
|
+
const t = e, m = v, c = D(e, "visible"), { i18n: o } = z.useI18n(), { axiosInstance: V } = F(t.config.axiosRequestConfig), { getMessageFromError: k } = G(), h = M.Notice, u = p(h), s = p(E), i = p(!1), r = p(""), L = x(() => Z.map((n) => ({
|
|
50
|
+
label: o.t(`log_level.${n}`),
|
|
51
|
+
value: n
|
|
52
|
+
}))), _ = x(() => Number.isInteger(s.value) && s.value >= 1 && s.value <= 3600), A = (n) => {
|
|
53
|
+
let l = `${t.config.apiBaseUrl}${n}`;
|
|
54
|
+
return t.config.app === "konnect" && (l = l.replace(/{controlPlaneId}/gi, t.config.controlPlaneId)), l;
|
|
55
|
+
}, K = async () => {
|
|
56
|
+
r.value = "", i.value = !0;
|
|
326
57
|
try {
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
58
|
+
const n = A(Y.logLevel[t.config.app].update), l = {
|
|
59
|
+
log_level: u.value,
|
|
60
|
+
ttl: s.value,
|
|
61
|
+
targets: { node_ids: t.nodes.map((d) => d.id) }
|
|
62
|
+
};
|
|
63
|
+
await V.post(n, l), m("success");
|
|
64
|
+
} catch (n) {
|
|
65
|
+
r.value = k(n);
|
|
330
66
|
} finally {
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
}, V = () => {
|
|
334
|
-
t.value = !1, m.value = "60", r.value = "edit", s.value = o;
|
|
335
|
-
}, G = h(() => {
|
|
336
|
-
switch (r.value) {
|
|
337
|
-
case "submitting":
|
|
338
|
-
return a.t("modal.action_button.submitting");
|
|
339
|
-
case "submitted":
|
|
340
|
-
return a.t("modal.action_button.ok");
|
|
341
|
-
default:
|
|
342
|
-
return a.t("modal.action_button.confirm");
|
|
67
|
+
i.value = !1;
|
|
343
68
|
}
|
|
344
|
-
})
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
69
|
+
}, U = () => {
|
|
70
|
+
c.value = !1, u.value = h, s.value = E, r.value = "";
|
|
71
|
+
};
|
|
72
|
+
return (n, l) => {
|
|
73
|
+
const d = g("KAlert"), N = g("KSelect"), T = g("KInput"), B = g("KModal");
|
|
74
|
+
return w(), C(B, {
|
|
75
|
+
"action-button-disabled": i.value || !_.value || t.nodes.length === 0,
|
|
76
|
+
"action-button-text": a(o).t("modal.save"),
|
|
77
|
+
"cancel-button-disabled": i.value,
|
|
78
|
+
"cancel-button-text": a(o).t("modal.cancel"),
|
|
350
79
|
"data-testid": "change-log-level-modal",
|
|
351
|
-
"hide-
|
|
352
|
-
"hide-close-icon": r.value === "submitting",
|
|
80
|
+
"hide-close-icon": i.value,
|
|
353
81
|
"max-width": "640px",
|
|
354
|
-
title:
|
|
355
|
-
visible:
|
|
356
|
-
onCancel:
|
|
357
|
-
onProceed:
|
|
82
|
+
title: a(o).t("modal.title"),
|
|
83
|
+
visible: c.value,
|
|
84
|
+
onCancel: U,
|
|
85
|
+
onProceed: K
|
|
358
86
|
}, {
|
|
359
|
-
default:
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
}),
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
i("span", Pe, u(l(T)), 1)
|
|
399
|
-
])
|
|
400
|
-
]),
|
|
401
|
-
i("table", Me, [
|
|
402
|
-
i("thead", null, [
|
|
403
|
-
i("th", Ke, u(l(a).t("modal.dp_list.header.host")), 1),
|
|
404
|
-
i("th", qe, u(l(a).t("modal.dp_list.header.action")), 1),
|
|
405
|
-
i("th", null, u(l(a).t("modal.dp_list.header.status")), 1)
|
|
406
|
-
]),
|
|
407
|
-
i("tbody", null, [
|
|
408
|
-
(d(!0), I(Q, null, ne(e.instanceList, (_) => (d(), y(Ne, {
|
|
409
|
-
key: _.id,
|
|
410
|
-
ref_for: !0,
|
|
411
|
-
ref: (Z) => z(_.id, Z),
|
|
412
|
-
"check-log-level": l(W),
|
|
413
|
-
"data-plane-id": _.id,
|
|
414
|
-
"data-testid": `data-plane-node-list-row-${_.id}`,
|
|
415
|
-
"has-dll-capability": _.hasDLLCapability ?? !0,
|
|
416
|
-
hostname: _.hostname,
|
|
417
|
-
"log-level-hint": e.instanceLogLevel?.get(_.id),
|
|
418
|
-
"target-log-level": s.value
|
|
419
|
-
}, null, 8, ["check-log-level", "data-plane-id", "data-testid", "has-dll-capability", "hostname", "log-level-hint", "target-log-level"]))), 128))
|
|
420
|
-
])
|
|
87
|
+
default: P(() => [
|
|
88
|
+
I("div", ee, [
|
|
89
|
+
I("p", te, $(a(o).t("modal.description")), 1),
|
|
90
|
+
f(d, {
|
|
91
|
+
appearance: "warning",
|
|
92
|
+
"data-testid": "log-level-warning",
|
|
93
|
+
message: a(o).t("modal.warning"),
|
|
94
|
+
"show-icon": ""
|
|
95
|
+
}, null, 8, ["message"]),
|
|
96
|
+
f(N, {
|
|
97
|
+
modelValue: u.value,
|
|
98
|
+
"onUpdate:modelValue": l[0] || (l[0] = (b) => u.value = b),
|
|
99
|
+
"data-testid": "log-level-select",
|
|
100
|
+
items: L.value,
|
|
101
|
+
"kpop-attributes": { "data-testid": "log-level-select-popover" },
|
|
102
|
+
label: a(o).t("modal.log_level_label")
|
|
103
|
+
}, null, 8, ["modelValue", "items", "label"]),
|
|
104
|
+
f(T, {
|
|
105
|
+
modelValue: s.value,
|
|
106
|
+
"onUpdate:modelValue": l[1] || (l[1] = (b) => s.value = b),
|
|
107
|
+
modelModifiers: { number: !0 },
|
|
108
|
+
"data-testid": "expiration-input",
|
|
109
|
+
error: !_.value,
|
|
110
|
+
help: a(o).t("modal.expiration.help"),
|
|
111
|
+
label: a(o).t("modal.expiration.label"),
|
|
112
|
+
"label-attributes": {
|
|
113
|
+
info: a(o).t("modal.expiration.tooltip"),
|
|
114
|
+
tooltipAttributes: { maxWidth: "340px" }
|
|
115
|
+
},
|
|
116
|
+
max: "3600",
|
|
117
|
+
min: "1",
|
|
118
|
+
type: "number"
|
|
119
|
+
}, null, 8, ["modelValue", "error", "help", "label", "label-attributes"]),
|
|
120
|
+
r.value ? (w(), C(d, {
|
|
121
|
+
key: 0,
|
|
122
|
+
appearance: "danger",
|
|
123
|
+
"data-testid": "log-level-error",
|
|
124
|
+
message: r.value
|
|
125
|
+
}, null, 8, ["message"])) : O("", !0)
|
|
421
126
|
])
|
|
422
127
|
]),
|
|
423
128
|
_: 1
|
|
424
|
-
}, 8, ["action-button-disabled", "action-button-text", "hide-close-icon", "title", "visible"]);
|
|
129
|
+
}, 8, ["action-button-disabled", "action-button-text", "cancel-button-disabled", "cancel-button-text", "hide-close-icon", "title", "visible"]);
|
|
425
130
|
};
|
|
426
131
|
}
|
|
427
|
-
}),
|
|
132
|
+
}), le = (e, v) => {
|
|
133
|
+
const t = e.__vccOpts || e;
|
|
134
|
+
for (const [m, c] of v)
|
|
135
|
+
t[m] = c;
|
|
136
|
+
return t;
|
|
137
|
+
}, ie = /* @__PURE__ */ le(oe, [["__scopeId", "data-v-f6b55516"]]);
|
|
428
138
|
export {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
139
|
+
ie as ChangeLogLevelModal,
|
|
140
|
+
Z as LOG_LEVELS,
|
|
141
|
+
M as LogLevel,
|
|
142
|
+
z as composables
|
|
432
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(d,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong-ui-public/entities-shared"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong-ui-public/entities-shared","@kong/icons"],e):(d=typeof globalThis<"u"?globalThis:d||self,e(d["kong-ui-public-entities-data-plane-nodes"]={},d.Vue,d["kong-ui-public-i18n"],d["kong-ui-public-entities-shared"],d.KongIcons))})(this,(function(d,e,B,I,y){"use strict";const $={modal:{action_button:{confirm:"Confirm",submitting:"Submitting...",ok:"OK"},change_log_level:{title:"Change log level ({summary})",summary_with_name:"Node {name}",summary_with_number:"{number} Nodes"},dp_list:{header:{host:"Host",action:"Action",status:"Status"},status:{failed:"Failure",loading:"Loading",pending:"Pending",succeed:"Succeed",not_supported:"Not supported"}},log_level_disk_space_warning:"If left on for extended periods of time, can result in excess disk space consumption.",log_level_explanation:{debug:"Provides debug information about the plugin’s run loop and each individual plugin or other components.",info:"Provides messages that provide a record of the normal operation of the system.",notice:"Provides messages that provide a record of the normal operation of the system, but also alerts conditions that may require monitoring. Kong does not make a large difference between info and notice.",warn:"Is used to log any abnormal behavior that doesn’t result in dropped transactions but requires further investigation.",error:"Is used for logging errors that result in a request being dropped.",crit:"Is used when Kong is working under critical conditions and not working properly, thus affecting several clients."},revert_to_default_after:{label:"Revert to default after",hours:"hour",minutes:"min",seconds:"seconds"},select_log_level_title:"Select log level"},log_level:{debug:"Debug",info:"Info",notice:"Notice",warn:"Warn",error:"Error",crit:"Critical",not_applicable:"N/A"}};function w(){const o=B.createI18n("en-us",$);return{i18n:o,i18nT:B.i18nTComponent(o)}}var h=(o=>(o.Debug="debug",o.Info="info",o.Notice="notice",o.Warn="warn",o.Error="error",o.Critical="crit",o))(h||{});class A{concurrentTokenSet=new Set;concurrentTokenBorrowQueue=[];constructor(t){for(let n=0;n<t;++n)this.concurrentTokenSet.add(Symbol(`token-${n}`))}hasAvailableConcurrentToken(){return this.concurrentTokenSet.size>0}borrowConcurrentToken(){if(this.concurrentTokenSet.size>0){const t=this.concurrentTokenSet.values().next().value;if(t)return this.concurrentTokenSet.delete(t),()=>{this.returnConcurrentToken(t)}}throw new Error("BUG: No available token to borrow")}returnConcurrentToken(t){if(this.concurrentTokenSet.has(t))throw new Error("Token already returned");const n=this.concurrentTokenBorrowQueue.shift();n?n[0](()=>this.returnConcurrentToken(t)):this.concurrentTokenSet.add(t)}async borrowToken(){return this.hasAvailableConcurrentToken()?this.borrowConcurrentToken():new Promise((t,n)=>{this.concurrentTokenBorrowQueue.push([t,n])})}clearWaitingQueue(t){for(;this.concurrentTokenBorrowQueue.length>0;){const[,n]=this.concurrentTokenBorrowQueue.shift();n(t)}}}class S extends Error{constructor(t,n){super(t,n),this.name="AsyncAbortException"}}class C{tokenBucket=null;constructor(t){t.maxConcurrentAsyncs>0&&(this.tokenBucket=new A(t.maxConcurrentAsyncs))}schedule=async t=>{let n;this.tokenBucket&&(n=await this.tokenBucket.borrowToken());try{const a=await t();return n?.(),a}catch(a){throw n?.(),a}};cancelAll=(t,n)=>{this.tokenBucket?.clearWaitingQueue(new S(t,n))}}const P=Object.freeze(Object.defineProperty({__proto__:null,AsyncAbortException:S,AsyncScheduler:C,useAsyncScheduler:o=>o instanceof C?o:o===null?new C({maxConcurrentAsyncs:0}):new C(o)},Symbol.toStringTag,{value:"Module"})),T=[h.Debug,h.Info,h.Notice,h.Warn,h.Error,h.Critical],_={useI18n:w,...Object.freeze(Object.defineProperty({__proto__:null,supportedLevels:T,useDataPlaneLogLevelChecker:o=>{const t=o.requestExecutor??(r=>r()),{getDataPlaneLogLevel:n,setDataPlaneLogLevel:a}=o,{getMessageFromError:l}=I.useErrors();return{checkDataPlaneLogLevel:(r,g)=>{const c=e.ref(e.toValue(g?.currentLogLevelHint)??null);c.value===null&&t(async()=>{c.value=await n(r)}).catch(i=>{i instanceof S||console.error("Failed to get data plane log level",i)}),g?.currentLogLevelHint&&e.watch(()=>e.toValue(g.currentLogLevelHint),i=>{i&&(c.value=i)});const u=e.ref("pending"),k=e.ref(null);return{currentLogLevel:c,updateStatus:u,updateErrorMessage:k,updateLogLevel:async(i,b)=>{u.value="loading",k.value=null;try{await t(()=>a(r,i,b)),c.value=i,u.value="success"}catch(L){k.value=l(L),u.value="error"}}}}}},useFriendlyRevertTime:o=>{const{i18n:t}=w();return e.computed(()=>{const n=e.toValue(o);if(isNaN(n)||n<=0)return"";let a="";const l=n%60;l!==0&&(a+=`${l} ${t.t("modal.revert_to_default_after.seconds")}`);const s=Math.floor(n/60)%60;s!==0&&(a=`${s} ${t.t("modal.revert_to_default_after.minutes")} ${a}`);const r=Math.floor(n/3600);return r!==0&&(a=`${r} ${t.t("modal.revert_to_default_after.hours")} ${a}`),a})},useLogLevelCandidateSelectItems:o=>{const{i18n:t}=w();return e.computed(()=>{const n=e.toValue(o?.disabled)??[];return T.map(a=>({label:t.t(`log_level.${a}`),value:a,selected:o?.initialSelected===a,disabled:n.includes(a)}))})},useLogLevelExplanation:o=>{const t=[h.Debug],{i18n:n}=w();return e.computed(()=>{const a=e.toValue(o);return{explanation:n.t(`modal.log_level_explanation.${a}`),warning:t.includes(a)?n.t("modal.log_level_disk_space_warning"):void 0}})}},Symbol.toStringTag,{value:"Module"})),...P},M={"data-testid":"log-change-action"},K={key:0},q={"data-testid":"log-change-action-current-level"},F={key:0},R={"data-testid":"log-change-action-target-level"},H={"data-testid":"log-change-status"},j=e.defineComponent({__name:"CLLModalNodeRow",props:{dataPlaneId:{},hostname:{},hasDllCapability:{type:Boolean},targetLogLevel:{},checkLogLevel:{},logLevelHint:{}},setup(o,{expose:t}){const n=o,{i18n:a}=_.useI18n();let l=e.ref("not_supported"),s=e.ref("not_supported"),r=e.ref(null),g=async()=>{};n.hasDllCapability&&({currentLogLevel:l,updateStatus:s,updateErrorMessage:r,updateLogLevel:g}=n.checkLogLevel(n.dataPlaneId,{currentLogLevelHint:()=>n.logLevelHint??null})),t({updateLogLevel:g});const c=e.computed(()=>{switch(s.value){case"success":return"success";case"error":return"danger";case"loading":case"pending":return"warning";default:return"neutral"}}),u=e.computed(()=>{switch(s.value){case"success":return a.t("modal.dp_list.status.succeed");case"error":return a.t("modal.dp_list.status.failed");case"pending":return a.t("modal.dp_list.status.pending");case"loading":return a.t("modal.dp_list.status.loading");default:return a.t("modal.dp_list.status.not_supported")}}),k=e.computed(()=>{switch(s.value){case"success":return y.CheckCircleIcon;case"error":case"not_supported":return y.ClearIcon;case"loading":return y.ProgressIcon;default:return y.EqualIcon}});return(x,i)=>{const b=e.resolveComponent("KSkeleton"),L=e.resolveComponent("KBadge"),N=e.resolveComponent("KTooltip");return e.openBlock(),e.createElementBlock("tr",null,[e.createElementVNode("td",null,e.toDisplayString(o.hostname),1),e.createElementVNode("td",M,[e.unref(l)==="not_supported"?(e.openBlock(),e.createElementBlock("span",K,e.toDisplayString(e.unref(a).t("log_level.not_applicable")),1)):e.unref(l)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("span",q,e.toDisplayString(e.unref(a).t(`log_level.${e.unref(l)}`)),1),e.unref(l)!==o.targetLogLevel?(e.openBlock(),e.createElementBlock("span",F,[i[0]||(i[0]=e.createTextVNode(" → ",-1)),e.createElementVNode("span",R,e.toDisplayString(e.unref(a).t(`log_level.${o.targetLogLevel}`)),1)])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(b,{key:1,type:"spinner"}))]),e.createElementVNode("td",H,[e.unref(r)?(e.openBlock(),e.createBlock(N,{key:0,text:e.unref(r)},{default:e.withCtx(()=>[e.createVNode(L,{appearance:c.value,class:"badge-cell"},{icon:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k.value)))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(u.value),1)]),_:1},8,["appearance"])]),_:1},8,["text"])):(e.openBlock(),e.createBlock(L,{key:1,appearance:c.value,class:"badge-cell"},{icon:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k.value)))]),default:e.withCtx(()=>[e.createTextVNode(" "+e.toDisplayString(u.value),1)]),_:1},8,["appearance"]))])])}}}),E=(o,t)=>{const n=o.__vccOpts||o;for(const[a,l]of t)n[a]=l;return n},O=E(j,[["__scopeId","data-v-a77ba884"]]),Q={class:"explanation-wrapper"},W={key:0,class:"warning-message","data-testid":"log-level-warning-message"},z={class:"revert-after-wrapper"},U={class:"time"},G={class:"seconds"},J={class:"formatted-time","data-testid":"log-level-timeout-formatted"},X={class:"data-plane-node-list","data-testid":"data-plane-node-list"},Y={class:"data-plane-node-col"},Z={class:"data-plane-node-col"},ee=E(e.defineComponent({name:"ChangeLogLevelModal",__name:"ChangeLogLevelModal",props:e.mergeModels({instanceList:{},instanceLogLevel:{},requests:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(o){const t=o,n=e.useModel(o,"visible"),a=h.Notice,{i18n:l}=_.useI18n(),s=e.ref("edit"),r=e.ref(a),g=e.ref("60"),c=e.computed(()=>Math.floor(Number(g.value))),u=e.computed(()=>t.instanceList.filter(f=>f.hasDLLCapability!==!1)),k=e.computed(()=>{const f=u.value.length===1?l.t("modal.change_log_level.summary_with_name",{name:u.value[0].hostname}):l.t("modal.change_log_level.summary_with_number",{number:`${u.value.length}`});return l.t("modal.change_log_level.title",{summary:f})}),x=e.computed(()=>s.value==="submitting"||isNaN(c.value)||c.value<=0||u.value.length===0),i=_.useLogLevelCandidateSelectItems({initialSelected:a}),b=_.useLogLevelExplanation(r),L=_.useFriendlyRevertTime(c),N=_.useAsyncScheduler(t.requests.scheduler===void 0?{maxConcurrentAsyncs:10}:t.requests.scheduler),{checkDataPlaneLogLevel:te}=_.useDataPlaneLogLevelChecker({getDataPlaneLogLevel:t.requests.getDataPlaneLogLevel,setDataPlaneLogLevel:t.requests.setDataPlaneLogLevel,requestExecutor:N.schedule}),v=new Map,ne=(f,p)=>{p===null?v.delete(f):v.set(f,p)},oe=async()=>{if(s.value!=="edit"){V();return}s.value="submitting";const f=Array.from(v.values()).map(p=>p.updateLogLevel(r.value,c.value));try{await Promise.all(f)}catch(p){console.error("Failed to update log level",p)}finally{s.value="submitted"}},V=()=>{n.value=!1,g.value="60",s.value="edit",r.value=a},ae=e.computed(()=>{switch(s.value){case"submitting":return l.t("modal.action_button.submitting");case"submitted":return l.t("modal.action_button.ok");default:return l.t("modal.action_button.confirm")}});return(f,p)=>{const le=e.resolveComponent("KSelect"),D=e.resolveComponent("KLabel"),re=e.resolveComponent("KInput"),se=e.resolveComponent("KModal");return e.openBlock(),e.createBlock(se,{"action-button-disabled":x.value,"action-button-text":ae.value,"data-testid":"change-log-level-modal","hide-cancel-button":!0,"hide-close-icon":s.value==="submitting","max-width":"640px",title:k.value,visible:n.value,onCancel:V,onProceed:oe},{default:e.withCtx(()=>[s.value==="edit"?(e.openBlock(),e.createBlock(le,{key:0,modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=m=>r.value=m),class:"log-level-select","data-testid":"log-level-select",items:e.unref(i),label:e.unref(l).t("modal.select_log_level_title")},null,8,["modelValue","items","label"])):e.createCommentVNode("",!0),e.createElementVNode("div",Q,[e.createVNode(D,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l).t(`log_level.${r.value}`)),1)]),_:1}),e.createElementVNode("div",null,e.toDisplayString(e.unref(b).explanation),1),e.unref(b).warning?(e.openBlock(),e.createElementBlock("div",W,e.toDisplayString(e.unref(b).warning),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",z,[e.createVNode(D,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l).t("modal.revert_to_default_after.label")),1)]),_:1}),e.createElementVNode("div",U,[e.createVNode(re,{modelValue:g.value,"onUpdate:modelValue":p[1]||(p[1]=m=>g.value=m),class:"time-input","data-testid":"log-level-timeout",disabled:s.value!=="edit",error:c.value<=0||isNaN(c.value),min:"1",type:"number"},null,8,["modelValue","disabled","error"]),e.createElementVNode("span",G,e.toDisplayString(e.unref(l).t("modal.revert_to_default_after.seconds")),1),e.createElementVNode("span",J,e.toDisplayString(e.unref(L)),1)])]),e.createElementVNode("table",X,[e.createElementVNode("thead",null,[e.createElementVNode("th",Y,e.toDisplayString(e.unref(l).t("modal.dp_list.header.host")),1),e.createElementVNode("th",Z,e.toDisplayString(e.unref(l).t("modal.dp_list.header.action")),1),e.createElementVNode("th",null,e.toDisplayString(e.unref(l).t("modal.dp_list.header.status")),1)]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.instanceList,m=>(e.openBlock(),e.createBlock(O,{key:m.id,ref_for:!0,ref:ce=>ne(m.id,ce),"check-log-level":e.unref(te),"data-plane-id":m.id,"data-testid":`data-plane-node-list-row-${m.id}`,"has-dll-capability":m.hasDLLCapability??!0,hostname:m.hostname,"log-level-hint":t.instanceLogLevel?.get(m.id),"target-log-level":r.value},null,8,["check-log-level","data-plane-id","data-testid","has-dll-capability","hostname","log-level-hint","target-log-level"]))),128))])])]),_:1},8,["action-button-disabled","action-button-text","hide-close-icon","title","visible"])}}}),[["__scopeId","data-v-74e820cf"]]);d.ChangeLogLevelModal=ee,d.LogLevel=h,d.composables=_,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(t,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@kong-ui-public/entities-shared"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/entities-shared","@kong-ui-public/i18n"],e):(t=typeof globalThis<"u"?globalThis:t||self,e(t["kong-ui-public-entities-data-plane-nodes"]={},t.Vue,t["kong-ui-public-entities-shared"],t["kong-ui-public-i18n"]))})(this,(function(t,e,v,h){"use strict";const L={modal:{title:"Change log level temporarily",description:"Choose how much information Kong Gateway writes to its logs. Changes automatically revert when the TTL expires.",log_level_label:"Log level",expiration:{label:"Expiration",tooltip:"The duration (in seconds) before the log level automatically reverts to its default value.",help:"Enter a value between 1 second and 1 hour (3,600 seconds)."},warning:"Higher log levels can significantly increase log volume and disk usage. Use them only while troubleshooting.",save:"Save",cancel:"Cancel"},log_level:{debug:"Debug",info:"Info",notice:"Notice",warn:"Warn",error:"Error",crit:"Critical"}};function w(){const o=h.createI18n("en-us",L);return{i18n:o,i18nT:h.i18nTComponent(o)}}const _={useI18n:w},E={logLevel:{konnect:{update:"/v2/control-planes/{controlPlaneId}/nodes/log-level-operations"},kongManager:{update:"/debug/cluster/data-planes/log-level-operations"}}};var g=(o=>(o.Debug="debug",o.Info="info",o.Notice="notice",o.Warn="warn",o.Error="error",o.Critical="crit",o))(g||{});const x=["debug","info","notice","warn","error","crit"],M={class:"change-log-level-modal-content"},V={class:"description"},k=600,I=((o,m)=>{const n=o.__vccOpts||o;for(const[f,d]of m)n[f]=d;return n})(e.defineComponent({name:"ChangeLogLevelModal",__name:"ChangeLogLevelModal",props:e.mergeModels({config:{},nodes:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:e.mergeModels(["success"],["update:visible"]),setup(o,{emit:m}){const n=o,f=m,d=e.useModel(o,"visible"),{i18n:l}=_.useI18n(),{axiosInstance:A}=v.useAxios(n.config.axiosRequestConfig),{getMessageFromError:N}=v.useErrors(),C=g.Notice,u=e.ref(C),s=e.ref(k),r=e.ref(!1),c=e.ref(""),T=e.computed(()=>x.map(i=>({label:l.t(`log_level.${i}`),value:i}))),y=e.computed(()=>Number.isInteger(s.value)&&s.value>=1&&s.value<=3600),U=i=>{let a=`${n.config.apiBaseUrl}${i}`;return n.config.app==="konnect"&&(a=a.replace(/{controlPlaneId}/gi,n.config.controlPlaneId)),a},B=async()=>{c.value="",r.value=!0;try{const i=U(E.logLevel[n.config.app].update),a={log_level:u.value,ttl:s.value,targets:{node_ids:n.nodes.map(p=>p.id)}};await A.post(i,a),f("success")}catch(i){c.value=N(i)}finally{r.value=!1}},K=()=>{d.value=!1,u.value=C,s.value=k,c.value=""};return(i,a)=>{const p=e.resolveComponent("KAlert"),S=e.resolveComponent("KSelect"),O=e.resolveComponent("KInput"),P=e.resolveComponent("KModal");return e.openBlock(),e.createBlock(P,{"action-button-disabled":r.value||!y.value||n.nodes.length===0,"action-button-text":e.unref(l).t("modal.save"),"cancel-button-disabled":r.value,"cancel-button-text":e.unref(l).t("modal.cancel"),"data-testid":"change-log-level-modal","hide-close-icon":r.value,"max-width":"640px",title:e.unref(l).t("modal.title"),visible:d.value,onCancel:K,onProceed:B},{default:e.withCtx(()=>[e.createElementVNode("div",M,[e.createElementVNode("p",V,e.toDisplayString(e.unref(l).t("modal.description")),1),e.createVNode(p,{appearance:"warning","data-testid":"log-level-warning",message:e.unref(l).t("modal.warning"),"show-icon":""},null,8,["message"]),e.createVNode(S,{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=b=>u.value=b),"data-testid":"log-level-select",items:T.value,"kpop-attributes":{"data-testid":"log-level-select-popover"},label:e.unref(l).t("modal.log_level_label")},null,8,["modelValue","items","label"]),e.createVNode(O,{modelValue:s.value,"onUpdate:modelValue":a[1]||(a[1]=b=>s.value=b),modelModifiers:{number:!0},"data-testid":"expiration-input",error:!y.value,help:e.unref(l).t("modal.expiration.help"),label:e.unref(l).t("modal.expiration.label"),"label-attributes":{info:e.unref(l).t("modal.expiration.tooltip"),tooltipAttributes:{maxWidth:"340px"}},max:"3600",min:"1",type:"number"},null,8,["modelValue","error","help","label","label-attributes"]),c.value?(e.openBlock(),e.createBlock(p,{key:0,appearance:"danger","data-testid":"log-level-error",message:c.value},null,8,["message"])):e.createCommentVNode("",!0)])]),_:1},8,["action-button-disabled","action-button-text","cancel-button-disabled","cancel-button-text","hide-close-icon","title","visible"])}}}),[["__scopeId","data-v-f6b55516"]]);t.ChangeLogLevelModal=I,t.LOG_LEVELS=x,t.LogLevel=g,t.composables=_,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
.change-log-level-modal-content[data-v-f6b55516]{display:flex;flex-direction:column;gap:20px;gap:var(--kui-space-70, 20px)}.change-log-level-modal-content .description[data-v-f6b55516]{color:#3a3f51;color:var(--kui-color-text-neutral-stronger, #3a3f51);margin:0}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { AsyncScheduler, AsyncSchedulerOptions } from '../composables';
|
|
1
|
+
import type { ChangeLogLevelConfig } from '../types';
|
|
3
2
|
type __VLS_Props = {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
config: ChangeLogLevelConfig;
|
|
4
|
+
nodes: Array<{
|
|
5
|
+
id: string;
|
|
6
|
+
hostname: string;
|
|
6
7
|
}>;
|
|
7
|
-
instanceLogLevel: Map<string, LogLevel>;
|
|
8
|
-
requests: {
|
|
9
|
-
scheduler?: AsyncScheduler | AsyncSchedulerOptions | null;
|
|
10
|
-
getDataPlaneLogLevel: (instanceId: string) => Promise<LogLevel>;
|
|
11
|
-
setDataPlaneLogLevel: (instanceId: string, logLevel: LogLevel, revertAfter: number) => Promise<void>;
|
|
12
|
-
};
|
|
13
8
|
};
|
|
14
9
|
type __VLS_ModelProps = {
|
|
15
10
|
'visible'?: boolean;
|
|
16
11
|
};
|
|
17
12
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
18
13
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
success: () => any;
|
|
19
15
|
"update:visible": (value: boolean | undefined) => any;
|
|
20
16
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
onSuccess?: (() => any) | undefined;
|
|
21
18
|
"onUpdate:visible"?: ((value: boolean | undefined) => any) | undefined;
|
|
22
19
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
23
20
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChangeLogLevelModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ChangeLogLevelModal.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChangeLogLevelModal.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ChangeLogLevelModal.vue"],"names":[],"mappings":"AA8JA,OAAO,KAAK,EAAE,oBAAoB,EAA4B,MAAM,UAAU,CAAA;AAM9E,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,oBAAoB,CAAA;IAC5B,KAAK,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC/C,CAAC;AAkEF,KAAK,gBAAgB,GAAG;IACxB,SAAS,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAKF,KAAK,iBAAiB,GAAG,WAAW,GAAG,gBAAgB,CAAC;AA4KxD,QAAA,MAAM,YAAY;;;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,28 +1,5 @@
|
|
|
1
1
|
import useI18n from './useI18n';
|
|
2
|
-
import * as useLogLevels from './useLogLevels';
|
|
3
|
-
import * as useAsyncScheduler from './useAsyncScheduler';
|
|
4
|
-
export type { AsyncScheduler, AsyncAbortException, AsyncSchedulerOptions, } from './useAsyncScheduler';
|
|
5
|
-
export type { LogLevelExplanation, DataPlaneLogLevel, } from './useLogLevels';
|
|
6
2
|
declare const _default: {
|
|
7
|
-
AsyncAbortException: typeof useAsyncScheduler.AsyncAbortException;
|
|
8
|
-
AsyncScheduler: typeof useAsyncScheduler.AsyncScheduler;
|
|
9
|
-
useAsyncScheduler: (opt: useAsyncScheduler.AsyncScheduler | useAsyncScheduler.AsyncSchedulerOptions | null) => useAsyncScheduler.AsyncScheduler;
|
|
10
|
-
supportedLevels: import("..").LogLevel[];
|
|
11
|
-
useLogLevelCandidateSelectItems: (opt?: {
|
|
12
|
-
initialSelected?: import("..").LogLevel;
|
|
13
|
-
disabled?: import("vue").MaybeRefOrGetter<import("..").LogLevel[]>;
|
|
14
|
-
}) => import("vue").ComputedRef<import("@kong/kongponents").SelectItem[]>;
|
|
15
|
-
useLogLevelExplanation: (level: import("vue").MaybeRefOrGetter<import("..").LogLevel>) => import("vue").ComputedRef<useLogLevels.LogLevelExplanation>;
|
|
16
|
-
useFriendlyRevertTime: (revertTime: import("vue").MaybeRefOrGetter<number>) => import("vue").ComputedRef<string>;
|
|
17
|
-
useDataPlaneLogLevelChecker: (opt: {
|
|
18
|
-
getDataPlaneLogLevel: (dataPlaneId: string) => Promise<import("..").LogLevel>;
|
|
19
|
-
setDataPlaneLogLevel: (dataPlaneId: string, level: import("..").LogLevel, revertAfter: number) => Promise<void>;
|
|
20
|
-
requestExecutor?: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
21
|
-
}) => {
|
|
22
|
-
checkDataPlaneLogLevel: (dataPlaneId: string, opt?: {
|
|
23
|
-
currentLogLevelHint?: import("vue").MaybeRefOrGetter<import("..").LogLevel | null>;
|
|
24
|
-
}) => useLogLevels.DataPlaneLogLevel;
|
|
25
|
-
};
|
|
26
3
|
useI18n: typeof useI18n;
|
|
27
4
|
};
|
|
28
5
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAA;;;;AAG/B,wBAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-plane-nodes-endpoints.d.ts","sourceRoot":"","sources":["../../src/data-plane-nodes-endpoints.ts"],"names":[],"mappings":";;;;;;;;;;AAGA,wBASC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
interface BaseChangeLogLevelConfig {
|
|
3
|
+
apiBaseUrl: string;
|
|
4
|
+
axiosRequestConfig?: AxiosRequestConfig;
|
|
5
|
+
}
|
|
6
|
+
export interface KonnectChangeLogLevelConfig extends BaseChangeLogLevelConfig {
|
|
7
|
+
app: 'konnect';
|
|
8
|
+
controlPlaneId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface KongManagerChangeLogLevelConfig extends BaseChangeLogLevelConfig {
|
|
11
|
+
app: 'kongManager';
|
|
12
|
+
}
|
|
13
|
+
export type ChangeLogLevelConfig = KonnectChangeLogLevelConfig | KongManagerChangeLogLevelConfig;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAE/C,UAAU,wBAAwB;IAChC,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;CACxC;AAED,MAAM,WAAW,2BAA4B,SAAQ,wBAAwB;IAC3E,GAAG,EAAE,SAAS,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,+BAAgC,SAAQ,wBAAwB;IAC/E,GAAG,EAAE,aAAa,CAAA;CACnB;AAED,MAAM,MAAM,oBAAoB,GAAG,2BAA2B,GAAG,+BAA+B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare
|
|
1
|
+
export declare enum LogLevel {
|
|
2
2
|
Debug = "debug",
|
|
3
3
|
Info = "info",
|
|
4
4
|
Notice = "notice",
|
|
@@ -6,4 +6,12 @@ export declare const enum LogLevel {
|
|
|
6
6
|
Error = "error",
|
|
7
7
|
Critical = "crit"
|
|
8
8
|
}
|
|
9
|
+
export declare const LOG_LEVELS: LogLevel[];
|
|
10
|
+
export interface LogLevelOperationPayload {
|
|
11
|
+
log_level: LogLevel;
|
|
12
|
+
ttl: number;
|
|
13
|
+
targets: {
|
|
14
|
+
node_ids: string[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
9
17
|
//# sourceMappingURL=log-level.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-level.d.ts","sourceRoot":"","sources":["../../../src/types/log-level.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"log-level.d.ts","sourceRoot":"","sources":["../../../src/types/log-level.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,QAAQ,SAAS;CAClB;AAGD,eAAO,MAAM,UAAU,EAAE,QAAQ,EAOhC,CAAA;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,QAAQ,CAAA;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,EAAE,CAAA;KAAE,CAAA;CAChC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kong-ui-public/entities-data-plane-nodes",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/entities-data-plane-nodes.umd.js",
|
|
6
6
|
"module": "./dist/entities-data-plane-nodes.es.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"axios": "^1.16.1",
|
|
27
27
|
"vue": ">= 3.3.13 < 4",
|
|
28
28
|
"vue-router": "^4.6.4 || ^5.0.6",
|
|
29
|
-
"@kong-ui-public/entities-shared": "^3.57.
|
|
29
|
+
"@kong-ui-public/entities-shared": "^3.57.10",
|
|
30
30
|
"@kong-ui-public/i18n": "^2.5.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"axios": "^1.17.0",
|
|
37
37
|
"vue": "^3.5.35",
|
|
38
38
|
"vue-router": "^5.1.0",
|
|
39
|
-
"@kong-ui-public/
|
|
40
|
-
"@kong-ui-public/
|
|
39
|
+
"@kong-ui-public/i18n": "^2.5.0",
|
|
40
|
+
"@kong-ui-public/entities-shared": "^3.57.10"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"type": "git",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import composables from '../composables';
|
|
2
|
-
import type { LogLevel } from '../types';
|
|
3
|
-
type __VLS_Props = {
|
|
4
|
-
dataPlaneId: string;
|
|
5
|
-
hostname: string;
|
|
6
|
-
hasDllCapability: boolean;
|
|
7
|
-
targetLogLevel: LogLevel;
|
|
8
|
-
checkLogLevel: ReturnType<typeof composables.useDataPlaneLogLevelChecker>['checkDataPlaneLogLevel'];
|
|
9
|
-
logLevelHint?: LogLevel | null;
|
|
10
|
-
};
|
|
11
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
12
|
-
updateLogLevel: (level: LogLevel, revertAfter: number) => Promise<void>;
|
|
13
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
16
|
-
//# sourceMappingURL=CLLModalNodeRow.vue.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CLLModalNodeRow.vue.d.ts","sourceRoot":"","sources":["../../../src/components/CLLModalNodeRow.vue"],"names":[],"mappings":"AA2JA,OAAO,WAAW,MAAM,gBAAgB,CAAA;AAKxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAIxC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,gBAAgB,EAAE,OAAO,CAAA;IACzB,cAAc,EAAE,QAAQ,CAAA;IACxB,aAAa,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,2BAA2B,CAAC,CAAC,wBAAwB,CAAC,CAAA;IACnG,YAAY,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAA;CAC/B,CAAC;AAuNF,QAAA,MAAM,YAAY;;oPAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare class AsyncAbortException extends Error {
|
|
2
|
-
constructor(message?: string, options?: ErrorOptions);
|
|
3
|
-
}
|
|
4
|
-
export type AsyncSchedulerOptions = {
|
|
5
|
-
maxConcurrentAsyncs: number;
|
|
6
|
-
};
|
|
7
|
-
export declare class AsyncScheduler {
|
|
8
|
-
private tokenBucket;
|
|
9
|
-
constructor(opt: AsyncSchedulerOptions);
|
|
10
|
-
schedule: <T>(asyncInitiator: () => Promise<T>) => Promise<T>;
|
|
11
|
-
cancelAll: (message?: string, options?: ErrorOptions) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare const useAsyncScheduler: (opt: AsyncScheduler | AsyncSchedulerOptions | null) => AsyncScheduler;
|
|
14
|
-
//# sourceMappingURL=useAsyncScheduler.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAsyncScheduler.d.ts","sourceRoot":"","sources":["../../../src/composables/useAsyncScheduler.ts"],"names":[],"mappings":"AAgEA,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIrD;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,mBAAmB,EAAE,MAAM,CAAA;CAC5B,CAAA;AAED,qBAAa,cAAc;IACzB,OAAO,CAAC,WAAW,CAA2B;gBAElC,GAAG,EAAE,qBAAqB;IAMtC,QAAQ,GAAU,CAAC,EAAE,gBAAgB,MAAM,OAAO,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAAC,CAajE;IAED,SAAS,GAAI,UAAU,MAAM,EAAE,UAAU,YAAY,UAEpD;CACF;AAED,eAAO,MAAM,iBAAiB,GAAI,KAAK,cAAc,GAAG,qBAAqB,GAAG,IAAI,mBAQnF,CAAA"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { LogLevel } from '../types';
|
|
2
|
-
import type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
3
|
-
import type { SelectItem } from '@kong/kongponents';
|
|
4
|
-
export declare const supportedLevels: LogLevel[];
|
|
5
|
-
export declare const useLogLevelCandidateSelectItems: (opt?: {
|
|
6
|
-
initialSelected?: LogLevel;
|
|
7
|
-
disabled?: MaybeRefOrGetter<LogLevel[]>;
|
|
8
|
-
}) => ComputedRef<SelectItem[]>;
|
|
9
|
-
export type LogLevelExplanation = {
|
|
10
|
-
explanation: string;
|
|
11
|
-
warning?: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const useLogLevelExplanation: (level: MaybeRefOrGetter<LogLevel>) => ComputedRef<LogLevelExplanation>;
|
|
14
|
-
export declare const useFriendlyRevertTime: (revertTime: MaybeRefOrGetter<number>) => ComputedRef<string>;
|
|
15
|
-
export type DataPlaneLogLevel = {
|
|
16
|
-
currentLogLevel: Ref<LogLevel | null>;
|
|
17
|
-
updateStatus: Ref<'pending' | 'success' | 'error' | 'loading'>;
|
|
18
|
-
updateErrorMessage: Ref<string | null>;
|
|
19
|
-
updateLogLevel: (level: LogLevel, revertAfter: number) => Promise<void>;
|
|
20
|
-
};
|
|
21
|
-
export declare const useDataPlaneLogLevelChecker: (opt: {
|
|
22
|
-
getDataPlaneLogLevel: (dataPlaneId: string) => Promise<LogLevel>;
|
|
23
|
-
setDataPlaneLogLevel: (dataPlaneId: string, level: LogLevel, revertAfter: number) => Promise<void>;
|
|
24
|
-
requestExecutor?: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
25
|
-
}) => {
|
|
26
|
-
checkDataPlaneLogLevel: (dataPlaneId: string, opt?: {
|
|
27
|
-
currentLogLevelHint?: MaybeRefOrGetter<LogLevel | null>;
|
|
28
|
-
}) => DataPlaneLogLevel;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=useLogLevels.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLogLevels.d.ts","sourceRoot":"","sources":["../../../src/composables/useLogLevels.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAInC,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC7D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,eAAO,MAAM,eAAe,EAAE,QAAQ,EAOrC,CAAA;AAED,eAAO,MAAM,+BAA+B,GAAI,MAAM;IACpD,eAAe,CAAC,EAAE,QAAQ,CAAA;IAC1B,QAAQ,CAAC,EAAE,gBAAgB,CAAC,QAAQ,EAAE,CAAC,CAAA;CACxC,KAAG,WAAW,CAAC,UAAU,EAAE,CAa3B,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAC3E,eAAO,MAAM,sBAAsB,GAAI,OAAO,gBAAgB,CAAC,QAAQ,CAAC,KAAG,WAAW,CAAC,mBAAmB,CAazG,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,YAAY,gBAAgB,CAAC,MAAM,CAAC,KAAG,WAAW,CAAC,MAAM,CAyB9F,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;IACrC,YAAY,EAAE,GAAG,CAAC,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC,CAAA;IAC9D,kBAAkB,EAAE,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC,CAAA;IACtC,cAAc,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACxE,CAAA;AAED,eAAO,MAAM,2BAA2B,GAAI,KAAK;IAC/C,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IAChE,oBAAoB,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAClG,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAA;CAC1D;0CAM8C,MAAM,QAAQ;QACzD,mBAAmB,CAAC,EAAE,gBAAgB,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAA;KACxD,KAAG,iBAAiB;CA6CtB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-planes.d.ts","sourceRoot":"","sources":["../../../src/fixtures/data-planes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAEnD,eAAO,MAAM,aAAa,QAAO,mBAGhC,CAAA"}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export interface DataPlaneNodeCommon {
|
|
2
|
-
id: string;
|
|
3
|
-
hostname: string;
|
|
4
|
-
}
|
|
5
|
-
export interface KonnectRuntimeInstance extends DataPlaneNodeCommon {
|
|
6
|
-
version: string;
|
|
7
|
-
last_ping: number;
|
|
8
|
-
type: string;
|
|
9
|
-
created_at: number;
|
|
10
|
-
updated_at: number;
|
|
11
|
-
config_hash: string;
|
|
12
|
-
compatibility_status: {
|
|
13
|
-
state: string;
|
|
14
|
-
issues?: Array<{
|
|
15
|
-
affected_resources: Array<{
|
|
16
|
-
id: string;
|
|
17
|
-
type: string;
|
|
18
|
-
}>;
|
|
19
|
-
code: string;
|
|
20
|
-
description: string;
|
|
21
|
-
documentation_url: string;
|
|
22
|
-
resolution: string;
|
|
23
|
-
severity: string;
|
|
24
|
-
}>;
|
|
25
|
-
config_hash?: string;
|
|
26
|
-
};
|
|
27
|
-
data_plane_cert_id: string;
|
|
28
|
-
labels?: Record<string, string>;
|
|
29
|
-
process_conf: {
|
|
30
|
-
plugins: string[];
|
|
31
|
-
cluster_max_payload: number;
|
|
32
|
-
lmdb_map_size: string;
|
|
33
|
-
router_flavor: string;
|
|
34
|
-
};
|
|
35
|
-
connection_state: {
|
|
36
|
-
is_connected: boolean;
|
|
37
|
-
};
|
|
38
|
-
errors?: Array<{
|
|
39
|
-
name: string;
|
|
40
|
-
config_hash: string;
|
|
41
|
-
flattened_errors: Array<{
|
|
42
|
-
entity_id: string;
|
|
43
|
-
entity_name: string;
|
|
44
|
-
errors: Array<{
|
|
45
|
-
error_message: string;
|
|
46
|
-
type: string;
|
|
47
|
-
field: string;
|
|
48
|
-
}>;
|
|
49
|
-
entity_type: string;
|
|
50
|
-
}>;
|
|
51
|
-
code: number;
|
|
52
|
-
source: string;
|
|
53
|
-
}>;
|
|
54
|
-
connected?: string;
|
|
55
|
-
total_traffic: number | null;
|
|
56
|
-
error_rate: number | null;
|
|
57
|
-
status?: string;
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=data-plane-node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"data-plane-node.d.ts","sourceRoot":"","sources":["../../../src/types/data-plane-node.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,CAAA;IACnB,oBAAoB,EAAE;QACpB,KAAK,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,KAAK,CAAC;YACb,kBAAkB,EAAE,KAAK,CAAC;gBACxB,EAAE,EAAE,MAAM,CAAA;gBACV,IAAI,EAAE,MAAM,CAAA;aACb,CAAC,CAAA;YACF,IAAI,EAAE,MAAM,CAAA;YACZ,WAAW,EAAE,MAAM,CAAA;YACnB,iBAAiB,EAAE,MAAM,CAAA;YACzB,UAAU,EAAE,MAAM,CAAA;YAClB,QAAQ,EAAE,MAAM,CAAA;SACjB,CAAC,CAAA;QACF,WAAW,CAAC,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,YAAY,EAAE;QACZ,OAAO,EAAE,MAAM,EAAE,CAAA;QACjB,mBAAmB,EAAE,MAAM,CAAA;QAC3B,aAAa,EAAE,MAAM,CAAA;QACrB,aAAa,EAAE,MAAM,CAAA;KACtB,CAAA;IACD,gBAAgB,EAAE;QAChB,YAAY,EAAE,OAAO,CAAA;KACtB,CAAA;IACD,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,gBAAgB,EAAE,KAAK,CAAC;YACtB,SAAS,EAAE,MAAM,CAAA;YACjB,WAAW,EAAE,MAAM,CAAA;YACnB,MAAM,EAAE,KAAK,CAAC;gBACZ,aAAa,EAAE,MAAM,CAAA;gBACrB,IAAI,EAAE,MAAM,CAAA;gBACZ,KAAK,EAAE,MAAM,CAAA;aACd,CAAC,CAAA;YACF,WAAW,EAAE,MAAM,CAAA;SACpB,CAAC,CAAA;QACF,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;KACf,CAAC,CAAA;IACF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|