@techdocs/cli 1.10.2 → 1.10.3-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/commands/serve/mkdocs.cjs.js +4 -5
- package/dist/commands/serve/mkdocs.cjs.js.map +1 -1
- package/dist/commands/serve/serve.cjs.js +4 -5
- package/dist/commands/serve/serve.cjs.js.map +1 -1
- package/dist/commands/serve/utils.cjs.js +7 -10
- package/dist/commands/serve/utils.cjs.js.map +1 -1
- package/dist/embedded-app/.config-schema.json +227 -230
- package/dist/embedded-app/index.html +1 -1
- package/dist/embedded-app/index.html.tmpl +1 -1
- package/dist/embedded-app/static/1155.1bc918a1.chunk.js +10 -0
- package/dist/embedded-app/static/{1155.c6c120ba.chunk.js.map → 1155.1bc918a1.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1335.e649d01a.chunk.js → 1335.d9759037.chunk.js} +2 -2
- package/dist/embedded-app/static/{1335.e649d01a.chunk.js.map → 1335.d9759037.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1749.ecaae025.chunk.js → 1749.aa6bc589.chunk.js} +2 -2
- package/dist/embedded-app/static/{1749.ecaae025.chunk.js.map → 1749.aa6bc589.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{1994.90be16c3.chunk.js → 1994.ca9d4fc1.chunk.js} +2 -2
- package/dist/embedded-app/static/{1994.90be16c3.chunk.js.map → 1994.ca9d4fc1.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{2295.676254a6.chunk.js → 2295.3f44c986.chunk.js} +2 -2
- package/dist/embedded-app/static/{2295.676254a6.chunk.js.map → 2295.3f44c986.chunk.js.map} +1 -1
- package/dist/embedded-app/static/4591.8c1cd36f.chunk.js +2 -0
- package/dist/embedded-app/static/4591.8c1cd36f.chunk.js.map +1 -0
- package/dist/embedded-app/static/{4648.42e253c5.chunk.js → 4648.68d2c6ff.chunk.js} +2 -2
- package/dist/embedded-app/static/{4648.42e253c5.chunk.js.map → 4648.68d2c6ff.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{5574.3e0b1b01.chunk.js → 5574.723a5e64.chunk.js} +2 -2
- package/dist/embedded-app/static/{5574.3e0b1b01.chunk.js.map → 5574.723a5e64.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7203.f047878f.chunk.js → 6138.ca5f4dea.chunk.js} +2 -2
- package/dist/embedded-app/static/{6138.72f63616.chunk.js.map → 6138.ca5f4dea.chunk.js.map} +1 -1
- package/dist/embedded-app/static/6270.33cbf043.chunk.js +2 -0
- package/dist/embedded-app/static/{6270.0cf24ebb.chunk.js.map → 6270.33cbf043.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7186.96e6edf9.chunk.js +2 -0
- package/dist/embedded-app/static/{7186.c0fa7899.chunk.js.map → 7186.96e6edf9.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{6138.72f63616.chunk.js → 7203.7288c4e0.chunk.js} +2 -2
- package/dist/embedded-app/static/{7203.f047878f.chunk.js.map → 7203.7288c4e0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7226.99db194a.chunk.js +2 -0
- package/dist/embedded-app/static/{7226.f8fc7544.chunk.js.map → 7226.99db194a.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{7382.688a734f.chunk.js → 7382.836db1c7.chunk.js} +2 -2
- package/dist/embedded-app/static/{7382.688a734f.chunk.js.map → 7382.836db1c7.chunk.js.map} +1 -1
- package/dist/embedded-app/static/7526.601d8e47.chunk.js +2 -0
- package/dist/embedded-app/static/{7526.a9e2aca8.chunk.js.map → 7526.601d8e47.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{8125.d73ed16d.chunk.js → 8125.2e82046f.chunk.js} +3 -3
- package/dist/embedded-app/static/{8125.d73ed16d.chunk.js.map → 8125.2e82046f.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9050.47091371.chunk.js → 9050.1b486cae.chunk.js} +2 -2
- package/dist/embedded-app/static/{9050.47091371.chunk.js.map → 9050.1b486cae.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9230.57f4ae14.chunk.js → 9230.02b12ff0.chunk.js} +2 -2
- package/dist/embedded-app/static/{9230.57f4ae14.chunk.js.map → 9230.02b12ff0.chunk.js.map} +1 -1
- package/dist/embedded-app/static/{9579.46a875e3.chunk.js → 9579.beaea584.chunk.js} +2 -2
- package/dist/embedded-app/static/{9579.46a875e3.chunk.js.map → 9579.beaea584.chunk.js.map} +1 -1
- package/dist/embedded-app/static/main.1e025874.js +550 -0
- package/dist/embedded-app/static/main.1e025874.js.map +1 -0
- package/dist/embedded-app/static/{runtime.1ed9627a.js → runtime.a358dfe6.js} +2 -2
- package/dist/embedded-app/static/runtime.a358dfe6.js.map +1 -0
- package/dist/embedded-app/static/vendor.4b7983a7.js +2 -0
- package/dist/embedded-app/static/vendor.4b7983a7.js.map +1 -0
- package/dist/lib/mkdocsServer.cjs.js +10 -10
- package/dist/lib/mkdocsServer.cjs.js.map +1 -1
- package/dist/package.json.cjs.js +1 -1
- package/package.json +7 -7
- package/dist/embedded-app/static/1155.c6c120ba.chunk.js +0 -10
- package/dist/embedded-app/static/4591.c7904e2c.chunk.js +0 -2
- package/dist/embedded-app/static/4591.c7904e2c.chunk.js.map +0 -1
- package/dist/embedded-app/static/6270.0cf24ebb.chunk.js +0 -2
- package/dist/embedded-app/static/7186.c0fa7899.chunk.js +0 -2
- package/dist/embedded-app/static/7226.f8fc7544.chunk.js +0 -2
- package/dist/embedded-app/static/7526.a9e2aca8.chunk.js +0 -2
- package/dist/embedded-app/static/main.a9a0a87c.js +0 -550
- package/dist/embedded-app/static/main.a9a0a87c.js.map +0 -1
- package/dist/embedded-app/static/runtime.1ed9627a.js.map +0 -1
- package/dist/embedded-app/static/vendor.5686e88b.js +0 -2
- package/dist/embedded-app/static/vendor.5686e88b.js.map +0 -1
- package/dist/lib/run.cjs.js +0 -58
- package/dist/lib/run.cjs.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var cliCommon = require('@backstage/cli-common');
|
|
4
4
|
|
|
5
|
-
const runMkdocsServer =
|
|
5
|
+
const runMkdocsServer = (options) => {
|
|
6
6
|
const port = options.port ?? "8000";
|
|
7
7
|
const useDocker = options.useDocker ?? true;
|
|
8
8
|
const dockerImage = options.dockerImage ?? "spotify/techdocs";
|
|
9
9
|
if (useDocker) {
|
|
10
|
-
return
|
|
11
|
-
"docker",
|
|
10
|
+
return cliCommon.run(
|
|
12
11
|
[
|
|
12
|
+
"docker",
|
|
13
13
|
"run",
|
|
14
14
|
"--rm",
|
|
15
15
|
"-w",
|
|
@@ -31,14 +31,14 @@ const runMkdocsServer = async (options) => {
|
|
|
31
31
|
...options.mkdocsParameterStrict ? ["--strict"] : []
|
|
32
32
|
],
|
|
33
33
|
{
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
onStdout: options.onStdout,
|
|
35
|
+
onStderr: options.onStderr
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
|
-
return
|
|
40
|
-
"mkdocs",
|
|
39
|
+
return cliCommon.run(
|
|
41
40
|
[
|
|
41
|
+
"mkdocs",
|
|
42
42
|
"serve",
|
|
43
43
|
"--dev-addr",
|
|
44
44
|
`127.0.0.1:${port}`,
|
|
@@ -48,8 +48,8 @@ const runMkdocsServer = async (options) => {
|
|
|
48
48
|
...options.mkdocsParameterStrict ? ["--strict"] : []
|
|
49
49
|
],
|
|
50
50
|
{
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
onStdout: options.onStdout,
|
|
52
|
+
onStderr: options.onStderr
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mkdocsServer.cjs.js","sources":["../../src/lib/mkdocsServer.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {
|
|
1
|
+
{"version":3,"file":"mkdocsServer.cjs.js","sources":["../../src/lib/mkdocsServer.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { run, RunChildProcess, RunOnOutput } from '@backstage/cli-common';\n\nexport const runMkdocsServer = (options: {\n port?: string;\n useDocker?: boolean;\n dockerImage?: string;\n dockerEntrypoint?: string;\n dockerOptions?: string[];\n onStdout?: RunOnOutput;\n onStderr?: RunOnOutput;\n mkdocsConfigFileName?: string;\n mkdocsParameterClean?: boolean;\n mkdocsParameterDirtyReload?: boolean;\n mkdocsParameterStrict?: boolean;\n}): RunChildProcess => {\n const port = options.port ?? '8000';\n const useDocker = options.useDocker ?? true;\n const dockerImage = options.dockerImage ?? 'spotify/techdocs';\n\n if (useDocker) {\n return run(\n [\n 'docker',\n 'run',\n '--rm',\n '-w',\n '/content',\n '-v',\n `${process.cwd()}:/content`,\n '-p',\n `${port}:${port}`,\n '-it',\n ...(options.dockerEntrypoint\n ? ['--entrypoint', options.dockerEntrypoint]\n : []),\n ...(options.dockerOptions || []),\n dockerImage,\n 'serve',\n '--dev-addr',\n `0.0.0.0:${port}`,\n ...(options.mkdocsConfigFileName\n ? ['--config-file', options.mkdocsConfigFileName]\n : []),\n ...(options.mkdocsParameterClean ? ['--clean'] : []),\n ...(options.mkdocsParameterDirtyReload ? ['--dirtyreload'] : []),\n ...(options.mkdocsParameterStrict ? ['--strict'] : []),\n ],\n {\n onStdout: options.onStdout,\n onStderr: options.onStderr,\n },\n );\n }\n\n return run(\n [\n 'mkdocs',\n 'serve',\n '--dev-addr',\n `127.0.0.1:${port}`,\n ...(options.mkdocsConfigFileName\n ? ['--config-file', options.mkdocsConfigFileName]\n : []),\n ...(options.mkdocsParameterClean ? ['--clean'] : []),\n ...(options.mkdocsParameterDirtyReload ? ['--dirtyreload'] : []),\n ...(options.mkdocsParameterStrict ? ['--strict'] : []),\n ],\n {\n onStdout: options.onStdout,\n onStderr: options.onStderr,\n },\n );\n};\n"],"names":["run"],"mappings":";;;;AAkBO,MAAM,eAAA,GAAkB,CAAC,OAAA,KAYT;AACrB,EAAA,MAAM,IAAA,GAAO,QAAQ,IAAA,IAAQ,MAAA;AAC7B,EAAA,MAAM,SAAA,GAAY,QAAQ,SAAA,IAAa,IAAA;AACvC,EAAA,MAAM,WAAA,GAAc,QAAQ,WAAA,IAAe,kBAAA;AAE3C,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,OAAOA,aAAA;AAAA,MACL;AAAA,QACE,QAAA;AAAA,QACA,KAAA;AAAA,QACA,MAAA;AAAA,QACA,IAAA;AAAA,QACA,UAAA;AAAA,QACA,IAAA;AAAA,QACA,CAAA,EAAG,OAAA,CAAQ,GAAA,EAAK,CAAA,SAAA,CAAA;AAAA,QAChB,IAAA;AAAA,QACA,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA;AAAA,QACf,KAAA;AAAA,QACA,GAAI,QAAQ,gBAAA,GACR,CAAC,gBAAgB,OAAA,CAAQ,gBAAgB,IACzC,EAAC;AAAA,QACL,GAAI,OAAA,CAAQ,aAAA,IAAiB,EAAC;AAAA,QAC9B,WAAA;AAAA,QACA,OAAA;AAAA,QACA,YAAA;AAAA,QACA,WAAW,IAAI,CAAA,CAAA;AAAA,QACf,GAAI,QAAQ,oBAAA,GACR,CAAC,iBAAiB,OAAA,CAAQ,oBAAoB,IAC9C,EAAC;AAAA,QACL,GAAI,OAAA,CAAQ,oBAAA,GAAuB,CAAC,SAAS,IAAI,EAAC;AAAA,QAClD,GAAI,OAAA,CAAQ,0BAAA,GAA6B,CAAC,eAAe,IAAI,EAAC;AAAA,QAC9D,GAAI,OAAA,CAAQ,qBAAA,GAAwB,CAAC,UAAU,IAAI;AAAC,OACtD;AAAA,MACA;AAAA,QACE,UAAU,OAAA,CAAQ,QAAA;AAAA,QAClB,UAAU,OAAA,CAAQ;AAAA;AACpB,KACF;AAAA,EACF;AAEA,EAAA,OAAOA,aAAA;AAAA,IACL;AAAA,MACE,QAAA;AAAA,MACA,OAAA;AAAA,MACA,YAAA;AAAA,MACA,aAAa,IAAI,CAAA,CAAA;AAAA,MACjB,GAAI,QAAQ,oBAAA,GACR,CAAC,iBAAiB,OAAA,CAAQ,oBAAoB,IAC9C,EAAC;AAAA,MACL,GAAI,OAAA,CAAQ,oBAAA,GAAuB,CAAC,SAAS,IAAI,EAAC;AAAA,MAClD,GAAI,OAAA,CAAQ,0BAAA,GAA6B,CAAC,eAAe,IAAI,EAAC;AAAA,MAC9D,GAAI,OAAA,CAAQ,qBAAA,GAAwB,CAAC,UAAU,IAAI;AAAC,KACtD;AAAA,IACA;AAAA,MACE,UAAU,OAAA,CAAQ,QAAA;AAAA,MAClB,UAAU,OAAA,CAAQ;AAAA;AACpB,GACF;AACF;;;;"}
|
package/dist/package.json.cjs.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@techdocs/cli",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.3-next.1",
|
|
4
4
|
"description": "Utility CLI for managing TechDocs sites in Backstage.",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "cli"
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"watch": "./src"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@backstage/backend-defaults": "
|
|
48
|
-
"@backstage/catalog-model": "
|
|
49
|
-
"@backstage/cli-common": "
|
|
50
|
-
"@backstage/config": "
|
|
51
|
-
"@backstage/plugin-techdocs-node": "
|
|
47
|
+
"@backstage/backend-defaults": "0.14.0-next.0",
|
|
48
|
+
"@backstage/catalog-model": "1.7.6",
|
|
49
|
+
"@backstage/cli-common": "0.1.16-next.1",
|
|
50
|
+
"@backstage/config": "1.3.6",
|
|
51
|
+
"@backstage/plugin-techdocs-node": "1.13.10-next.0",
|
|
52
52
|
"commander": "^12.0.0",
|
|
53
53
|
"fs-extra": "^11.0.0",
|
|
54
54
|
"global-agent": "^3.0.0",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"winston": "^3.2.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@backstage/cli": "
|
|
61
|
+
"@backstage/cli": "0.34.6-next.1",
|
|
62
62
|
"@types/commander": "^2.12.2",
|
|
63
63
|
"@types/fs-extra": "^11.0.0",
|
|
64
64
|
"@types/http-proxy": "^1.17.4",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["1155"],{90615:function(e,t,n){n.d(t,{K:()=>r});var a=n(18690);function r(e){return(0,a.g)()}},22845:function(e,t,n){n.d(t,{T7:()=>c,TY:()=>d,tN:()=>u});var a=n(31085),r=n(58077),s=n(92829),i=n(9135),o=n(20549);let l=(0,i.tK)("entity-context"),c=e=>{let{children:t,entity:n,loading:i,error:c,refresh:u}=e;return(0,a.jsx)(l.Provider,{value:(0,o.B)({1:{entity:n,loading:i,error:c,refresh:u}}),children:(0,a.jsx)(s.Ig,{attributes:{...n?{entityRef:(0,r.U2)(n)}:void 0},children:t})})};function u(){let e=(0,i.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:t.entity}}function d(){let e=(0,i.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:n,loading:a,error:r,refresh:s}=t;return{entity:n,loading:a,error:r,refresh:s}}},83390:function(e,t,n){n.d(t,{Router:()=>M,LegacyEmbeddedDocsRouter:()=>$});var a=n(31085),r=n(18690),s=n(58077),i=n(78931),o=n(95269),l=n(50875),c=n(85066),u=n(4518),d=n(14041),h=n(81219),p=n(90898);let m=({entity:e,withSearch:t=!0})=>{let n=(0,s.sM)(e),r=function(e){let{kind:t,name:n,namespace:a}=e,r=(0,h.S)(p.Oc),s=(0,h.S)(p.Ri);return(0,d.useMemo)(()=>{let e=r({kind:t,namespace:a,name:n}).replace(/\/+$/,""),i=s().replace(/\/+$/,"");return t=>{if(t.toLocaleLowerCase("en-US").startsWith(e.toLocaleLowerCase("en-US"))){let n=t.slice(e.length).replace(/^\/+/,"");return 0===n.length||n.startsWith("#")?`${i}${n}`:`${i}/${n}`}return t}},[r,s,t,n,a])}(n);if(e.metadata.annotations?.[i.GO])try{n=(0,s.KU)(e.metadata.annotations?.[i.GO])}catch{}let m=(0,o.oN)(e);return(0,a.jsxs)(l.Wj,{entityRef:n,children:[(0,a.jsx)(u.Z,{}),(0,a.jsx)(c.p,{withSearch:t,searchResultUrlMapper:r,defaultPath:m})]})};var g=n(34289),x=n(99480),f=n(22845),y=n(9720),j=n(64947),v=n(58837),w=n(72501),E=n(35571),A=n(4809),b=n(60603),k=n(55994),C=n(79811);let S=(0,v.A)(e=>({code:{borderRadius:6,margin:e.spacing(2,0),background:"dark"===e.palette.type?"#444":e.palette.common.white}}),{name:"BackstageMissingAnnotationEmptyState"});function R(e){var t;let n,r,s,i,o,l,c,u,{t:d}=(0,k.i)(C.j);try{n=(0,f.tN)().entity}catch(e){}let{annotation:h,readMoreUrl:p}=e,m=Array.isArray(h)?h:[h],g=S(),x=n?.kind||"Component",{yamlText:v,lineNumbers:R}=(t=n,r=t?.kind||"Component",s=t?.metadata.name||"example",i=t?.spec?.type||"website",o=t?.spec?.owner||"user:default/guest",l=`apiVersion: backstage.io/v1alpha1
|
|
2
|
-
kind: ${r}
|
|
3
|
-
metadata:
|
|
4
|
-
name: ${s}
|
|
5
|
-
annotations:${m.map(e=>`
|
|
6
|
-
${e}: value`).join("")}
|
|
7
|
-
spec:
|
|
8
|
-
type: ${i}
|
|
9
|
-
owner: ${o}`,c=6,u=[],m.forEach(()=>{u.push(c),c++}),{yamlText:l,lineNumbers:u});return(0,a.jsx)(E.p,{missing:"field",title:d("missingAnnotationEmptyState.title"),description:function(e,t="Component",n){let r=e.map(e=>(0,a.jsx)("code",{children:e},e)).reduce((e,t)=>(0,a.jsxs)(a.Fragment,{children:[e,", ",t]}));return n("missingAnnotationEmptyState.generateDescription",{count:e.length,entityKind:t,annotations:r})}(m,x,d),action:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.A,{variant:"body1",children:d("missingAnnotationEmptyState.annotationYaml",{entityKind:x})}),(0,a.jsx)(y.A,{className:g.code,children:(0,a.jsx)(A.z,{text:v,language:"yaml",showLineNumbers:!0,highlightedNumbers:R,customStyle:{background:"inherit",fontSize:"115%"}})}),(0,a.jsx)(j.A,{color:"primary",component:b.N_,to:p||"https://backstage.io/docs/features/software-catalog/well-known-annotations",children:d("missingAnnotationEmptyState.readMore")})]})})}let M=()=>(0,a.jsxs)(r.BV,{children:[(0,a.jsx)(r.qh,{path:"/",element:(0,a.jsx)(g.TechDocsIndexPage,{})}),(0,a.jsx)(r.qh,{path:"/:namespace/:kind/:name/*",element:(0,a.jsx)(x.W,{})})]}),O=e=>{let{children:t,emptyState:n,withSearch:s=!0}=e,{entity:o}=(0,f.tN)(),l=(0,r.Ye)([{path:"/*",element:(0,a.jsx)(m,{entity:o,withSearch:s}),children:[{path:"*",element:t}]}]);return o.metadata.annotations?.[i.As]||o.metadata.annotations?.[i.GO]?l:n??(0,a.jsx)(R,{annotation:[i.As]})},$=({children:e,withSearch:t=!0})=>(0,a.jsx)(O,{children:e,withSearch:t})},34289:function(e,t,n){n.d(t,{TechDocsIndexPage:()=>i});var a=n(31085),r=n(18690),s=n(70335);let i=e=>(0,r.P1)()||(0,a.jsx)(s.K,{...e})},99480:function(e,t,n){n.d(t,{W:()=>D});var a=n(31085),r=n(14041),s=n(18690),i=n(12439),o=n(55489),l=n(90479),c=n(63401),u=n(85066),d=n(68999),h=n(4518),p=n(90898),m=n(90615),g=n(65605),x=n(60691),f=n(91189),y=n(64947),j=n(5712),v=n(62244),w=n(89602),E=n(16261),A=n(76842),b=n(33947);function k(e){let{children:t,...n}=e,{Progress:s}=(0,f.n)().getComponents(),i=function(e){let{pluginId:t}=e??{},n=(0,j.gf)(v.a),a=(0,j.gf)(w.I),s=(0,r.useMemo)(()=>"BroadcastChannel"in window?new BroadcastChannel(`${t}-auth-cookie-expires-at`):null,[t]),[i,o]=function(e,t){let[n,a]=(0,r.useState)({status:"not-executed",error:void 0,result:void 0}),s=(0,r.useRef)(),i=(0,r.useRef)(),o=(0,E.J)({execute(...t){i.current=t;let n=e(...t);return s.current=n,a(e=>({...e,status:"loading"})),n.then(e=>{n===s.current&&a(t=>({...t,status:"success",error:void 0,result:e}))},e=>{n===s.current&&a(t=>({...t,status:"error",error:e}))}),n},reset(){a({status:"not-executed",error:void 0,result:void 0}),s.current=void 0,i.current=void 0}});return[n,(0,r.useMemo)(()=>({reset(){o.current.reset()},execute:(...e)=>o.current.execute(...e)}),[]),{promise:s.current,lastArgs:i.current}]}(async()=>{let e=await a.getBaseUrl(t),r=`${e}/.backstage/auth/v1/cookie`,s=await n.fetch(`${r}`,{credentials:"include"});if(!s.ok){if(404===s.status)return{expiresAt:new Date(Date.now()+31536e6)};throw await b.o.fromResponse(s)}let i=await s.json();if(!i.expiresAt)throw Error("No expiration date found in response");return i});(0,A.u)(o.execute);let l=(0,r.useCallback)(()=>{o.execute()},[o]),c=(0,r.useCallback)(e=>{let t=(1+3*Math.random())*6e4,n=setTimeout(l,Date.parse(e.expiresAt)-Date.now()-t);return()=>clearTimeout(n)},[l]);return((0,r.useEffect)(()=>{if("success"!==i.status||!i.result)return()=>{};s?.postMessage({action:"COOKIE_REFRESH_SUCCESS",payload:i.result});let e=c(i.result),t=t=>{let{action:n,payload:a}=t.data;"COOKIE_REFRESH_SUCCESS"===n&&(e(),e=c(a))};return s?.addEventListener("message",t),()=>{e(),s?.removeEventListener("message",t)}},[i,c,s]),"not-executed"===i.status||"loading"===i.status&&!i.result||"loading"===i.status&&i.error)?{status:"loading"}:"error"===i.status&&i.error?{status:"error",error:i.error,retry:l}:{status:"success",data:i.result}}(n);return"loading"===i.status?(0,a.jsx)(s,{}):"error"===i.status?(0,a.jsx)(x.b,{error:i.error,children:(0,a.jsx)(y.A,{variant:"outlined",onClick:i.retry,children:"Retry"})}):(0,a.jsx)(a.Fragment,{children:t})}var C=n(99314),S=n(54917),R=n(41329),M=n(50868),O=n(73466),$=n(81219),I=n(76272),L=n(58077),_=n(95269),N=n(78931);let T=e=>{let{withSearch:t,withHeader:n=!0}=e;return(0,a.jsxs)(i.Y,{themeId:"documentation",children:[n&&(0,a.jsx)(d.T,{}),(0,a.jsx)(h.Z,{}),(0,a.jsx)(u.p,{withSearch:t})]})},B=(0,C.A)(i.Y)({height:"inherit",overflowY:"visible"}),D=e=>{let t,n,i,u,d,h,x,f,y=(0,S.A)(),v=(0,r.useMemo)(()=>(0,R.A)({...y,...e.overrideThemeOptions||{}}),[y,e.overrideThemeOptions]),{kind:w,name:E,namespace:A}=(0,m.K)(p.Oc),{children:b,entityRef:C={kind:w,name:E,namespace:A}}=e,D=(0,s.P1)(),U=(0,r.useMemo)(()=>({kind:C.kind,name:C.name,namespace:C.namespace}),[C.kind,C.name,C.namespace]),{shouldShowProgress:F}=(t=(0,j.gf)(I.v),n=(0,s.Zp)(),i=(0,$.S)(p.Oc),u=(0,L.U2)(U),h=(d=(0,r.useRef)(null)).current!==u,x=(0,O.A)(async()=>{try{let e=await t.getEntityByRef(U);if(e?.metadata?.annotations?.[N.GO])return(0,_.b1)(e,i)}catch(e){}},[u,t]),(0,r.useEffect)(()=>{!x.loading&&x.value&&n(x.value,{replace:!0}),x.loading||x.value||(d.current=u)},[x.loading,x.value,n,u]),f=h&&x.loading||!!x.value,{loading:x.loading,shouldShowProgress:f}),K=(0,r.useMemo)(()=>b?null:(D?r.Children.toArray(D.props.children):[]).flatMap(e=>e?.props?.children??[]).find(e=>!(0,g.E)(e,l.AF)&&!(0,g.E)(e,l.Wm)),[b,D]);return F?(0,a.jsx)(o.k,{}):b?(0,a.jsx)(M.A,{theme:v,children:(0,a.jsx)(k,{pluginId:"techdocs",children:(0,a.jsx)(c.R,{entityRef:U,children:({metadata:e,entityMetadata:t,onReady:n})=>(0,a.jsx)(B,{themeId:"documentation",className:"techdocs-reader-page",children:b instanceof Function?b({entityRef:U,techdocsMetadataValue:e.value,entityMetadataValue:t.value,onReady:n}):b})})})}):(0,a.jsx)(M.A,{theme:v,children:(0,a.jsx)(k,{pluginId:"techdocs",children:(0,a.jsx)(c.R,{entityRef:U,children:K||(0,a.jsx)(T,{})})})})}},4518:function(e,t,n){n.d(t,{Z:()=>x});var a=n(31085),r=n(14041),s=n(58837),i=n(29365),o=n(75173),l=n(71677),c=n(37757),u=n(9720),d=n(9684),h=n(63401),p=n(90479),m=n(10337);let g=(0,s.A)(e=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:e.spacing(3,3,0),"@media print":{display:"none"}}})),x=e=>{let t=g(),[n,s]=(0,r.useState)(null),x=(0,r.useCallback)(e=>{s(e.currentTarget)},[]),f=(0,r.useCallback)(()=>{s(null)},[]),{entityMetadata:{value:y,loading:j}}=(0,h.V)(),v=(0,p.YR)(),w=v.renderComponentsByLocation(m.e.Subheader),E=v.renderComponentsByLocation(m.e.Settings);return(w||E)&&(!1!==j||y)?(0,a.jsx)(o.A,{classes:t,...e.toolbarProps,children:(0,a.jsxs)(u.A,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[w,E?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Ay,{title:"Settings",children:(0,a.jsx)(i.A,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:x,children:(0,a.jsx)(d.default,{})})}),(0,a.jsx)(c.A,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:n,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!!n,onClose:f,keepMounted:!0,children:(0,a.jsx)("div",{children:E})})]}):null]})}):null}}}]);
|
|
10
|
-
//# sourceMappingURL=1155.c6c120ba.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["4591"],{69890:function(e,t,n){n.d(t,{RealLogViewer:()=>D});var r=n(31085),i=n(9720),l=n(29365),o=n(99594),s=n(53373),a=n.n(s),c=n(14041),d=n(18690),u=n(19686),h=n(84392);let g=(0,n(84774).A)(),f=/\n\r?/g,m=Object.fromEntries(Object.entries({1:e=>({...e,bold:!0}),3:e=>({...e,italic:!0}),4:e=>({...e,underline:!0}),22:({bold:e,...t})=>t,23:({italic:e,...t})=>t,24:({underline:e,...t})=>t,30:e=>({...e,foreground:"black"}),31:e=>({...e,foreground:"red"}),32:e=>({...e,foreground:"green"}),33:e=>({...e,foreground:"yellow"}),34:e=>({...e,foreground:"blue"}),35:e=>({...e,foreground:"magenta"}),36:e=>({...e,foreground:"cyan"}),37:e=>({...e,foreground:"white"}),39:({foreground:e,...t})=>t,90:e=>({...e,foreground:"grey"}),40:e=>({...e,background:"black"}),41:e=>({...e,background:"red"}),42:e=>({...e,background:"green"}),43:e=>({...e,background:"yellow"}),44:e=>({...e,background:"blue"}),45:e=>({...e,background:"magenta"}),46:e=>({...e,background:"cyan"}),47:e=>({...e,background:"white"}),49:({background:e,...t})=>t}).map(([e,t])=>[`\x1b[${e}m`,t]));class p{text;lineNumber;chunks;constructor(e=1,t=[]){this.lineNumber=e,this.chunks=t,this.text=t.map(e=>e.text).join("").toLocaleLowerCase("en-US")}lastChunk(){return this.chunks[this.chunks.length-1]}replaceLastChunk(e){e&&(this.chunks.splice(this.chunks.length-1,1,...e),this.text=this.chunks.map(e=>e.text).join("").toLocaleLowerCase("en-US"))}}class x{text="";lines=[];process(e){if(this.text===e)return this.lines;if(this.text&&e.startsWith(this.text)){let t=this.lines.length>0?this.lines.length-1:0,n=this.lines[t]??new p,r=n.lastChunk(),i=this.processLines((r?.text??"")+e.slice(this.text.length),r?.modifiers,n?.lineNumber);n.replaceLastChunk(i[0]?.chunks),this.lines[t]=n,this.lines=this.lines.concat(i.slice(1))}else this.lines=this.processLines(e);return this.text=e,this.lines}processLines=(e,t={},n=1)=>{let r=[],i=t,l=n,o=0;for(f.lastIndex=0;;){let t=f.exec(e);if(!t){let t=this.processText(e.slice(o),i);return r.push(new p(l,t)),r}let n=e.slice(o,t.index);o=t.index+t[0].length;let s=this.processText(n,i);r.push(new p(l,s)),i=s[s.length-1].modifiers??i,l+=1}};processText=(e,t)=>{let n=[],r=t,i=0;for(g.lastIndex=0;;){let t=g.exec(e);if(!t)return n.push({text:e.slice(i),modifiers:r}),n;let l=e.slice(i,t.index);n.push({text:l,modifiers:r}),i=t.index+t[0].length,r=this.processCode(t[0],r)}};processCode=(e,t)=>m[e]?.(t)??t}var k=n(95479),b=n.n(k),y=n(60075),j=n(60603);let A=({attributes:e,content:t})=>{let{href:n,...i}=e;return(0,r.jsx)(j.N_,{to:n,...i,children:t})};function S({line:e,classes:t,searchText:n,highlightResultIndex:i,setRowHeight:l}){let o=(0,c.useRef)(null),s=(0,c.useMemo)(()=>(function(e,t){let n=function(e,t){if(!t||!e.includes(t))return;let n=[],r=0;for(;;){let i=e.indexOf(t,r);if(-1===i)break;let l=i+t.length;n.push({start:i,end:l}),r=l}return n}(e.text,t);if(!n)return e.chunks;let r=[],i=0,l=0,o=n[0];for(let t of e.chunks){let{text:e,modifiers:s}=t;if(!o||i+e.length<o.start){r.push(t),i+=e.length;continue}let a=0;for(;o;){let t=Math.max(o.start-i,0);if(t>e.length)break;let c=Math.min(o.end-i,e.length);if(t>a&&r.push({text:e.slice(a,t),modifiers:s}),c>t&&r.push({modifiers:s,highlight:l,text:e.slice(t,c)}),a=c,o.end-i===c)l+=1,o=n[l];else break}a<e.length&&r.push({text:e.slice(a),modifiers:s}),i+=e.length}return r})(e,n),[e,n]);(0,c.useEffect)(()=>{o.current&&l&&l(e.lineNumber,o.current.offsetHeight)},[e.lineNumber,l]);let d=(0,c.useMemo)(()=>s.map(({text:e,modifiers:n,highlight:o},s)=>(0,r.jsx)("span",{className:a()(function(e,t){let n=[];if(t.bold&&n.push(e.modifierBold),t.italic&&n.push(e.modifierItalic),t.underline&&n.push(e.modifierUnderline),t.foreground){let r=`modifierForeground${b()(t.foreground)}`;n.push(e[r])}if(t.background){let r=`modifierBackground${b()(t.background)}`;n.push(e[r])}return n.length>0?n.join(" "):void 0}(t,n),void 0!==o&&(o===i?t.textSelectedHighlight:t.textHighlight),{[t.textWrap]:!!l}),children:(0,r.jsx)(y.A,{options:{render:A},children:e})},s)),[s,i,t,l]);return(0,r.jsx)("span",{ref:o,children:d})}var w=n(16249),v=n(72501),B=n(68887),C=n(63798),I=n(65859);function L(e){let{resultCount:t,resultIndexStep:n,toggleShouldFilter:i}=e,o=e.resultIndex??0;return(0,r.jsxs)(r.Fragment,{children:[void 0!==t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.A,{size:"small",onClick:()=>n(!0),children:(0,r.jsx)(B.default,{})}),(0,r.jsxs)(v.A,{children:[Math.min(o+1,t),"/",t]}),(0,r.jsx)(l.A,{size:"small",onClick:()=>n(),children:(0,r.jsx)(C.default,{})})]}),(0,r.jsx)(w.A,{size:"small",variant:"standard",placeholder:"Search",value:e.searchInput,onKeyPress:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey||e.altKey?i():n(e.shiftKey))},onChange:t=>e.setSearchInput(t.target.value)}),(0,r.jsx)(l.A,{size:"small",onClick:i,children:e.shouldFilter?(0,r.jsx)(I.default,{color:"primary"}):(0,r.jsx)(I.default,{color:"disabled"})})]})}var N=n(58837),M=n(268),F=n(95186),z=n(38084),T=n(54024),R=n(40935),_=n(4499),W=n(85229),E=n(42020),H=n(6456);let K=(0,N.A)(e=>({root:{background:e.palette.background.paper},header:{height:40,display:"flex",alignItems:"center",justifyContent:"flex-end"},log:{fontFamily:'"Monaco", monospace',fontSize:e.typography.pxToRem(12),lineHeight:"20px"},line:{position:"relative",whiteSpace:"pre",display:"flex",alignItems:"flex-start","&:hover":{background:e.palette.action.hover}},lineSelected:{background:e.palette.action.selected,"&:hover":{background:e.palette.action.selected}},lineCopyButton:{position:"absolute",paddingTop:0,paddingBottom:0},lineNumber:{display:"inline-block",textAlign:"end",width:60,marginRight:e.spacing(1),cursor:"pointer",flexShrink:0,userSelect:"none"},textHighlight:{background:(0,M.X4)(e.palette.info.main,.15)},textSelectedHighlight:{background:(0,M.X4)(e.palette.info.main,.4)},modifierBold:{fontWeight:e.typography.fontWeightBold},modifierItalic:{fontStyle:"italic"},modifierUnderline:{textDecoration:"underline"},modifierForegroundBlack:{color:F.A.black},modifierForegroundRed:{color:z.A["500"]},modifierForegroundGreen:{color:T.A["500"]},modifierForegroundYellow:{color:R.A["500"]},modifierForegroundBlue:{color:_.A["500"]},modifierForegroundMagenta:{color:W.A["500"]},modifierForegroundCyan:{color:E.A["500"]},modifierForegroundWhite:{color:F.A.white},modifierForegroundGrey:{color:H.A["500"]},modifierBackgroundBlack:{background:F.A.black},modifierBackgroundRed:{background:z.A["500"]},modifierBackgroundGreen:{background:T.A["500"]},modifierBackgroundYellow:{background:R.A["500"]},modifierBackgroundBlue:{background:_.A["500"]},modifierBackgroundMagenta:{background:W.A["500"]},modifierBackgroundCyan:{background:E.A["500"]},modifierBackgroundWhite:{background:F.A.white},modifierBackgroundGrey:{background:H.A["500"]},textWrap:{whiteSpace:"pre-wrap",wordBreak:"break-all"}}),{name:"BackstageLogViewer"});var U=n(54633),G=n(5712),O=n(62454),$=n(11688);function D(e){let t=K({classes:e.classes}),[n,s]=(0,c.useState)(null),g=e.textWrap??!1,f=(0,c.useRef)({}),m=(0,c.useMemo)(()=>new x,[]).process(e.text),p=function(e){let[t,n]=(0,c.useState)(""),r=t.toLocaleLowerCase("en-US"),[i,l]=(0,c.useState)(0),[o,s]=(0,U.e)(!1),a=(0,c.useMemo)(()=>(function(e,t){if(!t)return{lines:e};let n=[],r=[];for(let i of e)if(i.text.includes(t)){n.push(i);let e=0,l=0;for(;;){let n=i.text.indexOf(t,e);if(-1===n)break;r.push({lineNumber:i.lineNumber,lineIndex:l++}),e=n+t.length}}return{lines:n,results:r}})(e,r),[e,r]),d=a.results?a.results[Math.min(i,a.results.length-1)]:void 0,u=a.results?.length;return{lines:o?a.lines:e,searchText:r,searchInput:t,setSearchInput:n,shouldFilter:o,toggleShouldFilter:s,resultCount:u,resultIndex:i,resultIndexStep:e=>{if(e){if(void 0!==u){let e=Math.min(i-1,u-2);l(e<0?u-1:e)}}else if(void 0!==u){let e=i+1;l(e>=u?0:e)}},resultLine:d?.lineNumber,resultLineIndex:d?.lineIndex}}(m),k=function(e){let t=(0,G.gf)(O.m),[n,r]=(0,c.useState)(),i=n?Math.min(n.start,n.end):void 0,l=n?Math.max(n.start,n.end):void 0,[{error:o},s]=(0,$.A)();return(0,c.useEffect)(()=>{o&&t.post(o)},[o,t]),{shouldShowButton:e=>i===e||l===e,isSelected:e=>!!n&&i<=e&&e<=l,setSelection(e,t){t?r(t=>t?{start:t.start,end:e}:{start:e,end:e}):r(t=>t?.start===e&&t?.end===e?void 0:{start:e,end:e})},copySelection(){n&&(s(e.slice(Math.min(n.start,n.end)-1,Math.max(n.start,n.end)).map(e=>e.chunks.map(e=>e.text).join("")).join("\n")),r(void 0))}}}(m),b=(0,d.zy)();(0,c.useEffect)(()=>{n&&n.scrollToItem(m.length-1,"end")},[n,m]),(0,c.useEffect)(()=>{n&&(p.resultLine?n.scrollToItem(p.resultLine-1,"center"):n.scrollToItem(m.length-1,"end"))},[n,p.resultLine,m]),(0,c.useEffect)(()=>{if(b.hash){let e=parseInt(b.hash.replace(/\D/g,""),10);k.setSelection(e,!1)}},[]);let y=(e,t)=>{k.setSelection(e,t.shiftKey)};function j(e,t){g&&n&&(n.resetAfterIndex(0),f.current[e-1]=t)}function A(e){return f.current[e]||20}return(0,r.jsx)(u.Ay,{children:({height:e,width:n})=>{let c={ref:s,className:t.log,height:(e||480)-40,width:n||640,itemData:p.lines,itemCount:p.lines.length},d=({index:e,style:n,data:s})=>{let c=s[e],{lineNumber:d}=c;return(0,r.jsxs)(i.A,{style:{...n},className:a()(t.line,{[t.lineSelected]:k.isSelected(d)}),children:[k.shouldShowButton(d)&&(0,r.jsx)(l.A,{"data-testid":"copy-button",size:"small",className:t.lineCopyButton,onClick:()=>k.copySelection(),children:(0,r.jsx)(o.default,{fontSize:"inherit"})}),(0,r.jsx)("a",{role:"row",target:"_self",href:`#line-${d}`,className:t.lineNumber,onClick:e=>y(d,e),onKeyPress:e=>y(d,e),children:d}),(0,r.jsx)(S,{setRowHeight:g?j:void 0,line:c,classes:t,searchText:p.searchText,highlightResultIndex:p.resultLine===d?p.resultLineIndex:void 0})]})};return(0,r.jsxs)(i.A,{style:{width:n,height:e},className:t.root,children:[(0,r.jsx)(i.A,{className:t.header,children:(0,r.jsx)(L,{...p})}),g?(0,r.jsx)(h._m,{...c,itemSize:A,children:d}):(0,r.jsx)(h.Y1,{...c,itemSize:20,children:d})]})}})}}}]);
|
|
2
|
-
//# sourceMappingURL=4591.c7904e2c.chunk.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"static/4591.c7904e2c.chunk.js","sources":["webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/AnsiProcessor.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogLine.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/LogViewerControls.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/styles.ts","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/RealLogViewer.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSearch.tsx","webpack://techdocs-cli-embedded-app/../core-components/src/components/LogViewer/useLogViewerSelection.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport ansiRegexMaker from 'ansi-regex';\n\nconst ansiRegex = ansiRegexMaker();\nconst newlineRegex = /\\n\\r?/g;\n\n// A mapping of how each escape code changes the modifiers\nconst codeModifiers = Object.fromEntries(\n Object.entries({\n 1: m => ({ ...m, bold: true }),\n 3: m => ({ ...m, italic: true }),\n 4: m => ({ ...m, underline: true }),\n 22: ({ bold: _, ...m }) => m,\n 23: ({ italic: _, ...m }) => m,\n 24: ({ underline: _, ...m }) => m,\n 30: m => ({ ...m, foreground: 'black' }),\n 31: m => ({ ...m, foreground: 'red' }),\n 32: m => ({ ...m, foreground: 'green' }),\n 33: m => ({ ...m, foreground: 'yellow' }),\n 34: m => ({ ...m, foreground: 'blue' }),\n 35: m => ({ ...m, foreground: 'magenta' }),\n 36: m => ({ ...m, foreground: 'cyan' }),\n 37: m => ({ ...m, foreground: 'white' }),\n 39: ({ foreground: _, ...m }) => m,\n 90: m => ({ ...m, foreground: 'grey' }),\n 40: m => ({ ...m, background: 'black' }),\n 41: m => ({ ...m, background: 'red' }),\n 42: m => ({ ...m, background: 'green' }),\n 43: m => ({ ...m, background: 'yellow' }),\n 44: m => ({ ...m, background: 'blue' }),\n 45: m => ({ ...m, background: 'magenta' }),\n 46: m => ({ ...m, background: 'cyan' }),\n 47: m => ({ ...m, background: 'white' }),\n 49: ({ background: _, ...m }) => m,\n } as Record<string, (m: ChunkModifiers) => ChunkModifiers>).map(\n ([code, modifier]) => [`\\x1b[${code}m`, modifier],\n ),\n);\n\nexport type AnsiColor =\n | 'black'\n | 'red'\n | 'green'\n | 'yellow'\n | 'blue'\n | 'magenta'\n | 'cyan'\n | 'white'\n | 'grey';\n\nexport interface ChunkModifiers {\n foreground?: AnsiColor;\n background?: AnsiColor;\n bold?: boolean;\n italic?: boolean;\n underline?: boolean;\n}\n\nexport interface AnsiChunk {\n text: string;\n modifiers: ChunkModifiers;\n}\n\nexport class AnsiLine {\n text: string;\n readonly lineNumber: number;\n readonly chunks: AnsiChunk[];\n\n constructor(lineNumber: number = 1, chunks: AnsiChunk[] = []) {\n this.lineNumber = lineNumber;\n this.chunks = chunks;\n this.text = chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n\n lastChunk(): AnsiChunk | undefined {\n return this.chunks[this.chunks.length - 1];\n }\n\n replaceLastChunk(newChunks?: AnsiChunk[]) {\n if (newChunks) {\n this.chunks.splice(this.chunks.length - 1, 1, ...newChunks);\n this.text = this.chunks\n .map(c => c.text)\n .join('')\n .toLocaleLowerCase('en-US');\n }\n }\n}\n\nexport class AnsiProcessor {\n private text: string = '';\n private lines: AnsiLine[] = [];\n\n /**\n * Processes a chunk of text while keeping internal state that optimizes\n * subsequent processing that appends to the text.\n */\n process(text: string): AnsiLine[] {\n if (this.text === text) {\n return this.lines;\n }\n\n if (this.text && text.startsWith(this.text)) {\n const lastLineIndex = this.lines.length > 0 ? this.lines.length - 1 : 0;\n const lastLine = this.lines[lastLineIndex] ?? new AnsiLine();\n const lastChunk = lastLine.lastChunk();\n\n const newLines = this.processLines(\n (lastChunk?.text ?? '') + text.slice(this.text.length),\n lastChunk?.modifiers,\n lastLine?.lineNumber,\n );\n lastLine.replaceLastChunk(newLines[0]?.chunks);\n\n this.lines[lastLineIndex] = lastLine;\n this.lines = this.lines.concat(newLines.slice(1));\n } else {\n this.lines = this.processLines(text);\n }\n this.text = text;\n\n return this.lines;\n }\n\n // Split a chunk of text up into lines and process each line individually\n private processLines = (\n text: string,\n modifiers: ChunkModifiers = {},\n startingLineNumber: number = 1,\n ): AnsiLine[] => {\n const lines: AnsiLine[] = [];\n\n let currentModifiers = modifiers;\n let currentLineNumber = startingLineNumber;\n\n let prevIndex = 0;\n newlineRegex.lastIndex = 0;\n for (;;) {\n const match = newlineRegex.exec(text);\n if (!match) {\n const chunks = this.processText(\n text.slice(prevIndex),\n currentModifiers,\n );\n lines.push(new AnsiLine(currentLineNumber, chunks));\n return lines;\n }\n\n const line = text.slice(prevIndex, match.index);\n prevIndex = match.index + match[0].length;\n\n const chunks = this.processText(line, currentModifiers);\n lines.push(new AnsiLine(currentLineNumber, chunks));\n\n // Modifiers that are active in the last chunk are carried over to the next line\n currentModifiers =\n chunks[chunks.length - 1].modifiers ?? currentModifiers;\n currentLineNumber += 1;\n }\n };\n\n // Processing of a one individual text chunk\n private processText = (\n fullText: string,\n modifiers: ChunkModifiers,\n ): AnsiChunk[] => {\n const chunks: AnsiChunk[] = [];\n\n let currentModifiers = modifiers;\n\n let prevIndex = 0;\n ansiRegex.lastIndex = 0;\n for (;;) {\n const match = ansiRegex.exec(fullText);\n if (!match) {\n chunks.push({\n text: fullText.slice(prevIndex),\n modifiers: currentModifiers,\n });\n return chunks;\n }\n\n const text = fullText.slice(prevIndex, match.index);\n chunks.push({ text, modifiers: currentModifiers });\n\n // For every escape code that we encounter we keep track of where the\n // next chunk of text starts, and what modifiers it has\n prevIndex = match.index + match[0].length;\n currentModifiers = this.processCode(match[0], currentModifiers);\n }\n };\n\n private processCode = (\n code: string,\n modifiers: ChunkModifiers,\n ): ChunkModifiers => {\n return codeModifiers[code]?.(modifiers) ?? modifiers;\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useEffect, useMemo, useRef } from 'react';\nimport { AnsiChunk, AnsiLine, ChunkModifiers } from './AnsiProcessor';\nimport startCase from 'lodash/startCase';\nimport classnames from 'classnames';\nimport { useStyles } from './styles';\nimport Linkify from 'linkify-react';\nimport { Link } from '../Link';\n\nexport function getModifierClasses(\n classes: ReturnType<typeof useStyles>,\n modifiers: ChunkModifiers,\n) {\n const classNames = new Array<string>();\n if (modifiers.bold) {\n classNames.push(classes.modifierBold);\n }\n if (modifiers.italic) {\n classNames.push(classes.modifierItalic);\n }\n if (modifiers.underline) {\n classNames.push(classes.modifierUnderline);\n }\n if (modifiers.foreground) {\n const key = `modifierForeground${startCase(\n modifiers.foreground,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n if (modifiers.background) {\n const key = `modifierBackground${startCase(\n modifiers.background,\n )}` as keyof typeof classes;\n classNames.push(classes[key]);\n }\n return classNames.length > 0 ? classNames.join(' ') : undefined;\n}\n\nexport function findSearchResults(text: string, searchText: string) {\n if (!searchText || !text.includes(searchText)) {\n return undefined;\n }\n const searchResults = new Array<{ start: number; end: number }>();\n let offset = 0;\n for (;;) {\n const start = text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n const end = start + searchText.length;\n searchResults.push({ start, end });\n offset = end;\n }\n return searchResults;\n}\n\nexport interface HighlightAnsiChunk extends AnsiChunk {\n highlight?: number;\n}\n\nexport function calculateHighlightedChunks(\n line: AnsiLine,\n searchText: string,\n): HighlightAnsiChunk[] {\n const results = findSearchResults(line.text, searchText);\n if (!results) {\n return line.chunks;\n }\n\n const chunks = new Array<HighlightAnsiChunk>();\n\n let lineOffset = 0;\n let resultIndex = 0;\n let result = results[resultIndex];\n for (const chunk of line.chunks) {\n const { text, modifiers } = chunk;\n if (!result || lineOffset + text.length < result.start) {\n chunks.push(chunk);\n lineOffset += text.length;\n continue;\n }\n\n let localOffset = 0;\n while (result) {\n const localStart = Math.max(result.start - lineOffset, 0);\n if (localStart > text.length) {\n break; // The next result is not in this chunk\n }\n\n const localEnd = Math.min(result.end - lineOffset, text.length);\n\n const hasTextBeforeResult = localStart > localOffset;\n if (hasTextBeforeResult) {\n chunks.push({ text: text.slice(localOffset, localStart), modifiers });\n }\n const hasResultText = localEnd > localStart;\n if (hasResultText) {\n chunks.push({\n modifiers,\n highlight: resultIndex,\n text: text.slice(localStart, localEnd),\n });\n }\n\n localOffset = localEnd;\n\n const foundCompleteResult = result.end - lineOffset === localEnd;\n if (foundCompleteResult) {\n resultIndex += 1;\n result = results[resultIndex];\n } else {\n break; // The rest of the result is in the following chunks\n }\n }\n\n const hasTextAfterResult = localOffset < text.length;\n if (hasTextAfterResult) {\n chunks.push({ text: text.slice(localOffset), modifiers });\n }\n\n lineOffset += text.length;\n }\n\n return chunks;\n}\n\nconst renderLink = ({\n attributes,\n content,\n}: {\n attributes: { [attr: string]: any };\n content: string;\n}) => {\n const { href, ...props } = attributes;\n return (\n <Link to={href} {...props}>\n {content}\n </Link>\n );\n};\n\nexport interface LogLineProps {\n line: AnsiLine;\n classes: ReturnType<typeof useStyles>;\n searchText: string;\n highlightResultIndex?: number;\n setRowHeight?: (index: number, size: number) => void;\n}\n\nexport function LogLine({\n line,\n classes,\n searchText,\n highlightResultIndex,\n setRowHeight,\n}: LogLineProps) {\n const lineRef = useRef<HTMLSpanElement>(null);\n const chunks = useMemo(\n () => calculateHighlightedChunks(line, searchText),\n [line, searchText],\n );\n\n useEffect(() => {\n if (lineRef.current && setRowHeight) {\n setRowHeight(line.lineNumber, lineRef.current.offsetHeight);\n }\n }, [line.lineNumber, setRowHeight]);\n\n const elements = useMemo(\n () =>\n chunks.map(({ text, modifiers, highlight }, index) => (\n // eslint-disable-next-line react/forbid-elements\n <span\n key={index}\n className={classnames(\n getModifierClasses(classes, modifiers),\n highlight !== undefined &&\n (highlight === highlightResultIndex\n ? classes.textSelectedHighlight\n : classes.textHighlight),\n { [classes.textWrap]: !!setRowHeight },\n )}\n >\n <Linkify options={{ render: renderLink }}>{text}</Linkify>\n </span>\n )),\n [chunks, highlightResultIndex, classes, setRowHeight],\n );\n\n return <span ref={lineRef}>{elements}</span>;\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { KeyboardEvent } from 'react';\nimport IconButton from '@material-ui/core/IconButton';\nimport TextField from '@material-ui/core/TextField';\nimport Typography from '@material-ui/core/Typography';\nimport ChevronLeftIcon from '@material-ui/icons/ChevronLeft';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport FilterListIcon from '@material-ui/icons/FilterList';\nimport { LogViewerSearch } from './useLogViewerSearch';\n\nexport interface LogViewerControlsProps extends LogViewerSearch {}\n\nexport function LogViewerControls(props: LogViewerControlsProps) {\n const { resultCount, resultIndexStep, toggleShouldFilter } = props;\n const resultIndex = props.resultIndex ?? 0;\n\n const handleKeyPress = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Enter') {\n if (event.metaKey || event.ctrlKey || event.altKey) {\n toggleShouldFilter();\n } else {\n resultIndexStep(event.shiftKey);\n }\n }\n };\n\n return (\n <>\n {resultCount !== undefined && (\n <>\n <IconButton size=\"small\" onClick={() => resultIndexStep(true)}>\n <ChevronLeftIcon />\n </IconButton>\n <Typography>\n {Math.min(resultIndex + 1, resultCount)}/{resultCount}\n </Typography>\n <IconButton size=\"small\" onClick={() => resultIndexStep()}>\n <ChevronRightIcon />\n </IconButton>\n </>\n )}\n <TextField\n size=\"small\"\n variant=\"standard\"\n placeholder=\"Search\"\n value={props.searchInput}\n onKeyPress={handleKeyPress}\n onChange={e => props.setSearchInput(e.target.value)}\n />\n <IconButton size=\"small\" onClick={toggleShouldFilter}>\n {props.shouldFilter ? (\n <FilterListIcon color=\"primary\" />\n ) : (\n <FilterListIcon color=\"disabled\" />\n )}\n </IconButton>\n </>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { alpha, makeStyles } from '@material-ui/core/styles';\nimport * as colors from '@material-ui/core/colors';\n\nexport const HEADER_SIZE = 40;\n\n/** @public Class keys for overriding LogViewer styles */\nexport type LogViewerClassKey =\n | 'root'\n | 'header'\n | 'log'\n | 'line'\n | 'lineSelected'\n | 'lineCopyButton'\n | 'lineNumber'\n | 'textHighlight'\n | 'textSelectedHighlight'\n | 'modifierBold'\n | 'modifierItalic'\n | 'modifierUnderline'\n | 'modifierForegroundBlack'\n | 'modifierForegroundRed'\n | 'modifierForegroundGreen'\n | 'modifierForegroundYellow'\n | 'modifierForegroundBlue'\n | 'modifierForegroundMagenta'\n | 'modifierForegroundCyan'\n | 'modifierForegroundWhite'\n | 'modifierForegroundGrey'\n | 'modifierBackgroundBlack'\n | 'modifierBackgroundRed'\n | 'modifierBackgroundGreen'\n | 'modifierBackgroundYellow'\n | 'modifierBackgroundBlue'\n | 'modifierBackgroundMagenta'\n | 'modifierBackgroundCyan'\n | 'modifierBackgroundWhite'\n | 'modifierBackgroundGrey';\n\nexport const useStyles = makeStyles(\n theme => ({\n root: {\n background: theme.palette.background.paper,\n },\n header: {\n height: HEADER_SIZE,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'flex-end',\n },\n log: {\n fontFamily: '\"Monaco\", monospace',\n fontSize: theme.typography.pxToRem(12),\n lineHeight: '20px',\n },\n line: {\n position: 'relative',\n whiteSpace: 'pre',\n display: 'flex',\n alignItems: 'flex-start',\n\n '&:hover': {\n background: theme.palette.action.hover,\n },\n },\n lineSelected: {\n background: theme.palette.action.selected,\n\n '&:hover': {\n background: theme.palette.action.selected,\n },\n },\n lineCopyButton: {\n position: 'absolute',\n paddingTop: 0,\n paddingBottom: 0,\n },\n lineNumber: {\n display: 'inline-block',\n textAlign: 'end',\n width: 60,\n marginRight: theme.spacing(1),\n cursor: 'pointer',\n flexShrink: 0,\n userSelect: 'none',\n },\n textHighlight: {\n background: alpha(theme.palette.info.main, 0.15),\n },\n textSelectedHighlight: {\n background: alpha(theme.palette.info.main, 0.4),\n },\n modifierBold: {\n fontWeight: theme.typography.fontWeightBold,\n },\n modifierItalic: {\n fontStyle: 'italic',\n },\n modifierUnderline: {\n textDecoration: 'underline',\n },\n modifierForegroundBlack: {\n color: colors.common.black,\n },\n modifierForegroundRed: {\n color: colors.red[500],\n },\n modifierForegroundGreen: {\n color: colors.green[500],\n },\n modifierForegroundYellow: {\n color: colors.yellow[500],\n },\n modifierForegroundBlue: {\n color: colors.blue[500],\n },\n modifierForegroundMagenta: {\n color: colors.purple[500],\n },\n modifierForegroundCyan: {\n color: colors.cyan[500],\n },\n modifierForegroundWhite: {\n color: colors.common.white,\n },\n modifierForegroundGrey: {\n color: colors.grey[500],\n },\n modifierBackgroundBlack: {\n background: colors.common.black,\n },\n modifierBackgroundRed: {\n background: colors.red[500],\n },\n modifierBackgroundGreen: {\n background: colors.green[500],\n },\n modifierBackgroundYellow: {\n background: colors.yellow[500],\n },\n modifierBackgroundBlue: {\n background: colors.blue[500],\n },\n modifierBackgroundMagenta: {\n background: colors.purple[500],\n },\n modifierBackgroundCyan: {\n background: colors.cyan[500],\n },\n modifierBackgroundWhite: {\n background: colors.common.white,\n },\n modifierBackgroundGrey: {\n background: colors.grey[500],\n },\n textWrap: {\n whiteSpace: 'pre-wrap',\n wordBreak: 'break-all',\n },\n }),\n { name: 'BackstageLogViewer' },\n);\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Box from '@material-ui/core/Box';\nimport IconButton from '@material-ui/core/IconButton';\nimport CopyIcon from '@material-ui/icons/FileCopy';\nimport classnames from 'classnames';\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport AutoSizer from 'react-virtualized-auto-sizer';\nimport { VariableSizeList, FixedSizeList } from 'react-window';\n\nimport { AnsiLine, AnsiProcessor } from './AnsiProcessor';\nimport { LogLine } from './LogLine';\nimport { LogViewerControls } from './LogViewerControls';\nimport { HEADER_SIZE, useStyles } from './styles';\nimport { useLogViewerSearch } from './useLogViewerSearch';\nimport { useLogViewerSelection } from './useLogViewerSelection';\n\nexport interface RealLogViewerProps {\n text: string;\n textWrap?: boolean;\n classes?: { root?: string };\n}\n\nexport function RealLogViewer(props: RealLogViewerProps) {\n const classes = useStyles({ classes: props.classes });\n const [listInstance, setListInstance] = useState<\n VariableSizeList<AnsiLine[]> | FixedSizeList<AnsiLine[]> | null\n >(null);\n const shouldTextWrap = props.textWrap ?? false;\n const heights = useRef<{ [key: number]: number }>({});\n\n // The processor keeps state that optimizes appending to the text\n const processor = useMemo(() => new AnsiProcessor(), []);\n const lines = processor.process(props.text);\n\n const search = useLogViewerSearch(lines);\n const selection = useLogViewerSelection(lines);\n const location = useLocation();\n\n useEffect(() => {\n if (listInstance) {\n listInstance.scrollToItem(lines.length - 1, 'end');\n }\n }, [listInstance, lines]);\n\n useEffect(() => {\n if (!listInstance) {\n return;\n }\n if (search.resultLine) {\n listInstance.scrollToItem(search.resultLine - 1, 'center');\n } else {\n listInstance.scrollToItem(lines.length - 1, 'end');\n }\n }, [listInstance, search.resultLine, lines]);\n\n useEffect(() => {\n if (location.hash) {\n // #line-6 -> 6\n const line = parseInt(location.hash.replace(/\\D/g, ''), 10);\n selection.setSelection(line, false);\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleSelectLine = (\n line: number,\n event: { shiftKey: boolean; preventDefault: () => void },\n ) => {\n selection.setSelection(line, event.shiftKey);\n };\n\n function setRowHeight(index: number, size: number) {\n if (shouldTextWrap && listInstance) {\n (listInstance as VariableSizeList<AnsiLine[]>).resetAfterIndex(0);\n // lineNumber is 1-based but index is 0-based\n heights.current[index - 1] = size;\n }\n }\n\n function getRowHeight(index: number) {\n return heights.current[index] || 20;\n }\n\n return (\n <AutoSizer>\n {({ height, width }: { height?: number; width?: number }) => {\n const commonProps = {\n ref: setListInstance,\n className: classes.log,\n height: (height || 480) - HEADER_SIZE,\n width: width || 640,\n itemData: search.lines,\n itemCount: search.lines.length,\n };\n\n const renderItem = ({\n index,\n style,\n data,\n }: {\n index: number;\n style: React.CSSProperties;\n data: AnsiLine[];\n }) => {\n const line = data[index];\n const { lineNumber } = line;\n return (\n <Box\n style={{ ...style }}\n className={classnames(classes.line, {\n [classes.lineSelected]: selection.isSelected(lineNumber),\n })}\n >\n {selection.shouldShowButton(lineNumber) && (\n <IconButton\n data-testid=\"copy-button\"\n size=\"small\"\n className={classes.lineCopyButton}\n onClick={() => selection.copySelection()}\n >\n <CopyIcon fontSize=\"inherit\" />\n </IconButton>\n )}\n <a\n role=\"row\"\n target=\"_self\"\n href={`#line-${lineNumber}`}\n className={classes.lineNumber}\n onClick={event => handleSelectLine(lineNumber, event)}\n onKeyPress={event => handleSelectLine(lineNumber, event)}\n >\n {lineNumber}\n </a>\n <LogLine\n setRowHeight={shouldTextWrap ? setRowHeight : undefined}\n line={line}\n classes={classes}\n searchText={search.searchText}\n highlightResultIndex={\n search.resultLine === lineNumber\n ? search.resultLineIndex\n : undefined\n }\n />\n </Box>\n );\n };\n\n return (\n <Box style={{ width, height }} className={classes.root}>\n <Box className={classes.header}>\n <LogViewerControls {...search} />\n </Box>\n {shouldTextWrap ? (\n <VariableSizeList<AnsiLine[]>\n {...commonProps}\n itemSize={getRowHeight}\n >\n {renderItem}\n </VariableSizeList>\n ) : (\n <FixedSizeList<AnsiLine[]> {...commonProps} itemSize={20}>\n {renderItem}\n </FixedSizeList>\n )}\n </Box>\n );\n }}\n </AutoSizer>\n );\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useMemo, useState } from 'react';\nimport { useToggle } from '@react-hookz/web';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function applySearchFilter(lines: AnsiLine[], searchText: string) {\n if (!searchText) {\n return { lines };\n }\n\n const matchingLines = [];\n const searchResults = [];\n for (const line of lines) {\n if (line.text.includes(searchText)) {\n matchingLines.push(line);\n\n let offset = 0;\n let lineResultIndex = 0;\n for (;;) {\n const start = line.text.indexOf(searchText, offset);\n if (start === -1) {\n break;\n }\n searchResults.push({\n lineNumber: line.lineNumber,\n lineIndex: lineResultIndex++,\n });\n offset = start + searchText.length;\n }\n }\n }\n\n return {\n lines: matchingLines,\n results: searchResults,\n };\n}\n\nexport interface LogViewerSearch {\n lines: AnsiLine[];\n\n searchText: string;\n searchInput: string;\n setSearchInput: (searchInput: string) => void;\n\n shouldFilter: boolean;\n toggleShouldFilter: () => void;\n\n resultCount: number | undefined;\n resultIndex: number | undefined;\n resultIndexStep: (decrement?: boolean) => void;\n\n resultLine: number | undefined;\n resultLineIndex: number | undefined;\n}\n\nexport function useLogViewerSearch(lines: AnsiLine[]): LogViewerSearch {\n const [searchInput, setSearchInput] = useState('');\n const searchText = searchInput.toLocaleLowerCase('en-US');\n\n const [resultIndex, setResultIndex] = useState<number>(0);\n\n const [shouldFilter, toggleShouldFilter] = useToggle(false);\n\n const filter = useMemo(\n () => applySearchFilter(lines, searchText),\n [lines, searchText],\n );\n\n const searchResult = filter.results\n ? filter.results[Math.min(resultIndex, filter.results.length - 1)]\n : undefined;\n const resultCount = filter.results?.length;\n\n const resultIndexStep = (decrement?: boolean) => {\n if (decrement) {\n if (resultCount !== undefined) {\n const next = Math.min(resultIndex - 1, resultCount - 2);\n setResultIndex(next < 0 ? resultCount - 1 : next);\n }\n } else {\n if (resultCount !== undefined) {\n const next = resultIndex + 1;\n setResultIndex(next >= resultCount ? 0 : next);\n }\n }\n };\n\n return {\n lines: shouldFilter ? filter.lines : lines,\n searchText,\n searchInput,\n setSearchInput,\n shouldFilter,\n toggleShouldFilter,\n resultCount,\n resultIndex,\n resultIndexStep,\n resultLine: searchResult?.lineNumber,\n resultLineIndex: searchResult?.lineIndex,\n };\n}\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { errorApiRef, useApi } from '@backstage/core-plugin-api';\nimport { useEffect, useState } from 'react';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\nimport { AnsiLine } from './AnsiProcessor';\n\nexport function useLogViewerSelection(lines: AnsiLine[]) {\n const errorApi = useApi(errorApiRef);\n const [sel, setSelection] = useState<{ start: number; end: number }>();\n const start = sel ? Math.min(sel.start, sel.end) : undefined;\n const end = sel ? Math.max(sel.start, sel.end) : undefined;\n\n const [{ error }, copyToClipboard] = useCopyToClipboard();\n\n useEffect(() => {\n if (error) {\n errorApi.post(error);\n }\n }, [error, errorApi]);\n\n return {\n shouldShowButton(line: number) {\n return start === line || end === line;\n },\n isSelected(line: number) {\n if (!sel) {\n return false;\n }\n return start! <= line && line <= end!;\n },\n setSelection(line: number, add: boolean) {\n if (add) {\n setSelection(s =>\n s ? { start: s.start, end: line } : { start: line, end: line },\n );\n } else {\n setSelection(s =>\n s?.start === line && s?.end === line\n ? undefined\n : { start: line, end: line },\n );\n }\n },\n copySelection() {\n if (sel) {\n const copyText = lines\n .slice(Math.min(sel.start, sel.end) - 1, Math.max(sel.start, sel.end))\n .map(l => l.chunks.map(c => c.text).join(''))\n .join('\\n');\n copyToClipboard(copyText);\n setSelection(undefined);\n }\n },\n };\n}\n"],"names":["ansiRegex","ansiRegexMaker","newlineRegex","codeModifiers","Object","m","_","code","modifier","AnsiLine","lineNumber","chunks","c","newChunks","AnsiProcessor","text","lastLineIndex","lastLine","lastChunk","newLines","modifiers","startingLineNumber","lines","currentModifiers","currentLineNumber","prevIndex","match","line","fullText","renderLink","attributes","content","href","props","Link","LogLine","classes","searchText","highlightResultIndex","setRowHeight","lineRef","useRef","useMemo","calculateHighlightedChunks","results","findSearchResults","searchResults","Array","offset","start","end","lineOffset","resultIndex","result","chunk","localOffset","localStart","Math","localEnd","hasTextBeforeResult","hasResultText","hasTextAfterResult","useEffect","elements","highlight","index","classnames","getModifierClasses","classNames","key","startCase","undefined","Linkify","LogViewerControls","resultCount","resultIndexStep","toggleShouldFilter","IconButton","ChevronLeftIcon","Typography","ChevronRightIcon","TextField","event","e","FilterListIcon","useStyles","makeStyles","theme","alpha","colors","RealLogViewer","listInstance","setListInstance","useState","shouldTextWrap","heights","processor","search","useLogViewerSearch","searchInput","setSearchInput","setResultIndex","shouldFilter","useToggle","filter","applySearchFilter","matchingLines","lineResultIndex","searchResult","decrement","next","selection","useLogViewerSelection","errorApi","useApi","errorApiRef","sel","setSelection","error","copyToClipboard","useCopyToClipboard","add","s","l","location","useLocation","parseInt","handleSelectLine","size","getRowHeight","AutoSizer","height","width","commonProps","renderItem","style","data","Box","CopyIcon","VariableSizeList","FixedSizeList"],"mappings":"2RAkBA,IAAMA,EAAYC,AAAAA,GAAAA,A,SAAAA,CAAAA,AAAAA,IACZC,EAAe,SAGfC,EAAgBC,OAAO,WAAW,CACtCA,OAAO,OAAO,CAAC,CACb,EAAGC,AAAAA,GAAM,EAAE,GAAGA,CAAC,CAAE,KAAM,EAAK,GAC5B,EAAGA,AAAAA,GAAM,EAAE,GAAGA,CAAC,CAAE,OAAQ,EAAK,GAC9B,EAAGA,AAAAA,GAAM,EAAE,GAAGA,CAAC,CAAE,UAAW,EAAK,GACjC,GAAI,CAAC,CAAE,KAAMC,CAAC,CAAE,GAAGD,EAAG,GAAKA,EAC3B,GAAI,CAAC,CAAE,OAAQC,CAAC,CAAE,GAAGD,EAAG,GAAKA,EAC7B,GAAI,CAAC,CAAE,UAAWC,CAAC,CAAE,GAAGD,EAAG,GAAKA,EAChC,GAAI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A,CAAUA,CAAAA,CACT,cAAY,cACZ,KAAK,QACL,UAAWzC,EAAQ,cAAc,CACjC,QAAS,IAAM2E,EAAU,aAAa,G,SAEtC,UAAC2B,EAAAA,OAAQA,CAAAA,CAAC,SAAS,S,KAGvB,UAAC,KACC,KAAK,MACL,OAAO,QACP,KAAM,CAAC,MAAM,EAAEhI,EAAW,CAAC,CAC3B,UAAW0B,EAAQ,UAAU,CAC7B,QAAS8C,AAAAA,GAAS6C,EAAiBrH,EAAYwE,GAC/C,WAAYA,AAAAA,GAAS6C,EAAiBrH,EAAYwE,G,SAEjDxE,C,GAEH,UAACyB,EAAOA,CACN,aAAc2D,EAAiBvD,EAAegC,OAC9C,KAAM5C,EACN,QAASS,EACT,WAAY6D,EAAO,UAAU,CAC7B,qBACEA,EAAO,UAAU,GAAKvF,EAClBuF,EAAO,eAAe,CACtB1B,M,KAKd,EAEA,MACE,WAACkE,EAAAA,CAAGA,CAAAA,CAAC,MAAO,CAAEL,MAAAA,EAAOD,OAAAA,CAAO,EAAG,UAAW/F,EAAQ,IAAI,C,UACpD,UAACqG,EAAAA,CAAGA,CAAAA,CAAC,UAAWrG,EAAQ,MAAM,C,SAC5B,UAACqC,EAAiBA,CAAE,GAAGwB,CAAM,A,KAE9BH,EACC,UAAC6C,EAAAA,EAAgBA,CAAAA,CACd,GAAGN,CAAW,CACf,SAAUJ,E,SAETK,C,GAGH,UAACM,EAAAA,EAAaA,CAAAA,CAAc,GAAGP,CAAW,CAAE,SAAU,G,SACnDC,C,KAKX,C,EAGN,C"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["6270"],{90615:function(e,t,r){r.d(t,{K:()=>a});var n=r(18690);function a(e){return(0,n.g)()}},99480:function(e,t,r){r.d(t,{W:()=>L});var n=r(31085),a=r(14041),s=r(18690),o=r(12439),i=r(55489),l=r(90479),u=r(63401),c=r(85066),d=r(68999),h=r(4518),p=r(90898),g=r(90615),f=r(65605),x=r(60691),m=r(91189),v=r(64947),j=r(5712),C=r(62244),A=r(89602),y=r(16261),k=r(76842),w=r(33947);function E(e){let{children:t,...r}=e,{Progress:s}=(0,m.n)().getComponents(),o=function(e){let{pluginId:t}=e??{},r=(0,j.gf)(C.a),n=(0,j.gf)(A.I),s=(0,a.useMemo)(()=>"BroadcastChannel"in window?new BroadcastChannel(`${t}-auth-cookie-expires-at`):null,[t]),[o,i]=function(e,t){let[r,n]=(0,a.useState)({status:"not-executed",error:void 0,result:void 0}),s=(0,a.useRef)(),o=(0,a.useRef)(),i=(0,y.J)({execute(...t){o.current=t;let r=e(...t);return s.current=r,n(e=>({...e,status:"loading"})),r.then(e=>{r===s.current&&n(t=>({...t,status:"success",error:void 0,result:e}))},e=>{r===s.current&&n(t=>({...t,status:"error",error:e}))}),r},reset(){n({status:"not-executed",error:void 0,result:void 0}),s.current=void 0,o.current=void 0}});return[r,(0,a.useMemo)(()=>({reset(){i.current.reset()},execute:(...e)=>i.current.execute(...e)}),[]),{promise:s.current,lastArgs:o.current}]}(async()=>{let e=await n.getBaseUrl(t),a=`${e}/.backstage/auth/v1/cookie`,s=await r.fetch(`${a}`,{credentials:"include"});if(!s.ok){if(404===s.status)return{expiresAt:new Date(Date.now()+31536e6)};throw await w.o.fromResponse(s)}let o=await s.json();if(!o.expiresAt)throw Error("No expiration date found in response");return o});(0,k.u)(i.execute);let l=(0,a.useCallback)(()=>{i.execute()},[i]),u=(0,a.useCallback)(e=>{let t=(1+3*Math.random())*6e4,r=setTimeout(l,Date.parse(e.expiresAt)-Date.now()-t);return()=>clearTimeout(r)},[l]);return((0,a.useEffect)(()=>{if("success"!==o.status||!o.result)return()=>{};s?.postMessage({action:"COOKIE_REFRESH_SUCCESS",payload:o.result});let e=u(o.result),t=t=>{let{action:r,payload:n}=t.data;"COOKIE_REFRESH_SUCCESS"===r&&(e(),e=u(n))};return s?.addEventListener("message",t),()=>{e(),s?.removeEventListener("message",t)}},[o,u,s]),"not-executed"===o.status||"loading"===o.status&&!o.result||"loading"===o.status&&o.error)?{status:"loading"}:"error"===o.status&&o.error?{status:"error",error:o.error,retry:l}:{status:"success",data:o.result}}(r);return"loading"===o.status?(0,n.jsx)(s,{}):"error"===o.status?(0,n.jsx)(x.b,{error:o.error,children:(0,n.jsx)(v.A,{variant:"outlined",onClick:o.retry,children:"Retry"})}):(0,n.jsx)(n.Fragment,{children:t})}var R=r(99314),b=r(54917),S=r(41329),M=r(50868),O=r(73466),_=r(81219),I=r(76272),T=r(58077),B=r(95269),D=r(78931);let F=e=>{let{withSearch:t,withHeader:r=!0}=e;return(0,n.jsxs)(o.Y,{themeId:"documentation",children:[r&&(0,n.jsx)(d.T,{}),(0,n.jsx)(h.Z,{}),(0,n.jsx)(c.p,{withSearch:t})]})},K=(0,R.A)(o.Y)({height:"inherit",overflowY:"visible"}),L=e=>{let t,r,o,c,d,h,x,m,v=(0,b.A)(),C=(0,a.useMemo)(()=>(0,S.A)({...v,...e.overrideThemeOptions||{}}),[v,e.overrideThemeOptions]),{kind:A,name:y,namespace:k}=(0,g.K)(p.Oc),{children:w,entityRef:R={kind:A,name:y,namespace:k}}=e,L=(0,s.P1)(),U=(0,a.useMemo)(()=>({kind:R.kind,name:R.name,namespace:R.namespace}),[R.kind,R.name,R.namespace]),{shouldShowProgress:W}=(t=(0,j.gf)(I.v),r=(0,s.Zp)(),o=(0,_.S)(p.Oc),c=(0,T.U2)(U),h=(d=(0,a.useRef)(null)).current!==c,x=(0,O.A)(async()=>{try{let e=await t.getEntityByRef(U);if(e?.metadata?.annotations?.[D.GO])return(0,B.b1)(e,o)}catch(e){}},[c,t]),(0,a.useEffect)(()=>{!x.loading&&x.value&&r(x.value,{replace:!0}),x.loading||x.value||(d.current=c)},[x.loading,x.value,r,c]),m=h&&x.loading||!!x.value,{loading:x.loading,shouldShowProgress:m}),Y=(0,a.useMemo)(()=>w?null:(L?a.Children.toArray(L.props.children):[]).flatMap(e=>e?.props?.children??[]).find(e=>!(0,f.E)(e,l.AF)&&!(0,f.E)(e,l.Wm)),[w,L]);return W?(0,n.jsx)(i.k,{}):w?(0,n.jsx)(M.A,{theme:C,children:(0,n.jsx)(E,{pluginId:"techdocs",children:(0,n.jsx)(u.R,{entityRef:U,children:({metadata:e,entityMetadata:t,onReady:r})=>(0,n.jsx)(K,{themeId:"documentation",className:"techdocs-reader-page",children:w instanceof Function?w({entityRef:U,techdocsMetadataValue:e.value,entityMetadataValue:t.value,onReady:r}):w})})})}):(0,n.jsx)(M.A,{theme:C,children:(0,n.jsx)(E,{pluginId:"techdocs",children:(0,n.jsx)(u.R,{entityRef:U,children:Y||(0,n.jsx)(F,{})})})})}},70157:function(e,t,r){r.d(t,{TechDocsReaderPage:()=>n.W});var n=r(99480)},4518:function(e,t,r){r.d(t,{Z:()=>x});var n=r(31085),a=r(14041),s=r(58837),o=r(29365),i=r(75173),l=r(71677),u=r(37757),c=r(9720),d=r(9684),h=r(63401),p=r(90479),g=r(10337);let f=(0,s.A)(e=>({root:{gridArea:"pageSubheader",flexDirection:"column",minHeight:"auto",padding:e.spacing(3,3,0),"@media print":{display:"none"}}})),x=e=>{let t=f(),[r,s]=(0,a.useState)(null),x=(0,a.useCallback)(e=>{s(e.currentTarget)},[]),m=(0,a.useCallback)(()=>{s(null)},[]),{entityMetadata:{value:v,loading:j}}=(0,h.V)(),C=(0,p.YR)(),A=C.renderComponentsByLocation(g.e.Subheader),y=C.renderComponentsByLocation(g.e.Settings);return(A||y)&&(!1!==j||v)?(0,n.jsx)(i.A,{classes:t,...e.toolbarProps,children:(0,n.jsxs)(c.A,{display:"flex",justifyContent:"flex-end",width:"100%",flexWrap:"wrap",children:[A,y?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.Ay,{title:"Settings",children:(0,n.jsx)(o.A,{"aria-controls":"tech-docs-reader-page-settings","aria-haspopup":"true",onClick:x,children:(0,n.jsx)(d.default,{})})}),(0,n.jsx)(u.A,{id:"tech-docs-reader-page-settings",getContentAnchorEl:null,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:"right"},open:!!r,onClose:m,keepMounted:!0,children:(0,n.jsx)("div",{children:y})})]}):null]})}):null}}}]);
|
|
2
|
-
//# sourceMappingURL=6270.0cf24ebb.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["7186"],{98557:function(e,t,a){a.d(t,{M:()=>r});var n=a(31085),i=a(58837),l=a(71677),o=a(72501);let s=(0,i.A)({container:{overflow:"visible !important"},typo:{fontSize:"inherit",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box","-webkit-line-clamp":({line:e})=>e||1,"-webkit-box-orient":"vertical"}},{name:"BackstageOverflowTooltip"});function r(e){let t=s(e);return(0,n.jsx)(l.Ay,{title:e.title??(e.text||""),placement:e.placement,children:(0,n.jsx)(o.A,{className:t.typo,variant:"inherit",children:e.text})})}},40466:function(e,t,a){a.d(t,{C4:()=>l,tS:()=>o});var n=a(47426);let i="catalog-entity";(0,n.i)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:i});let l=(0,n.i)({name:"catalog.entity.create",attributes:{action:"create"}});(0,n.i)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:i});let o=(0,n.i)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:i});(0,n.i)({name:"catalog.entity.validate",attributes:{}}),(0,n.i)({name:"catalog.location.read",attributes:{action:"read"}}),(0,n.i)({name:"catalog.location.create",attributes:{action:"create"}}),(0,n.i)({name:"catalog.location.analyze",attributes:{}}),(0,n.i)({name:"catalog.location.delete",attributes:{action:"delete"}})},19857:function(e,t,a){a.d(t,{g:()=>l});var n=a(55994),i=a(79811);let l=({translationKey:e})=>{let{t}=(0,n.i)(i.j);return t(`entityTableColumnTitle.${e}`)}},50010:function(e,t,a){a.d(t,{W:()=>n});let n=(0,a(75493).h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:"This entity has relations to other entities, which can't be found in the catalog.\n Entities not found are: ",hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoom to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},20393:function(e,t,a){a.d(t,{CatalogPage:()=>eV});var n=a(31085),i=a(18690),l=a(17944),o=a(84391),s=a(15179),r=a(64947),c=a(29365),d=a(5893),u=a(73657),p=a(25534);function m(e){let{title:t,to:a}=e,i=(0,d.A)(e=>e.breakpoints.down("xs"));return a?i?(0,n.jsx)(c.A,{component:u.N_,color:"primary",title:t,size:"small",to:a,children:(0,n.jsx)(p.default,{})}):(0,n.jsx)(r.A,{component:u.N_,variant:"contained",color:"primary",to:a,children:t}):null}var y=a(23413),g=a(5712),f=a(63200),h=a(81219),x=a(59378),b=a(71242),C=a(48266),j=a(58262),w=a(9720),v=a(14041),S=a(47195),T=a(73466),A=a(76272),k=a(79811),L=a(55994);let P=e=>{let t,a,{allowedKinds:i,hidden:l,initialFilter:o="component"}=e,{t:s}=(0,L.i)(k.j),r=(0,g.gf)(j.k),{error:c,allKinds:d,selectedKind:u,setSelectedKind:p}=function(e){let{filters:t,queryParameters:{kind:a},updateFilters:n}=(0,x.nK)(),i=(0,v.useMemo)(()=>[a].flat()[0],[a]),[l,o]=(0,v.useState)(i??t.kind?.value??e.initialFilter);(0,v.useEffect)(()=>{i&&o(i)},[i]),(0,v.useEffect)(()=>{t.kind?.value&&o(t.kind?.value)},[t.kind]);let{allKinds:s,loading:r,error:c}=function(){let e=(0,g.gf)(A.v),{error:t,loading:a,value:n}=(0,T.A)(async()=>{let{facets:t}=await e.getEntityFacets({facets:["kind"]});return new Map((t.kind??[]).map(e=>e.value).map(e=>[e.toLocaleLowerCase("en-US"),e]))},[e]);return{loading:a,error:t,allKinds:n??new Map}}(),d=s.get(l)||l;return(0,v.useEffect)(()=>{n({kind:l?new S.gM(l,d):void 0})},[l,d,n]),{loading:r,error:c,allKinds:s,selectedKind:l,setSelectedKind:o}}({initialFilter:o});if((0,v.useEffect)(()=>{c&&r.post({message:s("entityKindPicker.errorMessage"),severity:"error"})},[c,r,s]),c)return null;let m=[...(t=Array.from(d.keys()),i&&(t=i.map(e=>e.toLocaleLowerCase("en-US")).filter(e=>d.has(e))),a=new Map(t.map(e=>[e,d.get(e)||e])),u&&!a.has(u)&&a.set(u.toLocaleLowerCase("en-US"),u),a).entries()].map(([e,t])=>({label:t,value:e}));return l?null:(0,n.jsx)(w.A,{pb:1,pt:1,children:(0,n.jsx)(C.w,{label:s("entityKindPicker.title"),items:m,selected:u.toLocaleLowerCase("en-US"),onChange:e=>p(String(e))})})};var M=a(58837),N=a(19030);let O=(0,M.A)({input:{}},{name:"CatalogReactEntityLifecyclePicker"}),R=e=>{let{initialFilter:t=[]}=e,a=O(),{t:i}=(0,L.i)(k.j);return(0,n.jsx)(N.y,{label:i("entityLifecyclePicker.title"),name:"lifecycles",path:"spec.lifecycle",Filter:S.I5,InputProps:{className:a.input},initialSelectedOptions:t})},E=(0,M.A)({input:{}},{name:"CatalogReactEntityNamespacePicker"}),F=e=>{let{initiallySelectedNamespaces:t}=e,a=E(),{t:i}=(0,L.i)(k.j);return(0,n.jsx)(N.y,{label:i("entityNamespacePicker.title"),name:"namespace",path:"metadata.namespace",Filter:S.z,InputProps:{className:a.input},initialSelectedOptions:t})};var K=a(53149),B=a(98552),z=a(86901),U=a(44148),D=a(41260),I=a(80018);let _=(0,M.A)({root:{},input:{},label:{}},{name:"CatalogReactEntityProcessingStatusPickerPicker"}),H=(0,n.jsx)(D.default,{fontSize:"small"}),W=(0,n.jsx)(U.default,{fontSize:"small"}),G=()=>{let e=_(),{updateFilters:t}=(0,x.nK)(),{t:a}=(0,L.i)(k.j),[i,l]=(0,v.useState)([]);return(0,n.jsx)(w.A,{className:e.root,pb:1,pt:1,children:(0,n.jsx)(I.Q,{label:a("entityProcessingStatusPicker.title"),multiple:!0,disableCloseOnSelect:!0,options:["Is Orphan","Has Error"],value:i,onChange:(e,a)=>{var n,i;l(a),t({orphan:(n=a.includes("Is Orphan"))?new S.Kf(n):void 0}),t({error:(i=a.includes("Has Error"))?new S.mT(i):void 0})},renderOption:(e,{selected:t})=>(0,n.jsx)(z.A,{control:(0,n.jsx)(B.A,{icon:H,checkedIcon:W,checked:t}),onClick:e=>e.preventDefault(),label:e}),name:"processing-status-picker",LabelProps:{className:e.label},TextFieldProps:{className:e.input}})})};var V=a(67762),X=a(46343),Y=a.n(X),q=a(40074),J=a.n(q);let $=e=>{let{hidden:t,initialFilter:a}=e,i=(0,g.gf)(j.k),{error:l,availableTypes:o,selectedTypes:s,setSelectedTypes:r}=function(){let e=(0,g.gf)(A.v),{filters:{kind:t,type:a},queryParameters:{type:n},updateFilters:i}=(0,x.nK)(),l=(0,v.useMemo)(()=>[n].flat().filter(Boolean),[n]),[o,s]=(0,v.useState)(l.length?l:a?.getTypes()??[]);(0,v.useEffect)(()=>{l.length&&s(l)},[l]);let[r,c]=(0,v.useState)([]),d=(0,v.useMemo)(()=>t?.value,[t]),{error:u,loading:p,value:m}=(0,T.A)(async()=>d?await e.getEntityFacets({filter:{kind:d},facets:["spec.type"]}).then(e=>e.facets["spec.type"]||[]):[],[d,e]),y=(0,v.useRef)(m);return(0,v.useEffect)(()=>{let e=y.current;if(y.current=m,p||!d||e===m||!m)return;let t=[...new Set(J()(m,e=>-e.count).map(e=>e.value.toLocaleLowerCase("en-US")))];c(t);let a=o.filter(e=>t.includes(e));Y()(o,a)||s(a)},[p,d,o,s,m]),(0,v.useEffect)(()=>{i({type:o.length?new S.qA(o):void 0})},[o,i]),{loading:p,error:u,availableTypes:r,selectedTypes:o,setSelectedTypes:s}}(),{t:c}=(0,L.i)(k.j);if((0,v.useEffect)(()=>{l&&i.post({message:c("entityTypePicker.errorMessage"),severity:"error"}),a&&r([a])},[l,i,a,r,c]),0===o.length||l)return null;o.sort((e,t)=>e.toLocaleLowerCase("en-US").localeCompare(t.toLocaleLowerCase("en-US")));let d=[{value:"all",label:c("entityTypePicker.optionAllTitle")},...o.map(e=>({value:e,label:e}))];return t?null:(0,n.jsx)(w.A,{pb:1,pt:1,children:(0,n.jsx)(C.w,{label:c("entityTypePicker.title"),items:d,selected:(d.length>1?s[0]:void 0)??"all",onChange:e=>r("all"===e?[]:[String(e)])})})};var Q=a(59302);let Z=e=>{let{initialKind:t,initiallySelectedFilter:a,ownerPickerMode:i,initiallySelectedNamespaces:l}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(P,{initialFilter:t}),(0,n.jsx)($,{}),(0,n.jsx)(Q.y,{initialFilter:a}),(0,n.jsx)(K.t,{mode:i}),(0,n.jsx)(R,{}),(0,n.jsx)(V.m,{}),(0,n.jsx)(G,{}),(0,n.jsx)(F,{initiallySelectedNamespaces:l})]})};var ee=a(50714),et=a(11773),ea=a(96403),en=a(58077),ei=a(87187),el=a(4809),eo=a(28499),es=a(7537),er=a(75710),ec=a(53320),ed=a(72501),eu=a(88654),ep=a(75625),em=a(39330),ey=a(45250),eg=a(65398),ef=a.n(eg),eh=a(76025),ex=a(53987),eb=a(94390),eC=a(98557),ej=a(19857);let ew=Object.freeze({createNameColumn(e){function t(t){return t.metadata?.title||(0,es.S)(t,{defaultKind:e?.defaultKind})}return{title:(0,n.jsx)(ej.g,{translationKey:"name"}),field:"resolved.entityRef",highlight:!0,customSort:({entity:e},{entity:a})=>t(e).localeCompare(t(a)),render:({entity:t})=>(0,n.jsx)(eh.z,{entityRef:t,defaultKind:e?.defaultKind||"Component"})}},createSystemColumn:()=>({title:(0,n.jsx)(ej.g,{translationKey:"system"}),field:"resolved.partOfSystemRelationTitle",customFilterAndSearch:(e,t)=>!!t.resolved.partOfSystemRelations&&t.resolved.partOfSystemRelations.map(e=>e.name).join(", ").toLocaleUpperCase("en-US").includes(e.toLocaleUpperCase("en-US")),render:({resolved:e})=>(0,n.jsx)(ex.i,{entityRefs:e.partOfSystemRelations,defaultKind:"system"})}),createOwnerColumn:()=>({title:(0,n.jsx)(ej.g,{translationKey:"owner"}),field:"resolved.ownedByRelationsTitle",render:({resolved:e})=>(0,n.jsx)(ex.i,{entityRefs:e.ownedByRelations,defaultKind:"group"})}),createSpecTargetsColumn:()=>({title:(0,n.jsx)(ej.g,{translationKey:"targets"}),field:"entity.spec.targets",customFilterAndSearch:(e,t)=>{let a=[];return t.entity?.spec?.targets&&Array.isArray(t.entity?.spec?.targets)?a=t.entity?.spec?.targets:t.entity?.spec?.target&&(a=[t.entity?.spec?.target]),a.join(", ").toLocaleUpperCase("en-US").includes(e.toLocaleUpperCase("en-US"))},render:({entity:e})=>(0,n.jsx)(n.Fragment,{children:(e?.spec?.targets||e?.spec?.target)&&(0,n.jsx)(eC.M,{text:(e.spec.targets||[e.spec.target]).join(", "),placement:"bottom-start"})})}),createSpecTypeColumn:(e={hidden:!1})=>({title:(0,n.jsx)(ej.g,{translationKey:"type"}),field:"entity.spec.type",hidden:e.hidden,width:"auto"}),createSpecLifecycleColumn:()=>({title:(0,n.jsx)(ej.g,{translationKey:"lifecycle"}),field:"entity.spec.lifecycle"}),createMetadataDescriptionColumn:()=>({title:(0,n.jsx)(ej.g,{translationKey:"description"}),field:"entity.metadata.description",render:({entity:e})=>(0,n.jsx)(eC.M,{text:e.metadata.description,placement:"bottom-start"}),width:"auto"}),createTagsColumn:()=>({title:(0,n.jsx)(ej.g,{translationKey:"tags"}),field:"entity.metadata.tags",cellStyle:{padding:"0px 16px 0px 20px"},render:({entity:e})=>(0,n.jsx)(n.Fragment,{children:e.metadata.tags&&e.metadata.tags.map(e=>(0,n.jsx)(eb.A,{label:e,size:"small",variant:"outlined",style:{marginBottom:"0px"}},e))}),width:"auto"}),createTitleColumn:e=>({title:(0,n.jsx)(ej.g,{translationKey:"title"}),field:"entity.metadata.title",hidden:e?.hidden,searchable:!0}),createLabelColumn(e,t){function a(e,t){let a=t.metadata?.labels;return a&&a[e]||""}return{title:t?.title||(0,n.jsx)(ej.g,{translationKey:"label"}),field:"entity.metadata.labels",cellStyle:{padding:"0px 16px 0px 20px"},customSort:({entity:t},{entity:n})=>a(e,t).localeCompare(a(e,n)),render:({entity:a})=>{let i=a.metadata?.labels,l=i&&i[e]||t?.defaultValue;return(0,n.jsx)(n.Fragment,{children:l&&(0,n.jsx)(eb.A,{label:l,size:"small",variant:"outlined"},l)})},width:"auto"}},createNamespaceColumn:()=>({title:(0,n.jsx)(ej.g,{translationKey:"namespace"}),field:"entity.metadata.namespace",width:"auto"})});var ev=a(95061),eS=a(63301),eT=a(34839),eA=a(75173),ek=a(64704),eL=a(45917),eP=a(16983);let eM=(0,M.A)(e=>({searchToolbar:{paddingLeft:0,paddingRight:0},input:{}}),{name:"CatalogReactEntitySearchBar"}),eN=()=>{let e=eM(),{t}=(0,L.i)(k.j),{updateFilters:a,queryParameters:{text:i}}=(0,x.nK)(),l=(0,v.useMemo)(()=>[i].flat()[0],[i]),[o,s]=(0,v.useState)(l??"");return(0,eP.default)(()=>{a({text:o.length?new S.V3(o):void 0})},250,[o,a]),(0,v.useEffect)(()=>{l&&s(l)},[l]),(0,n.jsx)(eA.A,{className:e.searchToolbar,children:(0,n.jsx)(ev.A,{children:(0,n.jsx)(eS.A,{"aria-label":"search",id:"input-with-icon-adornment",className:e.input,placeholder:t("entitySearchBar.placeholder"),autoComplete:"off",onChange:e=>s(e.target.value),value:o,startAdornment:(0,n.jsx)(eT.A,{position:"start",children:(0,n.jsx)(eL.default,{})}),endAdornment:(0,n.jsx)(eT.A,{position:"end",children:(0,n.jsx)(c.A,{"aria-label":"clear search",onClick:()=>s(""),edge:"end",disabled:0===o.length,children:(0,n.jsx)(ek.default,{})})})})})})},eO=(0,M.A)(e=>({root:{paddingTop:e.spacing(1.25),paddingLeft:e.spacing(2.5),paddingBottom:e.spacing(.75),display:"flex",justifyContent:"space-between"},text:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}),{name:"PluginCatalogTableToolbar"});function eR(e){let t=eO();return(0,n.jsxs)(eA.A,{className:t.root,children:[(0,n.jsx)(ed.A,{variant:"h5",className:t.text,children:e.title}),(0,n.jsx)(eN,{})]})}function eE(e){let{columns:t,data:a,options:i,...l}=e,{setLimit:o,setOffset:s,limit:r,totalItems:c,offset:d}=(0,x.nK)(),[u,p]=(0,v.useState)(d&&r?Math.floor(d/r):0);return(0,v.useEffect)(()=>{c&&u*r>=c?s(Math.max(0,c-r)):s(Math.max(0,u*r))},[s,u,r,c]),(0,n.jsx)(eo.X,{columns:t,data:a,options:{pageSizeOptions:[5,10,20,50,100],pageSize:r,emptyRowsWhenPaging:!1,...i},components:{Toolbar:eR},page:u,onPageChange:p,onRowsPerPageChange:o,totalCount:c,...l})}function eF(e){let{columns:t,data:a,next:i,prev:l,options:o,...s}=e;return(0,n.jsx)(eo.X,{columns:t,data:a,options:{...o,pageSizeOptions:[],showFirstLastPageButtons:!1,pageSize:Number.MAX_SAFE_INTEGER,emptyRowsWhenPaging:!1},onPageChange:e=>{e>0?i?.():l?.()},components:{Toolbar:eR},page:+!!l,totalCount:i?Number.MAX_VALUE:Number.MAX_SAFE_INTEGER,localization:{pagination:{labelDisplayedRows:""}},...s})}let eK=({filters:e,entities:t})=>{let a=void 0===e.type;return[ew.createTitleColumn({hidden:!0}),ew.createNameColumn({defaultKind:e.kind?.value}),...function(){let n=[ew.createMetadataDescriptionColumn(),ew.createTagsColumn()],i=[ew.createSystemColumn(),ew.createOwnerColumn(),ew.createSpecTypeColumn({hidden:!a}),ew.createSpecLifecycleColumn()];switch(e.kind?.value){case"user":return[...n];case"domain":case"system":return[ew.createOwnerColumn(),...n];case"group":case"template":return[ew.createSpecTypeColumn({hidden:!a}),...n];case"location":return[ew.createSpecTypeColumn({hidden:!a}),ew.createSpecTargetsColumn()];default:return t.every(e=>"default"===e.metadata.namespace)?[...i,...n]:[...i,ew.createNamespaceColumn(),...n]}}()]};var eB=a(50010),ez=a(77899);let eU=(e,t)=>{let a=e=>e.metadata.title||(0,es.S)(e,{defaultKind:"Component"});return a(e).localeCompare(a(t))},eD=e=>{let{columns:t=eK,tableOptions:a,subtitle:i,emptyContent:l}=e,{isStarredEntity:o,toggleStarredEntity:s}=(0,er.I)(),r=(0,x.nK)(),{loading:c,error:d,entities:u,filters:p,pageInfo:m,totalItems:y,paginationMode:g}=r,f=(0,v.useMemo)(()=>"function"==typeof t?t(r):t,[t,r]),{t:h}=(0,L.i)(eB.W);if(d)return(0,n.jsx)("div",{children:(0,n.jsx)(ei.B,{severity:"error",title:h("catalogTable.warningPanelTitle"),children:(0,n.jsx)(el.z,{language:"text",text:d.toString()})})});let b=[({entity:e})=>{let t=e.metadata.annotations?.[et._P],a=h("catalogTable.viewActionTitle");return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ed.A,{style:eu.A,children:a}),(0,n.jsx)(em.default,{fontSize:"small"})]}),tooltip:a,disabled:!t,onClick:()=>{t&&window.open(t,"_blank")}}},({entity:e})=>{let t=e.metadata.annotations?.[et.P],a=h("catalogTable.editActionTitle");return{icon:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ed.A,{style:eu.A,children:a}),(0,n.jsx)(ep.default,{fontSize:"small"})]}),tooltip:a,disabled:!t,onClick:()=>{t&&window.open(t,"_blank")}}},({entity:e})=>{let t=o(e);return{cellStyle:{paddingLeft:"1em"},icon:()=>(0,n.jsx)(ez.m,{isFavorite:t}),tooltip:t?h("catalogTable.unStarActionTitle"):h("catalogTable.starActionTitle"),onClick:()=>s(e)}}],C=p.kind?.label||"",j=p.type?.value||"",w="number"==typeof y?`(${y})`:"",S=(0,ey.capitalize)(p.user?.value??"all"),T=e.title||[S,j,ef()(C),w].filter(e=>e).join(" "),A=e.actions||b,k={actionsColumnIndex:-1,loadingType:"linear",showEmptyDataSourceMessage:!c,padding:"dense",...a};if("cursor"===g)return(0,n.jsx)(eF,{columns:f,emptyContent:l,isLoading:c,title:T,actions:A,subtitle:i,options:k,data:u.map(eI),next:m?.next,prev:m?.prev});if("offset"===g)return(0,n.jsx)(eE,{columns:f,emptyContent:l,isLoading:c,title:T,actions:A,subtitle:i,options:k,data:u.map(eI)});let P=u.sort(eU).map(eI),M=P.length>20;return(0,n.jsx)(eo.X,{isLoading:c,columns:f,options:{paging:M,pageSize:20,pageSizeOptions:[20,50,100],...k},title:T,data:P,actions:A,subtitle:i,emptyContent:l})};function eI(e){let t=(0,ec.t)(e,ea.jn,{kind:"system"}),a=(0,ec.t)(e,ea.vv);return{entity:e,resolved:{name:(0,es.S)(e,{defaultKind:"Component"}),entityRef:(0,en.U2)(e),ownedByRelationsTitle:a.map(e=>(0,es.S)(e,{defaultKind:"group"})).join(", "),ownedByRelations:a,partOfSystemRelationTitle:t.map(e=>(0,es.S)(e,{defaultKind:"system"})).join(", "),partOfSystemRelations:t}}}eD.columns=ew,eD.defaultColumnsFunc=eK;var e_=a(40466),eH=a(17883);function eW(e){let{filters:t,content:a=(0,n.jsx)(eD,{}),pagination:i}=e,r=(0,g.gf)(f.U).getOptionalString("organization.name")??"Backstage",c=(0,h.S)(ee.qP),{t:d}=(0,L.i)(eB.W),{allowed:u}=(0,eH.J)({permission:e_.C4});return(0,n.jsx)(l.d,{title:d("indexPage.title",{orgName:r}),themeId:"home",children:(0,n.jsxs)(o.U,{children:[(0,n.jsxs)(s.d,{title:"",children:[u&&(0,n.jsx)(m,{title:d("indexPage.createButtonTitle"),to:c&&c()}),(0,n.jsx)(y.Y,{children:d("indexPage.supportButtonContent")})]}),(0,n.jsx)(x.B9,{pagination:i,children:(0,n.jsxs)(b.GI,{children:[(0,n.jsx)(b.GI.Filters,{children:t}),(0,n.jsx)(b.GI.Content,{children:a})]})})]})})}function eG(e){let{columns:t,actions:a,initiallySelectedFilter:i="owned",initialKind:l="component",tableOptions:o={},emptyContent:s,pagination:r,ownerPickerMode:c,filters:d,initiallySelectedNamespaces:u}=e;return(0,n.jsx)(eW,{filters:d??(0,n.jsx)(Z,{initialKind:l,initiallySelectedFilter:i,ownerPickerMode:c,initiallySelectedNamespaces:u}),content:(0,n.jsx)(eD,{columns:t,actions:a,tableOptions:o,emptyContent:s}),pagination:r})}function eV(e){return(0,i.P1)()||(0,n.jsx)(eG,{...e})}},47426:function(e,t,a){a.d(t,{i:()=>n});function n({name:e,attributes:t,resourceType:a}){return a?{type:"resource",name:e,attributes:t,resourceType:a}:{type:"basic",name:e,attributes:t}}},17883:function(e,t,a){a.d(t,{J:()=>r});var n=a(5712),i=a(31057),l=a(98109),o=a(71696),s=a(22250);function r(e){let t=(0,n.gf)(i.x),{data:a,error:r}=(0,s.Ay)(e,async e=>{if((0,l.OL)(e.permission)&&!e.resourceRef)return o.b.DENY;let{result:a}=await t.authorize(e);return a});return r?{error:r,loading:!1,allowed:!1}:void 0===a?{loading:!0,allowed:!1}:{loading:!1,allowed:a===o.b.ALLOW}}}}]);
|
|
2
|
-
//# sourceMappingURL=7186.c0fa7899.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["7226"],{52235:function(e,t,a){var r=a(4293),n=a(78920);t.default=void 0;var i=n(a(14041));t.default=(0,r(a(74044)).default)(i.createElement("path",{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward")},89439:function(e,t,a){a.d(t,{n:()=>w});var r=a(31085),n=a(40703),i=a(59469),l=a(48653),s=a(45685),d=a(37197),o=a(58837),c=a(24568),p=a(53373),h=a.n(p),m=a(9720),u=a(72501),g=a(52235),x=a(60603);let f=(0,o.A)(e=>({root:{maxWidth:"fit-content",padding:e.spacing(2,2,2,2.5)},boxTitle:{margin:0,color:e.palette.textSubtle},arrow:{color:e.palette.textSubtle}}),{name:"BackstageBottomLink"});function j(e){let{link:t,title:a,onClick:n}=e,i=f();return(0,r.jsxs)(m.A,{children:[(0,r.jsx)(d.A,{}),(0,r.jsx)(x.N_,{to:t,onClick:n,underline:"none",children:(0,r.jsxs)(m.A,{display:"flex",alignItems:"center",className:i.root,children:[(0,r.jsx)(m.A,{className:i.boxTitle,fontWeight:"fontWeightBold",m:1,children:(0,r.jsx)(u.A,{children:(0,r.jsx)("strong",{children:a})})}),(0,r.jsx)(g.default,{className:i.arrow})]})})]})}var A=a(14041),b=a(45463),y=a(60691),v=a(89332),k=a(55994);let C=e=>{let{slackChannel:t}=e,{t:a}=(0,k.i)(v.O);return t?"string"==typeof t?(0,r.jsx)(u.A,{children:a("errorBoundary.title",{slackChannel:t})}):t.href?(0,r.jsx)(b.z,{to:t.href,variant:"contained",children:t.name}):(0,r.jsx)(u.A,{children:a("errorBoundary.title",{slackChannel:t.name})}):null},B=class extends A.Component{constructor(e){super(e),this.state={error:void 0,errorInfo:void 0}}componentDidCatch(e,t){console.error(`ErrorBoundary, error: ${e}`,{error:e,errorInfo:t}),this.setState({error:e,errorInfo:t})}render(){let{slackChannel:e,children:t}=this.props,{error:a}=this.state;return a?(0,r.jsx)(y.b,{title:"Something Went Wrong",error:a,children:(0,r.jsx)(C,{slackChannel:e})}):t}},S=(0,o.A)(e=>({noPadding:{padding:0,"&:last-child":{paddingBottom:0}},contentAlignBottom:{display:"flex",alignItems:"self-end"},header:{padding:e.spacing(2,2,2,2.5)},headerTitle:{fontWeight:e.typography.fontWeightBold},headerSubheader:{paddingTop:e.spacing(1)},headerAvatar:{},headerAction:{},headerContent:{},subheader:{display:"flex"}}),{name:"BackstageInfoCard"}),T=(0,c.A)(e=>({root:{display:"inline-block",padding:e.spacing(8,8,0,0),float:"right"}}),{name:"BackstageInfoCardCardActionsTopRight"})(i.A),I={flex:{display:"flex",flexDirection:"column"},fullHeight:{display:"flex",flexDirection:"column",height:"100%"},gridItem:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px",breakInside:"avoid-page","@media print":{height:"auto"}}},P={fullHeight:{flex:1},gridItem:{flex:1}};function w(e){let{title:t,subheader:a,divider:o=!0,deepLink:c,slackChannel:p,errorBoundaryProps:m,variant:u,alignContent:g="normal",children:x,headerStyle:f,headerProps:A,icon:b,action:y,actionsClassName:v,actions:k,cardClassName:C,actionsTopRight:w,className:N,noPadding:W,titleTypographyProps:D,subheaderTypographyProps:U}=e,_=S(),E={},H={};return u&&u.split(/[\s]+/g).forEach(e=>{E={...E,...I[e]},H={...H,...P[e]}}),(0,r.jsx)(n.A,{style:E,className:N,children:(0,r.jsxs)(B,{...m||(p?{slackChannel:p}:{}),children:[t&&(0,r.jsx)(s.A,{classes:{root:h()(_.header),title:_.headerTitle,subheader:_.headerSubheader,avatar:_.headerAvatar,action:_.headerAction,content:_.headerContent},title:t,subheader:a||b?(0,r.jsxs)("div",{"data-testid":"info-card-subheader",children:[a&&(0,r.jsx)("div",{className:_.subheader,children:a}),b]}):null,action:y,style:{...f},titleTypographyProps:D,subheaderTypographyProps:U,...A}),w&&(0,r.jsx)(T,{children:w}),o&&(0,r.jsx)(d.A,{}),(0,r.jsx)(l.A,{className:h()(C,{[_.noPadding]:W,[_.contentAlignBottom]:"bottom"===g}),style:H,children:x}),k&&(0,r.jsx)(i.A,{className:v,children:k}),c&&(0,r.jsx)(j,{...c})]})})}},68817:function(e,t,a){a.d(t,{TechDocsCustomHome:()=>Q});var r=a(31085),n=a(14041),i=a(73466),l=a(58837),s=a(96403),d=a(58077),o=a(5712),c=a(15796),p=a(53320),h=a(59378),m=a(76272),u=a(74854),g=a(31314),x=a(90898),f=a(99255),j=a(81219),A=a(63200),b=a(9720),y=a(30455);let v=(0,l.A)(e=>(0,y.A)({root:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(22em, 1fr))",gridAutoRows:"1fr",gridGap:e.spacing(2)}}),{name:"BackstageItemCardGrid"});function k(e){let{children:t,...a}=e,n=v(a);return(0,r.jsx)(b.A,{className:n.root,...a,children:t})}var C=a(72501);let B=(0,l.A)(e=>(0,y.A)({root:{color:e.palette.text.primary,padding:e.spacing(2,2,3),backgroundImage:e.getPageTheme({themeId:"card"}).backgroundImage,backgroundPosition:0,backgroundSize:"inherit"}}),{name:"BackstageItemCardHeader"});function S(e){let{title:t,subtitle:a,children:n}=e,i=B(e);return(0,r.jsxs)(b.A,{className:i.root,children:[a&&(0,r.jsx)(C.A,{variant:"subtitle2",component:"h3",children:a}),t&&(0,r.jsx)(C.A,{variant:"h6",component:"h4",children:t}),n]})}var T=a(45463),I=a(40703),P=a(59469),w=a(48653),N=a(57369),W=a(55489),D=a(89439),U=a(60603),_=a(87623);let E=(0,l.A)(e=>({linkSpacer:{paddingTop:e.spacing(.2)},readMoreLink:{paddingTop:e.spacing(.2)}}),{name:"BackstageInfoCardGrid"});var H=a(90998),V=a(34289),L=a(15179),R=a(23413),z=a(84391),G=a(87187),M=a(4809),O=a(38605),$=a(74953);let F=(0,l.A)(e=>({tabsWrapper:{gridArea:"pageSubheader",backgroundColor:e.palette.background.paper,paddingLeft:e.spacing(3),minWidth:0},defaultTab:{...e.typography.caption,padding:e.spacing(3,3),textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,color:e.palette.text.secondary},selected:{color:e.palette.text.primary},tabRoot:{"&:hover":{backgroundColor:e.palette.background.default,color:e.palette.text.primary}}}),{name:"BackstageHeaderTabs"});function K(e){let{tabs:t,onChange:a,selectedIndex:i}=e,[l,s]=(0,n.useState)(i??0),d=F(),o=(0,n.useCallback)((e,t)=>{void 0===i&&s(t),a&&a(t)},[i,a]);return(0,n.useEffect)(()=>{void 0!==i&&s(i)},[i]),(0,r.jsx)(b.A,{className:d.tabsWrapper,children:(0,r.jsx)($.A,{indicatorColor:"primary",textColor:"inherit",variant:"scrollable",scrollButtons:"auto","aria-label":"tabs",onChange:o,value:l,children:t.map((e,t)=>(0,r.jsx)(O.A,{"data-testid":`header-tab-${t}`,label:e.label,value:t,className:d.defaultTab,classes:{selected:d.selected,root:d.tabRoot},...e.tabProps},e.id))})})}var Y=a(78931);let q={DocsTable:g.o,DocsCardGrid:e=>{let{entities:t}=e,a=(0,j.S)(x.Oc),n=(0,o.gf)(A.U);return t?(0,r.jsx)(k,{"data-testid":"docs-explore",children:t?.length?t.map((e,t)=>(0,r.jsxs)(I.A,{children:[(0,r.jsx)(N.A,{children:(0,r.jsx)(S,{title:e.metadata.title??e.metadata.name})}),(0,r.jsx)(w.A,{children:e.metadata.description}),(0,r.jsx)(P.A,{children:(0,r.jsx)(T.z,{to:a({namespace:(0,f.V)(e.metadata.namespace??"default",n),kind:(0,f.V)(e.kind,n),name:(0,f.V)(e.metadata.name,n)}),color:"primary","data-testid":"read_docs",children:"Read Docs"})})]},t)):null}):null},TechDocsIndexPage:V.TechDocsIndexPage,InfoCardGrid:e=>{let{entities:t,linkContent:a,linkDestination:n}=e,l=E(),s=(0,j.S)(x.Oc),c=(0,o.gf)(A.U),p=(0,o.gf)(_.n),{value:h,loading:m}=(0,i.A)(async()=>new Map(await Promise.all(t?.map(async e=>{let t=await p.forEntity(e).promise;return[(0,d.U2)(e),t]})||[])));return m?(0,r.jsx)(W.k,{}):t&&t?.length?(0,r.jsx)(k,{"data-testid":"info-card-container",children:t.map(e=>(0,r.jsxs)(D.n,{"data-testid":e?.metadata?.title,title:h?.get((0,d.U2)(e))?.primaryTitle,children:[(0,r.jsx)("div",{children:e?.metadata?.description}),(0,r.jsx)("div",{className:l.linkSpacer}),(0,r.jsx)(U.N_,{to:(e=>{if(n){let t=n(e);if(t)return t}return s({namespace:(0,f.V)(e.metadata.namespace??"default",c),kind:(0,f.V)(e.kind,c),name:(0,f.V)(e.metadata.name,c)})})(e),className:l.readMoreLink,"data-testid":"read-docs-link",children:a||"Read Docs"})]},e.metadata.name))}):null}},J=({config:e,entities:t,index:a})=>{let m=(0,l.A)({panelContainer:{marginBottom:"2rem",...e.panelCSS?e.panelCSS:{}}})(),{loading:u,isOwnedEntity:g}=function(){let e=(0,o.gf)(c.K),{loading:t,value:a}=(0,i.A)(async()=>{let{ownershipEntityRefs:t}=await e.getBackstageIdentity();return t},[]);return{loading:t,isOwnedEntity:(0,n.useMemo)(()=>{let e=new Set(a??[]);return t=>{for(let a of(0,p.t)(t,s.vv).map(d.U2))if(e.has(a))return!0;return!1}},[a])}}(),x=q[e.panelType],f=t.filter(t=>"ownedByUser"===e.filterPredicate?!u&&g(t):"function"==typeof e.filterPredicate&&e.filterPredicate(t)),j=e.panelProps?.CustomHeader||(()=>(0,r.jsx)(L.d,{title:e.title,description:e.description,children:0===a?(0,r.jsx)(R.Y,{children:"Discover documentation in your ecosystem."}):null}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(j,{}),(0,r.jsx)("div",{className:m.panelContainer,children:(0,r.jsx)(h.B9,{children:(0,r.jsx)(x,{"data-testid":"techdocs-custom-panel",entities:f,...e.panelProps})})})]})},Q=e=>{let{tabsConfig:t,filter:a,CustomPageWrapper:l}=e,[s,d]=(0,n.useState)(0),c=(0,o.gf)(m.v),{value:p,loading:h,error:g}=(0,i.A)(async()=>(await c.getEntities({filter:{...a,[`metadata.annotations.${Y.As}`]:u.c},fields:["apiVersion","kind","metadata","relations","spec.owner","spec.type"]})).items.filter(e=>!!e.metadata.annotations?.[Y.As])),x=t[s];return h?(0,r.jsx)(H.S,{CustomPageWrapper:l,children:(0,r.jsx)(z.U,{children:(0,r.jsx)(W.k,{})})}):g?(0,r.jsx)(H.S,{CustomPageWrapper:l,children:(0,r.jsx)(z.U,{children:(0,r.jsx)(G.B,{severity:"error",title:"Could not load available documentation.",children:(0,r.jsx)(M.z,{language:"text",text:g.toString()})})})}):(0,r.jsxs)(H.S,{CustomPageWrapper:l,children:[(0,r.jsx)(K,{selectedIndex:s,onChange:e=>d(e),tabs:t.map(({label:e},t)=>({id:t.toString(),label:e}))}),(0,r.jsx)(z.U,{"data-testid":"techdocs-content",children:x.panels.map((e,t)=>(0,r.jsx)(J,{config:e,entities:p||[],index:t},t))})]})}},34289:function(e,t,a){a.d(t,{TechDocsIndexPage:()=>l});var r=a(31085),n=a(18690),i=a(70335);let l=e=>(0,n.P1)()||(0,r.jsx)(i.K,{...e})}}]);
|
|
2
|
-
//# sourceMappingURL=7226.f8fc7544.chunk.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunktechdocs_cli_embedded_app=self.webpackChunktechdocs_cli_embedded_app||[]).push([["7526"],{40466:function(e,t,i){i.d(t,{C4:()=>r,tS:()=>o});var a=i(47426);let n="catalog-entity";(0,a.i)({name:"catalog.entity.read",attributes:{action:"read"},resourceType:n});let r=(0,a.i)({name:"catalog.entity.create",attributes:{action:"create"}});(0,a.i)({name:"catalog.entity.delete",attributes:{action:"delete"},resourceType:n});let o=(0,a.i)({name:"catalog.entity.refresh",attributes:{action:"update"},resourceType:n});(0,a.i)({name:"catalog.entity.validate",attributes:{}}),(0,a.i)({name:"catalog.location.read",attributes:{action:"read"}}),(0,a.i)({name:"catalog.location.create",attributes:{action:"create"}}),(0,a.i)({name:"catalog.location.analyze",attributes:{}}),(0,a.i)({name:"catalog.location.delete",attributes:{action:"delete"}})},22845:function(e,t,i){i.d(t,{T7:()=>p,TY:()=>c,tN:()=>d});var a=i(31085),n=i(58077),r=i(92829),o=i(9135),s=i(20549);let l=(0,o.tK)("entity-context"),p=e=>{let{children:t,entity:i,loading:o,error:p,refresh:d}=e;return(0,a.jsx)(l.Provider,{value:(0,s.B)({1:{entity:i,loading:o,error:p,refresh:d}}),children:(0,a.jsx)(r.Ig,{attributes:{...i?{entityRef:(0,n.U2)(i)}:void 0},children:t})})};function d(){let e=(0,o.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");if(!t.entity)throw Error("useEntity hook is being called outside of an EntityLayout where the entity has not been loaded. If this is intentional, please use useAsyncEntity instead.");return{entity:t.entity}}function c(){let e=(0,o.qO)("entity-context");if(!e)throw Error("Entity context is not available");let t=e.atVersion(1);if(!t)throw Error("EntityContext v1 not available");let{entity:i,loading:a,error:n,refresh:r}=t;return{entity:i,loading:a,error:n,refresh:r}}},50010:function(e,t,i){i.d(t,{W:()=>a});let a=(0,i(75493).h)({id:"catalog",messages:{indexPage:{title:"{{orgName}} Catalog",createButtonTitle:"Create",supportButtonContent:"All your software catalog entities"},aboutCard:{title:"About",refreshButtonTitle:"Schedule entity refresh",editButtonTitle:"Edit Metadata",createSimilarButtonTitle:"Create something similar",refreshScheduledMessage:"Refresh scheduled",launchTemplate:"Launch Template",viewTechdocs:"View TechDocs",viewSource:"View Source",descriptionField:{label:"Description",value:"No description"},ownerField:{label:"Owner",value:"No Owner"},domainField:{label:"Domain",value:"No Domain"},systemField:{label:"System",value:"No System"},parentComponentField:{label:"Parent Component",value:"No Parent Component"},typeField:{label:"Type"},lifecycleField:{label:"Lifecycle"},tagsField:{label:"Tags",value:"No Tags"},targetsField:{label:"Targets"}},searchResultItem:{lifecycle:"Lifecycle",Owner:"Owner"},catalogTable:{warningPanelTitle:"Could not fetch catalog entities.",viewActionTitle:"View",editActionTitle:"Edit",starActionTitle:"Add to favorites",unStarActionTitle:"Remove from favorites"},dependencyOfComponentsCard:{title:"Dependency of components",emptyMessage:"No component depends on this component"},dependsOnComponentsCard:{title:"Depends on components",emptyMessage:"No component is a dependency of this component"},dependsOnResourcesCard:{title:"Depends on resources",emptyMessage:"No resource is a dependency of this component"},entityContextMenu:{copiedMessage:"Copied!",moreButtonTitle:"More",inspectMenuTitle:"Inspect entity",copyURLMenuTitle:"Copy entity URL",unregisterMenuTitle:"Unregister entity"},entityLabelsCard:{title:"Labels",emptyDescription:"No labels defined for this entity. You can add labels to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityLabels:{warningPanelTitle:"Entity not found",ownerLabel:"Owner",lifecycleLabel:"Lifecycle"},entityLinksCard:{title:"Links",emptyDescription:"No links defined for this entity. You can add links to your entity YAML as shown in the highlighted example below:",readMoreButtonTitle:"Read more"},entityNotFound:{title:"Entity was not found",description:"Want to help us build this? Check out our Getting Started documentation.",docButtonTitle:"DOCS"},deleteEntity:{dialogTitle:"Are you sure you want to delete this entity?",deleteButtonTitle:"Delete",cancelButtonTitle:"Cancel",description:"This entity is not referenced by any location and is therefore not receiving updates. Click here to delete."},entityProcessingErrorsDescription:"The error below originates from",entityRelationWarningDescription:"This entity has relations to other entities, which can't be found in the catalog.\n Entities not found are: ",hasComponentsCard:{title:"Has components",emptyMessage:"No component is part of this system"},hasResourcesCard:{title:"Has resources",emptyMessage:"No resource is part of this system"},hasSubcomponentsCard:{title:"Has subcomponents",emptyMessage:"No subcomponent is part of this component"},hasSubdomainsCard:{title:"Has subdomains",emptyMessage:"No subdomain is part of this domain"},hasSystemsCard:{title:"Has systems",emptyMessage:"No system is part of this domain"},relatedEntitiesCard:{emptyHelpLinkTitle:"Learn how to change this"},systemDiagramCard:{title:"System Diagram",description:"Use pinch & zoom to move around the diagram.",edgeLabels:{partOf:"part of",provides:"provides",dependsOn:"depends on"}}}})},27541:function(e,t,i){let a;i.d(t,{AboutCard:()=>ew});var n=i(31085),r=i(14041),o=i(58837),s=i(40703),l=i(48653),p=i(45685),d=i(37197),c=i(29365),m=i(74011),u=i(75625),h=i(82451),y=i(25534),f=i(53373),g=i.n(f),b=i(86613),x=i(60603),v=i(9720),k=i(72501);let w=(0,o.A)(e=>({link:{display:"grid",justifyItems:"center",gridGap:4,textAlign:"center"},disabled:{color:e.palette.text.secondary,cursor:"default"},primary:{color:e.palette.primary.main},secondary:{color:e.palette.secondary.main},label:{textTransform:"uppercase",fontWeight:e.typography.fontWeightBold,letterSpacing:1.2}}),{name:"BackstageIconLinkVertical"});function j({color:e="primary",disabled:t=!1,href:i="#",icon:a=(0,n.jsx)(b.default,{}),label:r,onClick:o,title:s}){let l=w();return t?(0,n.jsxs)(v.A,{title:s,className:g()(l.link,l.disabled),children:[a,(0,n.jsx)(k.A,{variant:"caption",component:"span",className:l.label,children:r})]}):(0,n.jsxs)(x.N_,{title:s,className:g()(l.link,l[e]),to:i,onClick:o,children:[a,(0,n.jsx)(k.A,{variant:"caption",component:"span",className:l.label,children:r})]})}let T=(0,o.A)(e=>({links:{margin:e.spacing(2,0),display:"grid",gridAutoFlow:"column",gridAutoColumns:"min-content",gridGap:e.spacing(3),wordBreak:"keep-all"}}),{name:"BackstageHeaderIconLinkRow"});function A(e){let{links:t}=e,i=T();return(0,n.jsx)("nav",{className:i.links,children:t.map((e,t)=>(0,n.jsx)(j,{...e},t+1))})}var C=i(55940),L=i(5712),S=i(81219),N=i(91189),E=i(58262),I=i(62454),$=i(55994),U=i(60443),R=i(13660);let M=e=>{let{type:t}=e,i=(0,N.n)(),a=R.default,r=t?i.getSystemIcon(t)??a:a;return(0,n.jsx)(r,{})};var O=i(11773),P=i(16263),B=i(58077),F=i(22845),D=i(37121),q=i(76272),z=i(17883),V=i(40466),_=i(78931),H=i(95269),W=i(11601),J=i.n(W),G=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"Entity","description":"The parts of the format that\'s common to all versions/kinds of entity.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService","description":"Creates Lorems like a pro.","labels":{"product_name":"Random value Generator"},"annotations":{"docs":"https://github.com/..../tree/develop/doc"}},"spec":{"type":"service","lifecycle":"production","owner":"tools"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":false,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"$ref":"EntityMeta"},"spec":{"type":"object","description":"The specification data describing the entity itself."},"relations":{"type":"array","description":"The relations that this entity has with other entities.","items":{"$ref":"common#relation"}},"status":{"$ref":"common#status"}}}'),Y=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityEnvelope","description":"The envelope skeleton parts of an entity - whatever is necessary to be able to give it a ref and pass to further validation / policy checking.","examples":[{"apiVersion":"backstage.io/v1alpha1","kind":"Component","metadata":{"name":"LoremService"}}],"type":"object","required":["apiVersion","kind","metadata"],"additionalProperties":true,"properties":{"apiVersion":{"type":"string","description":"The version of specification format for this particular entity that this is written against.","minLength":1,"examples":["backstage.io/v1alpha1","my-company.net/v1","1.0"]},"kind":{"type":"string","description":"The high level entity type being described.","minLength":1,"examples":["API","Component","Domain","Group","Location","Resource","System","Template","User"]},"metadata":{"type":"object","required":["name"],"additionalProperties":true,"properties":{"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1}}}}}'),K=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"EntityMeta","description":"Metadata fields common to all versions/kinds of entity.","examples":[{"uid":"e01199ab-08cc-44c2-8e19-5c29ded82521","etag":"lsndfkjsndfkjnsdfkjnsd==","name":"my-component-yay","namespace":"the-namespace","labels":{"backstage.io/custom":"ValueStuff"},"annotations":{"example.com/bindings":"are-secret"},"tags":["java","data"]}],"type":"object","required":["name"],"additionalProperties":true,"properties":{"uid":{"type":"string","description":"A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics.","examples":["e01199ab-08cc-44c2-8e19-5c29ded82521"],"minLength":1},"etag":{"type":"string","description":"An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value.","examples":["lsndfkjsndfkjnsdfkjnsd=="],"minLength":1},"name":{"type":"string","description":"The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair.","examples":["metadata-proxy"],"minLength":1},"namespace":{"type":"string","description":"The namespace that the entity belongs to.","default":"default","examples":["default","admin"],"minLength":1},"title":{"type":"string","description":"A display name of the entity, to be presented in user interfaces instead of the name property, when available.","examples":["React SSR Template"],"minLength":1},"description":{"type":"string","description":"A short (typically relatively few words, on one line) description of the entity."},"labels":{"type":"object","description":"Key/value pairs of identifying information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"annotations":{"type":"object","description":"Key/value pairs of non-identifying auxiliary information attached to the entity.","additionalProperties":true,"patternProperties":{"^.+$":{"type":"string"}}},"tags":{"type":"array","description":"A list of single-valued strings, to for example classify catalog entities in various ways.","items":{"type":"string","minLength":1}},"links":{"type":"array","description":"A list of external hyperlinks related to the entity. Links can provide additional contextual information that may be located outside of Backstage itself. For example, an admin dashboard or external CMS page.","items":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://admin.example-org.com"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["Admin Dashboard"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"type":{"type":"string","description":"An optional value to categorize links into specific groups.","examples":["runbook","documentation","logs","dashboard"],"minLength":1}}}}}}'),X=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"common","type":"object","description":"Common definitions to import from other schemas","definitions":{"reference":{"$id":"#reference","type":"object","description":"A reference by name to another entity.","required":["kind","namespace","name"],"additionalProperties":false,"properties":{"kind":{"type":"string","description":"The kind field of the entity.","minLength":1},"namespace":{"type":"string","description":"The metadata.namespace field of the entity.","minLength":1},"name":{"type":"string","description":"The metadata.name field of the entity.","minLength":1}}},"relation":{"$id":"#relation","type":"object","description":"A directed relation from one entity to another.","required":["type","targetRef"],"additionalProperties":false,"properties":{"type":{"type":"string","minLength":1,"pattern":"^\\\\w+$","description":"The type of relation."},"target":{"$ref":"#reference","deprecated":true},"targetRef":{"type":"string","minLength":1,"description":"The entity ref of the target of this relation."}}},"status":{"$id":"#status","type":"object","description":"The current status of the entity, as claimed by various sources.","required":[],"additionalProperties":true,"properties":{"items":{"type":"array","items":{"$ref":"#statusItem"}}}},"statusItem":{"$id":"#statusItem","type":"object","description":"A specific status item on a well known format.","required":["type","level","message"],"additionalProperties":true,"properties":{"type":{"type":"string","minLength":1},"level":{"$ref":"#statusLevel","description":"The status level / severity of the status item."},"message":{"type":"string","description":"A brief message describing the status, intended for human consumption."},"error":{"$ref":"#error","description":"An optional serialized error object related to the status."}}},"statusLevel":{"$id":"#statusLevel","type":"string","description":"A status level / severity.","enum":["info","warning","error"]},"error":{"$id":"#error","type":"object","description":"A serialized error object.","required":["name","message"],"additionalProperties":true,"properties":{"name":{"type":"string","examples":["Error","InputError"],"description":"The type name of the error","minLength":1},"message":{"type":"string","description":"The message of the error"},"code":{"type":"string","description":"An error code associated with the error"},"stack":{"type":"string","description":"An error stack trace"}}}}}');let Z=new Map,Q=[Y,G,K,X];a=function(e,t={}){let i=t?.disableCache??!1,a=i?"":JSON.stringify(e);if(!i){let e=Z.get(a);if(e)return e}let n=function(e){if("object"!=typeof e)return[];let t=new Set;e.$id&&t.add(e.$id);let i=[],a=[e];for(;a.length;)for(let e of function*(e){let t=[e];for(;t.length;){let e=t.pop();if("object"==typeof e&&e)for(let[i,a]of Object.entries(e))"$ref"===i&&"string"==typeof a?yield a.split("#")[0]:t.push(a)}}(a.pop()))if(!t.has(e)){t.add(e);let n=Q.find(t=>t.$id===e);n&&(i.push(n),a.push(n))}return i}(e),r=new(J())({allowUnionTypes:!0,allErrors:!0,validateSchema:!0});n.length&&r.addSchema(n,void 0,void 0,!0);let o=r.compile(e);return i||Z.set(a,o),o}(JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","$id":"TemplateV1beta3","description":"A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.","examples":[{"apiVersion":"scaffolder.backstage.io/v1beta3","kind":"Template","metadata":{"name":"react-ssr-template","title":"React SSR Template","description":"Next.js application skeleton for creating isomorphic web applications.","tags":["recommended","react"]},"spec":{"owner":"artist-relations-team","type":"website","lifecycle":"production","parameters":{"required":["name","description","repoUrl"],"backstage:permissions":{"tags":["one","two"]},"properties":{"name":{"title":"Name","type":"string","description":"Unique name of the component"},"description":{"title":"Description","type":"string","description":"Description of the component"},"repoUrl":{"title":"Pick a repository","type":"string","ui:field":"RepoUrlPicker"}}},"steps":[{"id":"fetch","name":"Fetch","action":"fetch:plain","parameters":{"url":"./template"},"backstage:permissions":{"tags":["one","two"]}},{"id":"publish","name":"Publish to GitHub","action":"publish:github","parameters":{"repoUrl":"${{ parameters.repoUrl }}"},"if":"${{ parameters.repoUrl }}"}],"output":{"catalogInfoUrl":"${{ steps.publish.output.catalogInfoUrl }}"}}}],"allOf":[{"$ref":"Entity"},{"type":"object","required":["spec"],"properties":{"apiVersion":{"enum":["scaffolder.backstage.io/v1beta3"]},"kind":{"enum":["Template"]},"spec":{"type":"object","required":["type","steps"],"properties":{"type":{"type":"string","description":"The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.","examples":["service","website","library"],"minLength":1},"owner":{"type":"string","description":"The user (or group) owner of the template","minLength":1},"lifecycle":{"type":"string","description":"The lifecycle state of the template.","examples":["experimental","production","deprecated"],"minLength":1},"parameters":{"oneOf":[{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}},{"type":"array","description":"A list of separate forms to collect parameters.","items":{"type":"object","description":"The JSONSchema describing the inputs for the template.","properties":{"backstage:permissions":{"type":"object","description":"Object used for authorizing the parameter","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}}]},"presentation":{"type":"object","description":"A way to redefine the presentation of the scaffolder.","properties":{"buttonLabels":{"type":"object","description":"A way to redefine the labels for actionable buttons.","properties":{"backButtonText":{"type":"string","description":"A button which return the user to one step back."},"createButtonText":{"type":"string","description":"A button which start the execution of the template."},"reviewButtonText":{"type":"string","description":"A button which open the review step to verify the input prior to start the execution."}}}}},"EXPERIMENTAL_recovery":{"type":"object","description":"A task recovery section.","properties":{"EXPERIMENTAL_strategy":{"type":"string","description":"Recovery strategy for your task (none or startOver). By default none"}}},"EXPERIMENTAL_formDecorators":{"type":"array","description":"A list of decorators and their inputs that the form should trigger before submitting the job","items":{"type":"object","properties":{"id":{"type":"string","description":"The form hook ID"},"input":{"type":"object","description":"A object describing the inputs to the form hook."}}}},"steps":{"type":"array","description":"A list of steps to execute.","items":{"type":"object","description":"A description of the step to execute.","required":["action"],"properties":{"id":{"type":"string","description":"The ID of the step, which can be used to refer to its outputs."},"name":{"type":"string","description":"The name of the step, which will be displayed in the UI during the scaffolding process."},"action":{"type":"string","description":"The name of the action to execute."},"input":{"type":"object","description":"A templated object describing the inputs to the action."},"if":{"type":["string","boolean"],"description":"A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\\"\\"`, `0`, or `[]`."},"backstage:permissions":{"type":"object","description":"Object used for authorizing the step","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"output":{"type":"object","description":"A templated object describing the outputs of the scaffolding task.","properties":{"links":{"type":"array","description":"A list of external hyperlinks, typically pointing to resources created or updated by the template","items":{"type":"object","required":[],"properties":{"url":{"type":"string","description":"A url in a standard uri format.","examples":["https://github.com/my-org/my-new-repo"],"minLength":1},"entityRef":{"type":"string","description":"An entity reference to an entity in the catalog.","examples":["Component:default/my-app"],"minLength":1},"title":{"type":"string","description":"A user friendly display name for the link.","examples":["View new repo"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1}}}},"text":{"type":"array","description":"A list of Markdown text blobs, like output data from the template.","items":{"type":"object","required":[],"properties":{"title":{"type":"string","description":"A user friendly display name for the text.","examples":["Output Content"],"minLength":1},"icon":{"type":"string","description":"A key representing a visual icon to be displayed in the UI.","examples":["dashboard"],"minLength":1},"content":{"type":"string","description":"The text blob to display in the UI, rendered as Markdown.","examples":["**hey** _I\'m_ Markdown"]}}}}},"additionalProperties":{"type":"string"}}}}}}]}')),e=>{if(!0===a(e))return e;let t=a.errors?.filter(e=>["/kind","/apiVersion"].includes(e.instancePath));if(t?.length&&t.every(e=>"enum"===e.keyword))return!1;throw function(e){if(!e?.length)throw TypeError("Unknown error");let t=e[0];throw TypeError(`${t.instancePath||"<root>"} ${t.message}${t.params?` - ${Object.entries(t.params).map(([e,t])=>`${e}: ${t}`).join(", ")}`:""}`)}(a.errors)};var ee=i(47426);let et="scaffolder-template",ei="scaffolder-task",ea=((0,ee.i)({name:"scaffolder.action.execute",attributes:{},resourceType:"scaffolder-action"}),(0,ee.i)({name:"scaffolder.template.parameter.read",attributes:{action:"read"},resourceType:et}),(0,ee.i)({name:"scaffolder.template.step.read",attributes:{action:"read"},resourceType:et}),(0,ee.i)({name:"scaffolder.task.read",attributes:{action:"read"},resourceType:ei}),(0,ee.i)({name:"scaffolder.task.create",attributes:{action:"create"}}));(0,ee.i)({name:"scaffolder.task.cancel",attributes:{},resourceType:ei}),(0,ee.i)({name:"scaffolder.template.management",attributes:{}});var en=i(50714),er=i(50010),eo=i(91638),es=i(96403),el=i(53320),ep=i(53987),ed=i(94390),ec=i(42899),em=i(11629),eu=i(62335);let eh=(0,o.A)(e=>({value:{fontWeight:"bold",overflow:"hidden",lineHeight:"24px",wordBreak:"break-word"},label:{color:e.palette.text.secondary,textTransform:"uppercase",fontSize:"10px",fontWeight:"bold",letterSpacing:.5,overflow:"hidden",whiteSpace:"nowrap"}}));function ey(e){let{label:t,value:i,gridSizes:a,children:r,className:o}=e,s=eh(),l=(0,eu.O)(r,e=>e.getElements()),p=l.length>0?l:(0,n.jsx)(k.A,{variant:"body2",className:s.value,children:i||"unknown"});return(0,n.jsxs)(ec.A,{item:!0,...a,className:o,children:[(0,n.jsx)(k.A,{variant:"h2",className:s.label,children:t}),p]})}var ef=i(75836);let eg=(0,o.A)({description:{wordBreak:"break-word"}});function eb(e){let t,{entity:i}=e,a=eg(),{t:r}=(0,$.i)(er.W),o="system"===i.kind.toLocaleLowerCase("en-US"),s="resource"===i.kind.toLocaleLowerCase("en-US"),l="component"===i.kind.toLocaleLowerCase("en-US"),p="api"===i.kind.toLocaleLowerCase("en-US"),d="template"===i.kind.toLocaleLowerCase("en-US"),c="location"===i.kind.toLocaleLowerCase("en-US"),m="group"===i.kind.toLocaleLowerCase("en-US"),u=(0,el.t)(i,es.jn,{kind:"system"}),h=(0,el.t)(i,es.jn,{kind:"component"}),y=(0,el.t)(i,es.jn,{kind:"domain"}),f=(0,el.t)(i,es.vv);try{t=(0,D.Cr)(i)}catch(e){t=void 0}return(0,n.jsxs)(ec.A,{container:!0,children:[(0,n.jsx)(ey,{label:r("aboutCard.descriptionField.label"),gridSizes:{xs:12},children:(0,n.jsx)(em.h,{className:a.description,content:i?.metadata?.description||r("aboutCard.descriptionField.value")})}),(0,n.jsx)(ey,{label:r("aboutCard.ownerField.label"),value:r("aboutCard.ownerField.value"),className:a.description,gridSizes:{xs:12,sm:6,lg:4},children:f.length>0&&(0,n.jsx)(ep.i,{entityRefs:f,defaultKind:"group"})}),(o||y.length>0)&&(0,n.jsx)(ey,{label:r("aboutCard.domainField.label"),value:r("aboutCard.domainField.value"),gridSizes:{xs:12,sm:6,lg:4},children:y.length>0&&(0,n.jsx)(ep.i,{entityRefs:y,defaultKind:"domain"})}),(p||l||s||u.length>0)&&(0,n.jsx)(ey,{label:r("aboutCard.systemField.label"),value:r("aboutCard.systemField.value"),gridSizes:{xs:12,sm:6,lg:4},children:u.length>0&&(0,n.jsx)(ep.i,{entityRefs:u,defaultKind:"system"})}),l&&h.length>0&&(0,n.jsx)(ey,{label:r("aboutCard.parentComponentField.label"),value:r("aboutCard.parentComponentField.value"),gridSizes:{xs:12,sm:6,lg:4},children:(0,n.jsx)(ep.i,{entityRefs:h,defaultKind:"component"})}),(p||l||s||d||m||c||"string"==typeof i?.spec?.type)&&(0,n.jsx)(ey,{label:r("aboutCard.typeField.label"),value:i?.spec?.type,gridSizes:{xs:12,sm:6,lg:4}}),(p||l||"string"==typeof i?.spec?.lifecycle)&&(0,n.jsx)(ey,{label:r("aboutCard.lifecycleField.label"),value:i?.spec?.lifecycle,gridSizes:{xs:12,sm:6,lg:4}}),(0,n.jsx)(ey,{label:r("aboutCard.tagsField.label"),value:r("aboutCard.tagsField.value"),gridSizes:{xs:12,sm:6,lg:4},children:(i?.metadata?.tags||[]).map(e=>(0,n.jsx)(ed.A,{size:"small",label:e},e))}),c&&(i?.spec?.targets||i?.spec?.target)&&(0,n.jsx)(ey,{label:r("aboutCard.targetsField.label"),gridSizes:{xs:12},children:(0,n.jsx)(ef.m,{cols:1,items:(i.spec.targets||[i.spec.target]).map(e=>e).map(e=>({text:e,href:function(e,t,i){if("url"===t||e.includes("://"))return e;let a="file"===i.type?`file://${i.target}`:i.target;return"file"===t||"file"===i.type?new URL(e,a).href:a}(e,i?.spec?.type||"unknown",t)}))})})]})}function ex(){let{entity:e}=(0,F.tN)(),t=function(){let{entity:e}=(0,F.tN)(),t=(0,L.gf)(U.Y),{t:i}=(0,$.i)(er.W),a=function(e,t){let i=e.metadata.annotations?.[P.I4];if(i)try{let e=(0,D.aY)(i),a=t.byUrl(e.target);return{locationTargetUrl:e.target,integrationType:a?.type}}catch{return}}(e,t);return{label:i("aboutCard.viewSource"),disabled:!a,icon:(0,n.jsx)(M,{type:a?.integrationType}),href:a?.locationTargetUrl}}(),i=function(){let{entity:e}=(0,F.tN)(),t=(0,S.S)(en.UJ),{t:i}=(0,$.i)(er.W);return{label:i("aboutCard.viewTechdocs"),disabled:!(e.metadata.annotations?.[_.As]||e.metadata.annotations?.[_.GO])||!t,icon:(0,n.jsx)(h.default,{}),href:(0,H.b1)(e,t)}}(),a=function(){let e=(0,N.n)(),{entity:t}=(0,F.tN)(),i=(0,S.S)(en.Zg),{t:a}=(0,$.i)(er.W),r=e.getSystemIcon("scaffolder")??y.default,{allowed:o}=(0,z.J)({permission:ea});return{label:a("aboutCard.launchTemplate"),icon:(0,n.jsx)(r,{}),disabled:!i||!o,href:i&&i({templateName:t.metadata.name,namespace:t.metadata.namespace||O.oQ})}}(),r=[t,i];return"scaffolder.backstage.io/v1beta3"===e.apiVersion&&"Template"===e.kind&&r.push(a),(0,n.jsx)(A,{links:r})}let ev=(0,o.A)({gridItemCard:{display:"flex",flexDirection:"column",height:"calc(100% - 10px)",marginBottom:"10px"},fullHeightCard:{display:"flex",flexDirection:"column",height:"100%"},gridItemCardContent:{flex:1},fullHeightCardContent:{flex:1}});function ek(e){let{variant:t,subheader:i}=e,a=ev(),{entity:o}=(0,F.tN)(),h=(0,L.gf)(q.v),y=(0,L.gf)(E.k),f=(0,L.gf)(I.m),g=(0,S.S)(en.Zg),b=(e=>{let t=(0,L.gf)(q.v),{value:i}=(0,eo.default)(async()=>{let i,a=e.metadata.annotations?.["backstage.io/source-template"];if(a)try{let e=await t.getEntityByRef(a);return i=(0,B.KU)(a),void 0!==e?i:void 0}catch{return}},[t,e]);return i})(o),{allowed:v}=function(e){let{entity:t,loading:i,error:a}=(0,F.TY)(),{allowed:n,loading:r,error:o}=(0,z.J)({permission:e,resourceRef:t?(0,B.U2)(t):void 0});return i||r?{loading:!0,allowed:!1}:a?{loading:!1,allowed:!1,error:a}:{loading:!1,allowed:n,error:o}}(V.tS),{t:k}=(0,$.i)(er.W),w=o.metadata.annotations?.[O.P],j="";"gridItem"===t?j=a.gridItemCard:"fullHeight"===t&&(j=a.fullHeightCard);let T="";"gridItem"===t?T=a.gridItemCardContent:"fullHeight"===t&&(T=a.fullHeightCardContent);let A=o.metadata.annotations?.[P.Eo],N=A?.startsWith("url:")||A?.startsWith("file:"),U=(0,r.useCallback)(async()=>{try{await h.refreshEntity((0,B.U2)(o)),y.post({message:k("aboutCard.refreshScheduledMessage"),severity:"info",display:"transient"})}catch(e){f.post(e)}},[h,o,y,k,f]);return(0,n.jsxs)(s.A,{className:j,children:[(0,n.jsx)(p.A,{title:k("aboutCard.title"),action:(0,n.jsxs)(n.Fragment,{children:[N&&v&&(0,n.jsx)(c.A,{"aria-label":"Refresh",title:k("aboutCard.refreshButtonTitle"),onClick:U,children:(0,n.jsx)(m.default,{})}),(0,n.jsx)(c.A,{component:x.N_,"aria-label":"Edit",disabled:!w,title:k("aboutCard.editButtonTitle"),to:w??"#",children:(0,n.jsx)(u.default,{})}),b&&g&&(0,n.jsx)(c.A,{component:x.N_,title:k("aboutCard.createSimilarButtonTitle"),to:g({namespace:b.namespace,templateName:b.name}),children:(0,n.jsx)(C.z9,{id:"scaffolder"})})]}),subheader:i??(0,n.jsx)(ex,{})}),(0,n.jsx)(d.A,{}),(0,n.jsx)(l.A,{className:T,children:(0,n.jsx)(eb,{entity:o})})]})}function ew(e){return(0,n.jsx)(ek,{...e})}},75836:function(e,t,i){i.d(t,{m:()=>y});var a=i(31085),n=i(24709),r=i(44913),o=i(9720),s=i(72501),l=i(58837),p=i(23127),d=i(60603);let c=(0,l.A)({svgIcon:{display:"inline-block","& svg":{display:"inline-block",fontSize:"inherit",verticalAlign:"baseline"}}});function m(e){let{href:t,text:i,Icon:n}=e,r=c();return(0,a.jsxs)(o.A,{display:"flex",children:[(0,a.jsx)(o.A,{mr:1,className:r.svgIcon,children:(0,a.jsx)(s.A,{component:"div",children:n?(0,a.jsx)(n,{}):(0,a.jsx)(p.default,{})})}),(0,a.jsx)(o.A,{flexGrow:"1",children:(0,a.jsx)(d.N_,{to:t,target:"_blank",rel:"noopener",children:i||t})})]})}var u=i(5893);let h={xs:1,sm:1,md:1,lg:2,xl:3};function y(e){let{items:t,cols:i}=e,o=function(e){let t=[(0,u.A)(e=>e.breakpoints.up("xl"))?"xl":null,(0,u.A)(e=>e.breakpoints.up("lg"))?"lg":null,(0,u.A)(e=>e.breakpoints.up("md"))?"md":null,(0,u.A)(e=>e.breakpoints.up("sm"))?"sm":null,(0,u.A)(e=>e.breakpoints.up("xs"))?"xs":null],i=1;if("number"==typeof e)i=e;else{let a=t.find(e=>null!==e)??"xs";i=e?.[a]??h[a]}return i}(i);return(0,a.jsx)(n.A,{rowHeight:"auto",cols:o,children:t.map(({text:e,href:t,Icon:i},n)=>(0,a.jsx)(r.A,{children:(0,a.jsx)(m,{href:t,text:e??t,Icon:i})},n))})}},47426:function(e,t,i){i.d(t,{i:()=>a});function a({name:e,attributes:t,resourceType:i}){return i?{type:"resource",name:e,attributes:t,resourceType:i}:{type:"basic",name:e,attributes:t}}},17883:function(e,t,i){i.d(t,{J:()=>l});var a=i(5712),n=i(31057),r=i(98109),o=i(71696),s=i(22250);function l(e){let t=(0,a.gf)(n.x),{data:i,error:l}=(0,s.Ay)(e,async e=>{if((0,r.OL)(e.permission)&&!e.resourceRef)return o.b.DENY;let{result:i}=await t.authorize(e);return i});return l?{error:l,loading:!1,allowed:!1}:void 0===i?{loading:!0,allowed:!1}:{loading:!1,allowed:i===o.b.ALLOW}}}}]);
|
|
2
|
-
//# sourceMappingURL=7526.a9e2aca8.chunk.js.map
|