webpackJsonp([12],{1122:function(t,s,e){"use strict";var n=e(4),a=e(2),i=e(65);e.d(s,"a",(function(){return r}));var r=(function(){function t(t,s){this.rest=t,this.ws=s}return t.prototype.toggle=function(){var t,s=this;t="RUNNING"!=this.status.state?"service.start":"service.stop",this.busy=this.ws.call(t,[this.status.service]).subscribe((function(t){s.status.state=t?"RUNNING":"STOPPED"}))},t.prototype.enableToggle=function(t){var s=this;this.busy=this.ws.call("service.update",[this.status.id,{enable:this.status.enable}]).subscribe((function(t){t||(s.status.enable=!s.status.enable)}))},t})();n.a([e.i(a.Input)("status"),n.b("design:type",Object)],r.prototype,"status",void 0),r=n.a([e.i(a.Component)({selector:"service",styles:[e(1202)],template:'\n  <ba-card>\n    <div [ngBusy]="busy" class="row">\n      <div class="col-md-2">\n        <span class="v-center">{{ status.label }}</span>\n      </div>\n\n      <div class="col-md-2">\n        <span [ngClass]="status.state == \'RUNNING\' ? \'state-label-running\' : \'state-label-stopped\'" class="v-center">{{ status.state }}</span>\n      </div>\n\n      <div class="col-md-2">\n        <button class="btn btn-primary" (click)="toggle()">\n          <i [ngClass]="status.state == \'RUNNING\' ? \'ion-stop\' : \'ion-power\'"></i>\n          <span *ngIf="status.state != \'RUNNING\'">Start</span>\n          <span *ngIf="status.state == \'RUNNING\'">Stop</span>\n        </button>\n      </div>\n\n      <div class="col-md-2">\n        <ba-checkbox [(ngModel)]="status.enable" (change)="enableToggle($event)" [label]="\'Start on Boot\'" [baCheckboxClass]="\'v-center\'"></ba-checkbox>\n      </div>\n\n      <div class="col-md-1">\n        <button class="btn btn-primary">\n          <i class="ion-wrench"></i>\n          <span>Edit</span>\n        </button>\n      </div>\n    </div>\n  </ba-card>\n  '}),n.b("design:paramtypes",[i.b,i.a])],r)},1123:function(t,s,e){"use strict";var n=e(30),a=e(935);e.d(s,"a",(function(){return r}));var i=[{path:"",pathMatch:"full",component:a.a}],r=n.a.forChild(i)},1202:function(t,s){t.exports=".state-label-stopped{background-color:red;text-align:center;border-radius:5px;padding-left:5px;padding-right:5px}.state-label-running{background-color:green;text-align:center;font-style:italic;border-radius:5px;padding-left:5px;padding-right:5px}.v-center{height:30px;display:table-cell;vertical-align:middle}\n"},1203:function(t,s){t.exports=""},1207:function(t,s){t.exports='<service *ngFor="let service of services" [status]="service"></service>\n'},849:function(t,s,e){"use strict";Object.defineProperty(s,"__esModule",{value:!0});var n=e(4),a=e(2),i=e(31),r=e(52),c=e(160),o=e(1122),l=e(935),u=e(1123);e.d(s,"ServicesModule",(function(){return p}));var p=(function(){function t(){}return t})();p=n.a([e.i(a.NgModule)({imports:[i.CommonModule,r.a,c.a,u.a],declarations:[o.a,l.a],providers:[]})],p)},935:function(t,s,e){"use strict";var n=e(4),a=e(2),i=e(65);e.d(s,"a",(function(){return r}));var r=(function(){function t(t,s){this.rest=t,this.ws=s,this.NAME_MAP={afp:"AFP",domaincontroller:"Domain Controller",dynamicdns:"Dynamic DNS",ftp:"FTP",iscsitarget:"iSCSI",lldp:"LLDP",nfs:"NFS",rsync:"Rsync",s3:"S3",smartd:"S.M.A.R.T.",snmp:"SNMP",ssh:"SSH",cifs:"SMB",tftp:"TFTP",ups:"UPS",webdav:"WebDAV"}}return t.prototype.ngOnInit=function(){var t=this;this.busy=this.ws.call("service.query",[[],{order_by:["service"]}]).subscribe((function(s){t.services=s,t.services.forEach((function(s){t.NAME_MAP[s.service]?s.label=t.NAME_MAP[s.service]:s.label=s.service}))}))},t})();r=n.a([e.i(a.Component)({selector:"services",styles:[e(1203)],template:e(1207)}),n.b("design:paramtypes",[i.b,i.a])],r)}});