mirror of https://github.com/abpframework/abp.git
5 changed files with 64 additions and 47 deletions
@ -1,47 +1,62 @@ |
|||||
import { Component, computed, inject } from '@angular/core'; |
import { Component, inject } from '@angular/core'; |
||||
import { NgIf } from '@angular/common' |
import { InternetConnectionService, LocalizationModule } from '@abp/ng.core'; |
||||
import { InternetConnectionService , LocalizationModule } from '@abp/ng.core'; |
import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; |
||||
|
|
||||
@Component({ |
@Component({ |
||||
selector: 'abp-internet-status', |
selector: 'abp-internet-status', |
||||
standalone: true, |
standalone: true, |
||||
imports:[NgIf, LocalizationModule], |
imports: [LocalizationModule, NgbTooltip], |
||||
template: ` |
template: ` |
||||
<div class="status-icon" *ngIf="!isOnline()"> |
@if (!isOnline()) { |
||||
<i data-toggle="tooltip" title="{{ 'AbpUi::InternetConnectionInfo' | abpLocalization }}" data-placement="left" class="fa fa-circle text-blinking blink"> |
<div class="status-icon"> |
||||
</i> |
<i |
||||
</div> |
ngbTooltip="{{ 'AbpUi::InternetConnectionInfo' | abpLocalization }}" |
||||
`,
|
container="body" |
||||
styles: [` |
placement="left-top" |
||||
.blink { |
class="fa fa-circle text-blinking blink" |
||||
animation: blinker 0.9s cubic-bezier(.5, 0, 1, 1) infinite alternate; |
> |
||||
} |
</i> |
||||
@keyframes blinker { |
</div> |
||||
0% { color:#c1c1c1 } |
|
||||
70% { color: #DC3545 } |
|
||||
100% { color: #DC3545 } |
|
||||
} |
} |
||||
|
`,
|
||||
|
styles: [ |
||||
|
` |
||||
|
.blink { |
||||
|
animation: blinker 0.9s cubic-bezier(0.5, 0, 1, 1) infinite alternate; |
||||
|
} |
||||
|
@keyframes blinker { |
||||
|
0% { |
||||
|
color: #c1c1c1; |
||||
|
} |
||||
|
70% { |
||||
|
color: #dc3545; |
||||
|
} |
||||
|
100% { |
||||
|
color: #dc3545; |
||||
|
} |
||||
|
} |
||||
|
|
||||
.text-blinking{ |
.text-blinking { |
||||
font-size:1.2rem; |
font-size: 1.2rem; |
||||
} |
} |
||||
|
|
||||
.status-icon{ |
.status-icon { |
||||
position: fixed; |
position: fixed; |
||||
z-index: 999999; |
z-index: 999999; |
||||
top: 10px; |
top: 10px; |
||||
right: 10px; |
right: 10px; |
||||
} |
} |
||||
|
|
||||
@media (width < 768px){ |
@media (width < 768px) { |
||||
.status-icon{ |
.status-icon { |
||||
top: 26px; |
top: 26px; |
||||
right: 134px; |
right: 134px; |
||||
|
} |
||||
} |
} |
||||
} |
`,
|
||||
`]
|
], |
||||
}) |
}) |
||||
export class InternetConnectionStatusComponent{ |
export class InternetConnectionStatusComponent { |
||||
internetConnectionService = inject(InternetConnectionService); |
internetConnectionService = inject(InternetConnectionService); |
||||
isOnline = this.internetConnectionService.networkStatus |
isOnline = this.internetConnectionService.networkStatus; |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue