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
8a36a491
Unverified
Commit
8a36a491
authored
Apr 26, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
parent
4e7f081f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
2 deletions
+92
-2
elements.component.ts
src/app/elements/elements.component.ts
+0
-2
tree.component.html
src/app/elements/tree/tree.component.html
+17
-0
tree.component.scss
src/app/elements/tree/tree.component.scss
+0
-0
tree.component.spec.ts
src/app/elements/tree/tree.component.spec.ts
+25
-0
tree.component.ts
src/app/elements/tree/tree.component.ts
+50
-0
No files found.
src/app/elements/elements.component.ts
View file @
8a36a491
...
...
@@ -15,7 +15,6 @@ import {ElementSettingsComponent} from './settings/settings.component';
import
{
ElementDialogAlertComponent
}
from
'./dialog/dialog.service'
;
import
{
ElementGuacamoleComponent
}
from
'./guacamole/guacamole.component'
;
import
{
ElementAssetTreeComponent
}
from
'./asset-tree/asset-tree.component'
;
import
{
ElementTreeComponent
}
from
'./tree/tree.component'
;
export
const
ElementComponents
=
[
ElementLeftbarComponent
,
...
...
@@ -34,5 +33,4 @@ export const ElementComponents = [
ElementDialogAlertComponent
,
ElementGuacamoleComponent
,
ElementAssetTreeComponent
,
ElementTreeComponent
];
src/app/elements/tree/tree.component.html
0 → 100644
View file @
8a36a491
<div
*
ngFor=
"let node of TreeData"
>
<div
*
ngIf=
"node.leafs?.length>0"
>
{{node.id}}
<elements-tree
[
TreeData
]="
node
.
leafs
"
></elements-tree>
</div>
<div
*
ngIf=
"node.leafs?.length==0"
>
{{node.id}}
</div>
</div>
<!--<ul class="filetree ">-->
<!--<li *ngFor="let hostGroup of HostGroups | SearchFilter: q; let i = index ">-->
<!--<input type="checkbox" id="hostgroup-{{i}}">-->
<!--<label for="hostgroup-{{i}}" matTooltip="{{hostGroup.name}}" [matTooltipPosition]="TooltipPosition">{{hostGroup.name}}</label>-->
<!--</li>-->
<!--</ul>-->
src/app/elements/tree/tree.component.scss
0 → 100644
View file @
8a36a491
src/app/elements/tree/tree.component.spec.ts
0 → 100644
View file @
8a36a491
import
{
async
,
ComponentFixture
,
TestBed
}
from
'@angular/core/testing'
;
import
{
ElementTreeComponent
}
from
'./tree.component'
;
describe
(
'R '
,
()
=>
{
let
component
:
ElementTreeComponent
;
let
fixture
:
ComponentFixture
<
ElementTreeComponent
>
;
beforeEach
(
async
(()
=>
{
TestBed
.
configureTestingModule
({
declarations
:
[
ElementTreeComponent
]
})
.
compileComponents
();
}));
beforeEach
(()
=>
{
fixture
=
TestBed
.
createComponent
(
ElementTreeComponent
);
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
});
it
(
'should create'
,
()
=>
{
expect
(
component
).
toBeTruthy
();
});
});
src/app/elements/tree/tree.component.ts
0 → 100644
View file @
8a36a491
import
{
Component
,
Input
,
OnInit
}
from
'@angular/core'
;
import
{
HttpService
}
from
'../../app.service'
;
export
interface
Assets
{
name
:
string
;
id
:
string
;
type
:
string
;
}
export
interface
Groups
{
id
:
string
;
key
:
string
;
name
:
string
;
value
:
string
;
parent
:
string
;
assets_granted
:
Array
<
Assets
>
;
}
export
class
TreeStruct
{
id
:
string
;
leafs
:
Array
<
TreeStruct
>
;
static
create
(
id
,
parent
:
string
)
{
const
tmp
=
new
TreeStruct
();
tmp
.
id
=
id
;
tmp
.
leafs
=
[];
return
tmp
;
}
}
@
Component
({
selector
:
'elements-tree'
,
templateUrl
:
'./tree.component.html'
,
styleUrls
:
[
'./tree.component.scss'
]
})
export
class
ElementTreeComponent
implements
OnInit
{
@
Input
()
TreeData
:
Array
<
TreeStruct
>
;
constructor
(
private
_http
:
HttpService
)
{
}
ngOnInit
()
{
}
}
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