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
af6025c9
Commit
af6025c9
authored
Dec 07, 2017
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: tree update
parent
5b404ced
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
63 deletions
+58
-63
app.js
app.js
+2
-0
cleftbar.component.css
src/app/ControlPage/cleftbar/cleftbar.component.css
+20
-30
cleftbar.component.html
src/app/ControlPage/cleftbar/cleftbar.component.html
+4
-1
cleftbar.component.ts
src/app/ControlPage/cleftbar/cleftbar.component.ts
+32
-32
No files found.
app.js
View file @
af6025c9
...
...
@@ -188,6 +188,7 @@ server.run = function (options) {
"hostname"
:
"192.168.1.6"
,
"ip"
:
"192.168.2.6"
,
"port"
:
22
,
"system"
:
"windows"
,
"system_users"
:
[
{
"id"
:
1
,
...
...
@@ -204,6 +205,7 @@ server.run = function (options) {
"hostname"
:
"testserver123"
,
"ip"
:
"123.57.183.135"
,
"port"
:
8022
,
"system"
:
"linux"
,
"system_users"
:
[
{
"id"
:
1
,
...
...
src/app/ControlPage/cleftbar/cleftbar.component.css
View file @
af6025c9
...
...
@@ -6,10 +6,29 @@
font-family
:
"Hiragino Kaku Gothic ProN"
,
Meiryo
,
sans-serif
;
}
.filetree
{
padding-left
:
20px
;
}
.filetree
input
[
type
=
"checkbox"
]
{
display
:
none
;
}
.filetree
input
[
type
=
checkbox
]
+
label
:before
{
font-family
:
FontAwesome
;
display
:
inline-block
;
}
.filetree
input
[
type
=
checkbox
]
+
label
:before
{
content
:
"\f1b3"
;
letter-spacing
:
10px
;
width
:
30px
;
}
.filetree
input
[
type
=
checkbox
]
:checked
+
label
:before
{
content
:
"\f085"
;
}
.filetree
ul
{
height
:
0
;
overflow
:
hidden
;
...
...
@@ -26,40 +45,10 @@
}
.filetree
label
{
padding-left
:
33px
;
line-height
:
33px
;
display
:
inline-block
;
}
/**
* Icon
* */
.filetree
label
{
background-image
:
url('./icon.png')
;
background-repeat
:
no-repeat
;
}
.filetree
input
[
type
=
"checkbox"
]
+
label
{
background-position
:
0
0
;
width
:
100%
;
height
:
33px
;
}
.filetree
input
[
type
=
"checkbox"
]
:checked
+
label
{
background-position
:
0
-33px
;
width
:
100%
;
height
:
30px
;
}
@media
screen
and
(
-webkit-min-device-pixel-ratio
:
1.0
),
screen
and
(
min--moz-device-pixel-ratio
:
1.0
),
screen
and
(
-o-min-device-pixel-ratio
:
100
/
100
),
screen
and
(
min-device-pixel-ratio
:
1.0
),
screen
and
(
min-resolution
:
1.0dppx
)
{
filetree
label
{
background-image
:
url('./icon.png')
;
-webkit-background-size
:
33px
63px
;
-moz-background-size
:
33px
63px
;
background-size
:
33px
63px
;
}
}
.search
{
border-left-width
:
0
;
border-bottom
:
gold
2px
inset
;
...
...
@@ -71,4 +60,5 @@
border
:
none
;
height
:
28px
;
background
:
#2f2a2a
;
color
:
#ffffff
;
}
src/app/ControlPage/cleftbar/cleftbar.component.html
View file @
af6025c9
...
...
@@ -9,7 +9,10 @@
<input
type=
"checkbox"
id=
"hostgroup-{{i}}"
>
<label
for=
"hostgroup-{{i}}"
>
{{hostGroup.name}}
</label>
<ul>
<li
*
ngFor=
"let host of hostGroup.assets | SearchFilter: q"
(
click
)="
Connect
(
host
)"
>
{{host.hostname}}
</li>
<li
*
ngFor=
"let host of hostGroup.assets | SearchFilter: q"
(
click
)="
Connect
(
host
)"
>
<i
class=
"fa"
[
ngClass
]="'
fa-
'+
host
.
system
"
id=
"rdp-{{i}}"
></i>
{{host.hostname}}
</li>
</ul>
</li>
</ul>
...
...
src/app/ControlPage/cleftbar/cleftbar.component.ts
View file @
af6025c9
...
...
@@ -13,7 +13,7 @@ import {Logger} from 'angular2-logger/core';
import
{
AppService
,
DataStore
,
HttpService
}
from
'../../app.service'
;
import
{
SshComponent
}
from
'../control/ssh/ssh.component'
;
import
{
RdpComponent
}
from
'../control/rdp/rdp.component'
;
import
{
SearchComponent
}
from
"../search/search.component"
;
import
{
SearchComponent
}
from
'../search/search.component'
;
declare
let
layer
:
any
;
declare
let
jQuery
:
any
;
...
...
@@ -47,31 +47,31 @@ 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
]
=
{
"id"
:
"ShowLeftManager"
,
"click"
:
"ShowLeft"
,
"name"
:
"Show left manager"
}
for
(
var
ii
in
value
[
'children'
])
{
if
(
DataStore
.
Nav
[
i
][
'children'
][
ii
][
'id'
]
===
'HindLeftManager'
)
{
DataStore
.
Nav
[
i
][
'children'
][
ii
]
=
{
'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
]
=
{
"id"
:
"HindLeftManager"
,
"click"
:
"HideLeft"
,
"name"
:
"Hind left manager"
}
for
(
var
ii
in
value
[
'children'
])
{
if
(
DataStore
.
Nav
[
i
][
'children'
][
ii
][
'id'
]
===
'ShowLeftManager'
)
{
DataStore
.
Nav
[
i
][
'children'
][
ii
]
=
{
'id'
:
'HindLeftManager'
,
'click'
:
'HideLeft'
,
'name'
:
'Hind left manager'
}
;
}
}
})
})
;
}
constructor
(
private
_appService
:
AppService
,
...
...
@@ -96,47 +96,47 @@ export class CleftbarComponent implements OnInit {
console
.
log
(
host
);
let
username
:
string
;
if
(
host
.
system_users
.
length
>
1
)
{
let
options
=
""
;
let
options
=
''
;
for
(
let
u
of
host
.
system_users
)
{
options
+=
"<option value='"
+
u
.
username
+
"'>"
+
u
.
username
+
"</option>"
options
+=
'<option value="'
+
u
.
username
+
'">'
+
u
.
username
+
'</option>'
;
}
layer
.
open
({
title
:
'Please Choose a User'
,
scrollbar
:
false
,
moveOut
:
true
,
moveType
:
1
,
btn
:
[
"确定"
,
"取消"
],
content
:
"<select id='selectuser'>"
+
options
+
"</select>"
,
btn
:
[
'确定'
,
'取消'
],
content
:
'<select id="selectuser">'
+
options
+
'</select>'
,
yes
:
function
(
index
,
layero
)
{
username
=
jQuery
(
"#selectuser"
).
val
();
username
=
jQuery
(
'#selectuser'
).
val
();
layer
.
close
(
index
);
},
btn2
:
function
(
index
,
layero
)
{
},
cancel
:
function
()
{
//右上角关闭回调
//return false 开启该代码可禁止点击该按钮关闭
//
右上角关闭回调
//
return false 开启该代码可禁止点击该按钮关闭
}
});
}
else
if
(
host
.
system_users
.
length
===
1
)
{
username
=
host
.
system_users
[
0
].
username
username
=
host
.
system_users
[
0
].
username
;
}
if
(
username
===
""
)
{
return
if
(
username
===
''
)
{
return
;
}
if
(
host
.
type
===
'ssh'
)
{
jQuery
(
"app-ssh"
).
show
();
jQuery
(
"app-rdp"
).
hide
();
jQuery
(
'app-ssh'
).
show
();
jQuery
(
'app-rdp'
).
hide
();
this
.
_term
.
TerminalConnect
(
host
,
username
);
}
else
{
jQuery
(
"app-ssh"
).
hide
();
jQuery
(
"app-rdp"
).
show
();
jQuery
(
'app-ssh'
).
hide
();
jQuery
(
'app-rdp'
).
show
();
this
.
_rdp
.
Connect
(
host
,
username
);
}
}
Search
(
q
)
{
this
.
_search
.
Search
(
q
)
this
.
_search
.
Search
(
q
)
;
}
}
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