mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-20 03:51:00 +00:00
clean up mock data and update device interface
This commit is contained in:
parent
aebcc495f9
commit
f250425ef1
@ -1,5 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { SystemConfigService } from 'src/app/system-config.service';
|
||||
import { Folder } from '../../folder'
|
||||
import { cardElevation } from '../../style'
|
||||
|
||||
@Component({
|
||||
@ -10,6 +11,7 @@ import { cardElevation } from '../../style'
|
||||
export class FolderChartComponent implements OnInit {
|
||||
chartID: string = 'foldersChart';
|
||||
elevation: string = cardElevation;
|
||||
data: Folder[];
|
||||
|
||||
constructor(private systemConfigService: SystemConfigService) { }
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
export interface Device {
|
||||
id: string;
|
||||
deviceID: string;
|
||||
name: string;
|
||||
|
||||
// TODO add additional properties
|
||||
|
@ -68,7 +68,7 @@ export class DeviceListDataSource extends DataSource<Device> {
|
||||
const isAsc = this.sort.direction === 'asc';
|
||||
switch (this.sort.active) {
|
||||
case 'name': return compare(a.name, b.name, isAsc);
|
||||
case 'id': return compare(+a.id, +b.id, isAsc);
|
||||
case 'id': return compare(+a.deviceID, +b.deviceID, isAsc);
|
||||
default: return 0;
|
||||
}
|
||||
});
|
||||
|
@ -3,7 +3,7 @@
|
||||
<!-- Id Column -->
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>Id</th>
|
||||
<td mat-cell *matCellDef="let row">{{row.id}}</td>
|
||||
<td mat-cell *matCellDef="let row">{{row.deviceID}}</td>
|
||||
</ng-container>
|
||||
|
||||
<!-- Name Column -->
|
||||
|
@ -1,17 +0,0 @@
|
||||
import { Folder } from './folder';
|
||||
import { Device } from './device';
|
||||
|
||||
export const FOLDERS: Folder[] = [
|
||||
{ id: 'GXWxf-3zgnU', label: 'Downloads' },
|
||||
{ id: 'PXWxf-3zgnU', label: 'Music' },
|
||||
{ id: 'QXWxf-3zgnU', label: 'Photos' },
|
||||
{ id: 'RXWxf-3zgnU', label: 'Movies' },
|
||||
{ id: 'SXWxf-3zgnU', label: 'Folder 5' },
|
||||
];
|
||||
|
||||
export const DEVICES: Device[] = [
|
||||
{ id: '001', name: 'macbook' },
|
||||
{ id: '002', name: 'bedroom computer' },
|
||||
{ id: '003', name: 'server in closet' },
|
||||
{ id: '004', name: 'random' },
|
||||
];
|
@ -6,7 +6,6 @@ import { map } from 'rxjs/operators';
|
||||
|
||||
import { Folder } from './folder';
|
||||
import { Device } from './device';
|
||||
import { FOLDERS, DEVICES } from './mock-config-data';
|
||||
import { CookieService } from './cookie.service';
|
||||
import { environment } from '../environments/environment'
|
||||
import { apiURL } from './api-utils'
|
||||
|
Loading…
Reference in New Issue
Block a user