mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-27 02:41:53 +00:00
update to Angular 13 and Ionic 6
This commit is contained in:
committed by
Aiden McClelland
parent
48c2833112
commit
d380c57668
@@ -26,7 +26,8 @@
|
||||
</div>
|
||||
|
||||
<ng-template #list>
|
||||
<ion-item-group *ngIf="pkgs.length">
|
||||
<ng-container *ngIf="pkgs.length">
|
||||
<!-- header -->
|
||||
<ion-item-divider>
|
||||
{{ reordering ? 'Reorder' : 'Installed Services' }}
|
||||
<ion-button slot="end" fill="clear" (click)="toggleReorder()">
|
||||
@@ -89,50 +90,44 @@
|
||||
</ion-grid>
|
||||
|
||||
<!-- reordering -->
|
||||
<ion-grid *ngIf="reordering">
|
||||
<ion-row>
|
||||
<ion-col size="12" style="padding: 0;">
|
||||
<ion-reorder-group disabled="false" (ionItemReorder)="reorder($event)">
|
||||
<div *ngFor="let pkg of pkgs" style="padding: 5px;">
|
||||
<ion-reorder>
|
||||
<ion-item style="--background: var(--ion-color-medium-shade);">
|
||||
<div
|
||||
*ngIf="!pkg.error"
|
||||
slot="start"
|
||||
class="bulb"
|
||||
[style.background-color]="connectionFailure ? 'var(--ion-color-dark)' : 'var(--ion-color-' + pkg.primaryRendering.color + ')'"
|
||||
></div>
|
||||
<ion-icon
|
||||
*ngIf="pkg.error"
|
||||
slot="start"
|
||||
class="warning-icon"
|
||||
name="warning-outline"
|
||||
size="small"
|
||||
color="warning"
|
||||
></ion-icon>
|
||||
<ion-thumbnail slot="start" class="ion-margin-start">
|
||||
<img [src]="pkg.entry['static-files'].icon" />
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<h2>{{ pkg.entry.manifest.title }}</h2>
|
||||
<p>{{ pkg.entry.manifest.version | displayEmver }}</p>
|
||||
<status
|
||||
[disconnected]="connectionFailure"
|
||||
[rendering]="pkg.primaryRendering"
|
||||
[installProgress]="pkg.installProgress?.totalProgress"
|
||||
weight="bold"
|
||||
size="small"
|
||||
></status>
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="reorder-three" color="dark"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-reorder>
|
||||
</div>
|
||||
</ion-reorder-group>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
</ion-item-group>
|
||||
<ion-list>
|
||||
<ion-reorder-group *ngIf="reordering" disabled="false" (ionItemReorder)="reorder($event)">
|
||||
<ion-reorder *ngFor="let pkg of pkgs">
|
||||
<ion-item style="--background: var(--ion-color-medium-shade);">
|
||||
<div
|
||||
*ngIf="!pkg.error"
|
||||
slot="start"
|
||||
class="bulb"
|
||||
[style.background-color]="connectionFailure ? 'var(--ion-color-dark)' : 'var(--ion-color-' + pkg.primaryRendering.color + ')'"
|
||||
></div>
|
||||
<ion-icon
|
||||
*ngIf="pkg.error"
|
||||
slot="start"
|
||||
class="warning-icon"
|
||||
name="warning-outline"
|
||||
size="small"
|
||||
color="warning"
|
||||
></ion-icon>
|
||||
<ion-thumbnail slot="start" class="ion-margin-start">
|
||||
<img [src]="pkg.entry['static-files'].icon" />
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<h2>{{ pkg.entry.manifest.title }}</h2>
|
||||
<p>{{ pkg.entry.manifest.version | displayEmver }}</p>
|
||||
<status
|
||||
[disconnected]="connectionFailure"
|
||||
[rendering]="pkg.primaryRendering"
|
||||
[installProgress]="pkg.installProgress?.totalProgress"
|
||||
weight="bold"
|
||||
size="small"
|
||||
></status>
|
||||
</ion-label>
|
||||
<ion-icon slot="end" name="reorder-three" color="dark"></ion-icon>
|
||||
</ion-item>
|
||||
</ion-reorder>
|
||||
</ion-reorder-group>
|
||||
</ion-list>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="recoveredPkgs.length && !reordering">
|
||||
<ion-item-group>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { ItemReorderEventDetail } from '@ionic/core'
|
||||
import { ConfigService } from 'src/app/services/config.service'
|
||||
import { ConnectionFailure, ConnectionService } from 'src/app/services/connection.service'
|
||||
import { PatchDbService } from 'src/app/services/patch-db/patch-db.service'
|
||||
@@ -104,23 +105,14 @@ export class AppListPage {
|
||||
|
||||
toggleReorder (): void {
|
||||
if (this.reordering) {
|
||||
const newPkgs = []
|
||||
this.order.forEach(id => {
|
||||
const pkg = this.pkgs.find(pkg => pkg.entry.manifest.id === id)
|
||||
if (pkg) {
|
||||
newPkgs.push(pkg)
|
||||
}
|
||||
})
|
||||
this.pkgs = newPkgs
|
||||
this.order = this.pkgs.map(pkg => pkg.entry.manifest.id)
|
||||
this.setOrder()
|
||||
}
|
||||
this.reordering = !this.reordering
|
||||
}
|
||||
|
||||
async reorder (ev: any): Promise<void> {
|
||||
ev.detail.complete()
|
||||
const toMove = this.order.splice(ev.detail.from, 1)[0]
|
||||
this.order.splice(ev.detail.to, 0, toMove)
|
||||
async reorder (ev: CustomEvent<ItemReorderEventDetail>): Promise<void> {
|
||||
this.pkgs = ev.detail.complete(this.pkgs)
|
||||
}
|
||||
|
||||
async install (pkg: RecoveredInfo): Promise<void> {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core'
|
||||
import * as marked from 'marked'
|
||||
import { marked } from 'marked'
|
||||
import * as DOMPurify from 'dompurify'
|
||||
|
||||
@Pipe({
|
||||
name: 'markdown',
|
||||
@@ -7,7 +8,9 @@ import * as marked from 'marked'
|
||||
export class MarkdownPipe implements PipeTransform {
|
||||
transform (value: any): any {
|
||||
if (value && value.length > 0) {
|
||||
return marked(value)
|
||||
const html = marked(value)
|
||||
const sanitized = DOMPurify.sanitize(html)
|
||||
return sanitized
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
@@ -182,14 +182,8 @@ ion-button {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.modal-wrapper.sc-ion-modal-md {
|
||||
border-radius: 6px;
|
||||
border: 2px solid rgba(255,255,255,.03);
|
||||
box-shadow: 0 0 70px 70px black;
|
||||
}
|
||||
|
||||
.qr-modal {
|
||||
.modal-wrapper {
|
||||
&::part(content) {
|
||||
width: 400px !important;
|
||||
height: 400px !important;
|
||||
top: unset !important;
|
||||
@@ -197,28 +191,31 @@ ion-button {
|
||||
}
|
||||
}
|
||||
|
||||
.modal-wrapper {
|
||||
ion-modal::part(content) {
|
||||
position: absolute;
|
||||
height: 90% !important;
|
||||
top: 5%;
|
||||
width: 90% !important;
|
||||
left: 5%;
|
||||
display: block;
|
||||
|
||||
border-radius: 6px;
|
||||
border: 2px solid rgba(255,255,255,.03);
|
||||
box-shadow: 0 0 70px 70px black;
|
||||
}
|
||||
|
||||
@media (min-width:1000px) {
|
||||
.modal-wrapper {
|
||||
ion-modal::part(content) {
|
||||
position: absolute;
|
||||
height: 80% !important;
|
||||
top: 10%;
|
||||
width: 50% !important;
|
||||
left: 25%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.alertlike-modal {
|
||||
.modal-wrapper {
|
||||
&::part(content) {
|
||||
max-height: 380px !important;
|
||||
top: 25% !important;
|
||||
width: 90% !important;
|
||||
@@ -229,7 +226,7 @@ ion-button {
|
||||
|
||||
@media (min-width:1000px) {
|
||||
.alertlike-modal {
|
||||
.modal-wrapper {
|
||||
&::part(content) {
|
||||
width: 60% !important;
|
||||
left: 20% !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user