Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5eb3afd5
Commit
5eb3afd5
authored
Aug 03, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Focus terminal on load
Use object.assign for default option
parent
6f694f24
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
15 deletions
+13
-15
app/assets/javascripts/terminal/terminal.js
app/assets/javascripts/terminal/terminal.js
+6
-13
app/assets/stylesheets/application.scss
app/assets/stylesheets/application.scss
+0
-1
changelogs/unreleased/25990-improve-web-terminal.yml
changelogs/unreleased/25990-improve-web-terminal.yml
+5
-0
config/application.rb
config/application.rb
+2
-1
No files found.
app/assets/javascripts/terminal/terminal.js
View file @
5eb3afd5
import
$
from
'
jquery
'
;
import
{
Terminal
}
from
'
xterm
'
;
import
*
as
fit
from
'
xterm/lib/addons/fit/fit
'
;
import
*
as
attach
from
'
xterm/lib/addons/attach/attach
'
;
export
default
class
GLTerminal
{
constructor
(
options
)
{
this
.
options
=
options
||
{};
if
(
!
Object
.
prototype
.
hasOwnProperty
.
call
(
this
.
options
,
'
cursorBlink
'
))
{
this
.
options
.
cursorBlink
=
true
;
}
if
(
!
Object
.
prototype
.
hasOwnProperty
.
call
(
this
.
options
,
'
screenKeys
'
))
{
this
.
options
.
screenKeys
=
true
;
}
constructor
(
options
=
{})
{
this
.
options
=
Object
.
assign
({},
{
cursorBlink
:
true
,
screenKeys
:
true
,
},
options
);
this
.
container
=
document
.
querySelector
(
options
.
selector
);
...
...
@@ -37,16 +31,15 @@ export default class GLTerminal {
createTerminal
()
{
Terminal
.
applyAddon
(
fit
);
Terminal
.
applyAddon
(
attach
);
this
.
terminal
=
new
Terminal
(
this
.
options
);
//TODO - CHECK IF WE SHOULD USE `attach` instead
this
.
socket
=
new
WebSocket
(
this
.
socketUrl
,
[
'
terminal.gitlab.com
'
]);
this
.
socket
.
binaryType
=
'
arraybuffer
'
;
this
.
terminal
.
open
(
this
.
container
);
this
.
terminal
.
fit
();
this
.
terminal
.
focus
();
this
.
socket
.
onopen
=
()
=>
{
this
.
runTerminal
();
...
...
app/assets/stylesheets/application.scss
View file @
5eb3afd5
...
...
@@ -19,7 +19,6 @@
@import
"../../../node_modules/pikaday/scss/pikaday"
;
/*
* GitLab UI framework
*/
...
...
changelogs/unreleased/25990-improve-web-terminal.yml
0 → 100644
View file @
5eb3afd5
---
title
:
Move xterm to a node dependency and remove it from vendor's folder
merge_request
:
20588
author
:
type
:
other
config/application.rb
View file @
5eb3afd5
...
...
@@ -162,7 +162,8 @@ module Gitlab
config
.
assets
.
precompile
<<
"icons.json"
config
.
assets
.
precompile
<<
"illustrations/*.svg"
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules/xterm/src/"
# Import css for xterm
config
.
assets
.
paths
<<
"
#{
config
.
root
}
/node_modules/xterm/src/"
config
.
assets
.
precompile
<<
"xterm.css"
## EE-specific assets config START
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment