mirror of
https://github.com/dkmstr/openuds-gui.git
synced 2025-03-11 04:58:21 +03:00
Refactor actor CSS class and download logic
This commit is contained in:
parent
ebb27dad0f
commit
706107e66c
@ -9,7 +9,7 @@
|
||||
</div>
|
||||
|
||||
<div class="actors">
|
||||
<div [class]="css(p.name)" *ngFor="let p of actors" (click)="api.download(p.url)">
|
||||
<div [class]="css(p)" *ngFor="let p of actors" (click)="api.download(p.url)">
|
||||
<div class="image">
|
||||
<img [src]="img(p.name)">
|
||||
</div>
|
||||
@ -23,7 +23,6 @@
|
||||
<div class="info">
|
||||
<ul>
|
||||
<li><uds-translate>Always download the UDS actor matching your platform</uds-translate></li>
|
||||
<li><uds-translate>Legacy actors are only provided for old operating system support. Try to avoid them.</uds-translate></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
@ -17,7 +17,7 @@ export class DownloadsComponent implements OnInit {
|
||||
this.actors = []; // Put legacy at end of downloadables...
|
||||
const legacy: Downloadable[] = [];
|
||||
for (const a of this.api.actors) {
|
||||
if (a.name.includes('legacy')) {
|
||||
if (a.legacy) {
|
||||
legacy.push(a);
|
||||
} else {
|
||||
this.actors.push(a);
|
||||
@ -41,9 +41,9 @@ export class DownloadsComponent implements OnInit {
|
||||
return this.api.staticURL('modern/img/' + image + '.png');
|
||||
}
|
||||
|
||||
css(filename: string): string[] {
|
||||
css(downloadable: Downloadable): string[] {
|
||||
const styles = ['actor'];
|
||||
if (filename.toLowerCase().includes('legacy')) {
|
||||
if (downloadable.legacy) {
|
||||
styles.push('legacy');
|
||||
}
|
||||
return styles;
|
||||
|
Loading…
x
Reference in New Issue
Block a user