Skip to content

Commit a41e5e2

Browse files
authored
Merge pull request #35 from rhamilto/xterm-v3.1
Upgrade xterm.js to v3.1.0
2 parents 3bb24ad + d6e94a4 commit a41e5e2

File tree

7 files changed

+56
-108
lines changed

7 files changed

+56
-108
lines changed

bower.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "kubernetes-container-terminal",
3-
"version": "2.1.1",
3+
"version": "3.0.0",
44
"description": "Provides a terminal for a kubernetes container in a pod.",
55
"moduleType": [
66
"globals"
@@ -29,7 +29,7 @@
2929
],
3030
"dependencies": {
3131
"angular": ">=1.3.8 <1.6",
32-
"xterm.js": "^2.9.0",
32+
"xterm.js-next": "^3.1.0",
3333
"font-awesome": "*"
3434
},
3535
"devDependencies": {

container-terminal.css

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,13 @@
1-
kubernetes-container-terminal {
2-
position: relative;
3-
display: inline-block;
4-
}
5-
6-
kubernetes-container-terminal .terminal {
7-
font-family: "Monospace Regular", "DejaVu Sans Mono", Menlo, Monaco, Consolas, monospace;
8-
font-size: 10px;
9-
color: #F0F0F0;
10-
text-align: left;
11-
outline: medium none;
12-
border: 3px solid black;
13-
line-height: 1em;
14-
display: inline-block;
15-
}
16-
17-
@media (min-width: 568px) {
18-
kubernetes-container-terminal .terminal {
19-
font-size: 12px;
20-
}
21-
}
22-
23-
kubernetes-container-terminal .terminal-cursor {
24-
background: #f0f0f0;
25-
color: #000;
26-
}
27-
1+
kubernetes-container-terminal,
282
kubernetes-container-terminal .terminal-wrapper {
29-
vertical-align: top;
30-
display: inline-block;
31-
}
32-
33-
kubernetes-container-terminal .terminal-actions {
34-
display: inline-block;
35-
vertical-align: top;
36-
position: absolute;
37-
top: 10px;
38-
right: 34px;
39-
z-index: 1;
3+
display: inline-block;
4+
position: relative;
405
}
416

42-
kubernetes-container-terminal .terminal .xterm-viewport {
43-
overflow-y: auto;
7+
kubernetes-container-terminal .terminal {
8+
display: inline-block;
9+
outline: medium none;
10+
padding: 2px 0 2px 2px;
4411
}
4512

4613
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar {
@@ -54,23 +21,24 @@ kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-corne
5421
}
5522

5623
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-thumb {
57-
background-color: rgba(255,255,255,.25);
58-
box-shadow: inset 1px 1px 0 rgba(255,255,255,.1),inset 0 -1px 0 rgba(255,255,255,.07);
24+
background-color: rgba(255,255,255,.25);
25+
box-shadow: inset 1px 1px 0 rgba(255,255,255,.1),inset 0 -1px 0 rgba(255,255,255,.07);
5926
}
6027

6128
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-thumb:active,
6229
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-thumb:hover {
63-
background-color: rgba(255,255,255,.35);
30+
background-color: rgba(255,255,255,.35);
6431
}
6532

6633
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-track {
6734
background: transparent;
6835
}
6936

70-
/* https://github.com/patternfly/patternfly/pull/135 */
71-
.spinner-white {
72-
border-bottom: 4px solid rgba(255, 255, 255, 0.25) !important;
73-
border-left: 4px solid rgba(255, 255, 255, 0.25) !important;
74-
border-right: 4px solid rgba(255, 255, 255, 0.25) !important;
75-
border-top: 4px solid rgba(255, 255, 255, 0.75) !important;
76-
}
37+
kubernetes-container-terminal .terminal-actions {
38+
display: inline-block;
39+
position: absolute;
40+
right: 34px;
41+
top: 10px;
42+
vertical-align: top;
43+
z-index: 10;
44+
}

container-terminal.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
var outer = angular.element("<div class='terminal-wrapper'>");
9393
element.append(outer);
9494

95-
var spinner = angular.element("<div class='spinner spinner-white hidden'>");
95+
var spinner = angular.element("<div class='spinner spinner-inverse hidden'>");
9696

9797
var button = angular.element("<button class='btn btn-default fa fa-refresh'>");
9898
button.on("click", connect).attr("title", "Connect");
@@ -109,6 +109,12 @@
109109
cols: scope.cols || defaultCols,
110110
rows: scope.rows || defaultRows,
111111
cursorBlink: true,
112+
fontFamily: "'Courier New', 'Courier', monospace",
113+
fontSize: 12,
114+
lineHeight: 1,
115+
theme: {
116+
foreground: "#f0f0f0"
117+
},
112118
screenKeys: scope.screenKeys || true,
113119
applicationCursor: true, // Needed for proper scrollback behavior in applications like vi
114120
mouseEvents: true // Needed for proper scrollback behavior in applications like vi

dist/container-terminal.css

Lines changed: 18 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,13 @@
1-
kubernetes-container-terminal {
2-
position: relative;
3-
display: inline-block;
4-
}
5-
6-
kubernetes-container-terminal .terminal {
7-
font-family: "Monospace Regular", "DejaVu Sans Mono", Menlo, Monaco, Consolas, monospace;
8-
font-size: 10px;
9-
color: #F0F0F0;
10-
text-align: left;
11-
outline: medium none;
12-
border: 3px solid black;
13-
line-height: 1em;
14-
display: inline-block;
15-
}
16-
17-
@media (min-width: 568px) {
18-
kubernetes-container-terminal .terminal {
19-
font-size: 12px;
20-
}
21-
}
22-
23-
kubernetes-container-terminal .terminal-cursor {
24-
background: #f0f0f0;
25-
color: #000;
26-
}
27-
1+
kubernetes-container-terminal,
282
kubernetes-container-terminal .terminal-wrapper {
29-
vertical-align: top;
30-
display: inline-block;
31-
}
32-
33-
kubernetes-container-terminal .terminal-actions {
34-
display: inline-block;
35-
vertical-align: top;
36-
position: absolute;
37-
top: 10px;
38-
right: 34px;
39-
z-index: 1;
3+
display: inline-block;
4+
position: relative;
405
}
416

42-
kubernetes-container-terminal .terminal .xterm-viewport {
43-
overflow-y: auto;
7+
kubernetes-container-terminal .terminal {
8+
display: inline-block;
9+
outline: medium none;
10+
padding: 2px 0 2px 2px;
4411
}
4512

4613
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar {
@@ -54,23 +21,24 @@ kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-corne
5421
}
5522

5623
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-thumb {
57-
background-color: rgba(255,255,255,.25);
58-
box-shadow: inset 1px 1px 0 rgba(255,255,255,.1),inset 0 -1px 0 rgba(255,255,255,.07);
24+
background-color: rgba(255,255,255,.25);
25+
box-shadow: inset 1px 1px 0 rgba(255,255,255,.1),inset 0 -1px 0 rgba(255,255,255,.07);
5926
}
6027

6128
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-thumb:active,
6229
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-thumb:hover {
63-
background-color: rgba(255,255,255,.35);
30+
background-color: rgba(255,255,255,.35);
6431
}
6532

6633
kubernetes-container-terminal .terminal .xterm-viewport::-webkit-scrollbar-track {
6734
background: transparent;
6835
}
6936

70-
/* https://github.com/patternfly/patternfly/pull/135 */
71-
.spinner-white {
72-
border-bottom: 4px solid rgba(255, 255, 255, 0.25) !important;
73-
border-left: 4px solid rgba(255, 255, 255, 0.25) !important;
74-
border-right: 4px solid rgba(255, 255, 255, 0.25) !important;
75-
border-top: 4px solid rgba(255, 255, 255, 0.75) !important;
76-
}
37+
kubernetes-container-terminal .terminal-actions {
38+
display: inline-block;
39+
position: absolute;
40+
right: 34px;
41+
top: 10px;
42+
vertical-align: top;
43+
z-index: 10;
44+
}

dist/container-terminal.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
var outer = angular.element("<div class='terminal-wrapper'>");
9393
element.append(outer);
9494

95-
var spinner = angular.element("<div class='spinner spinner-white hidden'>");
95+
var spinner = angular.element("<div class='spinner spinner-inverse hidden'>");
9696

9797
var button = angular.element("<button class='btn btn-default fa fa-refresh'>");
9898
button.on("click", connect).attr("title", "Connect");
@@ -109,6 +109,12 @@
109109
cols: scope.cols || defaultCols,
110110
rows: scope.rows || defaultRows,
111111
cursorBlink: true,
112+
fontFamily: "'Courier New', 'Courier', monospace",
113+
fontSize: 12,
114+
lineHeight: 1,
115+
theme: {
116+
foreground: "#f0f0f0"
117+
},
112118
screenKeys: scope.screenKeys || true,
113119
applicationCursor: true, // Needed for proper scrollback behavior in applications like vi
114120
mouseEvents: true // Needed for proper scrollback behavior in applications like vi

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
</style>
1616
<link rel="stylesheet" href="bower_components/patternfly/dist/css/patternfly.css">
1717
<link rel="stylesheet" href="bower_components/patternfly/dist/css/patternfly-additions.css">
18-
<link rel="stylesheet" href="bower_components/xterm.js/dist/xterm.css">
18+
<link rel="stylesheet" href="bower_components/xterm.js-next/xterm.css">
1919
<link rel="stylesheet" href="container-terminal.css">
2020
<script src="bower_components/angular/angular.js"></script>
21-
<script src="bower_components/xterm.js/dist/xterm.js"></script>
21+
<script src="bower_components/xterm.js-next/xterm.js"></script>
2222
<script src="container-terminal.js"></script>
2323
</head>
2424
<body ng-app="exampleApp">

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "kubernetes-container-terminal",
33
"description": "Provides a terminal for a kubernetes container in a pod.",
44
"author": "Stef Walter",
5-
"version": "2.1.1",
5+
"version": "3.0.0",
66
"license": "LGPL-2.1-or-later",
77
"main": "dist/container-terminal.js",
88
"devDependencies": {
@@ -19,7 +19,7 @@
1919
},
2020
"dependencies": {
2121
"angular": ">=1.3.8 <1.6",
22-
"xterm": "^2.9.0",
22+
"xterm.js-next": "^3.1.0",
2323
"font-awesome": "*"
2424
}
2525
}

0 commit comments

Comments
 (0)