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
8c1e2a52
Unverified
Commit
8c1e2a52
authored
Feb 01, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: udpate
parent
2e1bfb6d
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
49 additions
and
58 deletions
+49
-58
cleftbar.component.ts
src/app/ControlPage/cleftbar/cleftbar.component.ts
+12
-12
control.component.ts
src/app/ControlPage/control/control.component.ts
+3
-7
controlnav.component.html
.../ControlPage/control/controlnav/controlnav.component.html
+3
-3
controlnav.component.ts
...pp/ControlPage/control/controlnav/controlnav.component.ts
+10
-6
term.component.ts
src/app/elements/term/term.component.ts
+11
-4
globals.ts
src/app/globals.ts
+2
-4
linux.component.html
src/app/monitor-page/linux/linux.component.html
+4
-1
linux.component.ts
src/app/monitor-page/linux/linux.component.ts
+3
-20
monitor-page.component.ts
src/app/monitor-page/monitor-page.component.ts
+1
-1
No files found.
src/app/ControlPage/cleftbar/cleftbar.component.ts
View file @
8c1e2a52
...
...
@@ -51,30 +51,30 @@ export class CleftbarComponent implements OnInit {
static
Hide
()
{
DataStore
.
leftbarshow
=
false
;
DataStore
.
Nav
.
map
(
function
(
value
,
i
)
{
for
(
var
ii
in
value
[
'children'
])
{
if
(
DataStore
.
Nav
[
i
][
'children'
][
ii
][
'id'
]
===
'HindLeftManager'
)
{
DataStore
.
Nav
[
i
][
'children'
][
ii
]
=
{
value
[
'children'
].
forEach
((
v
,
key
)
=>
{
if
(
DataStore
.
Nav
[
i
][
'children'
][
key
][
'id'
]
===
'HindLeftManager'
)
{
DataStore
.
Nav
[
i
][
'children'
][
key
]
=
{
'id'
:
'ShowLeftManager'
,
'click'
:
'ShowLeft'
,
'name'
:
'Show left manager'
};
}
}
}
);
});
}
static
Show
()
{
DataStore
.
leftbarshow
=
true
;
DataStore
.
Nav
.
map
(
function
(
value
,
i
)
{
for
(
var
ii
in
value
[
'children'
])
{
if
(
DataStore
.
Nav
[
i
][
'children'
][
ii
][
'id'
]
===
'ShowLeftManager'
)
{
DataStore
.
Nav
[
i
][
'children'
][
ii
]
=
{
value
[
'children'
].
forEach
((
v
,
key
)
=>
{
if
(
DataStore
.
Nav
[
i
][
'children'
][
key
][
'id'
]
===
'ShowLeftManager'
)
{
DataStore
.
Nav
[
i
][
'children'
][
key
]
=
{
'id'
:
'HindLeftManager'
,
'click'
:
'HideLeft'
,
'name'
:
'Hind left manager'
};
}
}
}
);
});
}
...
...
@@ -101,12 +101,12 @@ export class CleftbarComponent implements OnInit {
if
(
id
)
{
for
(
let
g
of
this
.
HostGroups
)
{
if
(
g
[
'assets_granted'
])
{
for
(
let
u
of
g
[
'assets_granted'
])
{
if
(
u
.
id
.
toString
()
===
id
.
toString
())
{
this
.
Connect
(
u
);
g
[
'assets_granted'
].
forEach
((
v
,
k
)
=>
{
if
(
v
.
id
.
toSource
()
===
id
.
toString
())
{
this
.
Connect
(
v
);
return
;
}
}
}
);
}
}
...
...
src/app/ControlPage/control/control.component.ts
View file @
8c1e2a52
...
...
@@ -53,13 +53,9 @@ export class ControlComponent implements OnInit {
NavList
=
NavList
;
static
active
(
id
)
{
for
(
let
i
in
NavList
.
List
)
{
if
(
id
.
toString
()
===
i
)
{
NavList
.
List
[
id
].
hide
=
false
;
}
else
{
NavList
.
List
[
i
].
hide
=
true
;
}
}
NavList
.
List
.
forEach
((
v
,
k
)
=>
{
v
.
hide
=
id
.
toString
()
!==
k
;
});
NavList
.
Active
=
id
;
}
...
...
src/app/ControlPage/control/controlnav/controlnav.component.html
View file @
8c1e2a52
...
...
@@ -8,9 +8,9 @@
<ul
[
ngStyle
]="{'
width
'
:150
*
NavList
.
List
.
length
+'
px
'}"
>
<li
*
ngFor=
"let m of NavList.List;let i = index"
[
ngClass
]="{'
active
'
:i=
=NavList.Active,'disconnected':!m.connected,
'
hidden
'
:
m
.
closed
!=
false
}"
id=
"termnav-{{i}}"
(
click
)="
setActive
(
i
)"
>
<span
*
ngIf=
"!m.edit"
(
dblclick
)="
m
.
edit=
true;setActive(i)"
>
{{m.nick}}
</span>
<input
*
ngIf=
"m.edit"
[(
ngModel
)]="
m
.
nick
"
autofocus
(
blur
)="
m
.
edit=
false"
(
keyup
.
enter
)="
m
.
edit=
fals
e"/
>
id=
"termnav-{{i}}"
(
click
)="
setActive
(
i
)"
(
dblclick
)="
m
.
edit=
true;setActive(i)"
>
<span
*
ngIf=
"!m.edit"
>
{{m.nick}}
</span>
<input
*
ngIf=
"m.edit"
[(
ngModel
)]="
m
.
nick
"
(
blur
)="
m
.
edit=
false"
(
keyup
.
enter
)="
m
.
edit=
false"
autofocus=
"tru
e"
/>
<a
class=
"close"
(
click
)="
close
(
m
,
i
)"
>
×
</a>
</li>
</ul>
...
...
src/app/ControlPage/control/controlnav/controlnav.component.ts
View file @
8c1e2a52
...
...
@@ -35,14 +35,18 @@ export class ControlnavComponent implements OnInit {
}
static
setActive
(
index
)
{
for
(
let
m
in
NavList
.
List
)
{
NavList
.
List
[
m
].
hide
=
true
;
}
NavList
.
List
.
forEach
((
value
,
key
)
=>
{
NavList
.
List
[
key
].
hide
=
true
;
}
);
NavList
.
List
[
index
].
hide
=
false
;
NavList
.
Active
=
index
;
if
(
NavList
.
List
[
index
].
type
===
'ssh'
)
{
NavList
.
List
[
index
].
Term
.
focus
();
}
else
if
(
NavList
.
List
[
index
].
type
===
'rdp'
)
{
if
(
!
NavList
.
List
[
index
].
edit
)
{
if
(
NavList
.
List
[
index
].
type
===
'ssh'
)
{
NavList
.
List
[
index
].
Term
.
focus
();
}
else
if
(
NavList
.
List
[
index
].
type
===
'rdp'
)
{
}
}
else
{
}
}
...
...
src/app/elements/term/term.component.ts
View file @
8c1e2a52
...
...
@@ -16,6 +16,8 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
@
Input
()
userid
:
any
;
@
Input
()
index
:
number
;
@
Input
()
token
:
string
;
@
Input
()
monitor
:
string
;
@
ViewChild
(
'term'
)
el
:
ElementRef
;
secret
:
string
;
term
:
any
;
...
...
@@ -72,11 +74,16 @@ export class ElementTermComponent implements OnInit, AfterViewInit {
TermWS
.
emit
(
'host'
,
{
'uuid'
:
this
.
host
.
id
,
'userid'
:
this
.
userid
,
'secret'
:
this
.
secret
});
}
if
(
this
.
token
)
{
TermWS
.
emit
(
'token'
,
{
'token'
:
this
.
token
,
'secr
te
'
:
this
.
secret
});
TermWS
.
emit
(
'token'
,
{
'token'
:
this
.
token
,
'secr
et
'
:
this
.
secret
});
}
this
.
term
.
on
(
'data'
,
function
(
data
)
{
TermWS
.
emit
(
'data'
,
{
'data'
:
data
,
'room'
:
NavList
.
List
[
that
.
index
].
room
});
});
if
(
this
.
monitor
)
{
TermWS
.
emit
(
'monitor'
,
{
'token'
:
this
.
monitor
,
'secret'
:
this
.
secret
});
}
else
{
this
.
term
.
on
(
'data'
,
function
(
data
)
{
TermWS
.
emit
(
'data'
,
{
'data'
:
data
,
'room'
:
NavList
.
List
[
that
.
index
].
room
});
});
}
TermWS
.
on
(
'data'
,
function
(
data
)
{
if
(
data
[
'room'
]
===
NavList
.
List
[
that
.
index
].
room
)
{
...
...
src/app/globals.ts
View file @
8c1e2a52
...
...
@@ -39,15 +39,13 @@ export let Video: {
};
export
let
Monitor
:
{
sessionid
:
string
,
token
:
string
,
room
:
string
,
type
:
string
,
socket
:
any
,
}
=
{
sessionid
:
''
,
token
:
''
,
room
:
''
,
type
:
'term'
,
socket
:
io
.
connect
(),
};
export
class
Group
{
...
...
src/app/monitor-page/linux/linux.component.html
View file @
8c1e2a52
<app-element-term></app-element-term>
<app-element-term
[
index
]="
0
"
[
monitor
]="
token
"
></app-element-term>
src/app/monitor-page/linux/linux.component.ts
View file @
8c1e2a52
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Monitor
,
term
}
from
'../../globals'
;
import
*
as
io
from
'socket.io-client'
;
import
*
as
jQuery
from
'jquery/dist/jquery.min.js'
;
import
{
Monitor
}
from
'../../globals'
;
@
Component
({
selector
:
'app-monitor-linux'
,
...
...
@@ -10,27 +7,13 @@ import * as jQuery from 'jquery/dist/jquery.min.js';
styleUrls
:
[
'./linux.component.css'
]
})
export
class
LinuxComponent
implements
OnInit
{
token
:
string
;
constructor
()
{
}
ngOnInit
()
{
Monitor
.
socket
=
io
.
connect
(
'/ssh'
);
Monitor
.
socket
.
on
(
'connect'
,
function
()
{
Monitor
.
socket
.
emit
(
'room'
,
Monitor
.
sessionid
);
Monitor
.
socket
.
on
(
'room'
,
function
(
room
)
{
Monitor
.
room
=
room
;
console
.
log
(
room
);
Monitor
.
socket
.
emit
(
'join'
,
room
);
console
.
log
(
Monitor
);
});
Monitor
.
socket
.
on
(
'data'
,
function
(
data
)
{
term
.
term
.
write
(
data
);
});
Monitor
.
socket
.
on
(
'error'
,
function
(
data
)
{
alert
(
data
);
});
});
this
.
token
=
Monitor
.
token
;
}
...
...
src/app/monitor-page/monitor-page.component.ts
View file @
8c1e2a52
...
...
@@ -15,7 +15,7 @@ export class MonitorPageComponent implements OnInit {
ngOnInit
()
{
this
.
activatedRoute
.
params
.
subscribe
((
params
:
Params
)
=>
{
Monitor
.
sessionid
=
params
[
'token'
];
Monitor
.
token
=
params
[
'token'
];
Monitor
.
type
=
'term'
;
console
.
log
(
Monitor
);
});
...
...
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