webpackJsonp([12],{1164:function(t,s,n){"use strict";n.d(s,"a",(function(){return c}));var e=n(4),a=n(2),i=n(61),c=(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})();e.a([n.i(a.Input)("status"),e.b("design:type",Object)],c.prototype,"status",void 0),c=e.a([n.i(a.Component)({selector:"service",styles:[n(1273)],template:'\n  <ba-card>\n    <div [ngBusy]="busy" class="row">\n      <div class="col-md-2">\n        <span [ngClass]="status.state == \'RUNNING\' ? \'state-label-running\' : \'state-label-stopped\'" class="v-center"></span>\n      </div>\n      <div class="col-md-2">\n        <span class="v-center">{{ status.label }}</span>\n      </div>\n\n\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  '}),e.b("design:paramtypes",[i.b,i.a])],c)},1165:function(t,s,n){"use strict";n.d(s,"a",(function(){return c}));var e=n(30),a=n(947),i=[{path:"",pathMatch:"full",component:a.a}],c=e.a.forChild(i)},1273:function(t,s){t.exports=".state-label-stopped{width:12px;height:12px;margin-right:12px;background-color:#c0392b;border-radius:50%;box-shadow:#000 0 -1px 7px 1px, inset #e74c3c 0 -1px 9px, #c0392b 0 2px 12px}.state-label-running{width:12px;height:12px;margin-right:12px;background-color:#16a085;border-radius:50%;box-shadow:#000 0 -1px 7px 1px, inset #1abc9c 0 -1px 9px, #16a085 0 2px 12px}.v-center{display:table-cell;float:left}\n"},1274:function(t,s){t.exports=""},1278:function(t,s){t.exports='<service *ngFor="let service of services" [status]="service"></service>\n'},850:function(t,s,n){"use strict";Object.defineProperty(s,"__esModule",{value:!0}),n.d(s,"ServicesModule",(function(){return p}));var e=n(4),a=n(2),i=n(31),c=n(52),r=n(160),o=n(1164),l=n(947),u=n(1165),p=(function(){function t(){}return t})();p=e.a([n.i(a.NgModule)({imports:[i.CommonModule,c.a,r.a,u.a],declarations:[o.a,l.a],providers:[]})],p)},947:function(t,s,n){"use strict";n.d(s,"a",(function(){return c}));var e=n(4),a=n(2),i=n(61),c=(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})();c=e.a([n.i(a.Component)({selector:"services",styles:[n(1274)],template:n(1278)}),e.b("design:paramtypes",[i.b,i.a])],c)}});