Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
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
luna
Commits
aedbbdca
Unverified
Commit
aedbbdca
authored
7 years ago
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: update
parent
4a36650c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
14 deletions
+11
-14
package-lock.json
package-lock.json
+0
-5
term.component.ts
src/app/elements/term/term.component.ts
+10
-8
term-page.component.html
src/app/term-page/term-page.component.html
+1
-1
No files found.
package-lock.json
View file @
aedbbdca
...
@@ -8351,11 +8351,6 @@
...
@@ -8351,11 +8351,6 @@
"chart.js"
:
"2.7.1"
"chart.js"
:
"2.7.1"
}
}
},
},
"ng2-cookies"
:
{
"version"
:
"1.0.12"
,
"resolved"
:
"https://registry.npmjs.org/ng2-cookies/-/ng2-cookies-1.0.12.tgz"
,
"integrity"
:
"sha1-Pz5hPgE3sGSbcFxngHS0vQgUnMw="
},
"ngx-bootstrap"
:
{
"ngx-bootstrap"
:
{
"version"
:
"1.9.3"
,
"version"
:
"1.9.3"
,
"resolved"
:
"https://registry.npmjs.org/ngx-bootstrap/-/ngx-bootstrap-1.9.3.tgz"
,
"resolved"
:
"https://registry.npmjs.org/ngx-bootstrap/-/ngx-bootstrap-1.9.3.tgz"
,
...
...
This diff is collapsed.
Click to expand it.
src/app/elements/term/term.component.ts
View file @
aedbbdca
import
{
AfterViewInit
,
Component
,
Input
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
AfterViewInit
,
Component
,
Input
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
ElementRef
}
from
'@angular/core'
;
import
{
ElementRef
}
from
'@angular/core'
;
import
{
term
,
Terminal
,
TermWS
}
from
'../../globals'
;
import
{
term
,
Terminal
,
TermWS
}
from
'../../globals'
;
import
{
Cookie
}
from
'ng2-cookies/ng2-cookies'
;
import
{
NavList
}
from
'../../ControlPage/control/control.component'
;
import
{
NavList
}
from
'../../ControlPage/control/control.component'
;
import
*
as
jQuery
from
'jquery/dist/jquery.min.js'
;
import
*
as
jQuery
from
'jquery/dist/jquery.min.js'
;
import
{
UUIDService
}
from
'../../app.service'
;
import
{
UUIDService
}
from
'../../app.service'
;
import
{
CookieService
}
from
'ngx-cookie-service'
;
@
Component
({
@
Component
({
selector
:
'app-element-term'
,
selector
:
'app-element-term'
,
...
@@ -22,7 +22,8 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -22,7 +22,8 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
secret
:
string
;
secret
:
string
;
term
:
any
;
term
:
any
;
constructor
(
private
_uuid
:
UUIDService
)
{
constructor
(
private
_uuid
:
UUIDService
,
private
_cookie
:
CookieService
)
{
}
}
ngOnInit
()
{
ngOnInit
()
{
...
@@ -38,11 +39,11 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -38,11 +39,11 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
ngAfterViewInit
()
{
ngAfterViewInit
()
{
if
(
this
.
host
||
this
.
token
)
{
if
(
this
.
host
||
this
.
token
)
{
if
(
C
ookie
.
get
(
'cols'
))
{
if
(
this
.
_c
ookie
.
get
(
'cols'
))
{
term
.
col
=
parseInt
(
C
ookie
.
get
(
'cols'
),
10
);
term
.
col
=
parseInt
(
this
.
_c
ookie
.
get
(
'cols'
),
10
);
}
}
if
(
C
ookie
.
get
(
'rows'
))
{
if
(
this
.
_c
ookie
.
get
(
'rows'
))
{
term
.
row
=
parseInt
(
C
ookie
.
get
(
'rows'
),
10
);
term
.
row
=
parseInt
(
this
.
_c
ookie
.
get
(
'rows'
),
10
);
}
}
}
else
{
}
else
{
term
.
col
=
Math
.
floor
(
jQuery
(
this
.
el
.
nativeElement
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
term
.
col
=
Math
.
floor
(
jQuery
(
this
.
el
.
nativeElement
).
width
()
/
jQuery
(
'#liuzheng'
).
width
()
*
8
)
-
3
;
...
@@ -62,8 +63,8 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -62,8 +63,8 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
}
}
that
.
term
.
resize
(
term
.
col
,
term
.
row
);
that
.
term
.
resize
(
term
.
col
,
term
.
row
);
if
(
that
.
host
)
{
if
(
that
.
host
)
{
C
ookie
.
set
(
'cols'
,
term
.
col
.
toString
(),
99
,
'/'
,
document
.
domain
);
this
.
_c
ookie
.
set
(
'cols'
,
term
.
col
.
toString
(),
99
,
'/'
,
document
.
domain
);
C
ookie
.
set
(
'rows'
,
term
.
row
.
toString
(),
99
,
'/'
,
document
.
domain
);
this
.
_c
ookie
.
set
(
'rows'
,
term
.
row
.
toString
(),
99
,
'/'
,
document
.
domain
);
TermWS
.
emit
(
'resize'
,
{
'cols'
:
term
.
col
,
'rows'
:
term
.
row
});
TermWS
.
emit
(
'resize'
,
{
'cols'
:
term
.
col
,
'rows'
:
term
.
row
});
}
}
};
};
...
@@ -75,6 +76,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
...
@@ -75,6 +76,7 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
}
}
if
(
this
.
token
)
{
if
(
this
.
token
)
{
TermWS
.
emit
(
'token'
,
{
'token'
:
this
.
token
,
'secret'
:
this
.
secret
});
TermWS
.
emit
(
'token'
,
{
'token'
:
this
.
token
,
'secret'
:
this
.
secret
});
console
.
log
(
this
.
token
);
}
}
if
(
this
.
monitor
)
{
if
(
this
.
monitor
)
{
TermWS
.
emit
(
'monitor'
,
{
'token'
:
this
.
monitor
,
'secret'
:
this
.
secret
});
TermWS
.
emit
(
'monitor'
,
{
'token'
:
this
.
monitor
,
'secret'
:
this
.
secret
});
...
...
This diff is collapsed.
Click to expand it.
src/app/term-page/term-page.component.html
View file @
aedbbdca
<app-element-term
<app-element-term
[
token
]="
token
"
[
token
]="
token
"
[
index
]="
0
"
>
[
index
]="
0
"
>
</app-element-term>
</app-element-term>
This diff is collapsed.
Click to expand it.
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