mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Uploader uses configurable host address
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
import {Component, NgZone} from 'angular2/core';
|
import {Component, NgZone} from 'angular2/core';
|
||||||
import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
|
import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
|
||||||
|
import {AlfrescoSettingsService} from 'ng2-alfresco-core/services';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'alfresco-uploader',
|
selector: 'alfresco-uploader',
|
||||||
@@ -61,8 +62,15 @@ import {UPLOAD_DIRECTIVES} from 'ng2-uploader/ng2-uploader';
|
|||||||
})
|
})
|
||||||
export class UploaderComponent {
|
export class UploaderComponent {
|
||||||
uploadFile:any;
|
uploadFile:any;
|
||||||
options:Object = {
|
options:Object;
|
||||||
url: 'http://192.168.99.100:8080/alfresco/service/api/upload',
|
|
||||||
|
zone:NgZone;
|
||||||
|
dropProgress:number = 0;
|
||||||
|
dropResp:any[] = [];
|
||||||
|
|
||||||
|
constructor(settings:AlfrescoSettingsService) {
|
||||||
|
this.options = {
|
||||||
|
url: settings.host + '/alfresco/service/api/upload',
|
||||||
withCredentials: true,
|
withCredentials: true,
|
||||||
authToken: btoa('admin:admin'),
|
authToken: btoa('admin:admin'),
|
||||||
authTokenPrefix: 'Basic',
|
authTokenPrefix: 'Basic',
|
||||||
@@ -72,12 +80,6 @@ export class UploaderComponent {
|
|||||||
containerid: 'documentLibrary'
|
containerid: 'documentLibrary'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
zone:NgZone;
|
|
||||||
dropProgress:number = 0;
|
|
||||||
dropResp:any[] = [];
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.zone = new NgZone({enableLongStackTrace: false});
|
this.zone = new NgZone({enableLongStackTrace: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user