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
75f77308
Unverified
Commit
75f77308
authored
Feb 07, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update
http://localhost:4200/luna/?asset_id=1&user_id=1
parent
b3e74b68
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
84 additions
and
24 deletions
+84
-24
cleftbar.component.ts
src/app/ControlPage/cleftbar/cleftbar.component.ts
+26
-9
app.module.ts
src/app/app.module.ts
+3
-1
alert.html
src/app/elements/dialog/alert.html
+5
-0
alert.scss
src/app/elements/dialog/alert.scss
+13
-0
dialog.service.ts
src/app/elements/dialog/dialog.service.ts
+30
-4
layer.js
src/app/elements/dialog/layer.js
+0
-0
server-menu.component.ts
src/app/elements/server-menu/server-menu.component.ts
+1
-1
replay-page.component.ts
src/app/replay-page/replay-page.component.ts
+0
-1
dialog.html
src/app/test-page/dialog.html
+0
-7
test-page.component.html
src/app/test-page/test-page.component.html
+1
-0
test-page.component.ts
src/app/test-page/test-page.component.ts
+5
-1
No files found.
src/app/ControlPage/cleftbar/cleftbar.component.ts
View file @
75f77308
...
...
@@ -16,6 +16,7 @@ import {ElementServerMenuComponent} from '../../elements/server-menu/server-menu
import
{
NavList
,
View
}
from
'../control/control.component'
;
import
{
MAT_DIALOG_DATA
,
MatDialog
,
MatDialogRef
}
from
'@angular/material'
;
import
{
FormControl
,
Validators
}
from
'@angular/forms'
;
import
{
DialogService
}
from
'../../elements/dialog/dialog.service'
;
export
interface
HostGroup
{
...
...
@@ -84,7 +85,8 @@ export class CleftbarComponent implements OnInit {
private
_search
:
SearchComponent
,
private
_logger
:
LogService
,
private
_menu
:
ElementServerMenuComponent
,
public
_dialog
:
MatDialog
)
{
public
_dialog
:
MatDialog
,
private
_layer
:
DialogService
)
{
this
.
_logger
.
log
(
'nav.ts:NavComponent'
);
// this._appService.getnav()
}
...
...
@@ -98,19 +100,34 @@ export class CleftbarComponent implements OnInit {
}
autologin
()
{
const
id
=
this
.
_appService
.
getQueryString
(
'id'
);
if
(
id
)
{
const
asset_id
=
this
.
_appService
.
getQueryString
(
'asset_id'
);
const
user_id
=
this
.
_appService
.
getQueryString
(
'user_id'
);
let
tag
=
false
;
if
(
asset_id
)
{
for
(
let
g
of
this
.
HostGroups
)
{
if
(
g
[
'assets_granted'
])
{
g
[
'assets_granted'
].
forEach
((
v
,
k
)
=>
{
if
(
v
.
id
.
toSource
()
===
id
.
toString
())
{
this
.
Connect
(
v
);
return
;
for
(
let
host
of
g
[
'assets_granted'
])
{
if
(
host
.
id
.
toString
()
===
asset_id
)
{
if
(
user_id
)
{
host
[
'system_users_granted'
].
forEach
((
user
,
kk
)
=>
{
if
(
user
.
id
.
toString
()
===
user_id
.
toString
())
{
this
.
login
(
host
,
user
);
tag
=
true
;
return
;
}
});
}
else
{
this
.
Connect
(
host
);
tag
=
true
;
return
;
}
}
}
);
}
}
}
}
if
(
!
tag
)
{
this
.
_layer
.
alert
(
'Maybe you do not have permission on that host'
);
}
}
...
...
src/app/app.module.ts
View file @
75f77308
...
...
@@ -18,7 +18,7 @@ import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
// service
import
{
AppService
,
HttpService
,
LogService
,
UUIDService
}
from
'./app.service'
;
import
{
DialogService
}
from
'./elements/dialog/dialog.service'
;
import
{
DialogService
,
ElementDialogAlertComponent
}
from
'./elements/dialog/dialog.service'
;
// Elements
import
{
ElementFooterComponent
}
from
'./elements/footer/footer.component'
;
...
...
@@ -79,6 +79,7 @@ import {ElementTableComponent} from './elements/table/table.component';
ElementRdpComponent
,
ElementServerMenuComponent
,
ElementIframeComponent
,
ElementDialogAlertComponent
,
LoginComponent
,
SearchComponent
,
SearchFilter
,
...
...
@@ -104,6 +105,7 @@ import {ElementTableComponent} from './elements/table/table.component';
],
entryComponents
:
[
CleftbarDialogComponent
,
ElementDialogAlertComponent
,
],
bootstrap
:
[
AppComponent
],
providers
:
[
...
...
src/app/elements/dialog/alert.html
0 → 100644
View file @
75f77308
<div
class=
"alert"
>
<h1
mat-dialog-title
>
Alert
</h1>
<p>
{{data.msg}}
</p>
<button
mat-raised-button
(
click
)="
onNoClick
()"
>
Close
</button>
</div>
src/app/elements/dialog/alert.scss
0 → 100644
View file @
75f77308
h1
{
border-bottom
:
1px
solid
#eee
;
width
:
100%
;
}
button
{
float
:
right
;
bottom
:
0
;
}
.alert
{
height
:
100%
;
}
src/app/elements/dialog/dialog.service.ts
View file @
75f77308
import
{
Injectable
}
from
'@angular/core'
;
import
{
Component
,
Inject
,
Injectable
,
OnInit
}
from
'@angular/core'
;
import
{
MAT_DIALOG_DATA
,
MatDialog
,
MatDialogRef
}
from
'@angular/material'
;
import
{
LogService
}
from
'../../app.service'
;
import
{
FormControl
,
Validators
}
from
'@angular/forms'
;
// import * as layer from 'layui-layer/src/layer.js';
@
Injectable
()
export
class
DialogService
{
constructor
()
{
constructor
(
public
_dialog
:
MatDialog
)
{
}
open
(
options
:
any
)
{
...
...
@@ -24,11 +28,33 @@ export class DialogService {
loading
()
{
}
alert
()
{
// alert('sss');
alert
(
msg
:
string
)
{
this
.
_dialog
.
open
(
ElementDialogAlertComponent
,
{
height
:
'200px'
,
width
:
'300px'
,
data
:
{
msg
:
msg
}
});
}
close
(
index
:
any
)
{
// layer.close(index);
}
}
@
Component
({
selector
:
'app-alert'
,
templateUrl
:
'alert.html'
,
styleUrls
:
[
'./alert.scss'
]
})
export
class
ElementDialogAlertComponent
{
constructor
(
public
dialogRef
:
MatDialogRef
<
ElementDialogAlertComponent
>
,
@
Inject
(
MAT_DIALOG_DATA
)
public
data
:
any
,
private
_logger
:
LogService
)
{
}
onNoClick
():
void
{
this
.
dialogRef
.
close
();
}
}
src/app/elements/dialog/layer.js
deleted
100644 → 0
View file @
b3e74b68
This diff is collapsed.
Click to expand it.
src/app/elements/server-menu/server-menu.component.ts
View file @
75f77308
...
...
@@ -29,7 +29,7 @@ export class ElementServerMenuComponent implements OnInit {
m
.
type
=
'lll'
;
line
.
type
=
'line'
;
this
.
MenuList
=
[
m
,
m
,
line
,
m
,
m
];
this
.
_dialog
.
alert
();
this
.
_dialog
.
alert
(
'sss'
);
}
public
contextmenu
(
top
:
number
,
left
:
number
)
{
...
...
src/app/replay-page/replay-page.component.ts
View file @
75f77308
...
...
@@ -9,7 +9,6 @@ import {Video, DataStore} from '../globals';
styleUrls
:
[
'./replay-page.component.css'
]
})
export
class
ReplayPageComponent
implements
OnInit
{
Video
=
Video
;
constructor
(
private
activatedRoute
:
ActivatedRoute
,
private
_http
:
HttpService
,
...
...
src/app/test-page/dialog.html
deleted
100644 → 0
View file @
b3e74b68
<h2
mat-dialog-title
>
Delete all
</h2>
<mat-dialog-content>
Are you sure?
</mat-dialog-content>
<mat-dialog-actions>
<button
mat-button
mat-dialog-close
>
No
</button>
<!-- The mat-dialog-close directive optionally accepts a value as a result for the dialog. -->
<button
mat-button
[
mat-dialog-close
]="
true
"
>
Yes
</button>
</mat-dialog-actions>
src/app/test-page/test-page.component.html
View file @
75f77308
...
...
@@ -3,3 +3,4 @@
[
columns
]="
columns
"
[
config
]="
config
"
></app-element-table>
<button
mat-raised-button
(
click
)="
test
()"
>
Test
</button>
src/app/test-page/test-page.component.ts
View file @
75f77308
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
DataStore
}
from
'../globals'
;
import
{
Config
}
from
'../elements/table/table.component'
;
import
{
DialogService
}
from
'../elements/dialog/dialog.service'
;
// import {Mats, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material';
...
...
@@ -22,7 +23,7 @@ export class TestPageComponent implements OnInit {
];
config
=
Config
;
constructor
()
{
constructor
(
private
_layer
:
DialogService
)
{
DataStore
.
NavShow
=
false
;
this
.
config
.
search
=
true
;
this
.
config
.
scrollbarH
=
true
;
...
...
@@ -31,4 +32,7 @@ export class TestPageComponent implements OnInit {
ngOnInit
()
{
}
test
()
{
this
.
_layer
.
alert
(
'sss'
);
}
}
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