-
Notifications
You must be signed in to change notification settings - Fork 572
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
a new built-in ui #304
a new built-in ui #304
Conversation
NB: Tox is failing because Tox appears to no longer support Py3.3. @mojtabaasadi: I'm impressed that you've written a web UI for
All of the above said.. I think a UI for |
@cathalgarvey Try ScrapydWeb: https://github.com/my8100/scrapydweb |
@my8100 that's a good one . but it has the need of lunching another application |
@cathalgarvey , I can agree with you for some of reasons . |
I wouldn't have said it any better than @cathalgarvey. Regarding this issue as a pull request:
Let's make it easier for users to replace the built-in website with their own. |
configurable views templating with twisted.web.template users now can create their own ui
Codecov Report
@@ Coverage Diff @@
## master #304 +/- ##
========================================
+ Coverage 68.37% 69% +0.62%
========================================
Files 16 16
Lines 819 813 -6
Branches 96 94 -2
========================================
+ Hits 560 561 +1
+ Misses 230 223 -7
Partials 29 29
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #304 +/- ##
========================================
+ Coverage 68.37% 69% +0.62%
========================================
Files 16 16
Lines 819 813 -6
Branches 96 94 -2
========================================
+ Hits 560 561 +1
+ Misses 230 223 -7
Partials 29 29
Continue to review full report at Codecov.
|
last commit makes users bale to have their own views base routes , |
I never heard of twisted.web.template. The idea behind the second commit is something I'd definitely like to see in scrapyd. |
This is really nice work, but now has conflicts with master and also need to add some tests. It will require work integrating with master. I'll put it on roadmap for 1.4, we could also maybe use some open source css framework? Just add it to project with proper license and link from html here? |
doc = self.prep_doc() | ||
txrequest.setHeader('Content-Type', 'text/html; charset=utf-8') | ||
doc = doc.encode('utf-8') | ||
txrequest.setHeader('Content-Length', str(len(doc))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mojtabaasadi setting content-type and content-length is probably fine to keep, or you see any reason to remove it?
Tests are failing because they need to be updated, change this content = scrapyd_site.children[b'jobs'].render(txrequest) to content = scrapyd_site.children[b'jobs'].render_GET(txrequest) and need to bring back content-type and content-length, same for render_home test. |
I would use a separate template for |
@mojtabaasadi I think we can just create default basic bit better UI with some open source CSS, like Twitter Bootstrap or Foundation, but your PR doesn't have to do this. It can be done separately on other branch, on other pull request. Just refactoring website html into templates is a useful thing, so you can just fix tests that are there, add some tests if you think you need it and we can merge. |
Sounds good to me, agreed! |
tried to fix prblem with test
…new formated response
9915c73
to
e7d9a5e
Compare
Since this PR was created, we made several changes to the web UI, including support for X-Forwarded-Prefix. After trying to use Twisted's templating to replicate those changes, I concluded that it's just too tightly coupled between the template and the view. The template language is too incomplete, requiring loops and if-statements to be written in the view. As such, I have to abandon this PR. The status quo is to edit strings directly. Perhaps a future PR could use Jinja, as an additional (but very common) dependency. |
user interface with
it can be parallelly developed
has some advantage in monitoring logs
and is as simple as current web services