Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete the datasets import UI code. #18

Closed
wants to merge 1 commit into from
Closed

complete the datasets import UI code. #18

wants to merge 1 commit into from

Conversation

liyu1981
Copy link

No description provided.

@liyu1981
Copy link
Author

@killfill, just reminder that, this is not tested yet. I will do it in somday, and update the pull request.

Currently all the UI and framework code should be done (only tested with fake uploader.)

@liyu1981
Copy link
Author

quote @killfill from IRC, pay attention :)

the wall i was hitting is this one: danialfarid/ng-file-upload#88 (comment)

@killfill
Copy link

More info here: https://jira.project-fifo.net/browse/FIFO-387
:)

@liyu1981
Copy link
Author

Now this should work. Have tested on DogeOS 0.4.5 :), imported joyent smartmachine datasets without problem.

This requires HTML5 FileReader support. But fortunately, recently firefox and chrome all support it.

Known issue is that if the inspector is turned on, you probably will see that chrome is dead :), just close the inspector, it should work. the reason should be that huge data is actually loaded into mem and then upload, inspector just goes crazy with that data.

Above issue also occurs when you have a xGB dataset.gz.

@liyu1981
Copy link
Author

liyu1981 commented Jun 9, 2014

Added the file size checking part, will not allow user to upload sth > 250MB, and will warn him to do it with client API, such as PyFi.

This is should be a solution usable.

@killfill
Copy link

killfill commented Jun 9, 2014

Hi mate!

Its not that i really have try hard to understand this.. (shame on me!)
But i could not make it work. i.e. https://github.com/liyu1981/jingles/blob/test/app/scripts/controllers/datasets.js#L139
Its trying to read the .gz file im dropping as text, and parse it as json.

How are you testing this?
Can you put the .dsmanifest and .gz file somewhere?

Thanks!!

@liyu1981
Copy link
Author

liyu1981 commented Jun 9, 2014

I have added some comments for easier understanding :) It is my issue that write code like sth crazy :)

The test data example is also embedded in comments, or you can just download with

wget -c https://images.joyent.com/images/19daa264-c4c4-11e3-bec3-c30e2c0d4ec0 -O CentOS-2.6.1.dsmanifest
wget -c https://images.joyent.com/images/19daa264-c4c4-11e3-bec3-c30e2c0d4ec0/file -O CentOS-2.6.1.gz

all joyent's datasets

@killfill
Copy link

killfill commented Jun 9, 2014

Hm.. i tried it with the nginx dataset wich is a little smaller, 150MB.
Could not make it work.. :s

http://monosnap.com/image/CEesnNnFiNofeO4pKD70g6RnuJCmov

@liyu1981
Copy link
Author

Where can I get these datasets? I will take more tests.

在 2014年6月10日,上午3:15,Phillip Neumann [email protected] 写道:

Hm.. i tried it with the nginx dataset wich is a little smaller, 150MB.
Could not make it work.. :s

http://monosnap.com/image/CEesnNnFiNofeO4pKD70g6RnuJCmov


Reply to this email directly or view it on GitHub.

@liyu1981
Copy link
Author

Tried locally, yes, my browser also breaks :(

I will find ways to solve this. Wait for my next update.

@liyu1981
Copy link
Author

I have revised the solution to use XMLHtttpRequest Level 2 API for uploading, this works much better than angular-file-upload one.

http://snag.gy/a3csz.jpg
http://snag.gy/xZ2dv.jpg

This is much robust. And I even suspect that can be used to upload huge files. (I have not remove the 250MB checking currently.)

@liyu1981 liyu1981 closed this Oct 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants