@jfvilas/plugin-kwirth-log 0.12.2 → 0.12.4
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 +10 -2
- package/dist/api/KwirthLogClient.esm.js +3 -3
- package/dist/api/KwirthLogClient.esm.js.map +1 -1
- package/dist/assets/kwirth-log-component-not-found.svg +26 -28
- package/dist/assets/kwirthlog-logo.svg +13 -17
- package/dist/components/ComponentNotFound/ComponentNotFound.esm.js +5 -5
- package/dist/components/ComponentNotFound/ComponentNotFound.esm.js.map +1 -1
- package/dist/components/EntityKwirthLogContent/EntityKwirthLogContent.esm.js +1 -4
- package/dist/components/EntityKwirthLogContent/EntityKwirthLogContent.esm.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -58,7 +58,8 @@ For Kwirth plugin to be usable on the frontend, you must tailor your Entity Page
|
|
|
58
58
|
Firstly, import the plugin module.
|
|
59
59
|
```typescript
|
|
60
60
|
// In packages/app/src/components/catalog/EntityPage.tsx
|
|
61
|
-
import { EntityKwirthLogContent
|
|
61
|
+
import { EntityKwirthLogContent } from '@jfvilas/plugin-kwirth-log';
|
|
62
|
+
import { isKwirthAvailable } from '@jfvilas/plugin-kwirth-common';
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
Then, add a tab to your EntityPage (the 'if' is optional, you can keep the 'KwirthLog' tab always visible if you prefer to do it that way).
|
|
@@ -119,7 +120,11 @@ When you access the tab, if you have not yet tagged your entities you would see
|
|
|
119
120
|
|
|
120
121
|

|
|
121
122
|
|
|
122
|
-
|
|
123
|
+
But, if the component is found on some of the clusters configured in Backstage, your screen will look like following one, showing some cluster that can be selected and some others that can't.
|
|
124
|
+
|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
Once you tagged your entities and your Kubernetes objects correctly, you should see something similar to this:
|
|
123
128
|
|
|
124
129
|

|
|
125
130
|
|
|
@@ -146,3 +151,6 @@ The icons will light up in its corresponding color when a new message arrives.
|
|
|
146
151
|
|
|
147
152
|
This is how it feels:
|
|
148
153
|

|
|
154
|
+
|
|
155
|
+
If you click on one of the status icons when theyr are enableds (coloured), you will see the detail of the status.
|
|
156
|
+

|
|
@@ -12,7 +12,7 @@ class KwirthLogClient {
|
|
|
12
12
|
*/
|
|
13
13
|
async getVersion() {
|
|
14
14
|
try {
|
|
15
|
-
const baseUrl = await this.discoveryApi.getBaseUrl("
|
|
15
|
+
const baseUrl = await this.discoveryApi.getBaseUrl("kwirth");
|
|
16
16
|
const targetUrl = `${baseUrl}/version`;
|
|
17
17
|
const result = await this.fetchApi.fetch(targetUrl);
|
|
18
18
|
const data = await result.json();
|
|
@@ -26,7 +26,7 @@ class KwirthLogClient {
|
|
|
26
26
|
}
|
|
27
27
|
async getResources(entity) {
|
|
28
28
|
try {
|
|
29
|
-
const baseUrl = await this.discoveryApi.getBaseUrl("
|
|
29
|
+
const baseUrl = await this.discoveryApi.getBaseUrl("kwirth");
|
|
30
30
|
const targetUrl = `${baseUrl}/start`;
|
|
31
31
|
var payload = JSON.stringify(entity);
|
|
32
32
|
const result = await this.fetchApi.fetch(targetUrl, { method: "POST", body: payload, headers: { "Content-Type": "application/json" } });
|
|
@@ -41,7 +41,7 @@ class KwirthLogClient {
|
|
|
41
41
|
}
|
|
42
42
|
async requestAccess(entity, channel, scopes) {
|
|
43
43
|
try {
|
|
44
|
-
const baseUrl = await this.discoveryApi.getBaseUrl("
|
|
44
|
+
const baseUrl = await this.discoveryApi.getBaseUrl("kwirth");
|
|
45
45
|
var targetUrl = new URL(`${baseUrl}/access`);
|
|
46
46
|
targetUrl.searchParams.append("scopes", scopes.join(","));
|
|
47
47
|
targetUrl.searchParams.append("channel", channel);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KwirthLogClient.esm.js","sources":["../../src/api/KwirthLogClient.ts"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api'\r\nimport { KwirthLogApi } from './types'\r\nimport { Entity } from '@backstage/catalog-model'\r\nimport { ClusterValidPods } from '@jfvilas/plugin-kwirth-common'\r\nimport { InstanceConfigScopeEnum } from '@jfvilas/kwirth-common'\r\n\r\nexport interface KwirthLogClientOptions {\r\n discoveryApi: DiscoveryApi\r\n fetchApi: FetchApi\r\n}\r\n\r\nexport class KwirthLogClient implements KwirthLogApi {\r\n private readonly discoveryApi: DiscoveryApi\r\n private readonly fetchApi: FetchApi\r\n\r\n constructor(options: KwirthLogClientOptions) {\r\n this.discoveryApi = options.discoveryApi\r\n this.fetchApi = options.fetchApi\r\n }\r\n\r\n /**\r\n * \r\n * @param entity \r\n * @returns an array of clusters (with their correpsonding info) and a pod list for each, where the entity has been dicovered\r\n */\r\n async getVersion(): Promise<string> {\r\n try {\r\n const baseUrl = await this.discoveryApi.getBaseUrl('
|
|
1
|
+
{"version":3,"file":"KwirthLogClient.esm.js","sources":["../../src/api/KwirthLogClient.ts"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api'\r\nimport { KwirthLogApi } from './types'\r\nimport { Entity } from '@backstage/catalog-model'\r\nimport { ClusterValidPods } from '@jfvilas/plugin-kwirth-common'\r\nimport { InstanceConfigScopeEnum } from '@jfvilas/kwirth-common'\r\n\r\nexport interface KwirthLogClientOptions {\r\n discoveryApi: DiscoveryApi\r\n fetchApi: FetchApi\r\n}\r\n\r\nexport class KwirthLogClient implements KwirthLogApi {\r\n private readonly discoveryApi: DiscoveryApi\r\n private readonly fetchApi: FetchApi\r\n\r\n constructor(options: KwirthLogClientOptions) {\r\n this.discoveryApi = options.discoveryApi\r\n this.fetchApi = options.fetchApi\r\n }\r\n\r\n /**\r\n * \r\n * @param entity \r\n * @returns an array of clusters (with their correpsonding info) and a pod list for each, where the entity has been dicovered\r\n */\r\n async getVersion(): Promise<string> {\r\n try {\r\n const baseUrl = await this.discoveryApi.getBaseUrl('kwirth')\r\n const targetUrl = `${baseUrl}/version`\r\n\r\n const result = await this.fetchApi.fetch(targetUrl)\r\n const data = await result.json()\r\n\r\n if (!result.ok) {\r\n throw new Error(`getVersion error: not ok`)\r\n }\r\n return data.version\r\n }\r\n catch (err) {\r\n throw new Error(`getVersion error: ${err}`)\r\n }\r\n }\r\n\r\n async getResources(entity:Entity): Promise<ClusterValidPods> {\r\n try {\r\n const baseUrl = await this.discoveryApi.getBaseUrl('kwirth')\r\n const targetUrl = `${baseUrl}/start`\r\n\r\n var payload=JSON.stringify(entity)\r\n const result = await this.fetchApi.fetch(targetUrl, {method:'POST', body:payload, headers:{'Content-Type':'application/json'}})\r\n const data = await result.json() as ClusterValidPods\r\n\r\n if (!result.ok) {\r\n throw new Error(`getResources error: not ok`)\r\n }\r\n return data\r\n }\r\n catch (err) {\r\n throw new Error(`getResources error: ${err}`)\r\n }\r\n }\r\n\r\n async requestAccess(entity:Entity, channel:string, scopes:InstanceConfigScopeEnum[]): Promise<ClusterValidPods[]> {\r\n try {\r\n const baseUrl = await this.discoveryApi.getBaseUrl('kwirth')\r\n var targetUrl:URL= new URL (`${baseUrl}/access`)\r\n targetUrl.searchParams.append('scopes',scopes.join(',')) //+++ poner mas elegante\r\n targetUrl.searchParams.append('channel',channel)\r\n\r\n var payload=JSON.stringify(entity)\r\n const result = await this.fetchApi.fetch(targetUrl, {method:'POST', body:payload, headers:{'Content-Type':'application/json'}})\r\n const data = await result.json() as ClusterValidPods[]\r\n\r\n // we reconstruct the 'Map' from string of arrays\r\n for (var c of data) {\r\n c.accessKeys = new Map(JSON.parse(((c as any).accessKeys)))\r\n }\r\n if (!result.ok) {\r\n throw new Error(`requestAccess error: not ok`)\r\n }\r\n return data\r\n }\r\n catch (err) {\r\n throw new Error(`requestAccess error: ${err}`)\r\n }\r\n }\r\n\r\n}\r\n"],"names":[],"mappings":"AA0BO,MAAM,eAAwC,CAAA;AAAA,EAChC,YAAA;AAAA,EACA,QAAA;AAAA,EAEjB,YAAY,OAAiC,EAAA;AACzC,IAAA,IAAA,CAAK,eAAe,OAAQ,CAAA,YAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAQ,CAAA,QAAA;AAAA;AAC5B;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,UAA8B,GAAA;AAChC,IAAI,IAAA;AACA,MAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,YAAA,CAAa,WAAW,QAAQ,CAAA;AAC3D,MAAM,MAAA,SAAA,GAAY,GAAG,OAAO,CAAA,QAAA,CAAA;AAE5B,MAAA,MAAM,MAAS,GAAA,MAAM,IAAK,CAAA,QAAA,CAAS,MAAM,SAAS,CAAA;AAClD,MAAM,MAAA,IAAA,GAAO,MAAM,MAAA,CAAO,IAAK,EAAA;AAE/B,MAAI,IAAA,CAAC,OAAO,EAAI,EAAA;AACZ,QAAM,MAAA,IAAI,MAAM,CAA0B,wBAAA,CAAA,CAAA;AAAA;AAE9C,MAAA,OAAO,IAAK,CAAA,OAAA;AAAA,aAET,GAAK,EAAA;AAC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,CAAA,SAAA,EAAU,OAAO,CAAA;AAE/C,MAAI,IAAA,OAAA,GAAQ,IAAK,CAAA,SAAA,CAAU,MAAM,CAAA;AACjC,MAAA,MAAM,SAAS,MAAM,IAAA,CAAK,QAAS,CAAA,KAAA,CAAM,WAAW,EAAC,MAAA,EAAO,MAAQ,EAAA,IAAA,EAAK,SAAS,OAAQ,EAAA,EAAC,cAAe,EAAA,kBAAA,IAAoB,CAAA;AAC9H,MAAM,MAAA,IAAA,GAAO,MAAM,MAAA,CAAO,IAAK,EAAA;AAG/B,MAAA,KAAA,IAAS,KAAK,IAAM,EAAA;AAChB,QAAA,CAAA,CAAE,aAAa,IAAI,GAAA,CAAI,KAAK,KAAQ,CAAA,CAAA,CAAU,UAAW,CAAC,CAAA;AAAA;AAE9D,MAAI,IAAA,CAAC,OAAO,EAAI,EAAA;AACZ,QAAM,MAAA,IAAI,MAAM,CAA6B,2BAAA,CAAA,CAAA;AAAA;AAEjD,MAAO,OAAA,IAAA;AAAA,aAEJ,GAAK,EAAA;AACR,MAAA,MAAM,IAAI,KAAA,CAAM,CAAwB,qBAAA,EAAA,GAAG,CAAE,CAAA,CAAA;AAAA;AACjD;AAGR;;;;"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<path d="M 53.459 61.827 L 24.736 61.827 C 24.362 61.827 24.059 61.38 24.059 60.827 C 24.059 60.274 24.362 59.827 24.736 59.827 L 53.459 59.827 C 53.833 59.827 54.136 60.274 54.136 60.827 C 54.136 61.38 53.833 61.827 53.459 61.827 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(172, 172, 172);" stroke-linecap="round"/>
|
|
17
|
-
<path d="M 58.371 72.909 L 24.849 72.909 C 24.413 72.909 24.059 72.462 24.059 71.909 C 24.059 71.356 24.413 70.909 24.849 70.909 L 58.371 70.909 C 58.808 70.909 59.161 71.356 59.161 71.909 C 59.161 72.462 58.808 72.909 58.371 72.909 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(172, 172, 172);" stroke-linecap="round"/>
|
|
18
|
-
<path d="M 61.849 56.286 L 24.929 56.286 C 24.449 56.286 24.059 55.839 24.059 55.286 C 24.059 54.733 24.449 54.286 24.929 54.286 L 61.849 54.286 C 62.33 54.286 62.719 54.733 62.719 55.286 C 62.719 55.839 62.33 56.286 61.849 56.286 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(172, 172, 172);" stroke-linecap="round"/>
|
|
19
|
-
<path d="M 59.387 83.993 L 24.873 83.993 C 24.424 83.993 24.059 83.546 24.059 82.993 C 24.059 82.44 24.424 81.993 24.873 81.993 L 59.387 81.993 C 59.837 81.993 60.201 82.44 60.201 82.993 C 60.201 83.546 59.837 83.993 59.387 83.993 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(172, 172, 172);" stroke-linecap="round"/>
|
|
20
|
-
</g>
|
|
21
|
-
<text style="fill: rgb(172, 172, 172); font-family: Consolas; font-size: 34px; font-weight: 700; stroke-miterlimit: 10; stroke-width: 0px; white-space: pre;" x="114.293" y="147.365">Kubelog</text>
|
|
22
|
-
<g transform="matrix(2.81, 0, 0, 2.81, 46.879719, -88.482063)" style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;">
|
|
1
|
+
<svg viewBox="0 0 340 260" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
|
|
2
|
+
<defs>
|
|
3
|
+
<bx:export>
|
|
4
|
+
<bx:file format="svg" excluded="true"></bx:file>
|
|
5
|
+
</bx:export>
|
|
6
|
+
</defs>
|
|
7
|
+
<rect style="fill-rule: nonzero; stroke: rgb(255, 255, 255); stroke-width: 0px; fill: rgb(230, 230, 230); transform-origin: 249.688px 205.227px;" transform="matrix(0.985765, -0.168131, 0.16314, 0.986616, -77.831916, -137.432801)" x="110.342" y="192.327" width="278.691" height="25.801" rx="12.015" ry="12.015"></rect>
|
|
8
|
+
<rect style="fill-rule: nonzero; stroke: rgb(255, 255, 255); stroke-width: 0px; fill: rgb(230, 230, 230); transform-origin: 182.174px 205.227px;" transform="matrix(0.985765, -0.168131, 0.16314, 0.986616, 10.429543, -115.974055)" x="80.507" y="192.327" width="203.336" height="25.801" rx="12.015" ry="12.015"></rect>
|
|
9
|
+
<rect style="fill-rule: nonzero; stroke: rgb(255, 255, 255); stroke-width: 0px; fill: rgb(230, 230, 230); transform-origin: 231.862px 205.227px;" transform="matrix(0.985765, -0.168131, 0.16314, 0.986616, -102.201054, -155.610408)" x="102.464" y="192.327" width="258.794" height="25.801" rx="12.015" ry="12.015"></rect>
|
|
10
|
+
<rect style="fill-rule: nonzero; stroke: rgb(255, 255, 255); stroke-width: 0px; fill: rgb(230, 230, 230); transform-origin: 291.228px 205.227px;" transform="matrix(0.985765, -0.168131, 0.16314, 0.986616, -113.546488, -27.809602)" x="128.7" y="192.327" width="325.056" height="25.801" rx="12.015" ry="12.015"></rect>
|
|
11
|
+
<rect style="fill-rule: nonzero; stroke: rgb(255, 255, 255); stroke-width: 0px; fill: rgb(230, 230, 230); transform-origin: 228.554px 205.227px;" transform="matrix(0.985765, -0.168131, 0.16314, 0.986616, -50.714188, -2.839044)" x="101.002" y="192.327" width="255.103" height="25.801" rx="12.015" ry="12.015"></rect>
|
|
12
|
+
<rect style="fill-rule: nonzero; stroke: rgb(255, 255, 255); stroke-width: 0px; fill: rgb(230, 230, 230); transform-origin: 231.862px 205.227px;" transform="matrix(0.985765, -0.168131, 0.16314, 0.986616, -73.522724, -49.884953)" x="102.464" y="192.327" width="258.794" height="25.801" rx="12.015" ry="12.015"></rect>
|
|
13
|
+
<path style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: medium; line-height: normal; font-family: sans-serif; font-feature-settings: normal; text-indent: 0px; text-align: start; text-decoration: none solid rgb(0, 0, 0); letter-spacing: normal; word-spacing: normal; text-transform: none; writing-mode: lr-tb; direction: ltr; text-orientation: mixed; dominant-baseline: auto; baseline-shift: baseline; text-anchor: start; white-space: normal; clip-rule: nonzero; display: inline; overflow: visible; visibility: visible; opacity: 1; isolation: auto; mix-blend-mode: normal; color-interpolation: srgb; color-interpolation-filters: linearrgb; vector-effect: none; fill: rgb(255, 255, 255); fill-opacity: 1; fill-rule: evenodd; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0; stroke-opacity: 1; color-rendering: auto; image-rendering: auto; shape-rendering: auto; text-rendering: auto; paint-order: fill; stroke-width: 9px; stroke: rgb(74, 74, 74);" d="M 90.279 31.639 L 236.352 31.639 L 236.352 225.458 L 90.279 225.458 L 90.279 31.639 Z" id="path3310"></path>
|
|
14
|
+
<g id="g3330" transform="matrix(0.441209, 0, 0, 0.468545, -799.76062, -5194.109863)">
|
|
15
|
+
<g transform="matrix(6.103682, 0, 0, 5.928513, 1904.565796, 10952.352539)">
|
|
23
16
|
<g>
|
|
24
|
-
<path d="M 68.066 63.
|
|
25
|
-
<path d="M 54.048 57.
|
|
26
|
-
<path d="M 58.96 69.
|
|
27
|
-
<path d="M 50.623
|
|
28
|
-
<path d="M 56.366 45.
|
|
17
|
+
<path d="M 68.066 63.636 L 25.648 63.636 C 25.096 63.636 24.648 63.189 24.648 62.636 C 24.648 62.083 25.096 61.636 25.648 61.636 L 68.066 61.636 C 68.619 61.636 69.066 62.083 69.066 62.636 C 69.066 63.189 68.619 63.636 68.066 63.636 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
18
|
+
<path d="M 54.048 57.677 L 25.325 57.677 C 24.951 57.677 24.648 57.23 24.648 56.677 C 24.648 56.124 24.951 55.677 25.325 55.677 L 54.048 55.677 C 54.422 55.677 54.725 56.124 54.725 56.677 C 54.725 57.23 54.422 57.677 54.048 57.677 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
19
|
+
<path d="M 58.96 69.595 L 25.438 69.595 C 25.002 69.595 24.648 69.148 24.648 68.595 C 24.648 68.042 25.002 67.595 25.438 67.595 L 58.96 67.595 C 59.397 67.595 59.75 68.042 59.75 68.595 C 59.75 69.148 59.397 69.595 58.96 69.595 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
20
|
+
<path d="M 50.623 51.718 L 25.246 51.718 C 24.916 51.718 24.648 51.271 24.648 50.718 C 24.648 50.165 24.916 49.718 25.246 49.718 L 50.623 49.718 C 50.953 49.718 51.221 50.165 51.221 50.718 C 51.221 51.271 50.953 51.718 50.623 51.718 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
21
|
+
<path d="M 56.366 45.759 L 25.378 45.759 C 24.975 45.759 24.648 45.312 24.648 44.759 C 24.648 44.206 24.975 43.759 25.378 43.759 L 56.366 43.759 C 56.77 43.759 57.097 44.206 57.097 44.759 C 57.097 45.312 56.77 45.759 56.366 45.759 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
22
|
+
<path d="M 54.048 75.556 L 25.325 75.556 C 24.951 75.556 24.648 75.109 24.648 74.556 C 24.648 74.003 24.951 73.556 25.325 73.556 L 54.048 73.556 C 54.422 73.556 54.725 74.003 54.725 74.556 C 54.725 75.109 54.422 75.556 54.048 75.556 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
23
|
+
<path d="M 50.623 98.363 L 25.246 98.363 C 24.916 98.363 24.648 97.916 24.648 97.363 C 24.648 96.81 24.916 96.363 25.246 96.363 L 50.623 96.363 C 50.953 96.363 51.221 96.81 51.221 97.363 C 51.221 97.916 50.953 98.363 50.623 98.363 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
24
|
+
<path d="M 56.366 92.082 L 25.378 92.082 C 24.975 92.082 24.648 91.635 24.648 91.082 C 24.648 90.529 24.975 90.082 25.378 90.082 L 56.366 90.082 C 56.77 90.082 57.097 90.529 57.097 91.082 C 57.097 91.635 56.77 92.082 56.366 92.082 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
25
|
+
<path d="M 50.623 39.8 L 25.246 39.8 C 24.916 39.8 24.648 39.353 24.648 38.8 C 24.648 38.247 24.916 37.8 25.246 37.8 L 50.623 37.8 C 50.953 37.8 51.221 38.247 51.221 38.8 C 51.221 39.353 50.953 39.8 50.623 39.8 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
29
26
|
</g>
|
|
30
27
|
</g>
|
|
31
28
|
</g>
|
|
32
|
-
</
|
|
29
|
+
<text style="fill: rgb(74, 74, 74); font-family: Consolas; font-size: 34px; font-weight: 700; stroke-miterlimit: 10; stroke-width: 0px; white-space: pre;" transform="matrix(0.654152, 0, 0, 0.636825, 32.884773, 81.612808)" x="114.293" y="147.365">KwirthLog</text>
|
|
30
|
+
</svg>
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
<svg viewBox="0 0 152 200" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<path d="M 50.623 98.363 L 25.246 98.363 C 24.916 98.363 24.648 97.916 24.648 97.363 C 24.648 96.81 24.916 96.363 25.246 96.363 L 50.623 96.363 C 50.953 96.363 51.221 96.81 51.221 97.363 C 51.221 97.916 50.953 98.363 50.623 98.363 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
16
|
-
<path d="M 56.366 92.082 L 25.378 92.082 C 24.975 92.082 24.648 91.635 24.648 91.082 C 24.648 90.529 24.975 90.082 25.378 90.082 L 56.366 90.082 C 56.77 90.082 57.097 90.529 57.097 91.082 C 57.097 91.635 56.77 92.082 56.366 92.082 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
17
|
-
<path d="M 50.623 39.8 L 25.246 39.8 C 24.916 39.8 24.648 39.353 24.648 38.8 C 24.648 38.247 24.916 37.8 25.246 37.8 L 50.623 37.8 C 50.953 37.8 51.221 38.247 51.221 38.8 C 51.221 39.353 50.953 39.8 50.623 39.8 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
18
|
-
</g>
|
|
2
|
+
<path style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; font-stretch: normal; font-size: medium; line-height: normal; font-family: sans-serif; font-feature-settings: normal; text-indent: 0px; text-align: start; text-decoration: none solid rgb(0, 0, 0); letter-spacing: normal; word-spacing: normal; text-transform: none; writing-mode: lr-tb; direction: ltr; text-orientation: mixed; dominant-baseline: auto; baseline-shift: baseline; text-anchor: start; white-space: normal; clip-rule: nonzero; display: inline; overflow: visible; visibility: visible; opacity: 1; isolation: auto; mix-blend-mode: normal; color-interpolation: srgb; color-interpolation-filters: linearrgb; vector-effect: none; fill: rgb(255, 255, 255); fill-opacity: 1; fill-rule: evenodd; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 4; stroke-dasharray: none; stroke-dashoffset: 0; stroke-opacity: 1; color-rendering: auto; image-rendering: auto; shape-rendering: auto; text-rendering: auto; paint-order: fill; stroke-width: 9px; stroke: rgb(74, 74, 74);" d="M 3.001 3.226 L 149.074 3.226 L 149.074 197.045 L 3.001 197.045 L 3.001 3.226 Z" id="path3310"></path>
|
|
3
|
+
<g id="g3330" transform="matrix(0.441209, 0, 0, 0.468545, -887.038696, -5222.522461)">
|
|
4
|
+
<g transform="matrix(6.103682, 0, 0, 5.928513, 1904.565796, 10952.352539)">
|
|
5
|
+
<g>
|
|
6
|
+
<path d="M 68.066 63.636 L 25.648 63.636 C 25.096 63.636 24.648 63.189 24.648 62.636 C 24.648 62.083 25.096 61.636 25.648 61.636 L 68.066 61.636 C 68.619 61.636 69.066 62.083 69.066 62.636 C 69.066 63.189 68.619 63.636 68.066 63.636 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
7
|
+
<path d="M 54.048 57.677 L 25.325 57.677 C 24.951 57.677 24.648 57.23 24.648 56.677 C 24.648 56.124 24.951 55.677 25.325 55.677 L 54.048 55.677 C 54.422 55.677 54.725 56.124 54.725 56.677 C 54.725 57.23 54.422 57.677 54.048 57.677 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
8
|
+
<path d="M 58.96 69.595 L 25.438 69.595 C 25.002 69.595 24.648 69.148 24.648 68.595 C 24.648 68.042 25.002 67.595 25.438 67.595 L 58.96 67.595 C 59.397 67.595 59.75 68.042 59.75 68.595 C 59.75 69.148 59.397 69.595 58.96 69.595 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
9
|
+
<path d="M 50.623 51.718 L 25.246 51.718 C 24.916 51.718 24.648 51.271 24.648 50.718 C 24.648 50.165 24.916 49.718 25.246 49.718 L 50.623 49.718 C 50.953 49.718 51.221 50.165 51.221 50.718 C 51.221 51.271 50.953 51.718 50.623 51.718 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
10
|
+
<path d="M 56.366 45.759 L 25.378 45.759 C 24.975 45.759 24.648 45.312 24.648 44.759 C 24.648 44.206 24.975 43.759 25.378 43.759 L 56.366 43.759 C 56.77 43.759 57.097 44.206 57.097 44.759 C 57.097 45.312 56.77 45.759 56.366 45.759 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
11
|
+
<path d="M 54.048 75.556 L 25.325 75.556 C 24.951 75.556 24.648 75.109 24.648 74.556 C 24.648 74.003 24.951 73.556 25.325 73.556 L 54.048 73.556 C 54.422 73.556 54.725 74.003 54.725 74.556 C 54.725 75.109 54.422 75.556 54.048 75.556 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
12
|
+
<path d="M 50.623 98.363 L 25.246 98.363 C 24.916 98.363 24.648 97.916 24.648 97.363 C 24.648 96.81 24.916 96.363 25.246 96.363 L 50.623 96.363 C 50.953 96.363 51.221 96.81 51.221 97.363 C 51.221 97.916 50.953 98.363 50.623 98.363 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
13
|
+
<path d="M 56.366 92.082 L 25.378 92.082 C 24.975 92.082 24.648 91.635 24.648 91.082 C 24.648 90.529 24.975 90.082 25.378 90.082 L 56.366 90.082 C 56.77 90.082 57.097 90.529 57.097 91.082 C 57.097 91.635 56.77 92.082 56.366 92.082 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
14
|
+
<path d="M 50.623 39.8 L 25.246 39.8 C 24.916 39.8 24.648 39.353 24.648 38.8 C 24.648 38.247 24.916 37.8 25.246 37.8 L 50.623 37.8 C 50.953 37.8 51.221 38.247 51.221 38.8 C 51.221 39.353 50.953 39.8 50.623 39.8 Z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill-rule: nonzero; opacity: 1; fill: rgb(156, 156, 156);" stroke-linecap="round"></path>
|
|
19
15
|
</g>
|
|
20
16
|
</g>
|
|
21
17
|
</g>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { CodeSnippet } from '@backstage/core-components';
|
|
3
3
|
import { Grid, Typography, Button } from '@material-ui/core';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
4
|
+
import KwirthComponentNotFound from '../../assets/kwirth-log-component-not-found.svg';
|
|
5
|
+
import { ANNOTATION_KWIRTH_LOCATION } from '@jfvilas/plugin-kwirth-common';
|
|
6
6
|
|
|
7
7
|
var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
|
|
8
8
|
ErrorType2[ErrorType2["NO_PODS"] = 0] = "NO_PODS";
|
|
@@ -15,7 +15,7 @@ metadata:
|
|
|
15
15
|
name: '$entityName'
|
|
16
16
|
description: '$entityDescription'
|
|
17
17
|
labels:
|
|
18
|
-
${
|
|
18
|
+
${ANNOTATION_KWIRTH_LOCATION}: '$entityName'
|
|
19
19
|
spec:
|
|
20
20
|
selector:
|
|
21
21
|
matchLabels:
|
|
@@ -25,7 +25,7 @@ spec:
|
|
|
25
25
|
name: '$entityName'-pod
|
|
26
26
|
labels:
|
|
27
27
|
app: '$entityName'
|
|
28
|
-
${
|
|
28
|
+
${ANNOTATION_KWIRTH_LOCATION}: '$entityName'
|
|
29
29
|
spec:
|
|
30
30
|
containers:
|
|
31
31
|
- name: '$entityName'
|
|
@@ -53,7 +53,7 @@ const ComponentNotFound = (props) => {
|
|
|
53
53
|
text = noclustersMsg;
|
|
54
54
|
break;
|
|
55
55
|
}
|
|
56
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "flex-start", spacing: 2 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6, md: 6 }, /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Component not found")), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, text)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, content))), /* @__PURE__ */ React.createElement("img", { src:
|
|
56
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "row", justifyContent: "flex-start", alignItems: "flex-start", spacing: 2 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6, md: 6 }, /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "column" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Component not found")), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, text)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: true }, content))), /* @__PURE__ */ React.createElement("img", { src: KwirthComponentNotFound, style: { left: "10%", marginTop: "10%", width: "30%", position: "relative" } })), /* @__PURE__ */ React.createElement(Button, { variant: "contained", color: "primary", target: "_blank", href: "https://backstage.io/docs/features/kubernetes/configuration#surfacing-your-kubernetes-components-as-part-of-an-entity" }, "READ MORE"));
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
export { ComponentNotFound, ErrorType };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentNotFound.esm.js","sources":["../../../src/components/ComponentNotFound/ComponentNotFound.tsx"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport React from 'react'\r\nimport { Entity } from '@backstage/catalog-model'\r\nimport { CodeSnippet } from '@backstage/core-components'\r\nimport { Button, Grid, Typography } from '@material-ui/core'\r\nimport
|
|
1
|
+
{"version":3,"file":"ComponentNotFound.esm.js","sources":["../../../src/components/ComponentNotFound/ComponentNotFound.tsx"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport React from 'react'\r\nimport { Entity } from '@backstage/catalog-model'\r\nimport { CodeSnippet } from '@backstage/core-components'\r\nimport { Button, Grid, Typography } from '@material-ui/core'\r\nimport KwirthComponentNotFound from '../../assets/kwirth-log-component-not-found.svg'\r\nimport { ANNOTATION_KWIRTH_LOCATION } from '@jfvilas/plugin-kwirth-common'\r\n\r\nenum ErrorType {\r\n NO_PODS,\r\n NO_CLUSTERS\r\n}\r\n\r\nconst KUBERNETES_YAML = `apiVersion: apps/v1\r\nkind: Deployment\r\nmetadata:\r\n name: '$entityName'\r\n description: '$entityDescription'\r\n labels:\r\n ${ANNOTATION_KWIRTH_LOCATION}: '$entityName'\r\nspec:\r\n selector:\r\n matchLabels:\r\n app: '$entityName'\r\n template:\r\n metadata:\r\n name: '$entityName'-pod\r\n labels:\r\n app: '$entityName'\r\n ${ANNOTATION_KWIRTH_LOCATION}: '$entityName'\r\n spec:\r\n containers:\r\n - name: '$entityName'\r\n image: your-OCI-image\r\n ...`;\r\n\r\nconst ComponentNotFound = (props: {error: ErrorType, entity:Entity}) => {\r\n var text:string='';\r\n var content:JSX.Element=<CodeSnippet\r\n text={KUBERNETES_YAML.replaceAll('$entityName', props.entity.metadata.name).replaceAll('$entityDescription',props.entity.metadata.description!)}\r\n language=\"yaml\"\r\n showLineNumbers\r\n highlightedNumbers={[7, 17]}\r\n customStyle={{ background: 'inherit' }}\r\n />;\r\n\r\n var nopodsMsg=`Although this component is well tagged, and we have found some clusters configured in Backstage, we were unable to find \"${props.entity.metadata.name}\" running on any pod. Maybe you need to tag Kubernetes objects (deployment and pod templates).`;\r\n var noclustersMsg=`Although this component has a correct 'kubernetes-id' in the ${props.entity.metadata.name} Component YAML, we couldn't find any cluster. Maybe you need to tag Kubernetes objects (deployments and pod templates).`;\r\n \r\n switch(props.error) {\r\n case ErrorType.NO_PODS:\r\n text=nopodsMsg;\r\n break;\r\n case ErrorType.NO_CLUSTERS:\r\n text=noclustersMsg;\r\n break;\r\n }\r\n\r\n return (<>\r\n <Grid container direction=\"row\" justifyContent=\"flex-start\" alignItems=\"flex-start\" spacing={2} >\r\n <Grid item xs={6} md={6}>\r\n <Grid container direction=\"column\">\r\n <Grid item xs>\r\n <Typography variant=\"h5\">{'Component not found'}</Typography>\r\n </Grid>\r\n <Grid item xs>\r\n <Typography variant=\"body1\">{text}</Typography>\r\n </Grid>\r\n <Grid item xs>\r\n {content}\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n <img src={KwirthComponentNotFound} style={{ left:'10%', marginTop:'10%', width:'30%', position:'relative' }} />\r\n </Grid>\r\n <Button variant=\"contained\" color=\"primary\" target=\"_blank\" href=\"https://backstage.io/docs/features/kubernetes/configuration#surfacing-your-kubernetes-components-as-part-of-an-entity\">\r\n READ MORE\r\n </Button>\r\n </>);\r\n}\r\n\r\nexport { ComponentNotFound, ErrorType }"],"names":["ErrorType"],"mappings":";;;;;;AAsBK,IAAA,SAAA,qBAAAA,UAAL,KAAA;AACE,EAAAA,UAAA,CAAA,UAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AACA,EAAAA,UAAA,CAAA,UAAA,CAAA,aAAA,CAAA,GAAA,CAAA,CAAA,GAAA,aAAA;AAFG,EAAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAKL,MAAM,eAAkB,GAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,EAMlB,0BAA0B,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAA,EAUtB,0BAA0B,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAA,CAAA;AAO9B,MAAA,iBAAA,GAAoB,CAAC,KAA6C,KAAA;AACpE,EAAA,IAAI,IAAY,GAAA,EAAA;AAChB,EAAA,IAAI,OAAoB,mBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACvB,IAAM,EAAA,eAAA,CAAgB,UAAW,CAAA,aAAA,EAAe,MAAM,MAAO,CAAA,QAAA,CAAS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Q,OAAS,EAAA,EAAA,IAAK,CAClC,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAI,EAAA,IAAA,EAAC,IAAE,IACZ,EAAA,EAAA,OACD,CACJ,CACJ,CAAA,sCACC,KAAI,EAAA,EAAA,GAAA,EAAK,yBAAyB,KAAO,EAAA,EAAE,MAAK,KAAO,EAAA,SAAA,EAAU,OAAO,KAAM,EAAA,KAAA,EAAO,UAAS,UAAW,EAAA,EAAG,CACjH,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAO,OAAQ,EAAA,WAAA,EAAY,OAAM,SAAU,EAAA,MAAA,EAAO,UAAS,IAAK,EAAA,uHAAA,EAAA,EAAwH,WAEzL,CACJ,CAAA;AACJ;;;;"}
|
|
@@ -269,9 +269,6 @@ const EntityKwirthLogContent = () => {
|
|
|
269
269
|
setShowStatusDialog(false);
|
|
270
270
|
};
|
|
271
271
|
const onSelectObject = (namespaces, podNames, containerNames) => {
|
|
272
|
-
console.log(namespaces);
|
|
273
|
-
console.log(podNames);
|
|
274
|
-
console.log(containerNames);
|
|
275
272
|
setSelectedNamespaces(namespaces);
|
|
276
273
|
setSelectedPodNames(podNames);
|
|
277
274
|
setSelectedContainerNames(containerNames);
|
|
@@ -290,7 +287,7 @@ const EntityKwirthLogContent = () => {
|
|
|
290
287
|
}
|
|
291
288
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, podPrefix, containerPrefix, m.text + "\n");
|
|
292
289
|
};
|
|
293
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, showError !== "" && /* @__PURE__ */ React.createElement(ShowError, { message: showError, onClose: () => setShowError("") }), loading && /* @__PURE__ */ React.createElement(Progress, null), !isKwirthAvailable(entity) && !loading && error && /* @__PURE__ */ React.createElement(WarningPanel, { title: "An error has ocurred while obtaining data from kuebernetes clusters.", message: error?.message }), !isKwirthAvailable(entity) && !loading && /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, { readMoreUrl: "https://github.com/jfvilas/
|
|
290
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, showError !== "" && /* @__PURE__ */ React.createElement(ShowError, { message: showError, onClose: () => setShowError("") }), loading && /* @__PURE__ */ React.createElement(Progress, null), !isKwirthAvailable(entity) && !loading && error && /* @__PURE__ */ React.createElement(WarningPanel, { title: "An error has ocurred while obtaining data from kuebernetes clusters.", message: error?.message }), !isKwirthAvailable(entity) && !loading && /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, { readMoreUrl: "https://github.com/jfvilas/plugin-kwirth-log", annotation: ANNOTATION_KWIRTH_LOCATION }), isKwirthAvailable(entity) && !loading && resources && resources.length === 0 && /* @__PURE__ */ React.createElement(ComponentNotFound, { error: ErrorType.NO_CLUSTERS, entity }), isKwirthAvailable(entity) && !loading && resources && resources.length > 0 && resources.reduce((sum, cluster) => sum + cluster.data.length, 0) === 0 && /* @__PURE__ */ React.createElement(ComponentNotFound, { error: ErrorType.NO_PODS, entity }), isKwirthAvailable(entity) && !loading && resources && resources.length > 0 && resources.reduce((sum, cluster) => sum + cluster.data.length, 0) > 0 && /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "row", spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { container: true, item: true, xs: 2, direction: "column", spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(ClusterList, { resources, selectedClusterName, onSelect: onSelectCluster }))), /* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(Card, null, /* @__PURE__ */ React.createElement(Options, { options: kwirthLogOptionsRef.current, onChange: onChangeLogConfig, disabled: selectedContainerNames.length === 0 || started || paused.current })))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 10 }, !selectedClusterName && /* @__PURE__ */ React.createElement("img", { src: KwirthLogLogo, alt: "No cluster selected", style: { left: "40%", marginTop: "10%", width: "20%", position: "relative" } }), selectedClusterName && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Card, { style: { maxHeight: "75vh" } }, /* @__PURE__ */ React.createElement(
|
|
294
291
|
CardHeader,
|
|
295
292
|
{
|
|
296
293
|
title: statusButtons(selectedClusterName),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityKwirthLogContent.esm.js","sources":["../../../src/components/EntityKwirthLogContent/EntityKwirthLogContent.tsx"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport React, { useRef, useState } from 'react'\r\nimport useAsync from 'react-use/esm/useAsync'\r\n\r\nimport { Progress, WarningPanel } from '@backstage/core-components'\r\nimport { useApi } from '@backstage/core-plugin-api'\r\nimport { ANNOTATION_KWIRTH_LOCATION, isKwirthAvailable, ClusterValidPods } from '@jfvilas/plugin-kwirth-common'\r\nimport { MissingAnnotationEmptyState, useEntity } from '@backstage/plugin-catalog-react'\r\n\r\n// kwirthlog\r\nimport { kwirthLogApiRef } from '../../api'\r\nimport { accessKeySerialize, LogMessage, InstanceConfigActionEnum, InstanceConfigChannelEnum, InstanceConfigFlowEnum, InstanceConfigScopeEnum, InstanceConfigViewEnum, InstanceMessage, InstanceMessageTypeEnum, SignalMessage, SignalMessageLevelEnum, InstanceConfigObjectEnum, InstanceConfig } from '@jfvilas/kwirth-common'\r\n\r\n// kwirthlog components\r\nimport { ComponentNotFound, ErrorType } from '../ComponentNotFound'\r\nimport { Options } from '../Options'\r\nimport { ClusterList } from '../ClusterList'\r\nimport { ShowError } from '../ShowError'\r\nimport { StatusLog } from '../StatusLog'\r\n\r\n\r\n// Material-UI\r\nimport { Grid } from '@material-ui/core'\r\nimport { Card, CardHeader, CardContent } from '@material-ui/core'\r\nimport Divider from '@material-ui/core/Divider'\r\nimport IconButton from '@material-ui/core/IconButton'\r\nimport Typography from '@material-ui/core/Typography'\r\n\r\n// Icons\r\nimport PlayIcon from '@material-ui/icons/PlayArrow'\r\nimport PauseIcon from '@material-ui/icons/Pause'\r\nimport StopIcon from '@material-ui/icons/Stop'\r\nimport InfoIcon from '@material-ui/icons/Info'\r\nimport WarningIcon from '@material-ui/icons/Warning'\r\nimport ErrorIcon from '@material-ui/icons/Error'\r\nimport DownloadIcon from '@material-ui/icons/CloudDownload'\r\nimport KwirthLogLogo from '../../assets/kwirthlog-logo.svg'\r\nimport { ObjectSelector } from '../ObjectSelector'\r\n\r\nconst LOG_MAX_MESSAGES=1000;\r\n\r\nexport const EntityKwirthLogContent = () => { \r\n const { entity } = useEntity()\r\n const kwirthLogApi = useApi(kwirthLogApiRef)\r\n const [resources, setResources] = useState<ClusterValidPods[]>([])\r\n const [selectedClusterName, setSelectedClusterName] = useState('')\r\n const [_namespaceList, setNamespaceList] = useState<string[]>([]) //+++\r\n const [selectedNamespaces, setSelectedNamespaces] = useState<string[]>([])\r\n const [selectedPodNames, setSelectedPodNames] = useState<string[]>([])\r\n const [selectedContainerNames, setSelectedContainerNames] = useState<string[]>([])\r\n const [showError, setShowError] = useState('') //+++ review if this is needed once we have errorMessages\r\n const [started, setStarted] = useState(false)\r\n const [stopped, setStopped] = useState(true)\r\n const paused=useRef<boolean>(false)\r\n const [messages, setMessages] = useState<LogMessage[]>([])\r\n const [pendingMessages, setPendingMessages] = useState<LogMessage[]>([])\r\n const [statusMessages, setStatusMessages] = useState<SignalMessage[]>([])\r\n const [websocket, setWebsocket] = useState<WebSocket>()\r\n const kwirthLogOptionsRef = useRef<any>({timestamp:false, follow:true, fromStart:false})\r\n const [showStatusDialog, setShowStatusDialog] = useState(false)\r\n const [statusLevel, setStatusLevel] = useState<SignalMessageLevelEnum>(SignalMessageLevelEnum.INFO)\r\n const preRef = useRef<HTMLPreElement|null>(null)\r\n const lastRef = useRef<HTMLPreElement|null>(null)\r\n const [ backendVersion, setBackendVersion ] = useState<string>('')\r\n const { loading, error } = useAsync ( async () => {\r\n if (backendVersion==='') setBackendVersion(await kwirthLogApi.getVersion())\r\n var data = await kwirthLogApi.requestAccess(entity,'log', [InstanceConfigScopeEnum.VIEW,InstanceConfigScopeEnum.RESTART])\r\n setResources(data)\r\n })\r\n\r\n const clickStart = (options:any) => {\r\n if (!paused.current) {\r\n setStarted(true)\r\n paused.current=false\r\n setStopped(false)\r\n startLogViewer(options)\r\n }\r\n else {\r\n setMessages( (prev) => [ ...prev, ...pendingMessages])\r\n setPendingMessages([])\r\n paused.current=false\r\n setStarted(true)\r\n }\r\n }\r\n\r\n const clickPause = () => {\r\n setStarted(false)\r\n paused.current=true\r\n }\r\n\r\n const clickStop = () => {\r\n setStarted(false)\r\n setStopped(true)\r\n paused.current=false\r\n stopLogViewer()\r\n }\r\n\r\n const onSelectCluster = (name:string|undefined) => {\r\n if (name) {\r\n setSelectedClusterName(name)\r\n resources.filter(cluster => cluster.name===name).map ( x => {\r\n var namespaces=Array.from(new Set(x.data.map ( (p:any) => p.namespace))) as string[]\r\n setNamespaceList(namespaces)\r\n })\r\n setMessages([{\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.SIGNAL,\r\n text: 'Select namespace in order to decide which pod logs to view.',\r\n instance: ''\r\n }])\r\n setSelectedNamespaces([])\r\n setSelectedPodNames([])\r\n setSelectedContainerNames([])\r\n setStatusMessages([])\r\n clickStop()\r\n }\r\n }\r\n\r\n const processLogMessage = (wsEvent:any) => {\r\n let msg = JSON.parse(wsEvent.data) as InstanceMessage\r\n switch (msg.type) {\r\n case 'data':\r\n var lmsg = msg as LogMessage\r\n if (paused.current) {\r\n setPendingMessages((prev) => [ ...prev, lmsg ])\r\n }\r\n else {\r\n setMessages((prev) => {\r\n while (prev.length>LOG_MAX_MESSAGES-1) {\r\n prev.splice(0,1)\r\n }\r\n if (kwirthLogOptionsRef.current.follow && lastRef.current) lastRef.current.scrollIntoView({ behavior: 'instant', block: 'start' })\r\n return [ ...prev, lmsg ]\r\n })\r\n } \r\n break\r\n case 'signal':\r\n let smsg = msg as SignalMessage\r\n setStatusMessages ((prev) => [...prev, smsg])\r\n break\r\n default:\r\n console.log('Invalid message type:')\r\n console.log(msg)\r\n setStatusMessages ((prev) => [...prev, {\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.SIGNAL,\r\n level: SignalMessageLevelEnum.ERROR,\r\n text: 'Invalid message type received: '+msg.type,\r\n instance: ''\r\n }])\r\n break\r\n }\r\n }\r\n \r\n const websocketOnMessage = (wsEvent:any) => {\r\n let instanceMessage:InstanceMessage\r\n try {\r\n instanceMessage = JSON.parse(wsEvent.data) as InstanceMessage\r\n }\r\n catch (err) {\r\n console.log(err)\r\n console.log(wsEvent.data)\r\n return\r\n }\r\n\r\n switch(instanceMessage.channel) {\r\n case 'log':\r\n processLogMessage(wsEvent)\r\n break\r\n default:\r\n console.log('Invalid channel in message: ', instanceMessage)\r\n break\r\n }\r\n\r\n }\r\n\r\n const websocketOnOpen = (ws:WebSocket, options:any) => {\r\n let cluster=resources.find(cluster => cluster.name === selectedClusterName)\r\n if (!cluster) {\r\n //+++ setShowError(msg.text);\r\n return\r\n }\r\n let pods = cluster.data.filter(p => selectedNamespaces.includes(p.namespace))\r\n if (!pods) {\r\n //+++ setShowError(msg.text);\r\n return\r\n }\r\n console.log(`WS connected`)\r\n let accessKey = cluster.accessKeys.get(InstanceConfigScopeEnum.VIEW)\r\n if (accessKey) {\r\n let containers:string[] = []\r\n if (selectedContainerNames.length>0) {\r\n for(var p of selectedPodNames) {\r\n for (var c of selectedContainerNames) {\r\n containers.push(p+'+'+c)\r\n }\r\n }\r\n }\r\n let iConfig:InstanceConfig = {\r\n channel: InstanceConfigChannelEnum.LOG,\r\n objects: InstanceConfigObjectEnum.PODS,\r\n action: InstanceConfigActionEnum.START,\r\n flow: InstanceConfigFlowEnum.REQUEST,\r\n instance: '',\r\n accessKey: accessKeySerialize(accessKey),\r\n scope: InstanceConfigScopeEnum.VIEW,\r\n view: (selectedContainerNames.length>0 ? InstanceConfigViewEnum.CONTAINER : InstanceConfigViewEnum.POD),\r\n namespace: selectedNamespaces.join(','),\r\n group: '',\r\n pod: selectedPodNames.map(p => p).join(','),\r\n container: containers.join(','),\r\n data: {\r\n timestamp: options.timestamp,\r\n previous: false,\r\n maxMessages: LOG_MAX_MESSAGES,\r\n fromStart: options.fromStart\r\n }\r\n }\r\n ws.send(JSON.stringify(iConfig))\r\n }\r\n else {\r\n // +++ error to user\r\n }\r\n }\r\n\r\n const startLogViewer = (options:any) => {\r\n let cluster=resources.find(cluster => cluster.name===selectedClusterName);\r\n if (!cluster) {\r\n //+++ show wargning\r\n return\r\n }\r\n\r\n setMessages([])\r\n try {\r\n let ws = new WebSocket(cluster.url)\r\n ws.onopen = () => websocketOnOpen(ws, options)\r\n ws.onmessage = (event) => websocketOnMessage(event)\r\n ws.onclose = (event) => websocketOnClose(event)\r\n setWebsocket(ws)\r\n }\r\n catch (err) {\r\n setMessages([ {\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.DATA,\r\n text: `Error opening log stream: ${err}`,\r\n instance: ''\r\n } ])\r\n }\r\n\r\n }\r\n\r\n const websocketOnClose = (_event:any) => {\r\n console.log(`WS disconnected`)\r\n setStarted(false)\r\n paused.current=false\r\n setStopped(true)\r\n }\r\n\r\n const stopLogViewer = () => {\r\n messages.push({\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.DATA,\r\n text: '============================================================================================================================',\r\n instance: ''\r\n })\r\n websocket?.close()\r\n }\r\n\r\n const onChangeLogConfig = (options:any) => {\r\n kwirthLogOptionsRef.current=options\r\n if (started) {\r\n clickStart(options)\r\n }\r\n }\r\n\r\n const handleDownload = () => {\r\n let content = preRef.current!.innerHTML.replaceAll('<pre>','').replaceAll('</pre>','\\n')\r\n content = content.replaceAll('<span style=\"color: green;\">','')\r\n content = content.replaceAll('<span style=\"color: blue;\">','')\r\n content = content.replaceAll('</span>','')\r\n let filename = selectedClusterName+'-'+selectedNamespaces+'-'+entity.metadata.name+'.txt'\r\n let mimeType:string = 'text/plain'\r\n \r\n const blob = new Blob([content], { type: mimeType })\r\n const url = URL.createObjectURL(blob)\r\n const link = document.createElement('a')\r\n link.href = url\r\n link.download = filename\r\n document.body.appendChild(link)\r\n link.click()\r\n document.body.removeChild(link)\r\n URL.revokeObjectURL(url)\r\n }\r\n \r\n const actionButtons = () => {\r\n let hasViewKey=false\r\n let cluster=resources.find(cluster => cluster.name===selectedClusterName)\r\n if (cluster) hasViewKey = Boolean(cluster.accessKeys.get(InstanceConfigScopeEnum.VIEW))\r\n\r\n return <>\r\n <IconButton title='Download' onClick={handleDownload} disabled={messages.length<=1}>\r\n <DownloadIcon />\r\n </IconButton>\r\n <IconButton onClick={() => clickStart(kwirthLogOptionsRef.current)} title=\"Play\" disabled={started || !paused || selectedPodNames.length === 0 || !hasViewKey}>\r\n <PlayIcon />\r\n </IconButton>\r\n <IconButton onClick={clickPause} title=\"Pause\" disabled={!((started && !paused.current) && selectedPodNames.length > 0)}>\r\n <PauseIcon />\r\n </IconButton>\r\n <IconButton onClick={clickStop} title=\"Stop\" disabled={stopped || selectedPodNames.length === 0}>\r\n <StopIcon />\r\n </IconButton>\r\n </>\r\n }\r\n\r\n const statusButtons = (title:string) => {\r\n const show = (level:SignalMessageLevelEnum) => {\r\n setShowStatusDialog(true)\r\n setStatusLevel(level)\r\n }\r\n\r\n return (\r\n <Grid container direction='row' >\r\n <Grid item>\r\n <Typography variant='h5'>{title}</Typography>\r\n </Grid>\r\n <Grid item style={{marginTop:'-8px'}}>\r\n <IconButton title=\"info\" disabled={!statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.INFO)} onClick={() => show(SignalMessageLevelEnum.INFO)}>\r\n <InfoIcon style={{ color:statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.INFO)?'blue':'#BDBDBD'}}/>\r\n </IconButton>\r\n <IconButton title=\"warning\" disabled={!statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.WARNING)} onClick={() => show(SignalMessageLevelEnum.WARNING)} style={{marginLeft:'-16px'}}>\r\n <WarningIcon style={{ color:statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.WARNING)?'gold':'#BDBDBD'}}/>\r\n </IconButton>\r\n <IconButton title=\"error\" disabled={!statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.ERROR)} onClick={() => show(SignalMessageLevelEnum.ERROR)} style={{marginLeft:'-16px'}}>\r\n <ErrorIcon style={{ color:statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.ERROR)?'red':'#BDBDBD'}}/>\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n )\r\n }\r\n\r\n const statusClear = (level: SignalMessageLevelEnum) => {\r\n setStatusMessages(statusMessages.filter(m=> m.level!==level))\r\n setShowStatusDialog(false)\r\n }\r\n \r\n const onSelectObject = (namespaces:string[], podNames:string[], containerNames:string[]) => {\r\n console.log(namespaces)\r\n console.log(podNames)\r\n console.log(containerNames)\r\n setSelectedNamespaces(namespaces)\r\n setSelectedPodNames(podNames)\r\n setSelectedContainerNames(containerNames)\r\n }\r\n\r\n const formatMessage = (m:LogMessage) => {\r\n if (!m.pod) {\r\n return <>{m.text+'\\n'}</>\r\n }\r\n\r\n let podPrefix = <></>\r\n if (selectedPodNames.length !== 1) {\r\n podPrefix = <span style={{color:\"green\"}}>{m.pod+' '}</span>\r\n }\r\n\r\n let containerPrefix = <></>\r\n if (selectedContainerNames.length !== 1){\r\n containerPrefix = <span style={{color:\"blue\"}}>{m.container+' '}</span>\r\n }\r\n return <>{podPrefix}{containerPrefix}{m.text+'\\n'}</>\r\n }\r\n\r\n return (<>\r\n { showError!=='' && <ShowError message={showError} onClose={() => setShowError('')}/> }\r\n\r\n { loading && <Progress/> }\r\n\r\n {!isKwirthAvailable(entity) && !loading && error && (\r\n <WarningPanel title={'An error has ocurred while obtaining data from kuebernetes clusters.'} message={error?.message} />\r\n )}\r\n\r\n {!isKwirthAvailable(entity) && !loading && (\r\n <MissingAnnotationEmptyState readMoreUrl='https://github.com/jfvilas/kubelog' annotation={ANNOTATION_KWIRTH_LOCATION}/>\r\n )}\r\n\r\n { isKwirthAvailable(entity) && !loading && resources && resources.length===0 &&\r\n <ComponentNotFound error={ErrorType.NO_CLUSTERS} entity={entity}/>\r\n }\r\n\r\n { isKwirthAvailable(entity) && !loading && resources && resources.length>0 && resources.reduce((sum,cluster) => sum+cluster.data.length, 0)===0 &&\r\n <ComponentNotFound error={ErrorType.NO_PODS} entity={entity}/>\r\n }\r\n\r\n { isKwirthAvailable(entity) && !loading && resources && resources.length>0 && resources.reduce((sum,cluster) => sum+cluster.data.length, 0)>0 &&\r\n <Grid container direction='row' spacing={3}>\r\n <Grid container item xs={2} direction='column' spacing={3}>\r\n <Grid item>\r\n <Card>\r\n <ClusterList resources={resources} selectedClusterName={selectedClusterName} onSelect={onSelectCluster}/>\r\n </Card>\r\n </Grid>\r\n <Grid item>\r\n <Card>\r\n <Options options={kwirthLogOptionsRef.current} onChange={onChangeLogConfig} disabled={selectedContainerNames.length === 0 || started || paused.current}/>\r\n </Card>\r\n </Grid>\r\n </Grid>\r\n\r\n <Grid item xs={10}>\r\n\r\n { !selectedClusterName && \r\n <img src={KwirthLogLogo} alt='No cluster selected' style={{ left:'40%', marginTop:'10%', width:'20%', position:'relative' }} />\r\n }\r\n\r\n { selectedClusterName && <>\r\n <Card style={{ maxHeight:'75vh'}}>\r\n <CardHeader\r\n title={statusButtons(selectedClusterName)}\r\n style={{marginTop:-4, marginBottom:4, flexShrink:0}}\r\n action={actionButtons()}\r\n />\r\n \r\n <Typography style={{marginLeft:16, marginBottom:4}}>\r\n <ObjectSelector cluster={resources.find(cluster => cluster.name === selectedClusterName)!} onSelect={onSelectObject} disabled={selectedClusterName === '' || started || paused.current} selectedNamespaces={selectedNamespaces} selectedPodNames={selectedPodNames} selectedContainerNames={selectedContainerNames}/>\r\n </Typography>\r\n <Divider/>\r\n <CardContent style={{ overflow: 'auto' }}>\r\n <pre ref={preRef}>\r\n { messages.map (m => formatMessage(m)) }\r\n </pre>\r\n <span ref={lastRef}></span>\r\n </CardContent>\r\n </Card>\r\n </>}\r\n\r\n </Grid>\r\n </Grid>\r\n }\r\n\r\n { showStatusDialog && <StatusLog level={statusLevel} onClose={() => setShowStatusDialog(false)} statusMessages={statusMessages} onClear={statusClear}/>}\r\n </>)\r\n}\r\n"],"names":["cluster","p"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,gBAAiB,GAAA,GAAA;AAEhB,MAAM,yBAAyB,MAAM;AACxC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,YAAA,GAAe,OAAO,eAAe,CAAA;AAC3C,EAAA,MAAM,CAAC,SAAW,EAAA,YAAY,CAAI,GAAA,QAAA,CAA6B,EAAE,CAAA;AACjE,EAAA,MAAM,CAAC,mBAAA,EAAqB,sBAAsB,CAAA,GAAI,SAAS,EAAE,CAAA;AACjE,EAAA,MAAM,CAAC,cAAgB,EAAA,gBAAgB,CAAI,GAAA,QAAA,CAAmB,EAAE,CAAA;AAChE,EAAA,MAAM,CAAC,kBAAoB,EAAA,qBAAqB,CAAI,GAAA,QAAA,CAAmB,EAAE,CAAA;AACzE,EAAA,MAAM,CAAC,gBAAkB,EAAA,mBAAmB,CAAI,GAAA,QAAA,CAAmB,EAA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AA,OAAA,EAAS,kBAAwC,EAAA,gBAAA,EAAoC,wBAA+C,CACvT,CAAA,sCACC,OAAO,EAAA,IAAA,CAAA,sCACP,WAAY,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,QAC5B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,UACJ,QAAS,CAAA,GAAA,CAAK,CAAK,CAAA,KAAA,aAAA,CAAc,CAAC,CAAC,CACzC,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAK,GAAK,EAAA,OAAA,EAAS,CACxB,CACJ,CACJ,CAEJ,CACJ,CAGF,EAAA,gBAAA,wCAAqB,SAAU,EAAA,EAAA,KAAA,EAAO,WAAa,EAAA,OAAA,EAAS,MAAM,mBAAoB,CAAA,KAAK,GAAG,cAAgC,EAAA,OAAA,EAAS,aAAY,CACzJ,CAAA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"EntityKwirthLogContent.esm.js","sources":["../../../src/components/EntityKwirthLogContent/EntityKwirthLogContent.tsx"],"sourcesContent":["/*\r\nCopyright 2024 Julio Fernandez\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\nimport React, { useRef, useState } from 'react'\r\nimport useAsync from 'react-use/esm/useAsync'\r\n\r\nimport { Progress, WarningPanel } from '@backstage/core-components'\r\nimport { useApi } from '@backstage/core-plugin-api'\r\nimport { ANNOTATION_KWIRTH_LOCATION, isKwirthAvailable, ClusterValidPods } from '@jfvilas/plugin-kwirth-common'\r\nimport { MissingAnnotationEmptyState, useEntity } from '@backstage/plugin-catalog-react'\r\n\r\n// kwirthlog\r\nimport { kwirthLogApiRef } from '../../api'\r\nimport { accessKeySerialize, LogMessage, InstanceConfigActionEnum, InstanceConfigChannelEnum, InstanceConfigFlowEnum, InstanceConfigScopeEnum, InstanceConfigViewEnum, InstanceMessage, InstanceMessageTypeEnum, SignalMessage, SignalMessageLevelEnum, InstanceConfigObjectEnum, InstanceConfig } from '@jfvilas/kwirth-common'\r\n\r\n// kwirthlog components\r\nimport { ComponentNotFound, ErrorType } from '../ComponentNotFound'\r\nimport { Options } from '../Options'\r\nimport { ClusterList } from '../ClusterList'\r\nimport { ShowError } from '../ShowError'\r\nimport { StatusLog } from '../StatusLog'\r\n\r\n\r\n// Material-UI\r\nimport { Grid } from '@material-ui/core'\r\nimport { Card, CardHeader, CardContent } from '@material-ui/core'\r\nimport Divider from '@material-ui/core/Divider'\r\nimport IconButton from '@material-ui/core/IconButton'\r\nimport Typography from '@material-ui/core/Typography'\r\n\r\n// Icons\r\nimport PlayIcon from '@material-ui/icons/PlayArrow'\r\nimport PauseIcon from '@material-ui/icons/Pause'\r\nimport StopIcon from '@material-ui/icons/Stop'\r\nimport InfoIcon from '@material-ui/icons/Info'\r\nimport WarningIcon from '@material-ui/icons/Warning'\r\nimport ErrorIcon from '@material-ui/icons/Error'\r\nimport DownloadIcon from '@material-ui/icons/CloudDownload'\r\nimport KwirthLogLogo from '../../assets/kwirthlog-logo.svg'\r\nimport { ObjectSelector } from '../ObjectSelector'\r\n\r\nconst LOG_MAX_MESSAGES=1000;\r\n\r\nexport const EntityKwirthLogContent = () => { \r\n const { entity } = useEntity()\r\n const kwirthLogApi = useApi(kwirthLogApiRef)\r\n const [resources, setResources] = useState<ClusterValidPods[]>([])\r\n const [selectedClusterName, setSelectedClusterName] = useState('')\r\n const [_namespaceList, setNamespaceList] = useState<string[]>([]) //+++\r\n const [selectedNamespaces, setSelectedNamespaces] = useState<string[]>([])\r\n const [selectedPodNames, setSelectedPodNames] = useState<string[]>([])\r\n const [selectedContainerNames, setSelectedContainerNames] = useState<string[]>([])\r\n const [showError, setShowError] = useState('') //+++ review if this is needed once we have errorMessages\r\n const [started, setStarted] = useState(false)\r\n const [stopped, setStopped] = useState(true)\r\n const paused=useRef<boolean>(false)\r\n const [messages, setMessages] = useState<LogMessage[]>([])\r\n const [pendingMessages, setPendingMessages] = useState<LogMessage[]>([])\r\n const [statusMessages, setStatusMessages] = useState<SignalMessage[]>([])\r\n const [websocket, setWebsocket] = useState<WebSocket>()\r\n const kwirthLogOptionsRef = useRef<any>({timestamp:false, follow:true, fromStart:false})\r\n const [showStatusDialog, setShowStatusDialog] = useState(false)\r\n const [statusLevel, setStatusLevel] = useState<SignalMessageLevelEnum>(SignalMessageLevelEnum.INFO)\r\n const preRef = useRef<HTMLPreElement|null>(null)\r\n const lastRef = useRef<HTMLPreElement|null>(null)\r\n const [ backendVersion, setBackendVersion ] = useState<string>('')\r\n const { loading, error } = useAsync ( async () => {\r\n if (backendVersion==='') setBackendVersion(await kwirthLogApi.getVersion())\r\n var data = await kwirthLogApi.requestAccess(entity,'log', [InstanceConfigScopeEnum.VIEW,InstanceConfigScopeEnum.RESTART])\r\n setResources(data)\r\n })\r\n\r\n const clickStart = (options:any) => {\r\n if (!paused.current) {\r\n setStarted(true)\r\n paused.current=false\r\n setStopped(false)\r\n startLogViewer(options)\r\n }\r\n else {\r\n setMessages( (prev) => [ ...prev, ...pendingMessages])\r\n setPendingMessages([])\r\n paused.current=false\r\n setStarted(true)\r\n }\r\n }\r\n\r\n const clickPause = () => {\r\n setStarted(false)\r\n paused.current=true\r\n }\r\n\r\n const clickStop = () => {\r\n setStarted(false)\r\n setStopped(true)\r\n paused.current=false\r\n stopLogViewer()\r\n }\r\n\r\n const onSelectCluster = (name:string|undefined) => {\r\n if (name) {\r\n setSelectedClusterName(name)\r\n resources.filter(cluster => cluster.name===name).map ( x => {\r\n var namespaces=Array.from(new Set(x.data.map ( (p:any) => p.namespace))) as string[]\r\n setNamespaceList(namespaces)\r\n })\r\n setMessages([{\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.SIGNAL,\r\n text: 'Select namespace in order to decide which pod logs to view.',\r\n instance: ''\r\n }])\r\n setSelectedNamespaces([])\r\n setSelectedPodNames([])\r\n setSelectedContainerNames([])\r\n setStatusMessages([])\r\n clickStop()\r\n }\r\n }\r\n\r\n const processLogMessage = (wsEvent:any) => {\r\n let msg = JSON.parse(wsEvent.data) as InstanceMessage\r\n switch (msg.type) {\r\n case 'data':\r\n var lmsg = msg as LogMessage\r\n if (paused.current) {\r\n setPendingMessages((prev) => [ ...prev, lmsg ])\r\n }\r\n else {\r\n setMessages((prev) => {\r\n while (prev.length>LOG_MAX_MESSAGES-1) {\r\n prev.splice(0,1)\r\n }\r\n if (kwirthLogOptionsRef.current.follow && lastRef.current) lastRef.current.scrollIntoView({ behavior: 'instant', block: 'start' })\r\n return [ ...prev, lmsg ]\r\n })\r\n } \r\n break\r\n case 'signal':\r\n let smsg = msg as SignalMessage\r\n setStatusMessages ((prev) => [...prev, smsg])\r\n break\r\n default:\r\n console.log('Invalid message type:')\r\n console.log(msg)\r\n setStatusMessages ((prev) => [...prev, {\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.SIGNAL,\r\n level: SignalMessageLevelEnum.ERROR,\r\n text: 'Invalid message type received: '+msg.type,\r\n instance: ''\r\n }])\r\n break\r\n }\r\n }\r\n \r\n const websocketOnMessage = (wsEvent:any) => {\r\n let instanceMessage:InstanceMessage\r\n try {\r\n instanceMessage = JSON.parse(wsEvent.data) as InstanceMessage\r\n }\r\n catch (err) {\r\n console.log(err)\r\n console.log(wsEvent.data)\r\n return\r\n }\r\n\r\n switch(instanceMessage.channel) {\r\n case 'log':\r\n processLogMessage(wsEvent)\r\n break\r\n default:\r\n console.log('Invalid channel in message: ', instanceMessage)\r\n break\r\n }\r\n\r\n }\r\n\r\n const websocketOnOpen = (ws:WebSocket, options:any) => {\r\n let cluster=resources.find(cluster => cluster.name === selectedClusterName)\r\n if (!cluster) {\r\n //+++ setShowError(msg.text);\r\n return\r\n }\r\n let pods = cluster.data.filter(p => selectedNamespaces.includes(p.namespace))\r\n if (!pods) {\r\n //+++ setShowError(msg.text);\r\n return\r\n }\r\n console.log(`WS connected`)\r\n let accessKey = cluster.accessKeys.get(InstanceConfigScopeEnum.VIEW)\r\n if (accessKey) {\r\n let containers:string[] = []\r\n if (selectedContainerNames.length>0) {\r\n for(var p of selectedPodNames) {\r\n for (var c of selectedContainerNames) {\r\n containers.push(p+'+'+c)\r\n }\r\n }\r\n }\r\n let iConfig:InstanceConfig = {\r\n channel: InstanceConfigChannelEnum.LOG,\r\n objects: InstanceConfigObjectEnum.PODS,\r\n action: InstanceConfigActionEnum.START,\r\n flow: InstanceConfigFlowEnum.REQUEST,\r\n instance: '',\r\n accessKey: accessKeySerialize(accessKey),\r\n scope: InstanceConfigScopeEnum.VIEW,\r\n view: (selectedContainerNames.length>0 ? InstanceConfigViewEnum.CONTAINER : InstanceConfigViewEnum.POD),\r\n namespace: selectedNamespaces.join(','),\r\n group: '',\r\n pod: selectedPodNames.map(p => p).join(','),\r\n container: containers.join(','),\r\n data: {\r\n timestamp: options.timestamp,\r\n previous: false,\r\n maxMessages: LOG_MAX_MESSAGES,\r\n fromStart: options.fromStart\r\n }\r\n }\r\n ws.send(JSON.stringify(iConfig))\r\n }\r\n else {\r\n // +++ error to user\r\n }\r\n }\r\n\r\n const startLogViewer = (options:any) => {\r\n let cluster=resources.find(cluster => cluster.name===selectedClusterName);\r\n if (!cluster) {\r\n //+++ show wargning\r\n return\r\n }\r\n\r\n setMessages([])\r\n try {\r\n let ws = new WebSocket(cluster.url)\r\n ws.onopen = () => websocketOnOpen(ws, options)\r\n ws.onmessage = (event) => websocketOnMessage(event)\r\n ws.onclose = (event) => websocketOnClose(event)\r\n setWebsocket(ws)\r\n }\r\n catch (err) {\r\n setMessages([ {\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.DATA,\r\n text: `Error opening log stream: ${err}`,\r\n instance: ''\r\n } ])\r\n }\r\n\r\n }\r\n\r\n const websocketOnClose = (_event:any) => {\r\n console.log(`WS disconnected`)\r\n setStarted(false)\r\n paused.current=false\r\n setStopped(true)\r\n }\r\n\r\n const stopLogViewer = () => {\r\n messages.push({\r\n channel: InstanceConfigChannelEnum.LOG,\r\n type: InstanceMessageTypeEnum.DATA,\r\n text: '============================================================================================================================',\r\n instance: ''\r\n })\r\n websocket?.close()\r\n }\r\n\r\n const onChangeLogConfig = (options:any) => {\r\n kwirthLogOptionsRef.current=options\r\n if (started) {\r\n clickStart(options)\r\n }\r\n }\r\n\r\n const handleDownload = () => {\r\n let content = preRef.current!.innerHTML.replaceAll('<pre>','').replaceAll('</pre>','\\n')\r\n content = content.replaceAll('<span style=\"color: green;\">','')\r\n content = content.replaceAll('<span style=\"color: blue;\">','')\r\n content = content.replaceAll('</span>','')\r\n let filename = selectedClusterName+'-'+selectedNamespaces+'-'+entity.metadata.name+'.txt'\r\n let mimeType:string = 'text/plain'\r\n \r\n const blob = new Blob([content], { type: mimeType })\r\n const url = URL.createObjectURL(blob)\r\n const link = document.createElement('a')\r\n link.href = url\r\n link.download = filename\r\n document.body.appendChild(link)\r\n link.click()\r\n document.body.removeChild(link)\r\n URL.revokeObjectURL(url)\r\n }\r\n \r\n const actionButtons = () => {\r\n let hasViewKey=false\r\n let cluster=resources.find(cluster => cluster.name===selectedClusterName)\r\n if (cluster) hasViewKey = Boolean(cluster.accessKeys.get(InstanceConfigScopeEnum.VIEW))\r\n\r\n return <>\r\n <IconButton title='Download' onClick={handleDownload} disabled={messages.length<=1}>\r\n <DownloadIcon />\r\n </IconButton>\r\n <IconButton onClick={() => clickStart(kwirthLogOptionsRef.current)} title=\"Play\" disabled={started || !paused || selectedPodNames.length === 0 || !hasViewKey}>\r\n <PlayIcon />\r\n </IconButton>\r\n <IconButton onClick={clickPause} title=\"Pause\" disabled={!((started && !paused.current) && selectedPodNames.length > 0)}>\r\n <PauseIcon />\r\n </IconButton>\r\n <IconButton onClick={clickStop} title=\"Stop\" disabled={stopped || selectedPodNames.length === 0}>\r\n <StopIcon />\r\n </IconButton>\r\n </>\r\n }\r\n\r\n const statusButtons = (title:string) => {\r\n const show = (level:SignalMessageLevelEnum) => {\r\n setShowStatusDialog(true)\r\n setStatusLevel(level)\r\n }\r\n\r\n return (\r\n <Grid container direction='row' >\r\n <Grid item>\r\n <Typography variant='h5'>{title}</Typography>\r\n </Grid>\r\n <Grid item style={{marginTop:'-8px'}}>\r\n <IconButton title=\"info\" disabled={!statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.INFO)} onClick={() => show(SignalMessageLevelEnum.INFO)}>\r\n <InfoIcon style={{ color:statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.INFO)?'blue':'#BDBDBD'}}/>\r\n </IconButton>\r\n <IconButton title=\"warning\" disabled={!statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.WARNING)} onClick={() => show(SignalMessageLevelEnum.WARNING)} style={{marginLeft:'-16px'}}>\r\n <WarningIcon style={{ color:statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.WARNING)?'gold':'#BDBDBD'}}/>\r\n </IconButton>\r\n <IconButton title=\"error\" disabled={!statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.ERROR)} onClick={() => show(SignalMessageLevelEnum.ERROR)} style={{marginLeft:'-16px'}}>\r\n <ErrorIcon style={{ color:statusMessages.some(m=>m.type === InstanceMessageTypeEnum.SIGNAL && m.level=== SignalMessageLevelEnum.ERROR)?'red':'#BDBDBD'}}/>\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n )\r\n }\r\n\r\n const statusClear = (level: SignalMessageLevelEnum) => {\r\n setStatusMessages(statusMessages.filter(m=> m.level!==level))\r\n setShowStatusDialog(false)\r\n }\r\n \r\n const onSelectObject = (namespaces:string[], podNames:string[], containerNames:string[]) => {\r\n setSelectedNamespaces(namespaces)\r\n setSelectedPodNames(podNames)\r\n setSelectedContainerNames(containerNames)\r\n }\r\n\r\n const formatMessage = (m:LogMessage) => {\r\n if (!m.pod) {\r\n return <>{m.text+'\\n'}</>\r\n }\r\n\r\n let podPrefix = <></>\r\n if (selectedPodNames.length !== 1) {\r\n podPrefix = <span style={{color:\"green\"}}>{m.pod+' '}</span>\r\n }\r\n\r\n let containerPrefix = <></>\r\n if (selectedContainerNames.length !== 1){\r\n containerPrefix = <span style={{color:\"blue\"}}>{m.container+' '}</span>\r\n }\r\n return <>{podPrefix}{containerPrefix}{m.text+'\\n'}</>\r\n }\r\n\r\n return (<>\r\n { showError!=='' && <ShowError message={showError} onClose={() => setShowError('')}/> }\r\n\r\n { loading && <Progress/> }\r\n\r\n {!isKwirthAvailable(entity) && !loading && error && (\r\n <WarningPanel title={'An error has ocurred while obtaining data from kuebernetes clusters.'} message={error?.message} />\r\n )}\r\n\r\n {!isKwirthAvailable(entity) && !loading && (\r\n <MissingAnnotationEmptyState readMoreUrl='https://github.com/jfvilas/plugin-kwirth-log' annotation={ANNOTATION_KWIRTH_LOCATION}/>\r\n )}\r\n\r\n { isKwirthAvailable(entity) && !loading && resources && resources.length===0 &&\r\n <ComponentNotFound error={ErrorType.NO_CLUSTERS} entity={entity}/>\r\n }\r\n\r\n { isKwirthAvailable(entity) && !loading && resources && resources.length>0 && resources.reduce((sum,cluster) => sum+cluster.data.length, 0)===0 &&\r\n <ComponentNotFound error={ErrorType.NO_PODS} entity={entity}/>\r\n }\r\n\r\n { isKwirthAvailable(entity) && !loading && resources && resources.length>0 && resources.reduce((sum,cluster) => sum+cluster.data.length, 0)>0 &&\r\n <Grid container direction='row' spacing={3}>\r\n <Grid container item xs={2} direction='column' spacing={3}>\r\n <Grid item>\r\n <Card>\r\n <ClusterList resources={resources} selectedClusterName={selectedClusterName} onSelect={onSelectCluster}/>\r\n </Card>\r\n </Grid>\r\n <Grid item>\r\n <Card>\r\n <Options options={kwirthLogOptionsRef.current} onChange={onChangeLogConfig} disabled={selectedContainerNames.length === 0 || started || paused.current}/>\r\n </Card>\r\n </Grid>\r\n </Grid>\r\n\r\n <Grid item xs={10}>\r\n\r\n { !selectedClusterName && \r\n <img src={KwirthLogLogo} alt='No cluster selected' style={{ left:'40%', marginTop:'10%', width:'20%', position:'relative' }} />\r\n }\r\n\r\n { selectedClusterName && <>\r\n <Card style={{ maxHeight:'75vh'}}>\r\n <CardHeader\r\n title={statusButtons(selectedClusterName)}\r\n style={{marginTop:-4, marginBottom:4, flexShrink:0}}\r\n action={actionButtons()}\r\n />\r\n \r\n <Typography style={{marginLeft:16, marginBottom:4}}>\r\n <ObjectSelector cluster={resources.find(cluster => cluster.name === selectedClusterName)!} onSelect={onSelectObject} disabled={selectedClusterName === '' || started || paused.current} selectedNamespaces={selectedNamespaces} selectedPodNames={selectedPodNames} selectedContainerNames={selectedContainerNames}/>\r\n </Typography>\r\n <Divider/>\r\n <CardContent style={{ overflow: 'auto' }}>\r\n <pre ref={preRef}>\r\n { messages.map (m => formatMessage(m)) }\r\n </pre>\r\n <span ref={lastRef}></span>\r\n </CardContent>\r\n </Card>\r\n </>}\r\n\r\n </Grid>\r\n </Grid>\r\n }\r\n\r\n { showStatusDialog && <StatusLog level={statusLevel} onClose={() => setShowStatusDialog(false)} statusMessages={statusMessages} onClear={statusClear}/>}\r\n </>)\r\n}\r\n"],"names":["cluster","p"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,gBAAiB,GAAA,GAAA;AAEhB,MAAM,yBAAyB,MAAM;AACxC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA;AAC7B,EAAM,MAAA,YAAA,GAAe,OAAO,eAAe,CAAA;AAC3C,EAAA,MAAM,CAAC,SAAW,EA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YAAW,EAAI,EAAA,YAAA,EAAa,CAAC,EAAA,EAAA,sCAC5C,cAAe,EAAA,EAAA,OAAA,EAAS,SAAU,CAAA,IAAA,CAAK,aAAW,OAAQ,CAAA,IAAA,KAAS,mBAAmB,CAAA,EAAI,UAAU,cAAgB,EAAA,QAAA,EAAU,mBAAwB,KAAA,EAAA,IAAM,WAAW,MAAO,CAAA,OAAA,EAAS,kBAAwC,EAAA,gBAAA,EAAoC,wBAA+C,CACvT,CAAA,sCACC,OAAO,EAAA,IAAA,CAAA,sCACP,WAAY,EAAA,EAAA,KAAA,EAAO,EAAE,QAAA,EAAU,QAC5B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,GAAA,EAAK,UACJ,QAAS,CAAA,GAAA,CAAK,CAAK,CAAA,KAAA,aAAA,CAAc,CAAC,CAAC,CACzC,CACA,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAK,GAAK,EAAA,OAAA,EAAS,CACxB,CACJ,CACJ,CAEJ,CACJ,CAGF,EAAA,gBAAA,wCAAqB,SAAU,EAAA,EAAA,KAAA,EAAO,WAAa,EAAA,OAAA,EAAS,MAAM,mBAAoB,CAAA,KAAK,GAAG,cAAgC,EAAA,OAAA,EAAS,aAAY,CACzJ,CAAA;AACJ;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
3
3
|
import { DiscoveryApi, FetchApi } from '@backstage/core-plugin-api';
|
|
4
|
-
export { isKubelogAvailable } from '@jfvilas/plugin-kubelog-common';
|
|
5
4
|
import { Entity } from '@backstage/catalog-model';
|
|
5
|
+
import { InstanceConfigScopeEnum } from '@jfvilas/kwirth-common';
|
|
6
6
|
import { ClusterValidPods } from '@jfvilas/plugin-kwirth-common';
|
|
7
7
|
|
|
8
8
|
declare const kwirthLogPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
@@ -12,7 +12,7 @@ declare const EntityKwirthLogContent: () => react.JSX.Element;
|
|
|
12
12
|
|
|
13
13
|
interface KwirthLogApi {
|
|
14
14
|
getResources(entity: Entity): Promise<any>;
|
|
15
|
-
requestAccess(entity: Entity, scopes:
|
|
15
|
+
requestAccess(entity: Entity, channel: string, scopes: InstanceConfigScopeEnum[]): Promise<ClusterValidPods[]>;
|
|
16
16
|
getVersion(): Promise<any>;
|
|
17
17
|
}
|
|
18
18
|
declare const kwirthLogApiRef: _backstage_core_plugin_api.ApiRef<KwirthLogApi>;
|
|
@@ -32,7 +32,7 @@ declare class KwirthLogClient implements KwirthLogApi {
|
|
|
32
32
|
*/
|
|
33
33
|
getVersion(): Promise<string>;
|
|
34
34
|
getResources(entity: Entity): Promise<ClusterValidPods>;
|
|
35
|
-
requestAccess(entity: Entity, scopes:
|
|
35
|
+
requestAccess(entity: Entity, channel: string, scopes: InstanceConfigScopeEnum[]): Promise<ClusterValidPods[]>;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export { EntityKwirthLogContent, KwirthLogClient, kwirthLogApiRef, kwirthLogPlugin };
|