dockly 3.21.2 → 3.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -10,17 +10,20 @@
10
10
  [![view on npm](http://img.shields.io/npm/v/dockly.svg)](https://www.npmjs.org/package/dockly)
11
11
  [![view on npm](http://img.shields.io/npm/l/dockly.svg)](https://www.npmjs.org/package/dockly)
12
12
  [![npm module downloads](http://img.shields.io/npm/dt/dockly.svg)](https://www.npmjs.org/package/dockly)
13
- [![Known Vulnerabilities](https://snyk.io/test/npm/dockly/badge.svg)](https://snyk.io/test/npm/dockly)
14
13
  [![Security Responsible Disclosure](https://img.shields.io/badge/Security-Responsible%20Disclosure-yellow.svg)](./SECURITY.md
15
14
  )
16
15
  [![dockly](https://snyk.io/advisor/npm-package/dockly/badge.svg)](https://snyk.io/advisor/npm-package/dockly)
17
16
 
18
- 🌟 Featured on [![Awesome Docker](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/veggiemonk/awesome-docker) [![DevOps Weekly](https://img.shields.io/badge/DevOpsWeekly-%F0%9F%95%B6-yellow.svg
17
+ Dockly has been highlighted, featured and chosen as favorite docker container management tool on:
18
+
19
+ [![Awesome Docker](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/veggiemonk/awesome-docker) [![DevOps Weekly](https://img.shields.io/badge/DevOpsWeekly-%F0%9F%95%B6-yellow.svg
19
20
  )](http://devopsweekly.com)
20
21
  [![terminals are sexy](https://img.shields.io/badge/TerminalsAreSexy-%F0%9F%92%BB-green.svg
21
- )](https://github.com/k4m4/terminals-are-sexy)
22
-
22
+ )](https://github.com/k4m4/terminals-are-sexy) [![Programmer's Weekly](https://img.shields.io/badge/ProgrammersWeekly-%F0%9F%95%B6-purple.svg
23
+ )](https://mailchi.mp/programmerweekly/programmer-weekly-issue-94?e=e8c11d0390) [![Console.dev](https://img.shields.io/badge/ConsoleDotDev-%F0%9F%95%B6-blue.svg
24
+ )](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
  ![dockly-demo-2](https://cloud.githubusercontent.com/assets/316371/25682867/c5212216-3027-11e7-8f36-72d38516d2af.gif)
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 |
@@ -110,10 +116,26 @@ Dockly requires Node.js v7.6 and above
110
116
 
111
117
  Follow the steps [in this comment](https://github.com/lirantal/dockly/issues/50#issuecomment-536190949) to enable VT100 support on the settings for the window
112
118
 
119
+ 3. Icons not working properly
113
120
 
114
- # Author
115
- Liran Tal <liran.tal@gmail.com>
121
+ set `LANG` and `LC_ALL` to c.UTF-8 like so
122
+ ```bash
123
+ export LANG=C.UTF-8
124
+ export LC_ALL=C.UTF-8
125
+ ```
126
+ for more info please see [this issue](https://github.com/yaronn/blessed-contrib/issues/111)
116
127
 
117
128
  ## Alternatives
118
129
 
119
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>
@@ -1,10 +1,8 @@
1
1
  'use strict'
2
2
 
3
- const EventEmitter = require('events')
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 baseWidget(EventEmitter) {
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.copyContainerIdToClipboard()
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
- copyContainerIdToClipboard () {
171
- if (this.widgetsRepo && this.widgetsRepo.has('containerList')) {
172
- const containerId = this.widgetsRepo.get('containerList').getSelectedContainer()
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
 
@@ -1,10 +1,8 @@
1
1
  'use strict'
2
2
 
3
- const EventEmitter = require('events')
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 baseWidget(EventEmitter) {
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.copyImageIdToClipboard()
22
+ this.copyItemIdToClipboard()
25
23
  }
26
24
  })
27
25
  }
28
26
 
29
- copyImageIdToClipboard () {
30
- if (this.widgetsRepo && this.widgetsRepo.has('imageList')) {
31
- const imageId = this.widgetsRepo.get('imageList').getSelectedImage()
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 () {
@@ -1,10 +1,8 @@
1
1
  'use strict'
2
2
 
3
- const EventEmitter = require('events')
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 baseWidget(EventEmitter) {
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.copyServiceIdToClipboard()
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
- copyServiceIdToClipboard () {
89
- if (this.widgetsRepo && this.widgetsRepo.has('servicesList')) {
90
- const serviceId = this.widgetsRepo.get('servicesList').getSelectedService()
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.21.2",
3
+ "version": "3.22.0",
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.9.0",
70
+ "blessed-contrib": "^4.10.1",
71
71
  "chalk": "2.4.2",
72
72
  "clipboardy": "^2.3.0",
73
- "command-line-args": "^5.1.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.1.6",
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
- "branch": "master"
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
- if (config.socketPath) {
13
- this.dockerCon = new DockerLib({
14
- socketPath: config.socketPath
15
- })
16
- } else {
17
- this.dockerCon = new DockerLib()
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
@@ -29,15 +29,15 @@ class myWidget extends baseWidget(EventEmitter) {
29
29
  return null
30
30
  }
31
31
 
32
- // clear log box of previous logs
33
- this.clearItemLogs()
34
-
35
32
  // get logs for the items
36
33
  this.getItemLogs(itemId, (err, stream) => {
37
34
  if (err) {
38
35
  return null
39
36
  }
40
37
 
38
+ // clear log box of previous logs
39
+ this.clearItemLogs()
40
+
41
41
  let str
42
42
  if (stream && stream.pipe) {
43
43
  stream.on('data', (chunk) => {
@@ -111,6 +111,10 @@ class myWidget extends ListWidget {
111
111
  getSelectedImage () {
112
112
  return this.widget.getItem(this.widget.selected).getContent().toString().trim().split(' ').shift()
113
113
  }
114
+
115
+ getItemLogs (itemId, cb) {
116
+ cb(new Error('image view don\'t have log widget'))
117
+ }
114
118
  }
115
119
 
116
120
  module.exports = myWidget