Skip to content

Commit

Permalink
On control page integrated the message (instead of just showing the m…
Browse files Browse the repository at this point in the history
…essage as text) for reloading the archive[Migrate UI to Angular 2 #440]
  • Loading branch information
shral committed Mar 10, 2017
1 parent 0ba46db commit e640f79
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
1 change: 1 addition & 0 deletions dcm4chee-arc-ui2/src/app/app.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export class AppService implements OnInit, OnDestroy{
createPatient$ = this.createPatientSource.asObservable();
// Service message commands
setMessage(msg: any) {
console.log("in set message",msg);
this.setMessageSource.next(msg);
}
setGlobal(object: any) {
Expand Down
1 change: 0 additions & 1 deletion dcm4chee-arc-ui2/src/app/control/control.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ <h3>Archive</h3>
<button type="button" class="btn btn-default" (click)="reload()" title="Reload Archive Configuration">Reload</button>
<button type="button" class="btn btn-default" (click)="fetchStatus()" title="Fetch Archive Status">Status</button>
</div>
<p [innerHtml]="message"></p>
<div class="monitor">
<!-- <code> -->
<h3>Monitoring</h3>
Expand Down
17 changes: 11 additions & 6 deletions dcm4chee-arc-ui2/src/app/control/control.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import 'rxjs/add/operator/catch';
import * as FileSaver from "file-saver";
import {AppService} from "../app.service";
import {SlimLoadingBarService} from "ng2-slim-loading-bar";
import {MessagingComponent} from "../widgets/messaging/messaging.component";

@Component({
selector: 'app-control',
templateUrl: './control.component.html',
styleUrls: ['./control.component.css'],
providers: [AppService]
styleUrls: ['./control.component.css']
})
export class ControlComponent implements OnInit {
export class ControlComponent {
updaterate:any = 3;
// logoutUrl = myApp.logoutUrl();
status:any;
Expand All @@ -22,8 +22,7 @@ export class ControlComponent implements OnInit {
others = false;
associationStatus;
// myValue = 10;
constructor(public $http: Http, public appservices:AppService, private cfpLoadingBar:SlimLoadingBarService ) {}
ngOnInit() {
constructor(public $http: Http, public appservices:AppService, private cfpLoadingBar:SlimLoadingBarService,public messaging:MessagingComponent) {
this.fetchStatus();
this.cfpLoadingBar.interval = 200;
}
Expand Down Expand Up @@ -51,9 +50,15 @@ export class ControlComponent implements OnInit {
});
};
reload() {
let $this = this;
this.$http.post("/dcm4chee-arc/ctrl/reload",{}).subscribe((res) => {
console.log("res",res);
this.message = 'Reload successful';
// $this.message = 'Reload successful';
$this.appservices.setMessage({
"title": "Info",
"text": "Reload successful",
"status":'info'
});
});
};

Expand Down
9 changes: 0 additions & 9 deletions dcm4chee-arc-ui2/src/app/studies/studies.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,20 +608,11 @@ export class StudiesComponent implements OnDestroy{
};
studyReceiveDateTimeChanged(e,mode){
this.filter["StudyReceiveDateTime"] = this.filter["StudyReceiveDateTime"] || {};
console.log("StudyReceiveDateTime=",this.StudyReceiveDateTime);
this['StudyReceiveDateTime'][mode] = e;
if(this.StudyReceiveDateTime.from && this.StudyReceiveDateTime.to){
/* var dd = this.StudyReceiveDateTime.from.getDate();
var mm = this.StudyReceiveDateTime.from.getMonth()+1; //January is 0!
var yyyy = this.StudyReceiveDateTime.from.getFullYear();
console.log("date",yyyy+'-'+mm+'-'+dd);*/
let datePipeEn = new DatePipe('us-US');
console.log("yy=",datePipeEn.transform(this.StudyReceiveDateTime.from, 'yyyyMMddHHmmss'));
this.filter["StudyReceiveDateTime"] = datePipeEn.transform(this.StudyReceiveDateTime.from, 'yyyyMMddHHmmss') + '-' + datePipeEn.transform(this.StudyReceiveDateTime.to, 'yyyyMMddHHmmss');
}else{
console.log("in else",this.StudyReceiveDateTime);
}
console.log("filter",this.filter);
}
deleteRejectedInstances(){
// let result = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class MessagingComponent implements OnDestroy{
});
}
setMsg(msg:any){
console.log("in setmessage in messaging.component",msg);
let timeout = msg.timeout || this.msgTimeout;
let isInArray = false;
let presentId = "";
Expand Down

0 comments on commit e640f79

Please sign in to comment.