blob: 7a7fa217b5dfb46e0fa07d07e54025cc06018663 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
import { Component, Input, Pipe, PipeTransform } from '@angular/core';
import { ConfigService, IProject, ProjectType } from "../services/config.service";
@Component({
selector: 'project-card',
template: `
<div class="row">
<div class="col-xs-12">
<div class="text-right" role="group">
<button class="btn btn-link" (click)="delete(project)"><span class="fa fa-trash fa-size-x2"></span></button>
</div>
</div>
</div>
<table class="table table-striped">
<tbody>
<tr>
<th><span class="fa fa-fw fa-id-badge"></span> <span>Project ID</span></th>
<td>{{ project.id }}</td>
</tr>
<tr>
<th><span class="fa fa-fw fa-folder-open-o"></span> <span>Folder path</span></th>
<td>{{ project.path}}</td>
</tr>
<tr>
<th><span class="fa fa-fw fa-exchange"></span> <span>Synchronization type</span></th>
<td>{{ project.type | readableType }}</td>
</tr>
</tbody>
</table >
`,
styleUrls: ['./app/config/config.component.css']
})
export class ProjectCardComponent {
@Input() project: IProject;
constructor(private configSvr: ConfigService) {
}
delete(prj: IProject) {
this.configSvr.deleteProject(prj);
}
}
// Remove APPS. prefix if translate has failed
@Pipe({
name: 'readableType'
})
export class ProjectReadableTypePipe implements PipeTransform {
transform(type: ProjectType): string {
switch (+type) {
case ProjectType.NATIVE: return "Native";
case ProjectType.SYNCTHING: return "Cloud (Syncthing)";
default: return String(type);
}
}
}
|