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