@jfvilas/plugin-kwirth-frontend 0.13.0

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 ADDED
@@ -0,0 +1,12 @@
1
+ # Backstage frontend common package
2
+ This package contains common artifacts for using with Kwirth BAckstage front plugins like:
3
+
4
+ - KwirthLog
5
+ - KwirthMetrics
6
+
7
+ ## Version compatibility
8
+ KwirthFrontend is compatible with Kwirth core server versions according to following table.
9
+
10
+ | Plugin Kwirth version | Kwirth version |
11
+ |-|-|
12
+ |0.13.0|0.4.131|
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import Box from '@material-ui/core/Box';
3
+ import CardHeader from '@material-ui/core/CardHeader';
4
+ import Divider from '@material-ui/core/Divider';
5
+ import List from '@material-ui/core/List';
6
+ import ListItem from '@material-ui/core/ListItem';
7
+ import ListItemText from '@material-ui/core/ListItemText';
8
+ import Typography from '@material-ui/core/Typography';
9
+ import { makeStyles } from '@material-ui/core/styles';
10
+
11
+ const useStyles = makeStyles((_theme) => ({
12
+ clusterBox: {
13
+ display: "flex",
14
+ marginTop: "8px"
15
+ }
16
+ }));
17
+ const ClusterList = (props) => {
18
+ const classes = useStyles();
19
+ const { resources, selectedClusterName, onSelect } = props;
20
+ const prepareText = (txt) => {
21
+ return txt ? txt.length > 25 ? txt.substring(0, 25) + "..." : txt : "N/A";
22
+ };
23
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CardHeader, { title: "Clusters" }), /* @__PURE__ */ React.createElement(Divider, { style: { marginTop: 8 } }), /* @__PURE__ */ React.createElement(List, { dense: true }, resources.map((cluster, index) => /* @__PURE__ */ React.createElement(ListItem, { button: true, key: index, selected: selectedClusterName === cluster.name, onClick: () => onSelect(cluster.name), disabled: cluster.pods.length === 0 }, /* @__PURE__ */ React.createElement(
24
+ ListItemText,
25
+ {
26
+ primary: prepareText(cluster.name),
27
+ secondary: /* @__PURE__ */ React.createElement(Box, { component: "span", className: classes.clusterBox }, /* @__PURE__ */ React.createElement(Typography, { component: "span", style: { fontSize: 12 } }, prepareText(cluster.title)))
28
+ }
29
+ )))));
30
+ };
31
+
32
+ export { ClusterList };
33
+ //# sourceMappingURL=ClusterList.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClusterList.esm.js","sources":["../../src/ClusterList/ClusterList.tsx"],"sourcesContent":["/*\r\nCopyright 2025 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 Box from '@material-ui/core/Box'\r\nimport CardHeader from '@material-ui/core/CardHeader'\r\nimport Divider from '@material-ui/core/Divider'\r\nimport List from '@material-ui/core/List'\r\nimport ListItem from '@material-ui/core/ListItem'\r\nimport ListItemText from '@material-ui/core/ListItemText'\r\nimport Typography from '@material-ui/core/Typography'\r\nimport { makeStyles, Theme } from '@material-ui/core/styles'\r\nimport { ClusterValidPods } from '@jfvilas/plugin-kwirth-common'\r\n\r\ninterface IProps {\r\n\tresources: ClusterValidPods[]\r\n\tselectedClusterName: string\r\n\tonSelect:(name:string|undefined) => void\r\n}\r\n\r\nconst useStyles = makeStyles((_theme: Theme) => ({\r\n clusterBox: {\r\n display: 'flex',\r\n marginTop: '8px',\r\n },\r\n}))\r\n \r\nconst ClusterList = (props: IProps) => { \r\n const classes=useStyles();\r\n const { resources, selectedClusterName, onSelect } = props;\r\n \r\n\tconst prepareText = (txt:string|undefined) => {\r\n\t\treturn txt? (txt.length>25? txt.substring(0,25)+\"...\":txt) : 'N/A'\r\n\t}\r\n\r\n\treturn (\r\n\t\t<>\r\n\t\t<CardHeader title={'Clusters'}/>\r\n\t\t\r\n\t\t<Divider style={{marginTop:8}}/>\r\n\r\n\t\t<List dense>\r\n\t\t\t{resources.map((cluster, index) => (\r\n\t\t\t<ListItem button key={index} selected={selectedClusterName === cluster.name} onClick={() => onSelect(cluster.name)} disabled={cluster.pods.length===0}>\r\n\t\t\t\t<ListItemText\r\n\t\t\t\t\tprimary={prepareText(cluster.name)}\r\n\t\t\t\t\tsecondary={\r\n\t\t\t\t\t\t<Box component={'span'} className={classes.clusterBox}>\r\n\t\t\t\t\t\t\t<Typography component={'span'} style={{fontSize:12}}>\r\n\t\t\t\t\t\t\t\t{prepareText(cluster.title)}\r\n\t\t\t\t\t\t\t</Typography>\r\n\t\t\t\t\t\t</Box>\r\n\t\t\t\t}\r\n\t\t\t\t/>\r\n\t\t\t</ListItem>\r\n\t\t\t))}\r\n\t\t</List>\r\n\t\t</>\r\n\t)\r\n}\r\n\r\nexport { ClusterList }"],"names":[],"mappings":";;;;;;;;;;AAgCA,MAAM,SAAA,GAAY,UAAA,CAAW,CAAC,MAAA,MAAmB;AAAA,EAC7C,UAAA,EAAY;AAAA,IACV,OAAA,EAAS,MAAA;AAAA,IACT,SAAA,EAAW;AAAA;AAEjB,CAAA,CAAE,CAAA;AAEF,MAAM,WAAA,GAAc,CAAC,KAAA,KAAkB;AACnC,EAAA,MAAM,UAAQ,SAAA,EAAU;AACxB,EAAA,MAAM,EAAE,SAAA,EAAW,mBAAA,EAAqB,QAAA,EAAS,GAAI,KAAA;AAExD,EAAA,MAAM,WAAA,GAAc,CAAC,GAAA,KAAyB;AAC7C,IAAA,OAAO,GAAA,GAAM,GAAA,CAAI,MAAA,GAAO,EAAA,GAAI,GAAA,CAAI,UAAU,CAAA,EAAE,EAAE,CAAA,GAAE,KAAA,GAAM,GAAA,GAAO,KAAA;AAAA,EAC9D,CAAA;AAEA,EAAA,iFAEC,KAAA,CAAA,aAAA,CAAC,UAAA,EAAA,EAAW,OAAO,UAAA,EAAW,CAAA,sCAE7B,OAAA,EAAA,EAAQ,KAAA,EAAO,EAAC,SAAA,EAAU,CAAA,IAAG,CAAA,kBAE9B,KAAA,CAAA,aAAA,CAAC,QAAK,KAAA,EAAK,IAAA,EAAA,EACT,UAAU,GAAA,CAAI,CAAC,SAAS,KAAA,qBACzB,KAAA,CAAA,aAAA,CAAC,YAAS,MAAA,EAAM,IAAA,EAAC,KAAK,KAAA,EAAO,QAAA,EAAU,wBAAwB,OAAA,CAAQ,IAAA,EAAM,SAAS,MAAM,QAAA,CAAS,QAAQ,IAAI,CAAA,EAAG,UAAU,OAAA,CAAQ,IAAA,CAAK,WAAS,CAAA,EAAA,kBACnJ,KAAA,CAAA,aAAA;AAAA,IAAC,YAAA;AAAA,IAAA;AAAA,MACA,OAAA,EAAS,WAAA,CAAY,OAAA,CAAQ,IAAI,CAAA;AAAA,MACjC,SAAA,sCACE,GAAA,EAAA,EAAI,SAAA,EAAW,QAAQ,SAAA,EAAW,OAAA,CAAQ,8BAC1C,KAAA,CAAA,aAAA,CAAC,UAAA,EAAA,EAAW,WAAW,MAAA,EAAQ,KAAA,EAAO,EAAC,QAAA,EAAS,EAAA,MAC9C,WAAA,CAAY,OAAA,CAAQ,KAAK,CAC3B,CACD;AAAA;AAAA,GAGH,CACC,CACF,CACA,CAAA;AAEF;;;;"}
@@ -0,0 +1,64 @@
1
+ import React from 'react';
2
+ import { CodeSnippet } from '@backstage/core-components';
3
+ import { Grid, Typography, Button } from '@material-ui/core';
4
+ import KwirthComponentNotFound from '../assets/kwirth-component-not-found.svg';
5
+ import { ANNOTATION_BACKSTAGE_KUBERNETES_LABELID, ANNOTATION_BACKSTAGE_KUBERNETES_LABELSELECTOR } from '@jfvilas/plugin-kwirth-common';
6
+
7
+ var ErrorType = /* @__PURE__ */ ((ErrorType2) => {
8
+ ErrorType2[ErrorType2["NO_PODS"] = 0] = "NO_PODS";
9
+ ErrorType2[ErrorType2["NO_CLUSTERS"] = 1] = "NO_CLUSTERS";
10
+ return ErrorType2;
11
+ })(ErrorType || {});
12
+ const KUBERNETES_YAML = `apiVersion: apps/v1
13
+ kind: Deployment
14
+ metadata:
15
+ name: '$entityName'
16
+ description: '$entityDescription'
17
+ labels:
18
+ ${ANNOTATION_BACKSTAGE_KUBERNETES_LABELID}: '$entityName'
19
+ # Or just don't add this label and use Backstage label selector this way:
20
+ # ${ANNOTATION_BACKSTAGE_KUBERNETES_LABELSELECTOR}: app=$entityName
21
+ spec:
22
+ selector:
23
+ matchLabels:
24
+ app: '$entityName'
25
+ template:
26
+ metadata:
27
+ name: '$entityName'-pod
28
+ labels:
29
+ app: '$entityName'
30
+ ${ANNOTATION_BACKSTAGE_KUBERNETES_LABELID}: '$entityName'
31
+ # Or just don't add this label and use Backstage label selector this way:
32
+ # ${ANNOTATION_BACKSTAGE_KUBERNETES_LABELSELECTOR}: app=$entityName
33
+ spec:
34
+ containers:
35
+ - name: '$entityName'
36
+ image: your-OCI-image
37
+ ...`;
38
+ const ComponentNotFound = (props) => {
39
+ var text = "";
40
+ var content = /* @__PURE__ */ React.createElement(
41
+ CodeSnippet,
42
+ {
43
+ text: KUBERNETES_YAML.replaceAll("$entityName", props.entity.metadata.name).replaceAll("$entityDescription", props.entity.metadata.description),
44
+ language: "yaml",
45
+ showLineNumbers: true,
46
+ highlightedNumbers: [7, 17],
47
+ customStyle: { background: "inherit" }
48
+ }
49
+ );
50
+ var nopodsMsg = `Although this component is well tagged inside Backstage, 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).`;
51
+ 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).`;
52
+ switch (props.error) {
53
+ case 0 /* NO_PODS */:
54
+ text = nopodsMsg;
55
+ break;
56
+ case 1 /* NO_CLUSTERS */:
57
+ text = noclustersMsg;
58
+ break;
59
+ }
60
+ 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"));
61
+ };
62
+
63
+ export { ComponentNotFound, ErrorType };
64
+ //# sourceMappingURL=ComponentNotFound.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ComponentNotFound.esm.js","sources":["../../src/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-component-not-found.svg'\r\nimport { ANNOTATION_BACKSTAGE_KUBERNETES_LABELID, ANNOTATION_BACKSTAGE_KUBERNETES_LABELSELECTOR } 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_BACKSTAGE_KUBERNETES_LABELID}: '$entityName'\r\n # Or just don't add this label and use Backstage label selector this way:\r\n # ${ANNOTATION_BACKSTAGE_KUBERNETES_LABELSELECTOR}: app=$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_BACKSTAGE_KUBERNETES_LABELID}: '$entityName'\r\n # Or just don't add this label and use Backstage label selector this way:\r\n # ${ANNOTATION_BACKSTAGE_KUBERNETES_LABELSELECTOR}: app=$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 inside Backstage, 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":";;;;;;AAsBA,IAAK,SAAA,qBAAAA,UAAAA,KAAL;AACE,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAA;AACA,EAAAA,UAAAA,CAAAA,UAAAA,CAAA,aAAA,CAAA,GAAA,CAAA,CAAA,GAAA,aAAA;AAFG,EAAA,OAAAA,UAAAA;AAAA,CAAA,EAAA,SAAA,IAAA,EAAA;AAKL,MAAM,eAAA,GAAkB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,EAMlB,uCAAuC,CAAA;AAAA;AAAA,MAAA,EAErC,6CAA6C,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAA,EAU3C,uCAAuC,CAAA;AAAA;AAAA,UAAA,EAErC,6CAA6C,CAAA;AAAA;AAAA;AAAA;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A,EAAU,QAAA,EAAA,sCACrB,IAAA,EAAA,EAAK,IAAA,EAAI,MAAC,EAAA,EAAE,IAAA,EAAA,sCACZ,UAAA,EAAA,EAAW,OAAA,EAAQ,QAAM,qBAAsB,CAChD,mBACA,KAAA,CAAA,aAAA,CAAC,IAAA,EAAA,EAAK,MAAI,IAAA,EAAC,EAAA,EAAE,wBACb,KAAA,CAAA,aAAA,CAAC,UAAA,EAAA,EAAW,SAAQ,OAAA,EAAA,EAAS,IAAK,CAClC,CAAA,kBACA,KAAA,CAAA,aAAA,CAAC,QAAK,IAAA,EAAI,IAAA,EAAC,IAAE,IAAA,EAAA,EACZ,OACD,CACJ,CACJ,CAAA,sCACC,KAAA,EAAA,EAAI,GAAA,EAAK,yBAAyB,KAAA,EAAO,EAAE,MAAK,KAAA,EAAO,SAAA,EAAU,OAAO,KAAA,EAAM,KAAA,EAAO,UAAS,UAAA,EAAW,EAAG,CACjH,CAAA,kBACA,KAAA,CAAA,aAAA,CAAC,UAAO,OAAA,EAAQ,WAAA,EAAY,OAAM,SAAA,EAAU,MAAA,EAAO,UAAS,IAAA,EAAK,uHAAA,EAAA,EAAwH,WAEzL,CACJ,CAAA;AACJ;;;;"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { CardHeader, Divider, Grid, Typography } from '@material-ui/core';
3
+ import { versionGreaterThan } from '@jfvilas/kwirth-common';
4
+
5
+ const KwirthNews = (props) => {
6
+ let news = [];
7
+ try {
8
+ if (props.latestVersions) {
9
+ if (versionGreaterThan(props.latestVersions["plugin-kwirth-backend"], props.backendVersion)) news.push(`New version of 'plugin-kwirth-backend': your have ${props.backendVersion} and latest is ${props.latestVersions["plugin-kwirth-backend"]}`);
10
+ }
11
+ } catch {
12
+ }
13
+ if (news.length === 0) return /* @__PURE__ */ React.createElement(React.Fragment, null);
14
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(CardHeader, { title: "Kwirth news" }), /* @__PURE__ */ React.createElement(Divider, { style: { marginTop: 8 } }), /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "column", spacing: 0 }, /* @__PURE__ */ React.createElement(Grid, { item: true, style: { padding: 4 } }, news.map((n) => {
15
+ return /* @__PURE__ */ React.createElement(Typography, { style: { fontSize: 11, marginBottom: 6 } }, n);
16
+ }), /* @__PURE__ */ React.createElement(Typography, { style: { fontSize: 9, marginLeft: 20, marginTop: 4, marginBottom: 6 } }, "Powered by ", /* @__PURE__ */ React.createElement("a", { href: "https://jfvilas.github.io/kwirth/", target: "_blank", style: { color: "blue" } }, "Kwirth")))));
17
+ };
18
+
19
+ export { KwirthNews };
20
+ //# sourceMappingURL=KwirthNews.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KwirthNews.esm.js","sources":["../../src/KwirthNews/KwirthNews.tsx"],"sourcesContent":["/*\r\nCopyright 2025 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 { CardHeader, Divider, Grid, Typography } from '@material-ui/core'\r\nimport { IBackendInfo } from '@jfvilas/plugin-kwirth-common'\r\nimport { versionGreaterThan } from '@jfvilas/kwirth-common'\r\n\r\ninterface IProps {\r\n backendVersion: string\r\n latestVersions?: IBackendInfo\r\n}\r\n\r\nconst KwirthNews = (props: IProps) => {\r\n\r\n let news:string[] = []\r\n try {\r\n if (props.latestVersions) {\r\n if (versionGreaterThan(props.latestVersions['plugin-kwirth-backend'], props.backendVersion)) news.push(`New version of 'plugin-kwirth-backend': your have ${props.backendVersion} and latest is ${props.latestVersions['plugin-kwirth-backend']}`)\r\n //if (versionGreaterThan(props.latestVersions['plugin-kwirth-log'], VERSION)) news.push(`New version of 'plugin-kwirth-log': your have ${VERSION} and latest is ${props.latestVersions['plugin-kwirth-log']}`)\r\n }\r\n }\r\n catch {\r\n }\r\n\r\n if (news.length===0) return <></>\r\n \r\n return (<>\r\n <CardHeader title={'Kwirth news'}/>\r\n <Divider style={{marginTop:8}}/>\r\n <Grid container direction='column' spacing={0}>\r\n <Grid item style={{padding:4}}>\r\n {\r\n news.map(n => {\r\n return <Typography style={{fontSize:11, marginBottom:6}}>{n}</Typography>\r\n })\r\n }\r\n\r\n <Typography style={{fontSize:9, marginLeft:20, marginTop:4, marginBottom:6}}>Powered by <a href='https://jfvilas.github.io/kwirth/' target='_blank' style={{color:'blue'}}>Kwirth</a></Typography>\r\n </Grid>\r\n </Grid>\r\n </>)\r\n}\r\n\r\nexport { KwirthNews }"],"names":[],"mappings":";;;;AAyBA,MAAM,UAAA,GAAa,CAAC,KAAA,KAAkB;AAElC,EAAA,IAAI,OAAgB,EAAC;AACrB,EAAA,IAAI;AACA,IAAA,IAAI,MAAM,cAAA,EAAgB;AACtB,MAAA,IAAI,mBAAmB,KAAA,CAAM,cAAA,CAAe,uBAAuB,CAAA,EAAG,KAAA,CAAM,cAAc,CAAA,EAAG,IAAA,CAAK,IAAA,CAAK,CAAA,kDAAA,EAAqD,MAAM,cAAc,CAAA,eAAA,EAAkB,MAAM,cAAA,CAAe,uBAAuB,CAAC,CAAA,CAAE,CAAA;AAAA,IAErP;AAAA,EACJ,CAAA,CAAA,MACM;AAAA,EACN;AAEA,EAAA,IAAI,IAAA,CAAK,MAAA,KAAS,CAAA,EAAG,uBAAO,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAE,CAAA;AAE9B,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,kBACJ,KAAA,CAAA,aAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,eAAc,CAAA,kBACjC,KAAA,CAAA,aAAA,CAAC,OAAA,EAAA,EAAQ,KAAA,EAAO,EAAC,SAAA,EAAU,CAAA,EAAC,EAAE,mBAC9B,KAAA,CAAA,aAAA,CAAC,IAAA,EAAA,EAAK,SAAA,EAAS,IAAA,EAAC,SAAA,EAAU,QAAA,EAAS,OAAA,EAAS,CAAA,EAAA,sCACvC,IAAA,EAAA,EAAK,IAAA,EAAI,IAAA,EAAC,KAAA,EAAO,EAAC,OAAA,EAAQ,CAAA,EAAC,EAAA,EAEpB,IAAA,CAAK,IAAI,CAAA,CAAA,KAAK;AACV,IAAA,uBAAO,KAAA,CAAA,aAAA,CAAC,cAAW,KAAA,EAAO,EAAC,UAAS,EAAA,EAAI,YAAA,EAAa,CAAA,EAAC,EAAA,EAAI,CAAE,CAAA;AAAA,EAChE,CAAC,CAAA,kBAGL,KAAA,CAAA,aAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,EAAC,QAAA,EAAS,CAAA,EAAG,UAAA,EAAW,EAAA,EAAI,SAAA,EAAU,CAAA,EAAG,cAAa,CAAA,EAAC,EAAA,EAAG,aAAA,kBAAW,KAAA,CAAA,aAAA,CAAC,GAAA,EAAA,EAAE,IAAA,EAAK,mCAAA,EAAoC,MAAA,EAAO,UAAS,KAAA,EAAO,EAAC,KAAA,EAAM,MAAA,EAAM,EAAA,EAAG,QAAM,CAAI,CACzL,CACJ,CACJ,CAAA;AACJ;;;;"}
@@ -0,0 +1,67 @@
1
+ import React, { useState } from 'react';
2
+ import { Grid, Chip, FormControl, Select, MenuItem, Checkbox, ListItemText } from '@material-ui/core';
3
+ import { getPodList, getContainerList } from '@jfvilas/plugin-kwirth-common';
4
+ import { parseResources } from '@jfvilas/kwirth-common';
5
+
6
+ const ObjectSelector = (props) => {
7
+ const [render, setRender] = useState(false);
8
+ let pods = props.cluster.pods;
9
+ let namespaceList = Array.from(new Set(pods.map((p) => p.namespace)));
10
+ const onNamespaceChange = (namespace) => {
11
+ let i = props.selectedNamespaces.indexOf(namespace);
12
+ if (i >= 0)
13
+ props.selectedNamespaces.splice(i, 1);
14
+ else
15
+ props.selectedNamespaces.push(namespace);
16
+ props.selectedPodNames.splice(0, props.selectedPodNames.length);
17
+ let validPods = getPodList(pods, props.selectedNamespaces);
18
+ props.selectedPodNames.push(...validPods.map((pod) => pod.name));
19
+ props.selectedContainerNames.splice(0, props.selectedContainerNames.length);
20
+ let containers = getContainerList(pods, props.selectedNamespaces, props.selectedPodNames);
21
+ props.selectedContainerNames.push(...containers);
22
+ props.onSelect([...props.selectedNamespaces], [...props.selectedPodNames], [...props.selectedContainerNames]);
23
+ setRender(!render);
24
+ };
25
+ const onSelectPod = (event) => {
26
+ props.selectedPodNames.splice(0, props.selectedPodNames.length);
27
+ props.selectedPodNames.push(...event.target.value);
28
+ props.selectedContainerNames.splice(0, props.selectedContainerNames.length);
29
+ let containers = getContainerList(pods, props.selectedNamespaces, props.selectedPodNames);
30
+ if (containers.length === 1) props.selectedContainerNames.push(...containers);
31
+ props.onSelect([...props.selectedNamespaces], [...props.selectedPodNames], [...props.selectedContainerNames]);
32
+ setRender(!render);
33
+ };
34
+ const onSelectContainer = (event) => {
35
+ props.selectedContainerNames.splice(0, props.selectedContainerNames.length);
36
+ props.selectedContainerNames.push(...event.target.value);
37
+ props.onSelect([...props.selectedNamespaces], [...props.selectedPodNames], [...props.selectedContainerNames]);
38
+ };
39
+ const existAccessKey = (namespace) => {
40
+ if (!props.cluster.accessKeys.has(props.scope)) return false;
41
+ let accessKey = props.cluster.accessKeys.get(props.scope);
42
+ if (accessKey) {
43
+ let resources = parseResources(accessKey.resources);
44
+ return resources.find((r) => r.namespaces === namespace);
45
+ } else return false;
46
+ };
47
+ return /* @__PURE__ */ React.createElement(Grid, { container: true, direction: "column", spacing: 0, style: { marginBottom: 6, width: "100%" } }, /* @__PURE__ */ React.createElement(Grid, { item: true }, namespaceList.map((namespace, index) => {
48
+ if (props.disabled) {
49
+ if (existAccessKey(namespace))
50
+ return /* @__PURE__ */ React.createElement(Chip, { component: "span", key: index, label: namespace, variant: props.selectedNamespaces.includes(namespace) ? "default" : "outlined", size: "small", color: "default" });
51
+ else
52
+ return /* @__PURE__ */ React.createElement(Chip, { component: "span", key: index, label: namespace, size: "small", color: "default", variant: "outlined" });
53
+ } else {
54
+ if (existAccessKey(namespace))
55
+ return /* @__PURE__ */ React.createElement(Chip, { component: "span", key: index, label: namespace, onClick: () => onNamespaceChange(namespace), variant: props.selectedNamespaces.includes(namespace) ? "default" : "outlined", size: "small", color: "primary" });
56
+ else
57
+ return /* @__PURE__ */ React.createElement(Chip, { component: "span", key: index, label: namespace, size: "small", color: "secondary", variant: "outlined" });
58
+ }
59
+ })), /* @__PURE__ */ React.createElement(Grid, { container: true, item: true, xs: 12, spacing: 2 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(FormControl, { size: "small", fullWidth: true }, /* @__PURE__ */ React.createElement(Select, { value: props.selectedPodNames, MenuProps: { variant: "menu" }, multiple: true, onChange: onSelectPod, renderValue: (selected) => selected.join(", "), disabled: props.disabled || props.selectedNamespaces.length === 0 || getPodList(pods, props.selectedNamespaces).length === 1 }, getPodList(pods, props.selectedNamespaces).map((pod) => {
60
+ return /* @__PURE__ */ React.createElement(MenuItem, { key: pod.name, value: pod.name }, /* @__PURE__ */ React.createElement(Checkbox, { checked: props.selectedPodNames.includes(pod.name) }), /* @__PURE__ */ React.createElement(ListItemText, { primary: pod.name }));
61
+ })))), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 6 }, /* @__PURE__ */ React.createElement(FormControl, { size: "small", fullWidth: true }, /* @__PURE__ */ React.createElement(Select, { value: props.selectedContainerNames, MenuProps: { variant: "menu" }, multiple: true, onChange: onSelectContainer, renderValue: (selected) => selected.join(", "), disabled: props.disabled || props.selectedPodNames.length === 0 || getContainerList(pods, props.selectedNamespaces, props.selectedPodNames).length === 1 }, getContainerList(pods, props.selectedNamespaces, props.selectedPodNames).map((container) => {
62
+ return /* @__PURE__ */ React.createElement(MenuItem, { key: container, value: container }, /* @__PURE__ */ React.createElement(Checkbox, { checked: props.selectedContainerNames.includes(container) }), /* @__PURE__ */ React.createElement(ListItemText, { primary: container }));
63
+ }))))));
64
+ };
65
+
66
+ export { ObjectSelector };
67
+ //# sourceMappingURL=ObjectSelector.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ObjectSelector.esm.js","sources":["../../src/ObjectSelector/ObjectSelector.tsx"],"sourcesContent":["/*\r\nCopyright 2025 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, { useState } from 'react'\r\nimport { FormControl, Select, MenuItem, Checkbox, Chip, Grid, ListItemText } from '@material-ui/core'\r\nimport { ClusterValidPods, getContainerList, getPodList } from '@jfvilas/plugin-kwirth-common'\r\nimport { InstanceConfigScopeEnum, parseResources } from '@jfvilas/kwirth-common'\r\n\r\ninterface IProps {\r\n onSelect: (namespaces:string[], podNames:string[], containerNames:string[]) => void,\r\n cluster: ClusterValidPods,\r\n selectedNamespaces: string[],\r\n selectedPodNames: string[],\r\n selectedContainerNames: string[],\r\n scope: InstanceConfigScopeEnum,\r\n disabled: boolean\r\n}\r\n\r\nconst ObjectSelector = (props: IProps) => {\r\n const [render, setRender] = useState(false)\r\n let pods = props.cluster.pods\r\n let namespaceList = Array.from(new Set(pods.map(p => p.namespace)))\r\n\r\n const onNamespaceChange = (namespace:string) => {\r\n let i = props.selectedNamespaces.indexOf(namespace)\r\n if (i>=0)\r\n props.selectedNamespaces.splice(i,1)\r\n else\r\n props.selectedNamespaces.push(namespace)\r\n\r\n props.selectedPodNames.splice(0,props.selectedPodNames.length)\r\n let validPods = getPodList(pods, props.selectedNamespaces)\r\n props.selectedPodNames.push( ...validPods.map(pod => pod.name) )\r\n\r\n props.selectedContainerNames.splice(0,props.selectedContainerNames.length)\r\n let containers = getContainerList(pods, props.selectedNamespaces, props.selectedPodNames)\r\n props.selectedContainerNames.push(...containers)\r\n props.onSelect([...props.selectedNamespaces], [...props.selectedPodNames], [...props.selectedContainerNames])\r\n\r\n setRender(!render)\r\n }\r\n\r\n const onSelectPod = (event : any) => {\r\n props.selectedPodNames.splice(0,props.selectedPodNames.length)\r\n props.selectedPodNames.push( ...event.target.value )\r\n\r\n props.selectedContainerNames.splice(0,props.selectedContainerNames.length)\r\n let containers = getContainerList(pods, props.selectedNamespaces, props.selectedPodNames)\r\n if (containers.length===1) props.selectedContainerNames.push(...containers)\r\n\r\n props.onSelect([...props.selectedNamespaces], [...props.selectedPodNames], [...props.selectedContainerNames])\r\n\r\n setRender(!render)\r\n }\r\n\r\n const onSelectContainer = (event : any) => {\r\n props.selectedContainerNames.splice(0,props.selectedContainerNames.length)\r\n props.selectedContainerNames.push( ...event.target.value )\r\n props.onSelect([...props.selectedNamespaces], [...props.selectedPodNames], [...props.selectedContainerNames])\r\n }\r\n\r\n // const existAccessKey = (namespace:string) => {\r\n // if (!props.cluster.accessKeys.has(InstanceConfigScopeEnum.VIEW)) return false\r\n // let accessKey = props.cluster.accessKeys.get(InstanceConfigScopeEnum.VIEW)\r\n // if (accessKey) {\r\n // let resources = parseResources(accessKey.resources)\r\n // return (resources.find(resource => resource.namespaces === namespace))\r\n // }\r\n // else return false\r\n\r\n // }\r\n const existAccessKey = (namespace:string) => {\r\n if (!props.cluster.accessKeys.has(props.scope)) return false\r\n let accessKey = props.cluster.accessKeys.get(props.scope)\r\n if (accessKey) {\r\n let resources = parseResources(accessKey.resources)\r\n return (resources.find(r => r.namespaces === namespace))\r\n }\r\n else return false\r\n\r\n }\r\n \r\n return (\r\n <Grid container direction='column' spacing={0} style={{marginBottom:6, width:'100%'}}>\r\n <Grid item>\r\n {\r\n namespaceList.map ((namespace,index) => {\r\n if (props.disabled) {\r\n if (existAccessKey(namespace))\r\n return <Chip component={'span'} key={index} label={namespace} variant={props.selectedNamespaces.includes(namespace)?'default':'outlined'} size='small' color='default' />\r\n else\r\n return <Chip component={'span'} key={index} label={namespace} size='small' color='default' variant={'outlined'}/>\r\n }\r\n else {\r\n if (existAccessKey(namespace))\r\n return <Chip component={'span'} key={index} label={namespace} onClick={() => onNamespaceChange(namespace)} variant={props.selectedNamespaces.includes(namespace)?'default':'outlined'} size='small' color='primary' />\r\n else\r\n return <Chip component={'span'} key={index} label={namespace} size='small' color='secondary' variant={'outlined'}/>\r\n }\r\n })\r\n }\r\n </Grid>\r\n <Grid container item xs={12} spacing={2}>\r\n <Grid item xs={6}>\r\n <FormControl size='small' fullWidth>\r\n <Select value={props.selectedPodNames} MenuProps={{variant:'menu'}} multiple onChange={onSelectPod} renderValue={(selected) => (selected as string[]).join(', ')} disabled={props.disabled || props.selectedNamespaces.length===0 || getPodList(pods,props.selectedNamespaces).length===1}>\r\n {\r\n getPodList(pods, props.selectedNamespaces).map(pod => {\r\n return (\r\n <MenuItem key={pod.name} value={pod.name}>\r\n <Checkbox checked={props.selectedPodNames.includes(pod.name)} />\r\n <ListItemText primary={pod.name} />\r\n </MenuItem>\r\n )\r\n })\r\n }\r\n </Select>\r\n </FormControl>\r\n </Grid>\r\n <Grid item xs={6}>\r\n <FormControl size='small' fullWidth>\r\n <Select value={props.selectedContainerNames} MenuProps={{variant:'menu'}} multiple onChange={onSelectContainer} renderValue={(selected) => (selected as string[]).join(', ')} disabled={props.disabled || props.selectedPodNames.length===0 || getContainerList(pods, props.selectedNamespaces, props.selectedPodNames).length===1}>\r\n {\r\n getContainerList(pods, props.selectedNamespaces, props.selectedPodNames).map(container => {\r\n return (\r\n <MenuItem key={container} value={container}>\r\n <Checkbox checked={props.selectedContainerNames.includes(container)} />\r\n <ListItemText primary={container} />\r\n </MenuItem>\r\n )\r\n })\r\n }\r\n </Select>\r\n </FormControl>\r\n </Grid>\r\n </Grid>\r\n </Grid>\r\n )\r\n}\r\n\r\nexport { ObjectSelector }"],"names":[],"mappings":";;;;;AA8BA,MAAM,cAAA,GAAiB,CAAC,KAAA,KAAkB;AACtC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAI,SAAS,KAAK,CAAA;AAC1C,EAAA,IAAI,IAAA,GAAO,MAAM,OAAA,CAAQ,IAAA;AACzB,EAAA,IAAI,aAAA,GAAgB,KAAA,CAAM,IAAA,CAAK,IAAI,GAAA,CAAI,IAAA,CAAK,GAAA,CAAI,CAAA,CAAA,KAAK,CAAA,CAAE,SAAS,CAAC,CAAC,CAAA;AAElE,EAAA,MAAM,iBAAA,GAAoB,CAAC,SAAA,KAAqB;AAC5C,IAAA,IAAI,CAAA,GAAI,KAAA,CAAM,kBAAA,CAAmB,OAAA,CAAQ,SAAS,CAAA;AAClD,IAAA,IAAI,CAAA,IAAG,CAAA;AACH,MAAA,KAAA,CAAM,kBAAA,CAAmB,MAAA,CAAO,CAAA,EAAE,CAAC,CAAA;AAAA;AAEnC,MAAA,KAAA,CAAM,kBAAA,CAAmB,KAAK,SAAS,CAAA;AAE3C,IAAA,KAAA,CAAM,gBAAA,CAAiB,MAAA,CAAO,CAAA,EAAE,KAAA,CAAM,iBAAiB,MAAM,CAAA;AAC7D,IAAA,IAAI,SAAA,GAAY,UAAA,CAAW,IAAA,EAAM,KAAA,CAAM,kBAAkB,CAAA;AACzD,IAAA,KAAA,CAAM,gBAAA,CAAiB,KAAM,GAAG,SAAA,CAAU,IAAI,CAAA,GAAA,KAAO,GAAA,CAAI,IAAI,CAAE,CAAA;AAE/D,IAAA,KAAA,CAAM,sBAAA,CAAuB,MAAA,CAAO,CAAA,EAAE,KAAA,CAAM,uBAAuB,MAAM,CAAA;AACzE,IAAA,IAAI,aAAa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AA,EAAwB,SAAA,EAAW,EAAC,OAAA,EAAQ,MAAA,EAAM,EAAG,QAAA,EAAQ,MAAC,QAAA,EAAU,iBAAA,EAAmB,WAAA,EAAa,CAAC,QAAA,KAAc,QAAA,CAAsB,IAAA,CAAK,IAAI,CAAA,EAAG,QAAA,EAAU,KAAA,CAAM,QAAA,IAAY,KAAA,CAAM,gBAAA,CAAiB,MAAA,KAAS,CAAA,IAAK,gBAAA,CAAiB,IAAA,EAAM,KAAA,CAAM,kBAAA,EAAoB,KAAA,CAAM,gBAAgB,CAAA,CAAE,MAAA,KAAS,CAAA,EAAA,EAEzT,gBAAA,CAAiB,IAAA,EAAM,KAAA,CAAM,kBAAA,EAAoB,KAAA,CAAM,gBAAgB,CAAA,CAAE,IAAI,CAAA,SAAA,KAAa;AACtF,IAAA,2CACK,QAAA,EAAA,EAAS,GAAA,EAAK,WAAW,KAAA,EAAO,SAAA,EAAA,sCAC5B,QAAA,EAAA,EAAS,OAAA,EAAS,MAAM,sBAAA,CAAuB,QAAA,CAAS,SAAS,CAAA,EAAG,CAAA,sCACpE,YAAA,EAAA,EAAa,OAAA,EAAS,WAAW,CACtC,CAAA;AAAA,EAER,CAAC,CAET,CACJ,CACJ,CACJ,CACJ,CAAA;AAER;;;;"}
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import IconButton from '@material-ui/core/IconButton';
3
+ import Snackbar from '@material-ui/core/Snackbar';
4
+ import CloseIcon from '@material-ui/icons/Close';
5
+
6
+ const ShowError = (props) => {
7
+ return /* @__PURE__ */ React.createElement(
8
+ Snackbar,
9
+ {
10
+ message: `An error has ocurred: ${props.message}`,
11
+ open: true,
12
+ autoHideDuration: 3e3,
13
+ anchorOrigin: { vertical: "top", horizontal: "center" },
14
+ action: /* @__PURE__ */ React.createElement(IconButton, { size: "small", "aria-label": "close", color: "inherit", onClick: props.onClose }, /* @__PURE__ */ React.createElement(CloseIcon, { fontSize: "small" }))
15
+ }
16
+ );
17
+ };
18
+
19
+ export { ShowError };
20
+ //# sourceMappingURL=ShowError.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShowError.esm.js","sources":["../../src/ShowError/ShowError.tsx"],"sourcesContent":["/*\r\nCopyright 2025 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 IconButton from '@material-ui/core/IconButton'\r\nimport Snackbar from '@material-ui/core/Snackbar'\r\nimport CloseIcon from '@material-ui/icons/Close'\r\n\r\nconst ShowError = (props: {\r\n message: string\r\n onClose:() => void\r\n }) => {\r\n\r\n return (\r\n <Snackbar \r\n message={`An error has ocurred: ${props.message}`}\r\n open={true}\r\n autoHideDuration={3000}\r\n anchorOrigin={{ vertical:'top', horizontal:'center' }}\r\n action={ \r\n <IconButton size=\"small\" aria-label=\"close\" color=\"inherit\" onClick={props.onClose}>\r\n <CloseIcon fontSize=\"small\" />\r\n </IconButton>\r\n }>\r\n </Snackbar>\r\n )\r\n}\r\n\r\nexport { ShowError }"],"names":[],"mappings":";;;;;AAoBA,MAAM,SAAA,GAAY,CAAC,KAAA,KAGT;AAEN,EAAA,uBACI,KAAA,CAAA,aAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACG,OAAA,EAAS,CAAA,sBAAA,EAAyB,KAAA,CAAM,OAAO,CAAA,CAAA;AAAA,MAC/C,IAAA,EAAM,IAAA;AAAA,MACN,gBAAA,EAAkB,GAAA;AAAA,MAClB,YAAA,EAAc,EAAE,QAAA,EAAS,KAAA,EAAO,YAAW,QAAA,EAAS;AAAA,MACpD,wBACI,KAAA,CAAA,aAAA,CAAC,UAAA,EAAA,EAAW,IAAA,EAAK,OAAA,EAAQ,cAAW,OAAA,EAAQ,KAAA,EAAM,SAAA,EAAU,OAAA,EAAS,MAAM,OAAA,EAAA,kBACvE,KAAA,CAAA,aAAA,CAAC,SAAA,EAAA,EAAU,QAAA,EAAS,SAAQ,CAChC;AAAA;AAAA,GAER;AAER;;;;"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Dialog, DialogTitle, DialogContent, Typography, DialogActions, Button } from '@material-ui/core';
3
+ import { InstanceMessageTypeEnum } from '@jfvilas/kwirth-common';
4
+
5
+ const StatusLog = (props) => {
6
+ return /* @__PURE__ */ React.createElement(Dialog, { open: true }, /* @__PURE__ */ React.createElement(DialogTitle, null, "Status: ", props.level), /* @__PURE__ */ React.createElement(DialogContent, null, props.statusMessages.filter((m) => m.type === InstanceMessageTypeEnum.SIGNAL && m.level === props.level).map((m, index) => /* @__PURE__ */ React.createElement(Typography, { key: index }, m.text))), /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, { onClick: () => props.onClear(props.level), color: "primary", variant: "contained" }, "Clear"), /* @__PURE__ */ React.createElement(Button, { onClick: props.onClose, color: "primary", variant: "contained" }, "Close")));
7
+ };
8
+
9
+ export { StatusLog };
10
+ //# sourceMappingURL=StatusLog.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StatusLog.esm.js","sources":["../../src/StatusLog/StatusLog.tsx"],"sourcesContent":["/*\r\nCopyright 2025 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 { Dialog, DialogTitle, DialogContent, DialogActions, Button, Typography } from '@material-ui/core'\r\nimport { InstanceMessageTypeEnum, SignalMessageLevelEnum } from '@jfvilas/kwirth-common'\r\nimport { IStatusLine } from '@jfvilas/plugin-kwirth-common';\r\n\r\ninterface IProps {\r\n level: SignalMessageLevelEnum\r\n statusMessages: IStatusLine[]\r\n onClear: (level:SignalMessageLevelEnum) => void\r\n onClose: () => void\r\n}\r\n\r\nconst StatusLog = (props:IProps) => {\r\n return (\r\n <Dialog open={true}>\r\n <DialogTitle>\r\n Status: {props.level} \r\n </DialogTitle>\r\n <DialogContent>\r\n { props.statusMessages.filter(m => m.type === InstanceMessageTypeEnum.SIGNAL && m.level === props.level).map( (m,index) => <Typography key={index}>{m.text}</Typography>) }\r\n </DialogContent>\r\n <DialogActions>\r\n <Button onClick={() => props.onClear(props.level)} color='primary' variant='contained'>Clear</Button>\r\n <Button onClick={props.onClose} color='primary' variant='contained'>Close</Button>\r\n </DialogActions>\r\n </Dialog>\r\n )\r\n\r\n}\r\n\r\nexport { StatusLog }"],"names":[],"mappings":";;;;AA2BA,MAAM,SAAA,GAAY,CAAC,KAAA,KAAiB;AAChC,EAAA,uBACI,KAAA,CAAA,aAAA,CAAC,MAAA,EAAA,EAAO,IAAA,EAAM,IAAA,EAAA,kBACV,KAAA,CAAA,aAAA,CAAC,WAAA,EAAA,IAAA,EAAY,UAAA,EACA,KAAA,CAAM,KACnB,CAAA,kBACA,KAAA,CAAA,aAAA,CAAC,aAAA,EAAA,IAAA,EACK,MAAM,cAAA,CAAe,MAAA,CAAO,CAAA,CAAA,KAAK,CAAA,CAAE,IAAA,KAAS,uBAAA,CAAwB,MAAA,IAAU,CAAA,CAAE,UAAU,KAAA,CAAM,KAAK,CAAA,CAAE,GAAA,CAAK,CAAC,CAAA,EAAE,KAAA,qBAAU,KAAA,CAAA,aAAA,CAAC,cAAW,GAAA,EAAK,KAAA,EAAA,EAAQ,CAAA,CAAE,IAAK,CAAa,CAC5K,CAAA,kBACA,KAAA,CAAA,aAAA,CAAC,aAAA,EAAA,IAAA,kBACG,KAAA,CAAA,aAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAS,MAAM,KAAA,CAAM,OAAA,CAAQ,KAAA,CAAM,KAAK,CAAA,EAAG,KAAA,EAAM,SAAA,EAAU,OAAA,EAAQ,WAAA,EAAA,EAAY,OAAK,CAAA,kBAC5F,KAAA,CAAA,aAAA,CAAC,UAAO,OAAA,EAAS,KAAA,CAAM,OAAA,EAAS,KAAA,EAAM,SAAA,EAAU,OAAA,EAAQ,WAAA,EAAA,EAAY,OAAK,CAC7E,CACJ,CAAA;AAGR;;;;"}
@@ -0,0 +1,15 @@
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
+ <text style="fill: rgb(51, 51, 51); font-family: &quot;Courier New&quot;; font-size: 1.75px; white-space: pre;" transform="matrix(1, 0, 0, 1, -44.411018, -3.602949)"><tspan x="145.276" y="93.456"> .%#@@@++==@@@@@@@@@-</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .@*-+% @@@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> #%-.+# @@@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> -%:.=@ @@@@..*</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> :@*::.@ @ @@ @@*@*: =.</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .:...@ .@@ % @@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@@@@@%*@ :.:+@@#%@@++ @@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@ :..@@%%@@@#*++=:....:-=+#%@@= *-</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> -+:::::...::::::::::::::..:+%#@@-</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .@.=@%+::.::::::::::::::::::::::::.:.-%@*</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> :@-%+:..:::::::::::::::::::::::::::::.@ :@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .@-...::::::::::::::::::::::::::::::: @ %@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> ==.:::::::::::::::::::::::::::::::: @</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .+...::::::::::::::::::::::::::::::.@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .++=.::::::::::::::::::::::::::::::.%</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> =@ ::.:::::::...:::...::::::::......%</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .@.:@@@@@#####%@@*:..=%@@@%##%%@@@@@@%@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@ .@@@% =@%@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> .+#. @%+.@@:</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> #+:@ @ @ -@ @# @@@@ @@@@@@-:: :@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @.-*@@ #@%@@@+=%@@ -%=*##++- .=#+:....... @</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @-...@ ......... :=::::::::....:::::::.%@: @</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @.*- .@@+-:-*#%#%@*:::::::::---:-::::::. @=-=</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> *::#- .:=-=::.*= %:::::::::-==-::::::::.:.@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @:-+:........:= %:.....:::....::::::::.:*.</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> %#*@@=::::::.=@ @@-.=. .:::::::::::::-*@*</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> %. =:::::::-* =@@#.::::::::::::=@ @@@@@@*</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@@@@@@@. @@@@@@@ --::::...+-@@@@: .:::::::::::-@ @@@.</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ @@: %=:::+*@:: @@@@+ ..::::::::::::@ @@@.</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ @@@ :- * @=%# .++-:. ..:... @@@ @@@.</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ @@ .@ . .. @@@ @@@.</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ @@@ @@@@@@@@. @@@ @@@@@@@@@@@@@@@@@@@@=#+:+@@@@@@ +@@@@@ @@@@@@@@@@@* @@@ =@@@@@@@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ +@@ @@@ +@@@@. @: # @@@ :.. @@@@@@@ @@ @@@ @@@%@@. @@@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@.@@ @@@@ @@@@@ @ . @@ @@@ +:::: @@@@ @@@ @@@@ @@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@=@@@@ @@@ @@ .@@. @@% @@@@ .:::: @@@@ =. @@@ @@@ @@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ =@@@@ @@@@%@@@@ @@@ @@ -@+ @@@@ ..... @@@@ = . @@@ @@@ @@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ @@@@. @@@ @% @@@ @@ %@- @@@**@@@%@ @@@@ = @@@@@@@ @@@ @@@ @@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ .@@@@ @@@@ @@ @@@ @. .@. :@ @@@ % @@@@ + . @@@ @@@ @@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ @@@@@ @@@@@ @@@@@ @. :* =@@@ @ @@@@ @@@ @@@ @@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@ @@@@ @@@@ *@@@ @ @@@ = @@@@ @@@@ @@@ @@@</tspan><tspan x="145.276" dy="1em">​</tspan><tspan> @@@@@@@@@ @@@@@@@@@ @@@ @@@ @@@@@@@@@@@@ @@@@@@@@@ @@@@@@@= @@@@@@@@@ @@@@@@@@@</tspan></text>
15
+ </svg>
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { Entity } from '@backstage/catalog-model';
3
+ import { ClusterValidPods } from '@jfvilas/plugin-kwirth-common';
4
+
5
+ declare enum ErrorType {
6
+ NO_PODS = 0,
7
+ NO_CLUSTERS = 1
8
+ }
9
+ declare const ComponentNotFound: (props: {
10
+ error: ErrorType;
11
+ entity: Entity;
12
+ }) => React.JSX.Element;
13
+
14
+ interface IProps {
15
+ onSelect: (namespaces: string[], podNames: string[], containerNames: string[]) => void;
16
+ cluster: ClusterValidPods;
17
+ selectedNamespaces: string[];
18
+ selectedPodNames: string[];
19
+ selectedContainerNames: string[];
20
+ disabled: boolean;
21
+ }
22
+ declare const ObjectSelector: (props: IProps) => React.JSX.Element;
23
+
24
+ declare const VERSION = "0.12.9";
25
+
26
+ export { ComponentNotFound, ErrorType, ObjectSelector, VERSION };
@@ -0,0 +1,11 @@
1
+ export { ComponentNotFound, ErrorType } from './ComponentNotFound/ComponentNotFound.esm.js';
2
+ export { ObjectSelector } from './ObjectSelector/ObjectSelector.esm.js';
3
+ export { ClusterList } from './ClusterList/ClusterList.esm.js';
4
+ export { StatusLog } from './StatusLog/StatusLog.esm.js';
5
+ export { KwirthNews } from './KwirthNews/KwirthNews.esm.js';
6
+ export { ShowError } from './ShowError/ShowError.esm.js';
7
+
8
+ const VERSION = "0.12.9";
9
+
10
+ export { VERSION };
11
+ //# sourceMappingURL=index.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.esm.js","sources":["../src/index.ts"],"sourcesContent":["export const VERSION='0.12.9'\r\n\r\nexport * from './ComponentNotFound'\r\nexport * from './ObjectSelector'\r\nexport * from './ClusterList'\r\nexport * from './StatusLog'\r\nexport * from './KwirthNews'\r\nexport * from './ShowError'"],"names":[],"mappings":";;;;;;;AAAO,MAAM,OAAA,GAAQ;;;;"}
package/package.json ADDED
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "@jfvilas/plugin-kwirth-frontend",
3
+ "version": "0.13.0",
4
+ "description": "Frontend common artifacts for viewing real-time Kubernetes logs in Backstage",
5
+ "keywords": [
6
+ "Backstage",
7
+ "Kubernetes",
8
+ "log",
9
+ "observability",
10
+ "Kwirth",
11
+ "plugin",
12
+ "metrics"
13
+ ],
14
+ "backstage": {
15
+ "role": "frontend-plugin",
16
+ "pluginId": "kwirth",
17
+ "pluginPackages": [
18
+ "@jfvilas/plugin-kwirth-frontend",
19
+ "@jfvilas/plugin-kwirth-common"
20
+ ]
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/jfvilas/plugin-kwirth-frontend.git"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "license": "Apache-2.0",
30
+ "author": {
31
+ "name": "Julio Fernandez",
32
+ "url": "https://github.com/jfvilas",
33
+ "email": "jfvilas@outlook.com"
34
+ },
35
+ "sideEffects": false,
36
+ "exports": {
37
+ ".": {
38
+ "import": "./dist/index.esm.js",
39
+ "types": "./dist/index.d.ts",
40
+ "default": "./dist/index.esm.js"
41
+ },
42
+ "./package.json": "./package.json"
43
+ },
44
+ "main": "./dist/index.esm.js",
45
+ "types": "./dist/index.d.ts",
46
+ "files": [
47
+ "dist"
48
+ ],
49
+ "scripts": {
50
+ "build": "backstage-cli package build",
51
+ "clean": "backstage-cli package clean",
52
+ "lint": "backstage-cli package lint",
53
+ "prepack": "backstage-cli package prepack",
54
+ "postpack": "backstage-cli package postpack",
55
+ "start": "backstage-cli package start",
56
+ "test": "backstage-cli package test"
57
+ },
58
+ "dependencies": {
59
+ "@backstage/catalog-model": "1.5.0",
60
+ "@backstage/core-components": "^0.14.9",
61
+ "@backstage/core-plugin-api": "^1.9.3",
62
+ "@backstage/frontend-plugin-api": "^0.7.0",
63
+ "@backstage/integration-react": "^1.1.29",
64
+ "@backstage/plugin-auth-react": "^0.1.4",
65
+ "@backstage/plugin-catalog-react": "^1.12.2",
66
+ "@material-ui/core": "^4.12.2",
67
+ "@material-ui/icons": "^4.9.1",
68
+ "@types/react": "^16.13.1 || ^17.0.0 || ^18.0.0",
69
+ "react-use": "^17.2.4"
70
+ },
71
+ "devDependencies": {
72
+ "@backstage/cli": "^0.26.11",
73
+ "@testing-library/dom": "^10.0.0",
74
+ "@testing-library/jest-dom": "^6.0.0",
75
+ "@testing-library/react": "^15.0.0",
76
+ "@types/lodash": "^4.14.151",
77
+ "@types/react-dom": "^18.2.19",
78
+ "canvas": "^2.11.2",
79
+ "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
80
+ "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
81
+ "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
82
+ },
83
+ "peerDependencies": {
84
+ "react": "^16.13.1 || ^17.0.0 || ^18.0.0",
85
+ "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0",
86
+ "react-router-dom": "6.0.0-beta.0 || ^6.3.0"
87
+ },
88
+ "module": "./dist/index.esm.js"
89
+ }