Ticket #1942: 1942-wui-replace-google-chart-with-d3js-initial.patch

File 1942-wui-replace-google-chart-with-d3js-initial.patch, 2.8 KB (added by d_, at 2014-01-16T03:47:42Z)
  • src/allmydata/web/map-update-status.xhtml

    diff --git a/src/allmydata/web/map-update-status.xhtml b/src/allmydata/web/map-update-status.xhtml
    index e428ca2..c85dc34 100644
    a b  
    44    <link href="/tahoe.css" rel="stylesheet" type="text/css"/>
    55    <link href="/icon.png" rel="shortcut icon" />
    66    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     7    <script type="text/javascript" src="/jquery-1.6.1.min.js"></script>
     8    <script type="text/javascript" src="/d3-2.4.6.min.js"></script>
     9    <script type="text/javascript" src="/d3-2.4.6.time.min.js"></script>
     10    <script type="text/javascript" src="/update_status_timing_chart.js"></script>
    711  </head>
    812  <body>
    913
     
    2125<h2>Update Results</h2>
    2226<ul>
    2327  <li n:render="problems" />
    24   <li>Timings: <span n:render="timing_chart" /></li>
     28  <!-- FIXME: function to change with d3.js!!! -->
     29  <li>Timings:
     30    <!-- <span n:render="timing_chart" /> -->
     31
     32    <div style="">
     33      <button id="toggle_misc_button">toggle misc events</button>
     34      <button id="zoom_in_button">zoom in</button>
     35      <button id="zoom_out_button">zoom out</button>
     36      <button id="reset_button">reset zoom</button>
     37      <!-- <div id="overview" style="float:right;width:166px;height:100px; border: 1px solid #ddd">overview</div> -->
     38      <div id="timeline" style="border: 1px solid #aaa"></div>
     39    </div>
     40
     41  </li>
    2542  <ul>
    2643    <li>Total: <span n:render="time" n:data="time_total" /></li>
    2744    <ul>
  • src/allmydata/web/status.py

    diff --git a/src/allmydata/web/status.py b/src/allmydata/web/status.py
    index 89e6b64..d9a7240 100644
    a b class DownloadStatusPage(DownloadResultsRendererMixin, rend.Page): 
    436436                           for groupnum in range(len(serverid_to_group))]
    437437        return new_events, highest_rownums
    438438
     439    # TODO: function that create the data for the download status timeline?
    439440    def child_event_json(self, ctx):
    440441        inevow.IRequest(ctx).setHeader("content-type", "text/plain")
    441442        data = { } # this will be returned to the GET
    class MapupdateStatusPage(rend.Page, RateAndTimeMixin): 
    962963            l[T.li["[%s]: %s" % (server.get_name(), times_s)]]
    963964        return T.li["Per-Server Response Times: ", l]
    964965
     966
     967    # FIXME: function to change with d3.js!!!
    965968    def render_timing_chart(self, ctx, data):
    966969        imageurl = self._timing_chart()
    967970        return ctx.tag[imageurl]
    968971
     972
     973    # FIXME: function to change with d3.js!!!
    969974    def _timing_chart(self):
    970975        started = self.update_status.get_started()
    971976        total = self.update_status.timings.get("total")