Javascript issues

Bug #244085 reported by Chirayu Patel
6
Affects Status Importance Assigned to Milestone
Graphite
Fix Released
Critical
chrismd

Bug Description

Hello,

I noticed some Javascript inconsistencies on both IE and Firefox, which I would like to bring to your notice. I am using extjs 2.1 with the trunk code and my data source is example-client.py.

  1. The tree view does not seem to work. Under Graphite I can see my system, but clicking on the system does not show other parameters. I checked with Firebug, and the server is responding with the correct contents in the JSON data structure (the url being fetched is http://192.168.1.112/browser/tree/?_dc=1214737267570&path=system&node=system).

  2. The webpage tries to fetch a bunch of files that don't exist in the system (builder.js, dragdrop.js, controls.js, slider.js and sound.js). These files are not bundled with ext-2.1. All except sound.js are part of trunk, but there is a path mismatch as page tries to fetch the javascript files from location /content/js/extJS/adapter/prototype/

Fixing problem 2, does not solve problem 1.

regards,
CP

Revision history for this message
Adam Jacob (adamhjk) wrote :

Additionally, the missing javascript files against ext-js 2.1 causes the CLI to not work at all.

Revision history for this message
chrismd (chrismd) wrote :

Yes there are a few problems with IE support at the moment. Everything should work fine under FireFox using the latest trunk, but please let me know if you still have issues. The js files you mentioned are a part of the scriptaculous library, which is now properly included with graphite. I should get IE support working for the tree browser UI later today, the CLI may take a couple days.

Changed in graphite:
assignee: nobody → chrismd
importance: Undecided → Critical
status: New → In Progress
Revision history for this message
chrismd (chrismd) wrote :

I just committed some javascript fixes to trunk. The tree browser UI should now fully work in IE. The CLI is still broken, but should work fine in FireFox for now.

Revision history for this message
Adam Jacob (adamhjk) wrote : Re: [Bug 244085] Re: Javascript issues

Nice! Thanks!

Adam

On Mon, Jun 30, 2008 at 10:52 AM, chrismd <email address hidden> wrote:
> I just committed some javascript fixes to trunk. The tree browser UI
> should now fully work in IE. The CLI is still broken, but should work
> fine in FireFox for now.
>
> --
> Javascript issues
> https://bugs.launchpad.net/bugs/244085
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
HJK Solutions - We Launch Startups - http://www.hjksolutions.com
Adam Jacob, Senior Partner
T: (206) 508-4759 E: <email address hidden>

Revision history for this message
Chirayu Patel (chirayu-chirayu) wrote :

Both problems persist at my end. Am using the latest code.

Revision history for this message
chrismd (chrismd) wrote :

Chirayu, it would be great if you could give me a little more detail.

The first issue you mentioned is that the tree browser does not show anything under "system". First you should make sure that there are actually data files present by doing "find /usr/local/graphite/storage/whisper/". If you do not see files under the "system" directory then your problem is with the backend not the frontend (probably filesystem permissions or ownership). Also there were several issues with IE which I have committed to trunk yesterday afternoon. Did you bzr pull the latest trunk, build a new release, install it, and shift-refresh your browser? If you have done this and still have issues with the tree view please let me know any details you can about what errors you do see and what version of IE you are using.

The second issue was that your browser was requesting some js files that could not be found. I have not been able to reproduce this (using trunk). Can you tell me what errors you are seeing along with your browser version?

Revision history for this message
Chirayu Patel (chirayu-chirayu) wrote :

Chris, I have attached screen shots that show both problems.

The following screen shots are attached:

1. initial load.jpg. This file shows the Firebug output when I visit the graphite home page.
2. tree view.jpg. This file shows that the response received from the server when I click on system, but the contents of the response are not displayed
3. auto completer.jpg. Just to show that it works.
4. command line.jpg. Again, just to show that it works

My environment uses the latest code from trunk, ext 2.1 (md5 63df2afa445ff6e9692f79b0bafa0c4f ), and Firefox 3.

All the missing javascript files are being fetched from within scriptaculous.js which is part of ext2-1. The files however are provided along with graphite and have a different install path. The browser tries to fetch the files - say builder.js - from the URL http://192.168.1.112/content/js/extJS/adapter/prototype/builder.js (url for builder.js), whereas it is located in /usr/local/graphite/webapp/content/js/scriptaculous/builder.js.

Even if I change the location of the missing files, the problem with the tree view persists, which makes me suspect the ext 2.1 package...

Revision history for this message
Chirayu Patel (chirayu-chirayu) wrote :

One more observation

CLI.html has the following javascript includes
<script src="/content/js/extJS/adapter/prototype/prototype.js" type="text/javascript"></script>
<script src="/content/js/extJS/adapter/prototype/scriptaculous.js" type="text/javascript"></script>
<script src="/content/js/prototype-window.js" type="text/javascript"></script>
<script src="/content/js/scriptaculous/controls.js"></script>
<script src="/content/js/scriptaculous/builder.js"></script>
<script src="/content/js/cli.js" type="text/javascript"></script>

whereas composer.html has

    <title>Graphite Composer</title>
    <link rel="stylesheet" type="text/css" href="/content/js/extJS/resources/css/ext-all.css" />
    <script type="text/javascript" src="/content/js/extJS/adapter/prototype/prototype.js"></script>
    <script type="text/javascript" src="/content/js/extJS/adapter/prototype/scriptaculous.js"></script>
    <script type="text/javascript" src="/content/js/extJS/adapter/prototype/effects.js"></script>
    <script type="text/javascript" src="/content/js/extJS/adapter/prototype/ext-prototype-adapter.js"></script>
    {% if debug %}
    <script type="text/javascript" src="/content/js/extJS/ext-all-debug.js"></script>
    {% else %}
    <script type="text/javascript" src="/content/js/extJS/ext-all.js"></script>
    {% endif %}

Notice that control.js and builder.js are not included in composer.html

Disclaimer - I am not a JS expert, and the code might be correct. But, it does look a bit fishy. :-)

Revision history for this message
chrismd (chrismd) wrote :

I have committed a fix for issue #2, but I am still looking into issue #1. Your screenshots have been very helpful.

Revision history for this message
chrismd (chrismd) wrote :

I have not been able to replicate the issue but thanks to your screenshot I *think* I can see what is happening differently on your system. The tree node id's in the JSON response appear to be improperly encoded because of a unicode issue. I have committed a fix to ensure that unicode strings get encoded properly and I believe that should fix the problem. If it does not please let me know.

Changed in graphite:
status: In Progress → Fix Committed
chrismd (chrismd)
Changed in graphite:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.