Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
1084be47
Commit
1084be47
authored
Mar 25, 2016
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
44b2bcb7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
36 deletions
+3
-36
record.js
static/js/record.js
+3
-36
No files found.
static/js/record.js
View file @
1084be47
...
...
@@ -102,10 +102,9 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) {
timer
=
setInterval
(
advance
,
TICK
);
};
var
rc
=
textSize
();
var
term
=
new
Terminal
({
rows
:
rc
.
y
,
cols
:
rc
.
x
,
rows
:
80
,
cols
:
24
,
useStyle
:
true
,
screenKeys
:
true
});
...
...
@@ -122,36 +121,3 @@ NgApp.controller('TerminalRecordCtrl', function ($scope, $http) {
})
})
\ No newline at end of file
function
textSize
()
{
var
charSize
=
getCharSize
();
var
windowSize
=
getwindowSize
();
var
size
=
{
x
:
Math
.
floor
(
windowSize
.
width
/
charSize
.
width
)
,
y
:
Math
.
floor
(
windowSize
.
height
/
charSize
.
height
)
};
if
(
size
.
x
>
150
)
size
.
x
=
150
;
if
(
size
.
y
>
35
)
size
.
y
=
35
;
size
.
x
=
140
;
size
.
y
=
30
;
return
size
;
}
function
getCharSize
()
{
var
$span
=
$
(
"<span>"
,
{
text
:
"qwertyuiopasdfghjklzxcvbnm"
});
$
(
'body'
).
append
(
$span
);
var
size
=
{
width
:
$span
.
outerWidth
()
/
30
,
height
:
$span
.
outerHeight
()
*
1.1
};
$span
.
remove
();
return
size
;
}
function
getwindowSize
()
{
var
e
=
window
,
a
=
'inner'
;
if
(
!
(
'innerWidth'
in
window
))
{
a
=
'client'
;
e
=
document
.
documentElement
||
document
.
body
;
}
return
{
width
:
e
[
a
+
'Width'
]
-
300
,
height
:
e
[
a
+
'Height'
]
-
120
};
}
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