dockly 3.21.3 → 3.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -7
- package/hooks/containers.hook.js +8 -18
- package/hooks/images.hook.js +8 -18
- package/hooks/services.hook.js +8 -18
- package/package.json +5 -5
- package/src/cli.js +18 -0
- package/src/dockerUtil.js +8 -7
- package/src/widgetsTemplates/base.hook.template.js +34 -0
- package/widgets/containers/containerList.widget.js +2 -1
package/README.md
CHANGED
|
@@ -10,17 +10,20 @@
|
|
|
10
10
|
[](https://www.npmjs.org/package/dockly)
|
|
11
11
|
[](https://www.npmjs.org/package/dockly)
|
|
12
12
|
[](https://www.npmjs.org/package/dockly)
|
|
13
|
-
[](https://snyk.io/test/npm/dockly)
|
|
14
13
|
[](./SECURITY.md
|
|
15
14
|
)
|
|
16
15
|
[](https://snyk.io/advisor/npm-package/dockly)
|
|
17
16
|
|
|
18
|
-
|
|
17
|
+
Dockly has been highlighted, featured and chosen as favorite docker container management tool on:
|
|
18
|
+
|
|
19
|
+
[](https://github.com/veggiemonk/awesome-docker) [](http://devopsweekly.com)
|
|
20
21
|
[](https://github.com/k4m4/terminals-are-sexy)
|
|
22
|
-
|
|
22
|
+
)](https://github.com/k4m4/terminals-are-sexy) [](https://mailchi.mp/programmerweekly/programmer-weekly-issue-94?e=e8c11d0390) [](https://console.dev/tools/)
|
|
23
25
|
|
|
26
|
+
<a href="https://console.dev" title="Visit Console - the best tools for developers"><img src="https://console.dev/img/badges/1.0/png/console-badge-pick-green1-dark.png" alt="Console - Developer Tool of the Week" /></a>
|
|
24
27
|
|
|
25
28
|

|
|
26
29
|
|
|
@@ -46,6 +49,9 @@ It's also possible to provide command line options for dockly to customize the d
|
|
|
46
49
|
| Param | Type | Description |
|
|
47
50
|
| --- | --- | --- |
|
|
48
51
|
| -s or --socketPath | string | Docker socket to connect to |
|
|
52
|
+
| -H or --host | string | Remote docker daemon host to connect to |
|
|
53
|
+
| -P or --port | string | Remote docker port to connect to |
|
|
54
|
+
| -T or --protocol | `http` \| `https` \| `ssh` | Remote docker protocol to connect to |
|
|
49
55
|
| --containerFilters | string | String to apply to filter shown containers |
|
|
50
56
|
| -h or --help | null | Display help |
|
|
51
57
|
| -v or --version | null | Display version information |
|
|
@@ -119,9 +125,17 @@ export LC_ALL=C.UTF-8
|
|
|
119
125
|
```
|
|
120
126
|
for more info please see [this issue](https://github.com/yaronn/blessed-contrib/issues/111)
|
|
121
127
|
|
|
122
|
-
# Author
|
|
123
|
-
Liran Tal <liran.tal@gmail.com>
|
|
124
|
-
|
|
125
128
|
## Alternatives
|
|
126
129
|
|
|
127
130
|
See [Awesome Docker list](https://github.com/veggiemonk/awesome-docker/blob/master/README.md#terminal) for similar tools to work with Docker.
|
|
131
|
+
|
|
132
|
+
# In the news
|
|
133
|
+
|
|
134
|
+
- Admin Magazine article: [Visualizing containers with clarity
|
|
135
|
+
](https://www.admin-magazine.com/Articles/Visualizing-containers-with-clarity)
|
|
136
|
+
- [A learnk8s tweet](https://twitter.com/learnk8s/status/1075677503782563840)
|
|
137
|
+
- [Dockly – Manage Docker Containers From Terminal](https://ostechnix.com/dockly-manage-docker-containers-from-terminal/)
|
|
138
|
+
- [Clever cloud CEO, Quentin Adam, tweeting about dockly](https://twitter.com/waxzce/status/1123886351924043777)
|
|
139
|
+
|
|
140
|
+
# Author
|
|
141
|
+
Liran Tal <liran.tal@gmail.com>
|
package/hooks/containers.hook.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const baseWidget = require('../src/baseWidget')
|
|
5
|
-
const clipboardy = require('clipboardy')
|
|
3
|
+
const baseHook = require('../src/widgetsTemplates/base.hook.template')
|
|
6
4
|
|
|
7
|
-
class hook extends
|
|
5
|
+
class hook extends baseHook {
|
|
8
6
|
init () {
|
|
9
7
|
// on startup we first emit data from the docker server
|
|
10
8
|
this.getFreshData((err, data) => {
|
|
@@ -45,7 +43,7 @@ class hook extends baseWidget(EventEmitter) {
|
|
|
45
43
|
}
|
|
46
44
|
|
|
47
45
|
if (keyString === 'c') {
|
|
48
|
-
this.
|
|
46
|
+
this.copyItemIdToClipboard()
|
|
49
47
|
}
|
|
50
48
|
})
|
|
51
49
|
|
|
@@ -167,20 +165,12 @@ class hook extends baseWidget(EventEmitter) {
|
|
|
167
165
|
}
|
|
168
166
|
}
|
|
169
167
|
|
|
170
|
-
|
|
171
|
-
if (this.widgetsRepo
|
|
172
|
-
|
|
173
|
-
if (containerId) {
|
|
174
|
-
clipboardy.writeSync(containerId)
|
|
175
|
-
|
|
176
|
-
const actionStatus = this.widgetsRepo.get('actionStatus')
|
|
177
|
-
const message = `Container Id ${containerId} was copied to the clipboard`
|
|
178
|
-
|
|
179
|
-
actionStatus.emit('message', {
|
|
180
|
-
message: message
|
|
181
|
-
})
|
|
182
|
-
}
|
|
168
|
+
getSelectedItem () {
|
|
169
|
+
if (!this.widgetsRepo.has('containerList')) {
|
|
170
|
+
return null
|
|
183
171
|
}
|
|
172
|
+
|
|
173
|
+
return this.widgetsRepo.get('containerList').getSelectedContainer()
|
|
184
174
|
}
|
|
185
175
|
}
|
|
186
176
|
|
package/hooks/images.hook.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const baseWidget = require('../src/baseWidget')
|
|
5
|
-
const clipboardy = require('clipboardy')
|
|
3
|
+
const baseHook = require('../src/widgetsTemplates/base.hook.template')
|
|
6
4
|
|
|
7
|
-
class hook extends
|
|
5
|
+
class hook extends baseHook {
|
|
8
6
|
init () {
|
|
9
7
|
if (!this.widgetsRepo.has('toolbar')) {
|
|
10
8
|
return null
|
|
@@ -21,25 +19,17 @@ class hook extends baseWidget(EventEmitter) {
|
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
if (keyString === 'c') {
|
|
24
|
-
this.
|
|
22
|
+
this.copyItemIdToClipboard()
|
|
25
23
|
}
|
|
26
24
|
})
|
|
27
25
|
}
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
if (this.widgetsRepo
|
|
31
|
-
|
|
32
|
-
if (imageId) {
|
|
33
|
-
clipboardy.writeSync(imageId)
|
|
34
|
-
|
|
35
|
-
const actionStatus = this.widgetsRepo.get('actionStatus')
|
|
36
|
-
const message = `Image Id ${imageId} was copied to the clipboard`
|
|
37
|
-
|
|
38
|
-
actionStatus.emit('message', {
|
|
39
|
-
message: message
|
|
40
|
-
})
|
|
41
|
-
}
|
|
27
|
+
getSelectedItem () {
|
|
28
|
+
if (!this.widgetsRepo.has('imageList')) {
|
|
29
|
+
return null
|
|
42
30
|
}
|
|
31
|
+
|
|
32
|
+
return this.widgetsRepo.get('imageList').getSelectedImage()
|
|
43
33
|
}
|
|
44
34
|
|
|
45
35
|
notifyOnImageUpdate () {
|
package/hooks/services.hook.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const baseWidget = require('../src/baseWidget')
|
|
5
|
-
const clipboardy = require('clipboardy')
|
|
3
|
+
const baseHook = require('../src/widgetsTemplates/base.hook.template')
|
|
6
4
|
|
|
7
|
-
class hook extends
|
|
5
|
+
class hook extends baseHook {
|
|
8
6
|
init () {
|
|
9
7
|
// on startup we first emit data from the docker server
|
|
10
8
|
this.getFreshData((err, data) => {
|
|
@@ -36,7 +34,7 @@ class hook extends baseWidget(EventEmitter) {
|
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
if (keyString === 'c') {
|
|
39
|
-
this.
|
|
37
|
+
this.copyItemIdToClipboard()
|
|
40
38
|
}
|
|
41
39
|
})
|
|
42
40
|
|
|
@@ -85,20 +83,12 @@ class hook extends baseWidget(EventEmitter) {
|
|
|
85
83
|
})
|
|
86
84
|
}
|
|
87
85
|
|
|
88
|
-
|
|
89
|
-
if (this.widgetsRepo
|
|
90
|
-
|
|
91
|
-
if (serviceId) {
|
|
92
|
-
clipboardy.writeSync(serviceId)
|
|
93
|
-
|
|
94
|
-
const actionStatus = this.widgetsRepo.get('actionStatus')
|
|
95
|
-
const message = `Service Id ${serviceId} was copied to the clipboard`
|
|
96
|
-
|
|
97
|
-
actionStatus.emit('message', {
|
|
98
|
-
message: message
|
|
99
|
-
})
|
|
100
|
-
}
|
|
86
|
+
getSelectedItem () {
|
|
87
|
+
if (!this.widgetsRepo.has('servicesList')) {
|
|
88
|
+
return null
|
|
101
89
|
}
|
|
90
|
+
|
|
91
|
+
return this.widgetsRepo.get('servicesList').getSelectedService()
|
|
102
92
|
}
|
|
103
93
|
}
|
|
104
94
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dockly",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.1",
|
|
4
4
|
"description": "Immersive terminal interface for managing docker containers and services",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"homepage": "https://github.com/lirantal/dockly#readme",
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"blessed": "^0.1.81",
|
|
70
|
-
"blessed-contrib": "^4.
|
|
70
|
+
"blessed-contrib": "^4.10.1",
|
|
71
71
|
"chalk": "2.4.2",
|
|
72
72
|
"clipboardy": "^2.3.0",
|
|
73
|
-
"command-line-args": "^5.1.
|
|
73
|
+
"command-line-args": "^5.1.2",
|
|
74
74
|
"command-line-usage": "^5.0.5",
|
|
75
75
|
"dockerode": "2.5.8",
|
|
76
76
|
"figures": "^2.0.0",
|
|
77
|
-
"glob": "^7.
|
|
77
|
+
"glob": "^7.2.0",
|
|
78
78
|
"lockfile-lint": "^3.0.9",
|
|
79
79
|
"semver": "6.3.0"
|
|
80
80
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"standard": "^12.0.1"
|
|
83
83
|
},
|
|
84
84
|
"release": {
|
|
85
|
-
"
|
|
85
|
+
"branches": "main"
|
|
86
86
|
},
|
|
87
87
|
"standard": {
|
|
88
88
|
"ignore": [
|
package/src/cli.js
CHANGED
|
@@ -13,6 +13,24 @@ function Cli () {
|
|
|
13
13
|
type: String,
|
|
14
14
|
description: 'Docker daemon socket to connect to'
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
name: 'host',
|
|
18
|
+
alias: 'H',
|
|
19
|
+
type: String,
|
|
20
|
+
description: 'Remote docker daemon host to connect to'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'port',
|
|
24
|
+
alias: 'P',
|
|
25
|
+
type: Number,
|
|
26
|
+
description: 'Remote docker port to connect to'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'protocol',
|
|
30
|
+
alias: 'T',
|
|
31
|
+
type: 'http' | 'https' | 'ssh',
|
|
32
|
+
description: 'Remote docker protocol to connect to'
|
|
33
|
+
},
|
|
16
34
|
{
|
|
17
35
|
name: 'help',
|
|
18
36
|
alias: 'h',
|
package/src/dockerUtil.js
CHANGED
|
@@ -9,13 +9,14 @@ class Util {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
// If a socketPath was explicitly specified, attempt connection based on it
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const dockerlibConfig = {}
|
|
13
|
+
|
|
14
|
+
if (config.socketPath) { dockerlibConfig.socketPath = config.socketPath }
|
|
15
|
+
if (config.host) { dockerlibConfig.host = config.host }
|
|
16
|
+
if (config.port) { dockerlibConfig.port = config.port }
|
|
17
|
+
if (config.protocol) { dockerlibConfig.protocol = config.protocol }
|
|
18
|
+
|
|
19
|
+
this.dockerCon = new DockerLib(dockerlibConfig)
|
|
19
20
|
|
|
20
21
|
if (config.containerFilters) {
|
|
21
22
|
this.containerFilters = JSON.stringify(config.containerFilters.split('&').reduce((carry, e) => {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
const baseWidget = require('../baseWidget')
|
|
3
|
+
const EventEmitter = require('events')
|
|
4
|
+
const clipboardy = require('clipboardy')
|
|
5
|
+
|
|
6
|
+
class myWidget extends baseWidget(EventEmitter) {
|
|
7
|
+
copyItemIdToClipboard () {
|
|
8
|
+
const itemId = this.getSelectedItem()
|
|
9
|
+
if (!itemId) {
|
|
10
|
+
return
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let message
|
|
14
|
+
try {
|
|
15
|
+
clipboardy.writeSync(itemId)
|
|
16
|
+
|
|
17
|
+
message = `Container Id ${itemId} was copied to the clipboard`
|
|
18
|
+
} catch (error) {
|
|
19
|
+
message = error
|
|
20
|
+
} finally {
|
|
21
|
+
const actionStatus = this.widgetsRepo.get('actionStatus')
|
|
22
|
+
|
|
23
|
+
actionStatus.emit('message', {
|
|
24
|
+
message: message
|
|
25
|
+
})
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
getSelectedItem () {
|
|
30
|
+
throw new Error('method getSelectedItem not implemented')
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = myWidget
|
|
@@ -64,7 +64,8 @@ class myWidget extends ListWidget {
|
|
|
64
64
|
container.Id.substring(0, 5),
|
|
65
65
|
container.Names[0].substring(0, 40),
|
|
66
66
|
container.Image.substring(0, 35),
|
|
67
|
-
container.Command
|
|
67
|
+
// remove any new lines or carriage return line feed from the string in container.Command
|
|
68
|
+
container.Command.substring(0, 30).replace(/(\r\n|\n|\r)/gm, ''),
|
|
68
69
|
container.State,
|
|
69
70
|
container.Status
|
|
70
71
|
]
|