Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
svmon-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jie Yuan
svmon-web
Commits
6fb9c020
Commit
6fb9c020
authored
Oct 02, 2019
by
Jie Yuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add dialog to table comp
parent
c94bc32f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
5 deletions
+49
-5
src/app/dashboard/table/table.component.css
src/app/dashboard/table/table.component.css
+8
-1
src/app/dashboard/table/table.component.html
src/app/dashboard/table/table.component.html
+9
-2
src/app/dashboard/table/table.component.ts
src/app/dashboard/table/table.component.ts
+32
-2
No files found.
src/app/dashboard/table/table.component.css
View file @
6fb9c020
...
...
@@ -98,6 +98,12 @@ table {
border
:
none
;
}
.submenu
{
pointer-events
:
none
;
}
img
{
width
:
80%
;
padding
:
3%
;
...
...
@@ -110,4 +116,5 @@ table {
.form-div
{
width
:
80%
;
margin
:
0
auto
;
}
\ No newline at end of file
}
src/app/dashboard/table/table.component.html
View file @
6fb9c020
...
...
@@ -57,13 +57,20 @@
<button
class=
"menu-button"
mat-icon-button
(click)=
"sidenavtoggle()"
><mat-icon>
menu
</mat-icon></button>
<span
class=
"example-fill-remaining-space"
></span>
<!--
<button class="menu-button" mat-button [matMenuTriggerFor]="menusite">Site</button>
<mat-menu #menusite="matMenu">
<button mat-menu-item (click)="onClickSite('dpmt')">DPMT</button>
<button mat-menu-item (click)="onClickSite('gocdb')">GOCDB</button>
<button mat-menu-item (click)="onClickSite('eosc')">EOSC</button>
</mat-menu>
-->
<button
class=
"menu-button"
(mouseenter) =
'mouseEnter("Site")'
>
Site
</button>
<mat-menu
class=
"submenu"
#menusite
="
matMenu
"
>
<button
class=
"submenu"
mat-menu-item
(click)=
"onClickSite('dpmt')"
>
DPMT
</button>
<button
class=
"submenu"
mat-menu-item
(click)=
"onClickSite('gocdb')"
>
GOCDB
</button>
<button
class=
"submenu"
mat-menu-item
(click)=
"onClickSite('eosc')"
>
EOSC
</button>
</mat-menu>
<button
class=
"menu-button"
mat-button
[matMenuTriggerFor]=
"menuservice"
>
Service
</button>
...
...
@@ -78,7 +85,7 @@
<button
class=
"menu-button"
mat-button
[matMenuTriggerFor]=
"menuuser"
>
{{username}}
</button>
<mat-menu
#menuuser
="
matMenu
"
>
<button
mat-menu-item
>
Profile
</button>
<button
mat-menu-item
(click)=
"openDialog()"
>
Profile
</button>
<button
mat-menu-item
(click)=
"onLogout()"
>
Logout
</button>
</mat-menu>
...
...
src/app/dashboard/table/table.component.ts
View file @
6fb9c020
import
{
Component
,
OnInit
,
Inject
,
ViewContainerRef
,
Input
,
DoCheck
,
ViewChild
,
OnDestroy
,
ChangeDetectorRef
,
AfterViewInit
,
ViewChildren
}
from
'
@angular/core
'
;
import
{
ActivatedRoute
,
Router
}
from
'
@angular/router
'
;
import
{
MatPaginator
,
MatTableDataSource
,
MatSort
}
from
'
@angular/material
'
;
import
{
MatPaginator
,
MatTableDataSource
,
MatSort
,
MatMenuTrigger
,
MatDialog
}
from
'
@angular/material
'
;
import
{
MediaMatcher
}
from
'
@angular/cdk/layout
'
;
import
{
SiteShort
}
from
'
../../model/site-short
'
;
...
...
@@ -11,6 +11,7 @@ import {SharedService} from '../../shared-service';
import
{
Site
}
from
'
../../model/site
'
;
import
{
AuthService
}
from
'
src/app/auth.service
'
;
import
{
DataSource
}
from
'
@angular/cdk/table
'
;
import
{
ProfileDialogComponent
}
from
'
../profile-dialog/profile-dialog.component
'
;
...
...
@@ -41,12 +42,14 @@ export class TableComponent implements OnInit, DoCheck,AfterViewInit {
@
ViewChild
(
MatPaginator
)
paginator
:
MatPaginator
;
@
ViewChild
(
MatSort
)
sort
:
MatSort
;
@
ViewChild
(
MatMenuTrigger
)
trigger
:
MatMenuTrigger
;
constructor
(
public
siteService
:
SiteShortService
,
public
router
:
Router
,
public
route
:
ActivatedRoute
,
public
authService
:
AuthService
public
authService
:
AuthService
,
public
dialog
:
MatDialog
)
{
console
.
log
(
'
table constructor
'
);
...
...
@@ -353,4 +356,31 @@ getPageSizeOptions(): number[] {
}
mouseEnter
(
name
:
string
)
{
console
.
log
(
"
enter
"
+
name
);
this
.
trigger
.
openMenu
();
}
mouseLeave
(
name
:
string
)
{
console
.
log
(
"
leave
"
+
name
);
this
.
trigger
.
closeMenu
();
}
openDialog
():
void
{
console
.
log
(
"
opening the dialog
"
);
const
dialogRef
=
this
.
dialog
.
open
(
ProfileDialogComponent
,
{
width
:
'
500px
'
});
dialogRef
.
afterClosed
().
subscribe
(
result
=>
{
console
.
log
(
'
The dialog was closed
'
);
});
}
}
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