cdd-cli 3.1.6 → 3.1.9
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/.eslintrc.json +1 -1
- package/.github/workflows/ci.yml +3 -0
- package/.github/workflows/docs.yml +8 -1
- package/CHANGELOG.md +23 -0
- package/CONTRIBUTING.md +28 -15
- package/README.md +56 -88
- package/babel.config.cjs +18 -1
- package/dist/components/ContainerRow.js +5 -78
- package/dist/components/LogViewer.js +4 -9
- package/dist/helpers/containerOptionsBuilder.js +58 -0
- package/dist/hooks/creation/useContainerCreation.js +16 -1
- package/dist/hooks/debug/useDebugLogs.js +46 -0
- package/dist/hooks/navigation/useContainerSelection.js +36 -0
- package/dist/hooks/useContainerCommandRouter.js +151 -0
- package/dist/{helpers/actionHelpers.js → hooks/useContainerStats.js} +76 -78
- package/dist/hooks/useControls.js +83 -342
- package/dist/hooks/useEraseConfirmation.js +47 -0
- package/dist/hooks/useExitHandler.js +68 -0
- package/jest.config.cjs +1 -1
- package/package.json +4 -5
- package/src/components/ContainerRow.jsx +3 -38
- package/src/components/LogViewer.jsx +4 -10
- package/src/helpers/containerOptionsBuilder.js +42 -0
- package/src/hooks/creation/useContainerCreation.js +15 -0
- package/src/hooks/debug/useDebugLogs.js +29 -0
- package/src/hooks/navigation/useContainerSelection.js +25 -0
- package/src/hooks/useContainerCommandRouter.js +110 -0
- package/src/hooks/useContainerStats.js +44 -0
- package/src/hooks/useControls.js +68 -272
- package/src/hooks/useEraseConfirmation.js +39 -0
- package/src/hooks/useExitHandler.js +66 -0
- package/test/useContainerCreation.dom.test.js +3 -0
- package/.babelrc +0 -6
- package/FIXES_APPLIED.md +0 -419
- package/SECURITY.md +0 -5
- package/dist/hooks/useLogsStream.js +0 -41
- package/docs/_config.yml +0 -13
- package/docs/components_ContainerCreationPrompt.jsx.html +0 -114
- package/docs/components_ContainerRow.jsx.html +0 -151
- package/docs/components_ContainerSection.jsx.html +0 -75
- package/docs/components_Footer.jsx.html +0 -66
- package/docs/components_Header.jsx.html +0 -84
- package/docs/components_LogViewer.jsx.html +0 -91
- package/docs/components_MessageFeedback.jsx.html +0 -76
- package/docs/components_PromptField.jsx.html +0 -99
- package/docs/components_StatsBar.jsx.html +0 -105
- package/docs/components_UsageMenu.jsx.html +0 -73
- package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/global.html +0 -6145
- package/docs/helpers_actionHelpers.js.html +0 -94
- package/docs/helpers_constants.js.html +0 -81
- package/docs/helpers_dockerService_dockerService.js.html +0 -79
- package/docs/helpers_dockerService_serviceComponents_containerActions.js.html +0 -153
- package/docs/helpers_dockerService_serviceComponents_containerList.js.html +0 -81
- package/docs/helpers_dockerService_serviceComponents_containerLogs.js.html +0 -85
- package/docs/helpers_dockerService_serviceComponents_containerStats.js.html +0 -107
- package/docs/helpers_dockerService_serviceComponents_imageUtils.js.html +0 -82
- package/docs/helpers_exitWithMessage.js.html +0 -77
- package/docs/helpers_safeCall.js.html +0 -68
- package/docs/helpers_validationHelpers.js.html +0 -96
- package/docs/hooks_creation_useContainerActions.js.html +0 -120
- package/docs/hooks_creation_useContainerCreation.js.html +0 -152
- package/docs/hooks_creation_useLogsViewer.js.html +0 -102
- package/docs/hooks_useControls.js.html +0 -298
- package/docs/hooks_useLogsStream.js.html +0 -82
- package/docs/index.html +0 -65
- package/docs/index.js.html +0 -65
- package/docs/module-index.html +0 -171
- package/docs/scripts/linenumber.js +0 -25
- package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/scripts/prettify/lang-css.js +0 -2
- package/docs/scripts/prettify/prettify.js +0 -28
- package/docs/styles/jsdoc-default.css +0 -358
- package/docs/styles/prettify-jsdoc.css +0 -111
- package/docs/styles/prettify-tomorrow.css +0 -132
- package/esbuild.config.cjs +0 -11
- package/src/helpers/actionHelpers.js +0 -52
- package/src/hooks/useLogsStream.js +0 -31
- package/test/actionHelpers.test.js +0 -106
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: components/ContainerRow.jsx</title>
|
|
6
|
-
|
|
7
|
-
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
-
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
-
<!--[if lt IE 9]>
|
|
10
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
-
<![endif]-->
|
|
12
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: components/ContainerRow.jsx</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>import React, { useState, useEffect } from "react";
|
|
30
|
-
import { Box, Text } from "ink";
|
|
31
|
-
import { getStats } from "../helpers/dockerService/serviceComponents/containerStats";
|
|
32
|
-
import { REFRESH_INTERVALS } from "../helpers/constants";
|
|
33
|
-
import StatsBar from "./StatsBar.jsx";
|
|
34
|
-
import PropTypes from 'prop-types';
|
|
35
|
-
|
|
36
|
-
const stateText = (state) => {
|
|
37
|
-
if (state === "running") return { text: "🟢 RUNNING", color: "green" };
|
|
38
|
-
if (state === "exited") return { text: "🔴 EXITED", color: "red" };
|
|
39
|
-
if (state === "paused") return { text: "🟠 PAUSED", color: "yellow" };
|
|
40
|
-
return { text: state.toUpperCase(), color: "gray" };
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Row component that renders information and live stats for a container.
|
|
45
|
-
*
|
|
46
|
-
* @param {Object} props
|
|
47
|
-
* @param {Object} props.container - Container object with id, name, image, state and ports
|
|
48
|
-
* @returns {JSX.Element}
|
|
49
|
-
*/
|
|
50
|
-
export default function ContainerRow({ container }) {
|
|
51
|
-
const { id, name, image, state } = container;
|
|
52
|
-
const [stats, setStats] = useState({
|
|
53
|
-
cpuPercent: 0,
|
|
54
|
-
memPercent: 0,
|
|
55
|
-
netIO: { rx: 0, tx: 0 },
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// Format ports for display
|
|
59
|
-
const formatPorts = (ports) => {
|
|
60
|
-
if (!ports || ports.length === 0) return "";
|
|
61
|
-
if (Array.isArray(ports)) {
|
|
62
|
-
return ports.map((p, _i) => ` 🔗 ${p}`).join(" ");
|
|
63
|
-
}
|
|
64
|
-
return ` 🔗 ${ports}`;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const [statsError, setStatsError] = useState("");
|
|
68
|
-
useEffect(() => {
|
|
69
|
-
if (state !== "running") return;
|
|
70
|
-
|
|
71
|
-
let isMounted = true;
|
|
72
|
-
|
|
73
|
-
const fetchStats = async () => {
|
|
74
|
-
try {
|
|
75
|
-
const s = await getStats(id);
|
|
76
|
-
if (isMounted) {
|
|
77
|
-
setStats(s);
|
|
78
|
-
setStatsError("");
|
|
79
|
-
}
|
|
80
|
-
} catch (err) {
|
|
81
|
-
if (isMounted) {
|
|
82
|
-
setStats({ cpuPercent: 0, memPercent: 0, netIO: { rx: 0, tx: 0 } });
|
|
83
|
-
setStatsError("Error fetching stats");
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
fetchStats();
|
|
89
|
-
const timer = setInterval(fetchStats, REFRESH_INTERVALS.CONTAINER_STATS);
|
|
90
|
-
|
|
91
|
-
return () => {
|
|
92
|
-
isMounted = false;
|
|
93
|
-
clearInterval(timer);
|
|
94
|
-
};
|
|
95
|
-
}, [id, state]);
|
|
96
|
-
|
|
97
|
-
const stateInfo = stateText(state);
|
|
98
|
-
return (
|
|
99
|
-
<Box flexDirection="column" marginBottom={1}>
|
|
100
|
-
<Box>
|
|
101
|
-
<Text color="cyan">{name.padEnd(20)}</Text>
|
|
102
|
-
<Text color="gray">{image.padEnd(20)}</Text>
|
|
103
|
-
<Text color={stateInfo.color}>{stateInfo.text}</Text>
|
|
104
|
-
<Text color="yellow">{formatPorts(container.ports)}</Text>
|
|
105
|
-
{state === "running" && <Text> </Text>}
|
|
106
|
-
{state === "running" && (
|
|
107
|
-
<StatsBar
|
|
108
|
-
cpu={parseFloat(stats.cpuPercent)}
|
|
109
|
-
mem={parseFloat(stats.memPercent)}
|
|
110
|
-
/>
|
|
111
|
-
)}
|
|
112
|
-
{state === "running" && statsError && (
|
|
113
|
-
<Text color="red">{statsError}</Text>
|
|
114
|
-
)}
|
|
115
|
-
</Box>
|
|
116
|
-
</Box>
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
ContainerRow.propTypes = {
|
|
121
|
-
container: PropTypes.shape({
|
|
122
|
-
id: PropTypes.string.isRequired,
|
|
123
|
-
name: PropTypes.string.isRequired,
|
|
124
|
-
image: PropTypes.string,
|
|
125
|
-
state: PropTypes.string,
|
|
126
|
-
ports: PropTypes.oneOfType([PropTypes.array, PropTypes.string])
|
|
127
|
-
}).isRequired,
|
|
128
|
-
};
|
|
129
|
-
</code></pre>
|
|
130
|
-
</article>
|
|
131
|
-
</section>
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
</div>
|
|
137
|
-
|
|
138
|
-
<nav>
|
|
139
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li></ul><h3>Global</h3><ul><li><a href="global.html#EXIT_DELAY">EXIT_DELAY</a></li><li><a href="global.html#MESSAGE_TIMEOUTS">MESSAGE_TIMEOUTS</a></li><li><a href="global.html#PromptField">PromptField</a></li><li><a href="global.html#PromptMessage">PromptMessage</a></li><li><a href="global.html#REFRESH_INTERVALS">REFRESH_INTERVALS</a></li><li><a href="global.html#TIMEOUTS">TIMEOUTS</a></li><li><a href="global.html#colorize">colorize</a></li><li><a href="global.html#createContainer">createContainer</a></li><li><a href="global.html#docker">docker</a></li><li><a href="global.html#exitWithMessage">exitWithMessage</a></li><li><a href="global.html#getContainers">getContainers</a></li><li><a href="global.html#getLogsStream">getLogsStream</a></li><li><a href="global.html#getStats">getStats</a></li><li><a href="global.html#handleAction">handleAction</a></li><li><a href="global.html#imageExists">imageExists</a></li><li><a href="global.html#makeBar">makeBar</a></li><li><a href="global.html#pullImage">pullImage</a></li><li><a href="global.html#removeContainer">removeContainer</a></li><li><a href="global.html#restartContainer">restartContainer</a></li><li><a href="global.html#safeCall">safeCall</a></li><li><a href="global.html#startContainer">startContainer</a></li><li><a href="global.html#stopContainer">stopContainer</a></li><li><a href="global.html#useContainerActions">useContainerActions</a></li><li><a href="global.html#useContainerCreation">useContainerCreation</a></li><li><a href="global.html#useControls">useControls</a></li><li><a href="global.html#useLogsStream">useLogsStream</a></li><li><a href="global.html#useLogsViewer">useLogsViewer</a></li><li><a href="global.html#validateEnvVars">validateEnvVars</a></li><li><a href="global.html#validatePorts">validatePorts</a></li><li><a href="global.html#withTimeout">withTimeout</a></li></ul>
|
|
140
|
-
</nav>
|
|
141
|
-
|
|
142
|
-
<br class="clear">
|
|
143
|
-
|
|
144
|
-
<footer>
|
|
145
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Oct 17 2025 16:07:18 GMT-0500 (hora estándar de Colombia)
|
|
146
|
-
</footer>
|
|
147
|
-
|
|
148
|
-
<script> prettyPrint(); </script>
|
|
149
|
-
<script src="scripts/linenumber.js"> </script>
|
|
150
|
-
</body>
|
|
151
|
-
</html>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: components/ContainerSection.jsx</title>
|
|
6
|
-
|
|
7
|
-
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
-
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
-
<!--[if lt IE 9]>
|
|
10
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
-
<![endif]-->
|
|
12
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: components/ContainerSection.jsx</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>import React from "react";
|
|
30
|
-
import { Text } from "ink";
|
|
31
|
-
import ContainerList from "./ContainerList.jsx";
|
|
32
|
-
import PropTypes from 'prop-types';
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Section that displays the list of containers or a message when none exist.
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} props
|
|
38
|
-
* @param {Array<Object>} props.containers - Array of container objects to display
|
|
39
|
-
* @param {number} [props.selected] - Index of the currently selected container
|
|
40
|
-
* @returns {JSX.Element}
|
|
41
|
-
*/
|
|
42
|
-
export default function ContainerSection({ containers, selected }) {
|
|
43
|
-
if (!containers || containers.length === 0) {
|
|
44
|
-
return <Text>No containers found</Text>;
|
|
45
|
-
}
|
|
46
|
-
return <ContainerList containers={containers} selected={selected} />;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
ContainerSection.propTypes = {
|
|
50
|
-
containers: PropTypes.array.isRequired,
|
|
51
|
-
selected: PropTypes.number,
|
|
52
|
-
};
|
|
53
|
-
</code></pre>
|
|
54
|
-
</article>
|
|
55
|
-
</section>
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<nav>
|
|
63
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li></ul><h3>Global</h3><ul><li><a href="global.html#EXIT_DELAY">EXIT_DELAY</a></li><li><a href="global.html#MESSAGE_TIMEOUTS">MESSAGE_TIMEOUTS</a></li><li><a href="global.html#PromptField">PromptField</a></li><li><a href="global.html#PromptMessage">PromptMessage</a></li><li><a href="global.html#REFRESH_INTERVALS">REFRESH_INTERVALS</a></li><li><a href="global.html#TIMEOUTS">TIMEOUTS</a></li><li><a href="global.html#colorize">colorize</a></li><li><a href="global.html#createContainer">createContainer</a></li><li><a href="global.html#docker">docker</a></li><li><a href="global.html#exitWithMessage">exitWithMessage</a></li><li><a href="global.html#getContainers">getContainers</a></li><li><a href="global.html#getLogsStream">getLogsStream</a></li><li><a href="global.html#getStats">getStats</a></li><li><a href="global.html#handleAction">handleAction</a></li><li><a href="global.html#imageExists">imageExists</a></li><li><a href="global.html#makeBar">makeBar</a></li><li><a href="global.html#pullImage">pullImage</a></li><li><a href="global.html#removeContainer">removeContainer</a></li><li><a href="global.html#restartContainer">restartContainer</a></li><li><a href="global.html#safeCall">safeCall</a></li><li><a href="global.html#startContainer">startContainer</a></li><li><a href="global.html#stopContainer">stopContainer</a></li><li><a href="global.html#useContainerActions">useContainerActions</a></li><li><a href="global.html#useContainerCreation">useContainerCreation</a></li><li><a href="global.html#useControls">useControls</a></li><li><a href="global.html#useLogsStream">useLogsStream</a></li><li><a href="global.html#useLogsViewer">useLogsViewer</a></li><li><a href="global.html#validateEnvVars">validateEnvVars</a></li><li><a href="global.html#validatePorts">validatePorts</a></li><li><a href="global.html#withTimeout">withTimeout</a></li></ul>
|
|
64
|
-
</nav>
|
|
65
|
-
|
|
66
|
-
<br class="clear">
|
|
67
|
-
|
|
68
|
-
<footer>
|
|
69
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Oct 17 2025 16:07:18 GMT-0500 (hora estándar de Colombia)
|
|
70
|
-
</footer>
|
|
71
|
-
|
|
72
|
-
<script> prettyPrint(); </script>
|
|
73
|
-
<script src="scripts/linenumber.js"> </script>
|
|
74
|
-
</body>
|
|
75
|
-
</html>
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: components/Footer.jsx</title>
|
|
6
|
-
|
|
7
|
-
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
-
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
-
<!--[if lt IE 9]>
|
|
10
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
-
<![endif]-->
|
|
12
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: components/Footer.jsx</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>import React from "react";
|
|
30
|
-
import { Box, Text } from "ink";
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Simple footer displayed at the bottom of the interface.
|
|
34
|
-
*
|
|
35
|
-
* @returns {JSX.Element}
|
|
36
|
-
*/
|
|
37
|
-
export default function Footer() {
|
|
38
|
-
return (
|
|
39
|
-
<Box justifyContent="flex-end" width="100%">
|
|
40
|
-
<Text dimColor>Crafted by Carlos Cochero 2025</Text>
|
|
41
|
-
</Box>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
</code></pre>
|
|
45
|
-
</article>
|
|
46
|
-
</section>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<nav>
|
|
54
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li></ul><h3>Global</h3><ul><li><a href="global.html#EXIT_DELAY">EXIT_DELAY</a></li><li><a href="global.html#MESSAGE_TIMEOUTS">MESSAGE_TIMEOUTS</a></li><li><a href="global.html#PromptField">PromptField</a></li><li><a href="global.html#PromptMessage">PromptMessage</a></li><li><a href="global.html#REFRESH_INTERVALS">REFRESH_INTERVALS</a></li><li><a href="global.html#TIMEOUTS">TIMEOUTS</a></li><li><a href="global.html#colorize">colorize</a></li><li><a href="global.html#createContainer">createContainer</a></li><li><a href="global.html#docker">docker</a></li><li><a href="global.html#exitWithMessage">exitWithMessage</a></li><li><a href="global.html#getContainers">getContainers</a></li><li><a href="global.html#getLogsStream">getLogsStream</a></li><li><a href="global.html#getStats">getStats</a></li><li><a href="global.html#handleAction">handleAction</a></li><li><a href="global.html#imageExists">imageExists</a></li><li><a href="global.html#makeBar">makeBar</a></li><li><a href="global.html#pullImage">pullImage</a></li><li><a href="global.html#removeContainer">removeContainer</a></li><li><a href="global.html#restartContainer">restartContainer</a></li><li><a href="global.html#safeCall">safeCall</a></li><li><a href="global.html#startContainer">startContainer</a></li><li><a href="global.html#stopContainer">stopContainer</a></li><li><a href="global.html#useContainerActions">useContainerActions</a></li><li><a href="global.html#useContainerCreation">useContainerCreation</a></li><li><a href="global.html#useControls">useControls</a></li><li><a href="global.html#useLogsStream">useLogsStream</a></li><li><a href="global.html#useLogsViewer">useLogsViewer</a></li><li><a href="global.html#validateEnvVars">validateEnvVars</a></li><li><a href="global.html#validatePorts">validatePorts</a></li><li><a href="global.html#withTimeout">withTimeout</a></li></ul>
|
|
55
|
-
</nav>
|
|
56
|
-
|
|
57
|
-
<br class="clear">
|
|
58
|
-
|
|
59
|
-
<footer>
|
|
60
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Oct 17 2025 16:07:18 GMT-0500 (hora estándar de Colombia)
|
|
61
|
-
</footer>
|
|
62
|
-
|
|
63
|
-
<script> prettyPrint(); </script>
|
|
64
|
-
<script src="scripts/linenumber.js"> </script>
|
|
65
|
-
</body>
|
|
66
|
-
</html>
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: components/Header.jsx</title>
|
|
6
|
-
|
|
7
|
-
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
-
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
-
<!--[if lt IE 9]>
|
|
10
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
-
<![endif]-->
|
|
12
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: components/Header.jsx</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>import React from "react";
|
|
30
|
-
import { Box, Text } from "ink";
|
|
31
|
-
import chalk from "chalk";
|
|
32
|
-
import PropTypes from 'prop-types';
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Header component displayed at the top of the CLI UI.
|
|
36
|
-
*
|
|
37
|
-
* @component
|
|
38
|
-
* @param {Object} props
|
|
39
|
-
* @param {number} props.count - Number of containers currently detected
|
|
40
|
-
* @returns {JSX.Element}
|
|
41
|
-
* @example
|
|
42
|
-
* <Header count={3} />
|
|
43
|
-
*/
|
|
44
|
-
|
|
45
|
-
export default function Header({ count }) {
|
|
46
|
-
return (
|
|
47
|
-
<Box justifyContent="space-between">
|
|
48
|
-
<Text color="cyanBright">
|
|
49
|
-
🐳 {chalk.bold("CDD")}
|
|
50
|
-
<Text color="gray"> — CLI Docker Dashboard</Text>
|
|
51
|
-
</Text>
|
|
52
|
-
<Text color="gray">
|
|
53
|
-
{count} container{count === 1 ? "" : "s"} found
|
|
54
|
-
</Text>
|
|
55
|
-
</Box>
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
Header.propTypes = {
|
|
60
|
-
count: PropTypes.number.isRequired,
|
|
61
|
-
};
|
|
62
|
-
</code></pre>
|
|
63
|
-
</article>
|
|
64
|
-
</section>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<nav>
|
|
72
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li></ul><h3>Global</h3><ul><li><a href="global.html#EXIT_DELAY">EXIT_DELAY</a></li><li><a href="global.html#MESSAGE_TIMEOUTS">MESSAGE_TIMEOUTS</a></li><li><a href="global.html#PromptField">PromptField</a></li><li><a href="global.html#PromptMessage">PromptMessage</a></li><li><a href="global.html#REFRESH_INTERVALS">REFRESH_INTERVALS</a></li><li><a href="global.html#TIMEOUTS">TIMEOUTS</a></li><li><a href="global.html#colorize">colorize</a></li><li><a href="global.html#createContainer">createContainer</a></li><li><a href="global.html#docker">docker</a></li><li><a href="global.html#exitWithMessage">exitWithMessage</a></li><li><a href="global.html#getContainers">getContainers</a></li><li><a href="global.html#getLogsStream">getLogsStream</a></li><li><a href="global.html#getStats">getStats</a></li><li><a href="global.html#handleAction">handleAction</a></li><li><a href="global.html#imageExists">imageExists</a></li><li><a href="global.html#makeBar">makeBar</a></li><li><a href="global.html#pullImage">pullImage</a></li><li><a href="global.html#removeContainer">removeContainer</a></li><li><a href="global.html#restartContainer">restartContainer</a></li><li><a href="global.html#safeCall">safeCall</a></li><li><a href="global.html#startContainer">startContainer</a></li><li><a href="global.html#stopContainer">stopContainer</a></li><li><a href="global.html#useContainerActions">useContainerActions</a></li><li><a href="global.html#useContainerCreation">useContainerCreation</a></li><li><a href="global.html#useControls">useControls</a></li><li><a href="global.html#useLogsStream">useLogsStream</a></li><li><a href="global.html#useLogsViewer">useLogsViewer</a></li><li><a href="global.html#validateEnvVars">validateEnvVars</a></li><li><a href="global.html#validatePorts">validatePorts</a></li><li><a href="global.html#withTimeout">withTimeout</a></li></ul>
|
|
73
|
-
</nav>
|
|
74
|
-
|
|
75
|
-
<br class="clear">
|
|
76
|
-
|
|
77
|
-
<footer>
|
|
78
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Oct 17 2025 16:07:18 GMT-0500 (hora estándar de Colombia)
|
|
79
|
-
</footer>
|
|
80
|
-
|
|
81
|
-
<script> prettyPrint(); </script>
|
|
82
|
-
<script src="scripts/linenumber.js"> </script>
|
|
83
|
-
</body>
|
|
84
|
-
</html>
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: components/LogViewer.jsx</title>
|
|
6
|
-
|
|
7
|
-
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
-
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
-
<!--[if lt IE 9]>
|
|
10
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
-
<![endif]-->
|
|
12
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: components/LogViewer.jsx</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>import React from "react";
|
|
30
|
-
import { Text, useInput } from "ink";
|
|
31
|
-
import { safeCall } from "../helpers/safeCall";
|
|
32
|
-
import PropTypes from 'prop-types';
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Log viewer overlay component. Shows the most recent lines and closes on ESC.
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} props
|
|
38
|
-
* @param {Array<string>} props.logs - Array of log lines
|
|
39
|
-
* @param {Function} [props.onExit] - Optional callback when the viewer closes
|
|
40
|
-
* @param {Object} [props.container] - Optional container metadata (used for title)
|
|
41
|
-
* @returns {JSX.Element}
|
|
42
|
-
*/
|
|
43
|
-
export default function LogViewer({ logs, onExit, container }) {
|
|
44
|
-
useInput((input, key) => {
|
|
45
|
-
if (key.escape) {
|
|
46
|
-
safeCall(onExit);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const visibleLogs = logs.slice(-15);
|
|
51
|
-
|
|
52
|
-
return (
|
|
53
|
-
<>
|
|
54
|
-
<Text color="green">{container?.name ?? "Container"} logs, press ESC to exit</Text>
|
|
55
|
-
{visibleLogs.length === 0 ? (
|
|
56
|
-
<Text dimColor>No logs...</Text>
|
|
57
|
-
) : (
|
|
58
|
-
visibleLogs.map((line, idx) => <Text key={idx}>{line}</Text>)
|
|
59
|
-
)}
|
|
60
|
-
</>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
LogViewer.propTypes = {
|
|
65
|
-
logs: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
66
|
-
onExit: PropTypes.func,
|
|
67
|
-
container: PropTypes.object,
|
|
68
|
-
};
|
|
69
|
-
</code></pre>
|
|
70
|
-
</article>
|
|
71
|
-
</section>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
</div>
|
|
77
|
-
|
|
78
|
-
<nav>
|
|
79
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li></ul><h3>Global</h3><ul><li><a href="global.html#EXIT_DELAY">EXIT_DELAY</a></li><li><a href="global.html#MESSAGE_TIMEOUTS">MESSAGE_TIMEOUTS</a></li><li><a href="global.html#PromptField">PromptField</a></li><li><a href="global.html#PromptMessage">PromptMessage</a></li><li><a href="global.html#REFRESH_INTERVALS">REFRESH_INTERVALS</a></li><li><a href="global.html#TIMEOUTS">TIMEOUTS</a></li><li><a href="global.html#colorize">colorize</a></li><li><a href="global.html#createContainer">createContainer</a></li><li><a href="global.html#docker">docker</a></li><li><a href="global.html#exitWithMessage">exitWithMessage</a></li><li><a href="global.html#getContainers">getContainers</a></li><li><a href="global.html#getLogsStream">getLogsStream</a></li><li><a href="global.html#getStats">getStats</a></li><li><a href="global.html#handleAction">handleAction</a></li><li><a href="global.html#imageExists">imageExists</a></li><li><a href="global.html#makeBar">makeBar</a></li><li><a href="global.html#pullImage">pullImage</a></li><li><a href="global.html#removeContainer">removeContainer</a></li><li><a href="global.html#restartContainer">restartContainer</a></li><li><a href="global.html#safeCall">safeCall</a></li><li><a href="global.html#startContainer">startContainer</a></li><li><a href="global.html#stopContainer">stopContainer</a></li><li><a href="global.html#useContainerActions">useContainerActions</a></li><li><a href="global.html#useContainerCreation">useContainerCreation</a></li><li><a href="global.html#useControls">useControls</a></li><li><a href="global.html#useLogsStream">useLogsStream</a></li><li><a href="global.html#useLogsViewer">useLogsViewer</a></li><li><a href="global.html#validateEnvVars">validateEnvVars</a></li><li><a href="global.html#validatePorts">validatePorts</a></li><li><a href="global.html#withTimeout">withTimeout</a></li></ul>
|
|
80
|
-
</nav>
|
|
81
|
-
|
|
82
|
-
<br class="clear">
|
|
83
|
-
|
|
84
|
-
<footer>
|
|
85
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Oct 17 2025 16:07:18 GMT-0500 (hora estándar de Colombia)
|
|
86
|
-
</footer>
|
|
87
|
-
|
|
88
|
-
<script> prettyPrint(); </script>
|
|
89
|
-
<script src="scripts/linenumber.js"> </script>
|
|
90
|
-
</body>
|
|
91
|
-
</html>
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="utf-8">
|
|
5
|
-
<title>JSDoc: Source: components/MessageFeedback.jsx</title>
|
|
6
|
-
|
|
7
|
-
<script src="scripts/prettify/prettify.js"> </script>
|
|
8
|
-
<script src="scripts/prettify/lang-css.js"> </script>
|
|
9
|
-
<!--[if lt IE 9]>
|
|
10
|
-
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
11
|
-
<![endif]-->
|
|
12
|
-
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
|
|
13
|
-
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
|
|
14
|
-
</head>
|
|
15
|
-
|
|
16
|
-
<body>
|
|
17
|
-
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: components/MessageFeedback.jsx</h1>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<section>
|
|
28
|
-
<article>
|
|
29
|
-
<pre class="prettyprint source linenums"><code>import React from "react";
|
|
30
|
-
import { Box, Text } from "ink";
|
|
31
|
-
import PropTypes from 'prop-types';
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Small component that shows a feedback message in the UI.
|
|
35
|
-
*
|
|
36
|
-
* @param {Object} props
|
|
37
|
-
* @param {string} props.message - Message to display. If falsy, component returns null.
|
|
38
|
-
* @param {string} [props.color] - Optional color name for the message text.
|
|
39
|
-
* @returns {JSX.Element|null}
|
|
40
|
-
*/
|
|
41
|
-
export default function MessageFeedback({ message, color }) {
|
|
42
|
-
if (!message) return null;
|
|
43
|
-
return (
|
|
44
|
-
<Box marginBottom={1}>
|
|
45
|
-
<Text color={color}>{message}</Text>
|
|
46
|
-
</Box>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
MessageFeedback.propTypes = {
|
|
51
|
-
message: PropTypes.string,
|
|
52
|
-
color: PropTypes.string,
|
|
53
|
-
};
|
|
54
|
-
</code></pre>
|
|
55
|
-
</article>
|
|
56
|
-
</section>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<nav>
|
|
64
|
-
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-index.html">index</a></li></ul><h3>Global</h3><ul><li><a href="global.html#EXIT_DELAY">EXIT_DELAY</a></li><li><a href="global.html#MESSAGE_TIMEOUTS">MESSAGE_TIMEOUTS</a></li><li><a href="global.html#PromptField">PromptField</a></li><li><a href="global.html#PromptMessage">PromptMessage</a></li><li><a href="global.html#REFRESH_INTERVALS">REFRESH_INTERVALS</a></li><li><a href="global.html#TIMEOUTS">TIMEOUTS</a></li><li><a href="global.html#colorize">colorize</a></li><li><a href="global.html#createContainer">createContainer</a></li><li><a href="global.html#docker">docker</a></li><li><a href="global.html#exitWithMessage">exitWithMessage</a></li><li><a href="global.html#getContainers">getContainers</a></li><li><a href="global.html#getLogsStream">getLogsStream</a></li><li><a href="global.html#getStats">getStats</a></li><li><a href="global.html#handleAction">handleAction</a></li><li><a href="global.html#imageExists">imageExists</a></li><li><a href="global.html#makeBar">makeBar</a></li><li><a href="global.html#pullImage">pullImage</a></li><li><a href="global.html#removeContainer">removeContainer</a></li><li><a href="global.html#restartContainer">restartContainer</a></li><li><a href="global.html#safeCall">safeCall</a></li><li><a href="global.html#startContainer">startContainer</a></li><li><a href="global.html#stopContainer">stopContainer</a></li><li><a href="global.html#useContainerActions">useContainerActions</a></li><li><a href="global.html#useContainerCreation">useContainerCreation</a></li><li><a href="global.html#useControls">useControls</a></li><li><a href="global.html#useLogsStream">useLogsStream</a></li><li><a href="global.html#useLogsViewer">useLogsViewer</a></li><li><a href="global.html#validateEnvVars">validateEnvVars</a></li><li><a href="global.html#validatePorts">validatePorts</a></li><li><a href="global.html#withTimeout">withTimeout</a></li></ul>
|
|
65
|
-
</nav>
|
|
66
|
-
|
|
67
|
-
<br class="clear">
|
|
68
|
-
|
|
69
|
-
<footer>
|
|
70
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Oct 17 2025 16:07:18 GMT-0500 (hora estándar de Colombia)
|
|
71
|
-
</footer>
|
|
72
|
-
|
|
73
|
-
<script> prettyPrint(); </script>
|
|
74
|
-
<script src="scripts/linenumber.js"> </script>
|
|
75
|
-
</body>
|
|
76
|
-
</html>
|