1 import { Component, Input, Pipe, PipeTransform } from '@angular/core';
2 import { ConfigService, IProject, ProjectType } from "../common/config.service";
5 selector: 'project-card',
8 <div class="col-xs-12">
9 <div class="text-right" role="group">
10 <button class="btn btn-link" (click)="delete(project)"><span class="fa fa-trash fa-size-x2"></span></button>
15 <table class="table table-striped">
18 <th><span class="fa fa-fw fa-id-badge"></span> <span>Project ID</span></th>
19 <td>{{ project.id }}</td>
22 <th><span class="fa fa-fw fa-folder-open-o"></span> <span>Folder path</span></th>
23 <td>{{ project.path}}</td>
26 <th><span class="fa fa-fw fa-exchange"></span> <span>Synchronization type</span></th>
27 <td>{{ project.type | readableType }}</td>
33 styleUrls: ['./app/config/config.component.css']
36 export class ProjectCardComponent {
38 @Input() project: IProject;
40 constructor(private configSvr: ConfigService) {
44 delete(prj: IProject) {
45 this.configSvr.deleteProject(prj);
50 // Remove APPS. prefix if translate has failed
55 export class ProjectReadableTypePipe implements PipeTransform {
56 transform(type: ProjectType): string {
58 case ProjectType.NATIVE: return "Native";
59 case ProjectType.SYNCTHING: return "Cloud (Syncthing)";
60 default: return String(type);