-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1209 from jumpserver/dev
v4.5.0
- Loading branch information
Showing
23 changed files
with
586 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<div class="box" [class.minimized]="isMinimized" *ngIf="isVisible"> | ||
<div class="box-header"> | ||
<span class="box-title" style="color: red" *ngIf="monitoringTabCount">● [{{ monitoringTabCount }}]个会话正在被监控中</span> | ||
<div class="box-controls"> | ||
<button (click)="minimizeBox()"> | ||
<i *ngIf="!isMinimized" class="fa fa-window-minimize"></i> | ||
<i *ngIf="isMinimized" class="fa fa-window-maximize"></i> | ||
</button> | ||
<button (click)="closeBox()"> | ||
<i class="fa fa-window-close"></i> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="box-content" [hidden]="isMinimized"> | ||
<iframe | ||
*ngIf="faceMonitorUrl" | ||
[src]="faceMonitorUrl" | ||
allow="camera" | ||
sandbox="allow-scripts allow-same-origin" | ||
style="width: 100%; height: 400px;border: none;"></iframe> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.box { | ||
position: absolute; | ||
width: 400px; | ||
height: 460px; | ||
bottom: 0; | ||
right: 0; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); | ||
display: flex; | ||
flex-direction: column; | ||
overflow: hidden; | ||
z-index: 99999; | ||
} | ||
|
||
.box.minimized { | ||
height: 40px; | ||
} | ||
|
||
.box-header { | ||
height: 40px; | ||
background-color: #3a3433; | ||
color: white; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
padding: 0 10px; | ||
} | ||
|
||
.box-title { | ||
font-weight: bold; | ||
} | ||
|
||
.box-controls button { | ||
background: none; | ||
border: none; | ||
color: white; | ||
font-size: 14px; | ||
margin-left: 5px; | ||
cursor: pointer; | ||
} | ||
|
||
.box-controls button:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
.box-content { | ||
flex: 1; | ||
padding: 8px; | ||
background-color: #2f2a2a; | ||
overflow: auto; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {Component, OnInit} from '@angular/core'; | ||
import {FaceService} from '@app/services/face'; | ||
import {DomSanitizer, SafeResourceUrl} from '@angular/platform-browser'; | ||
|
||
@Component({ | ||
selector: 'app-face-monitor', | ||
templateUrl: './face-monitor.component.html', | ||
styleUrls: ['./face-monitor.component.scss'] | ||
}) | ||
export class ElementFaceMonitorComponent implements OnInit { | ||
|
||
constructor( | ||
private faceMonitorService: FaceService, | ||
private sanitizer: DomSanitizer | ||
) { | ||
this.faceMonitorService.isVisible$.subscribe(status => { | ||
this.isVisible = status; | ||
}); | ||
this.faceMonitorService.monitoringTabCount$.subscribe(count => { | ||
if (count > 0) { | ||
this.ready = true; | ||
} | ||
this.monitoringTabCount = count; | ||
if (this.ready && this.monitoringTabCount === 0) { | ||
this.isVisible = false; | ||
} | ||
}); | ||
} | ||
|
||
public faceMonitorUrl: SafeResourceUrl; | ||
public isMinimized = false; | ||
public isVisible = true; | ||
public monitoringTabCount = 0; | ||
public ready = false; | ||
|
||
ngOnInit() { | ||
this.faceMonitorUrl = this.sanitizer.bypassSecurityTrustResourceUrl('/facelive/monitor?token=' + this.faceMonitorService.getToken()); | ||
} | ||
|
||
minimizeBox() { | ||
this.isMinimized = !this.isMinimized; | ||
} | ||
|
||
closeBox() { | ||
this.isVisible = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.