{"action":"created","comment":{"url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/comments/228118964","pull_request_review_id":168312273,"id":228118964,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODExODk2NA==","diff_hunk":"@@ -0,0 +1,79 @@\n+import { Component, OnInit, Inject, ViewChild } from '@angular/core';\n+import { MatStepper, MatDialogRef, MAT_DIALOG_DATA } from \"@angular/material\";\n+import { FileUploader, ParsedResponseHeaders, FileItem } from 'ng2-file-upload';\n+import { Server } from '../../../models/server';\n+import { v4 as uuid } from 'uuid';\n+\n+@Component({\n+    selector: 'app-import-project-dialog',\n+    templateUrl: 'import-project-dialog.component.html',\n+    styleUrls: ['import-project-dialog.component.css'],\n+})\n+export class ImportProjectDialogComponent implements OnInit {\n+    uploader: FileUploader;\n+    server : Server;\n+    projectName : string;\n+    isImportEnabled : boolean = false;\n+    isFinishEnabled : boolean = false;\n+    errorMessage : string;\n+\n+    @ViewChild('stepper') stepper: MatStepper;\n+  \n+    constructor(\n+      public dialogRef: MatDialogRef<ImportProjectDialogComponent>,\n+      @Inject(MAT_DIALOG_DATA) public data: any){}\n+  \n+    ngOnInit(){\n+      this.uploader = new FileUploader({});\n+      this.uploader.onAfterAddingFile = (file) => { file.withCredentials = false; };\n+    }\n+  \n+    uploadProjectFile(event) : void{\n+      this.projectName = event.target.files[0].name.split(\".\")[0];\n+      this.isImportEnabled = true;\n+    }\n+  \n+    onImportClick() : void{\n+      if(this.validateProjectName()){\n+        this.prepareUploadPath();\n+        this.stepper.selected.completed = true;\n+        this.stepper.next();\n+        let itemToUpload = this.uploader.queue[0];\n+        this.uploader.uploadItem(itemToUpload);\n+\n+        this.uploader.onErrorItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {\n+          this.errorMessage = response;\n+          this.isFinishEnabled = true;\n+        };\n+\n+        this.uploader.onSuccessItem = (item: FileItem, response: string, status: number, headers: ParsedResponseHeaders) => {\n+          this.isFinishEnabled = true;\n+        };\n+      }\n+    }\n+  \n+    onNoClick() : void{\n+      this.uploader.cancelAll();\n+      this.dialogRef.close();\n+    }\n+\n+    onFinishClick() : void{\n+      this.dialogRef.close();\n+    }\n+\n+    onDeleteClick() : void{\n+      this.uploader.queue.pop();\n+      this.isImportEnabled = false;\n+      this.projectName = \"\";\n+    }\n+\n+    prepareUploadPath() : void{\n+      let url = `http://${this.server.ip}:${this.server.port}/v2/projects/${uuid()}/import?name=${this.projectName}`;","path":"src/app/components/projects/import-project-dialog/import-project-dialog.component.ts","position":71,"original_position":71,"commit_id":"4084fb39e0450a0eae3fbde9d3f2195521027edd","original_commit_id":"4084fb39e0450a0eae3fbde9d3f2195521027edd","user":{"login":"ziajka","id":29223277,"node_id":"MDQ6VXNlcjI5MjIzMjc3","avatar_url":"https://avatars3.githubusercontent.com/u/29223277?v=4","gravatar_id":"","url":"https://api.github.com/users/ziajka","html_url":"https://github.com/ziajka","followers_url":"https://api.github.com/users/ziajka/followers","following_url":"https://api.github.com/users/ziajka/following{/other_user}","gists_url":"https://api.github.com/users/ziajka/gists{/gist_id}","starred_url":"https://api.github.com/users/ziajka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ziajka/subscriptions","organizations_url":"https://api.github.com/users/ziajka/orgs","repos_url":"https://api.github.com/users/ziajka/repos","events_url":"https://api.github.com/users/ziajka/events{/privacy}","received_events_url":"https://api.github.com/users/ziajka/received_events","type":"User","site_admin":false},"body":"URL generation in different method is fine, but adding to queue may be somewhere else.","created_at":"2018-10-25T10:29:59Z","updated_at":"2018-10-25T10:29:59Z","html_url":"https://github.com/GNS3/gns3-web-ui/pull/171#discussion_r228118964","pull_request_url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/comments/228118964"},"html":{"href":"https://github.com/GNS3/gns3-web-ui/pull/171#discussion_r228118964"},"pull_request":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171"}}},"pull_request":{"url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171","id":225690086,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1NjkwMDg2","html_url":"https://github.com/GNS3/gns3-web-ui/pull/171","diff_url":"https://github.com/GNS3/gns3-web-ui/pull/171.diff","patch_url":"https://github.com/GNS3/gns3-web-ui/pull/171.patch","issue_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/171","number":171,"state":"open","locked":false,"title":"Projects importing","user":{"login":"piotrpekala7","id":31202938,"node_id":"MDQ6VXNlcjMxMjAyOTM4","avatar_url":"https://avatars0.githubusercontent.com/u/31202938?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrpekala7","html_url":"https://github.com/piotrpekala7","followers_url":"https://api.github.com/users/piotrpekala7/followers","following_url":"https://api.github.com/users/piotrpekala7/following{/other_user}","gists_url":"https://api.github.com/users/piotrpekala7/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpekala7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpekala7/subscriptions","organizations_url":"https://api.github.com/users/piotrpekala7/orgs","repos_url":"https://api.github.com/users/piotrpekala7/repos","events_url":"https://api.github.com/users/piotrpekala7/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpekala7/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-25T09:42:16Z","updated_at":"2018-10-25T10:29:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4b3dfe51a8c5ecd83323ccbd523137ca2934acd","assignee":{"login":"piotrpekala7","id":31202938,"node_id":"MDQ6VXNlcjMxMjAyOTM4","avatar_url":"https://avatars0.githubusercontent.com/u/31202938?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrpekala7","html_url":"https://github.com/piotrpekala7","followers_url":"https://api.github.com/users/piotrpekala7/followers","following_url":"https://api.github.com/users/piotrpekala7/following{/other_user}","gists_url":"https://api.github.com/users/piotrpekala7/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpekala7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpekala7/subscriptions","organizations_url":"https://api.github.com/users/piotrpekala7/orgs","repos_url":"https://api.github.com/users/piotrpekala7/repos","events_url":"https://api.github.com/users/piotrpekala7/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpekala7/received_events","type":"User","site_admin":false},"assignees":[{"login":"piotrpekala7","id":31202938,"node_id":"MDQ6VXNlcjMxMjAyOTM4","avatar_url":"https://avatars0.githubusercontent.com/u/31202938?v=4","gravatar_id":"","url":"https://api.github.com/users/piotrpekala7","html_url":"https://github.com/piotrpekala7","followers_url":"https://api.github.com/users/piotrpekala7/followers","following_url":"https://api.github.com/users/piotrpekala7/following{/other_user}","gists_url":"https://api.github.com/users/piotrpekala7/gists{/gist_id}","starred_url":"https://api.github.com/users/piotrpekala7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piotrpekala7/subscriptions","organizations_url":"https://api.github.com/users/piotrpekala7/orgs","repos_url":"https://api.github.com/users/piotrpekala7/repos","events_url":"https://api.github.com/users/piotrpekala7/events{/privacy}","received_events_url":"https://api.github.com/users/piotrpekala7/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171/commits","review_comments_url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171/comments","review_comment_url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/171/comments","statuses_url":"https://api.github.com/repos/GNS3/gns3-web-ui/statuses/4084fb39e0450a0eae3fbde9d3f2195521027edd","head":{"label":"GNS3:importing-projects","ref":"importing-projects","sha":"4084fb39e0450a0eae3fbde9d3f2195521027edd","user":{"login":"GNS3","id":2739187,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MzkxODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2739187?v=4","gravatar_id":"","url":"https://api.github.com/users/GNS3","html_url":"https://github.com/GNS3","followers_url":"https://api.github.com/users/GNS3/followers","following_url":"https://api.github.com/users/GNS3/following{/other_user}","gists_url":"https://api.github.com/users/GNS3/gists{/gist_id}","starred_url":"https://api.github.com/users/GNS3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GNS3/subscriptions","organizations_url":"https://api.github.com/users/GNS3/orgs","repos_url":"https://api.github.com/users/GNS3/repos","events_url":"https://api.github.com/users/GNS3/events{/privacy}","received_events_url":"https://api.github.com/users/GNS3/received_events","type":"Organization","site_admin":false},"repo":{"id":104729788,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ3Mjk3ODg=","name":"gns3-web-ui","full_name":"GNS3/gns3-web-ui","private":false,"owner":{"login":"GNS3","id":2739187,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MzkxODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2739187?v=4","gravatar_id":"","url":"https://api.github.com/users/GNS3","html_url":"https://github.com/GNS3","followers_url":"https://api.github.com/users/GNS3/followers","following_url":"https://api.github.com/users/GNS3/following{/other_user}","gists_url":"https://api.github.com/users/GNS3/gists{/gist_id}","starred_url":"https://api.github.com/users/GNS3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GNS3/subscriptions","organizations_url":"https://api.github.com/users/GNS3/orgs","repos_url":"https://api.github.com/users/GNS3/repos","events_url":"https://api.github.com/users/GNS3/events{/privacy}","received_events_url":"https://api.github.com/users/GNS3/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GNS3/gns3-web-ui","description":"WebUI implementation for GNS3","fork":false,"url":"https://api.github.com/repos/GNS3/gns3-web-ui","forks_url":"https://api.github.com/repos/GNS3/gns3-web-ui/forks","keys_url":"https://api.github.com/repos/GNS3/gns3-web-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GNS3/gns3-web-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GNS3/gns3-web-ui/teams","hooks_url":"https://api.github.com/repos/GNS3/gns3-web-ui/hooks","issue_events_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/events{/number}","events_url":"https://api.github.com/repos/GNS3/gns3-web-ui/events","assignees_url":"https://api.github.com/repos/GNS3/gns3-web-ui/assignees{/user}","branches_url":"https://api.github.com/repos/GNS3/gns3-web-ui/branches{/branch}","tags_url":"https://api.github.com/repos/GNS3/gns3-web-ui/tags","blobs_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GNS3/gns3-web-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/GNS3/gns3-web-ui/languages","stargazers_url":"https://api.github.com/repos/GNS3/gns3-web-ui/stargazers","contributors_url":"https://api.github.com/repos/GNS3/gns3-web-ui/contributors","subscribers_url":"https://api.github.com/repos/GNS3/gns3-web-ui/subscribers","subscription_url":"https://api.github.com/repos/GNS3/gns3-web-ui/subscription","commits_url":"https://api.github.com/repos/GNS3/gns3-web-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/GNS3/gns3-web-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/GNS3/gns3-web-ui/contents/{+path}","compare_url":"https://api.github.com/repos/GNS3/gns3-web-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GNS3/gns3-web-ui/merges","archive_url":"https://api.github.com/repos/GNS3/gns3-web-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GNS3/gns3-web-ui/downloads","issues_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues{/number}","pulls_url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/GNS3/gns3-web-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/GNS3/gns3-web-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GNS3/gns3-web-ui/labels{/name}","releases_url":"https://api.github.com/repos/GNS3/gns3-web-ui/releases{/id}","deployments_url":"https://api.github.com/repos/GNS3/gns3-web-ui/deployments","created_at":"2017-09-25T09:27:22Z","updated_at":"2018-10-18T07:28:36Z","pushed_at":"2018-10-25T09:42:16Z","git_url":"git://github.com/GNS3/gns3-web-ui.git","ssh_url":"git@github.com:GNS3/gns3-web-ui.git","clone_url":"https://github.com/GNS3/gns3-web-ui.git","svn_url":"https://github.com/GNS3/gns3-web-ui","homepage":null,"size":1449,"stargazers_count":6,"watchers_count":6,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":6,"open_issues":36,"watchers":6,"default_branch":"master"}},"base":{"label":"GNS3:develop","ref":"develop","sha":"88ae3704dc191fe0477d2ebc6ca5f63bbdced622","user":{"login":"GNS3","id":2739187,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MzkxODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2739187?v=4","gravatar_id":"","url":"https://api.github.com/users/GNS3","html_url":"https://github.com/GNS3","followers_url":"https://api.github.com/users/GNS3/followers","following_url":"https://api.github.com/users/GNS3/following{/other_user}","gists_url":"https://api.github.com/users/GNS3/gists{/gist_id}","starred_url":"https://api.github.com/users/GNS3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GNS3/subscriptions","organizations_url":"https://api.github.com/users/GNS3/orgs","repos_url":"https://api.github.com/users/GNS3/repos","events_url":"https://api.github.com/users/GNS3/events{/privacy}","received_events_url":"https://api.github.com/users/GNS3/received_events","type":"Organization","site_admin":false},"repo":{"id":104729788,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ3Mjk3ODg=","name":"gns3-web-ui","full_name":"GNS3/gns3-web-ui","private":false,"owner":{"login":"GNS3","id":2739187,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3MzkxODc=","avatar_url":"https://avatars0.githubusercontent.com/u/2739187?v=4","gravatar_id":"","url":"https://api.github.com/users/GNS3","html_url":"https://github.com/GNS3","followers_url":"https://api.github.com/users/GNS3/followers","following_url":"https://api.github.com/users/GNS3/following{/other_user}","gists_url":"https://api.github.com/users/GNS3/gists{/gist_id}","starred_url":"https://api.github.com/users/GNS3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GNS3/subscriptions","organizations_url":"https://api.github.com/users/GNS3/orgs","repos_url":"https://api.github.com/users/GNS3/repos","events_url":"https://api.github.com/users/GNS3/events{/privacy}","received_events_url":"https://api.github.com/users/GNS3/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/GNS3/gns3-web-ui","description":"WebUI implementation for GNS3","fork":false,"url":"https://api.github.com/repos/GNS3/gns3-web-ui","forks_url":"https://api.github.com/repos/GNS3/gns3-web-ui/forks","keys_url":"https://api.github.com/repos/GNS3/gns3-web-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GNS3/gns3-web-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GNS3/gns3-web-ui/teams","hooks_url":"https://api.github.com/repos/GNS3/gns3-web-ui/hooks","issue_events_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/events{/number}","events_url":"https://api.github.com/repos/GNS3/gns3-web-ui/events","assignees_url":"https://api.github.com/repos/GNS3/gns3-web-ui/assignees{/user}","branches_url":"https://api.github.com/repos/GNS3/gns3-web-ui/branches{/branch}","tags_url":"https://api.github.com/repos/GNS3/gns3-web-ui/tags","blobs_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GNS3/gns3-web-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/GNS3/gns3-web-ui/languages","stargazers_url":"https://api.github.com/repos/GNS3/gns3-web-ui/stargazers","contributors_url":"https://api.github.com/repos/GNS3/gns3-web-ui/contributors","subscribers_url":"https://api.github.com/repos/GNS3/gns3-web-ui/subscribers","subscription_url":"https://api.github.com/repos/GNS3/gns3-web-ui/subscription","commits_url":"https://api.github.com/repos/GNS3/gns3-web-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/GNS3/gns3-web-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/GNS3/gns3-web-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/GNS3/gns3-web-ui/contents/{+path}","compare_url":"https://api.github.com/repos/GNS3/gns3-web-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GNS3/gns3-web-ui/merges","archive_url":"https://api.github.com/repos/GNS3/gns3-web-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GNS3/gns3-web-ui/downloads","issues_url":"https://api.github.com/repos/GNS3/gns3-web-ui/issues{/number}","pulls_url":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/GNS3/gns3-web-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/GNS3/gns3-web-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GNS3/gns3-web-ui/labels{/name}","releases_url":"https://api.github.com/repos/GNS3/gns3-web-ui/releases{/id}","deployments_url":"https://api.github.com/repos/GNS3/gns3-web-ui/deployments","created_at":"2017-09-25T09:27:22Z","updated_at":"2018-10-18T07:28:36Z","pushed_at":"2018-10-25T09:42:16Z","git_url":"git://github.com/GNS3/gns3-web-ui.git","ssh_url":"git@github.com:GNS3/gns3-web-ui.git","clone_url":"https://github.com/GNS3/gns3-web-ui.git","svn_url":"https://github.com/GNS3/gns3-web-ui","homepage":null,"size":1449,"stargazers_count":6,"watchers_count":6,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"archived":false,"open_issues_count":36,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":6,"open_issues":36,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171"},"html":{"href":"https://github.com/GNS3/gns3-web-ui/pull/171"},"issue":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/171"},"comments":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171/comments"},"review_comment":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/pulls/171/commits"},"statuses":{"href":"https://api.github.com/repos/GNS3/gns3-web-ui/statuses/4084fb39e0450a0eae3fbde9d3f2195521027edd"}},"author_association":"NONE"}}
{"actor":{"display_login":"ziajka"}}