mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-04 22:39:46 +00:00
Refactor AppListPage
This commit is contained in:
committed by
Aiden McClelland
parent
ee81ca111b
commit
60b9f2566a
@@ -6,5 +6,5 @@
|
|||||||
color="warning"
|
color="warning"
|
||||||
></ion-icon>
|
></ion-icon>
|
||||||
<ng-template #bulb>
|
<ng-template #bulb>
|
||||||
<div class="bulb" [style.background-color]="getColor(pkg)"></div>
|
<div class="bulb" [style.background-color]="color"></div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export class AppListIconComponent {
|
|||||||
@Input()
|
@Input()
|
||||||
connectionFailure = false;
|
connectionFailure = false;
|
||||||
|
|
||||||
getColor(pkg: PkgInfo): string {
|
get color(): string {
|
||||||
return this.connectionFailure
|
return this.connectionFailure
|
||||||
? "var(--ion-color-dark)"
|
? "var(--ion-color-dark)"
|
||||||
: "var(--ion-color-" + pkg.primaryRendering.color + ")";
|
: "var(--ion-color-" + this.pkg.primaryRendering.color + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
<ion-item
|
<ion-item button detail="false" [routerLink]="['/services', manifest.id]">
|
||||||
button
|
|
||||||
detail="false"
|
|
||||||
[routerLink]="['/services', pkg.entry.manifest.id]"
|
|
||||||
>
|
|
||||||
<app-list-icon
|
<app-list-icon
|
||||||
slot="start"
|
slot="start"
|
||||||
[pkg]="pkg"
|
[pkg]="pkg"
|
||||||
@@ -12,8 +8,8 @@
|
|||||||
<img alt="" [src]="pkg.entry['static-files'].icon" />
|
<img alt="" [src]="pkg.entry['static-files'].icon" />
|
||||||
</ion-thumbnail>
|
</ion-thumbnail>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<h2>{{ pkg.entry.manifest.title }}</h2>
|
<h2>{{ manifest.title }}</h2>
|
||||||
<p>{{ pkg.entry.manifest.version | displayEmver }}</p>
|
<p>{{ manifest.version | displayEmver }}</p>
|
||||||
<status
|
<status
|
||||||
[disconnected]="connectionFailure"
|
[disconnected]="connectionFailure"
|
||||||
[rendering]="pkg.primaryRendering"
|
[rendering]="pkg.primaryRendering"
|
||||||
@@ -23,19 +19,12 @@
|
|||||||
></status>
|
></status>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
<ion-button
|
<ion-button
|
||||||
*ngIf="pkg.entry.manifest.interfaces | hasUi"
|
*ngIf="manifest.interfaces | hasUi"
|
||||||
slot="end"
|
slot="end"
|
||||||
fill="clear"
|
fill="clear"
|
||||||
color="primary"
|
color="primary"
|
||||||
(click)="launchUi(pkg.entry)"
|
(click)="launchUi(pkg.entry)"
|
||||||
[disabled]="
|
[disabled]="!(pkg.entry.state | isLaunchable: status:manifest.interfaces)"
|
||||||
!(
|
|
||||||
pkg.entry.state
|
|
||||||
| isLaunchable
|
|
||||||
: pkg.entry.installed?.status.main.status
|
|
||||||
: pkg.entry.manifest.interfaces
|
|
||||||
)
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<ion-icon slot="icon-only" name="open-outline"></ion-icon>
|
<ion-icon slot="icon-only" name="open-outline"></ion-icon>
|
||||||
</ion-button>
|
</ion-button>
|
||||||
|
|||||||
@@ -5,7 +5,10 @@ import {
|
|||||||
Inject,
|
Inject,
|
||||||
Input,
|
Input,
|
||||||
} from "@angular/core";
|
} from "@angular/core";
|
||||||
import { PackageDataEntry } from "src/app/services/patch-db/data-model";
|
import {
|
||||||
|
PackageMainStatus,
|
||||||
|
PackageDataEntry, Manifest,
|
||||||
|
} from "src/app/services/patch-db/data-model";
|
||||||
import { ConfigService } from "src/app/services/config.service";
|
import { ConfigService } from "src/app/services/config.service";
|
||||||
import { PkgInfo } from "src/app/util/get-package-info";
|
import { PkgInfo } from "src/app/util/get-package-info";
|
||||||
|
|
||||||
@@ -26,10 +29,12 @@ export class AppListPkgComponent {
|
|||||||
private readonly config: ConfigService
|
private readonly config: ConfigService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
getColor(pkg: PkgInfo): string {
|
get status(): PackageMainStatus {
|
||||||
return this.connectionFailure
|
return this.pkg.entry.installed?.status.main.status;
|
||||||
? "var(--ion-color-dark)"
|
}
|
||||||
: "var(--ion-color-" + pkg.primaryRendering.color + ")";
|
|
||||||
|
get manifest(): Manifest {
|
||||||
|
return this.pkg.entry.manifest;
|
||||||
}
|
}
|
||||||
|
|
||||||
launchUi(pkg: PackageDataEntry): void {
|
launchUi(pkg: PackageDataEntry): void {
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
:host {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
--background: var(--ion-color-medium-shade);
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
@Component({
|
@Component({
|
||||||
selector: "app-list-reorder",
|
selector: "app-list-reorder",
|
||||||
templateUrl: "app-list-reorder.component.html",
|
templateUrl: "app-list-reorder.component.html",
|
||||||
|
styleUrls: ["app-list-reorder.component.scss"],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class AppListReorderComponent {
|
export class AppListReorderComponent {
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
ion-item-divider {
|
ion-item-divider {
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item {
|
|
||||||
--background: var(--ion-color-medium-shade);
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user