diff options
author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-05-05 01:37:38 +0200 |
---|---|---|
committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-05-05 01:37:38 +0200 |
commit | 7d7c18239582f8dcc5337a573c02033c0f5c3194 (patch) | |
tree | cb64f2775335cdd856e81ec9e8ba0bed93fa0985 /frontend/src/app/_elements/form-dataset/form-dataset.component.ts | |
parent | 60a0c91d48917babd52272f2ddf2a6bb3599e06a (diff) | |
parent | bdabccc6e8f4d35085a4defe61c579ea0002f798 (diff) |
Merge branch 'redesign' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into Guest-Koristik-Ispravka-FrontEnd
Diffstat (limited to 'frontend/src/app/_elements/form-dataset/form-dataset.component.ts')
-rw-r--r-- | frontend/src/app/_elements/form-dataset/form-dataset.component.ts | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/frontend/src/app/_elements/form-dataset/form-dataset.component.ts b/frontend/src/app/_elements/form-dataset/form-dataset.component.ts index 62afaa47..1eed2cdc 100644 --- a/frontend/src/app/_elements/form-dataset/form-dataset.component.ts +++ b/frontend/src/app/_elements/form-dataset/form-dataset.component.ts @@ -41,6 +41,10 @@ export class FormDatasetComponent { //@ViewChild('fileImportInput', { static: false }) fileImportInput: any; cemu je ovo sluzilo? + clear(){ + this.tableData.hasInput = false; + } + changeListener($event: any): void { this.files = $event.srcElement.files; if (this.files.length == 0 || this.files[0] == null) { @@ -55,8 +59,12 @@ export class FormDatasetComponent { this.update(); } + firstInput = false; + update() { + this.firstInput = true + if (this.files.length < 1) return; @@ -82,6 +90,25 @@ export class FormDatasetComponent { this.dataset.name = this.filename.slice(0, this.filename.length - 4); } + loadExisting(){ + this.firstInput = false; + + this.tableData.hasInput = true; + this.tableData.loaded = false; + + this.datasetsService.getDatasetFile(this.dataset.fileId).subscribe((file: string | undefined) => { + if (file) { + this.tableData.loaded = true; + this.tableData.numRows = this.dataset.rowCount; + this.tableData.numCols = this.dataset.columnInfo.length; + this.tableData.data = this.csv.csvToArray(file, (this.dataset.delimiter == "razmak") ? " " : (this.dataset.delimiter == "") ? "," : this.dataset.delimiter); + + } + }); + + + } + /*exportAsXLSX():void { this.excelService.exportAsExcelFile(this.data, 'sample'); }*/ |