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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
26b8209e
Commit
26b8209e
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
0116930b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
16 deletions
+13
-16
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
-2
No files found.
app/assets/javascripts/terminal/terminal.js
View file @
26b8209e
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 @
26b8209e
...
...
@@ -19,7 +19,6 @@
@import
"../../../node_modules/pikaday/scss/pikaday"
;
/*
* GitLab UI framework
*/
...
...
changelogs/unreleased/25990-improve-web-terminal.yml
0 → 100644
View file @
26b8209e
---
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 @
26b8209e
...
...
@@ -148,10 +148,10 @@ 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"
# Version of your assets, change this if you want to expire all your assets
config
.
assets
.
version
=
'1.0'
...
...
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