mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
chore: improve wifi icons
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
"@angular/common": ">=13.2.0",
|
||||
"@angular/core": ">=13.2.0",
|
||||
"@start9labs/shared": ">=0.3.2",
|
||||
"@taiga-ui/cdk": "4.0.0-rc.5",
|
||||
"@taiga-ui/cdk": "4.0.0-rc.6",
|
||||
"@tinkoff/ng-dompurify": ">=4.0.0",
|
||||
"fuse.js": "^6.4.6"
|
||||
},
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB |
1
web/projects/shared/assets/taiga-ui/icons/wifi-high.svg
Normal file
1
web/projects/shared/assets/taiga-ui/icons/wifi-high.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wifi-high"><path d="M12 20h.01"/><path d="M5 12.859a10 10 0 0 1 14 0"/><path d="M8.5 16.429a5 5 0 0 1 7 0"/></svg>
|
||||
|
After Width: | Height: | Size: 317 B |
1
web/projects/shared/assets/taiga-ui/icons/wifi-low.svg
Normal file
1
web/projects/shared/assets/taiga-ui/icons/wifi-low.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wifi-low"><path d="M12 20h.01"/><path d="M8.5 16.429a5 5 0 0 1 7 0"/></svg>
|
||||
|
After Width: | Height: | Size: 278 B |
@@ -8,9 +8,9 @@
|
||||
"@ng-web-apis/mutation-observer": ">=4.0.0",
|
||||
"@ng-web-apis/resize-observer": ">=4.0.0",
|
||||
"@start9labs/emver": "^0.1.5",
|
||||
"@taiga-ui/cdk": "4.0.0-rc.5",
|
||||
"@taiga-ui/core": "4.0.0-rc.5",
|
||||
"@taiga-ui/experimental": "4.0.0-rc.5",
|
||||
"@taiga-ui/cdk": "4.0.0-rc.6",
|
||||
"@taiga-ui/core": "4.0.0-rc.6",
|
||||
"@taiga-ui/experimental": "4.0.0-rc.6",
|
||||
"@tinkoff/ng-dompurify": ">=4.0.0",
|
||||
"ansi-to-html": "^0.7.2"
|
||||
},
|
||||
|
||||
@@ -44,10 +44,10 @@ export class LogsWindowComponent {
|
||||
scroll = true
|
||||
|
||||
scrollTo(bottom: HTMLElement) {
|
||||
if (this.scroll) bottom.scrollIntoView({ behavior: 'smooth' })
|
||||
if (this.scroll) bottom.scrollIntoView()
|
||||
}
|
||||
|
||||
onBottom([{ isIntersecting }]: readonly IntersectionObserverEntry[]) {
|
||||
this.scroll = isIntersecting
|
||||
onBottom(entries: readonly IntersectionObserverEntry[]) {
|
||||
this.scroll = entries[entries.length - 1].isIntersecting
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<span *ngIf="spec.required">*</span>
|
||||
<select
|
||||
tuiSelect
|
||||
[placeholder]="spec.name"
|
||||
[items]="items"
|
||||
[disabledItemHandler]="disabledItemHandler"
|
||||
></select>
|
||||
|
||||
@@ -143,6 +143,10 @@ import { DependencyInfo } from '../types/dependency-info'
|
||||
gap: inherit;
|
||||
grid-column: span 4;
|
||||
}
|
||||
|
||||
:host-context(tui-root._mobile) {
|
||||
margin: 0;
|
||||
}
|
||||
`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
|
||||
@@ -22,50 +22,63 @@ import { SettingsWifiComponent } from './wifi.component'
|
||||
@Component({
|
||||
selector: '[wifi]',
|
||||
template: `
|
||||
<ng-container *ngFor="let network of wifi">
|
||||
<div *ngIf="network.ssid" tuiCell [style.padding]="0">
|
||||
<div tuiTitle>
|
||||
<strong>
|
||||
{{ network.ssid }}
|
||||
<tui-badge *ngIf="network.connected" appearance="success">
|
||||
Connected
|
||||
</tui-badge>
|
||||
</strong>
|
||||
@for (network of wifi; track $index) {
|
||||
@if (network.ssid) {
|
||||
<div tuiCell [style.padding]="0">
|
||||
<div tuiTitle>
|
||||
<strong>
|
||||
{{ network.ssid }}
|
||||
@if (network.connected) {
|
||||
<tui-badge appearance="success">Connected</tui-badge>
|
||||
}
|
||||
</strong>
|
||||
</div>
|
||||
@if (!network.connected) {
|
||||
<button
|
||||
tuiButton
|
||||
size="xs"
|
||||
appearance="opposite"
|
||||
(click)="prompt(network)"
|
||||
>
|
||||
Connect
|
||||
</button>
|
||||
}
|
||||
@if (network.connected !== undefined) {
|
||||
<button
|
||||
tuiIconButton
|
||||
size="s"
|
||||
appearance="icon"
|
||||
iconStart="@tui.trash-2"
|
||||
(click)="forget(network)"
|
||||
>
|
||||
Forget
|
||||
</button>
|
||||
} @else {
|
||||
<tui-icon
|
||||
[icon]="network.security.length ? '@tui.lock' : '@tui.lock-open'"
|
||||
/>
|
||||
}
|
||||
@if (getSignal(network.strength); as signal) {
|
||||
<tui-icon
|
||||
background="@tui.wifi"
|
||||
[icon]="signal.icon"
|
||||
[style.background]="'var(--tui-background-neutral-2)'"
|
||||
[style.color]="signal.color"
|
||||
/>
|
||||
} @else {
|
||||
<tui-icon icon="@tui.wifi-off" />
|
||||
}
|
||||
</div>
|
||||
<button
|
||||
*ngIf="!network.connected"
|
||||
tuiButton
|
||||
size="xs"
|
||||
appearance="opposite"
|
||||
(click)="prompt(network)"
|
||||
>
|
||||
Connect
|
||||
</button>
|
||||
<button
|
||||
*ngIf="network.connected !== undefined; else strength"
|
||||
tuiIconButton
|
||||
size="s"
|
||||
appearance="icon"
|
||||
iconStart="@tui.trash-2"
|
||||
(click)="forget(network)"
|
||||
>
|
||||
Forget
|
||||
</button>
|
||||
<ng-template #strength>
|
||||
<tui-icon
|
||||
[style.width.rem]="2"
|
||||
[icon]="network.security.length ? '@tui.lock' : '@tui.lock-open'"
|
||||
/>
|
||||
</ng-template>
|
||||
<img
|
||||
[src]="getSignal(network.strength)"
|
||||
[style.width.rem]="2"
|
||||
alt="Signal Strength: {{ network.strength }}"
|
||||
/>
|
||||
</div>
|
||||
</ng-container>
|
||||
}
|
||||
}
|
||||
`,
|
||||
host: { style: 'align-items: stretch' },
|
||||
styles: `
|
||||
tui-icon {
|
||||
width: 2rem;
|
||||
color: var(--tui-text-tertiary);
|
||||
}
|
||||
`,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [CommonModule, TuiCell, TuiTitle, TuiBadge, TuiButton, TuiIcon],
|
||||
@@ -81,20 +94,27 @@ export class WifiTableComponent {
|
||||
@Input()
|
||||
wifi: readonly Wifi[] = []
|
||||
|
||||
getSignal(signal: number): string {
|
||||
getSignal(signal: number) {
|
||||
if (signal < 5) {
|
||||
return 'assets/img/icons/wifi-0.png'
|
||||
return null
|
||||
}
|
||||
|
||||
if (signal >= 5 && signal < 50) {
|
||||
return 'assets/img/icons/wifi-1.png'
|
||||
return {
|
||||
icon: '@tui.wifi-low',
|
||||
color: 'var(--tui-text-negative)',
|
||||
}
|
||||
}
|
||||
|
||||
if (signal >= 50 && signal < 90) {
|
||||
return 'assets/img/icons/wifi-2.png'
|
||||
}
|
||||
|
||||
return 'assets/img/icons/wifi-3.png'
|
||||
return signal >= 50 && signal < 90
|
||||
? {
|
||||
icon: '@tui.wifi-high',
|
||||
color: 'var(--tui-status-warning)',
|
||||
}
|
||||
: {
|
||||
icon: '@tui.wifi',
|
||||
color: 'var(--tui-text-positive)',
|
||||
}
|
||||
}
|
||||
|
||||
async forget({ ssid }: Wifi): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user