gist: 10710 Download_button fork
public
Public Clone URL: git://gist.github.com/10710.git
bandwidthgraph.ubiq.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
CmdUtils.CreateCommand({
  name: "bandwidth-graph",
  takes: {"ip":noun_arb_text},
  description: "Show Bandwidth Graph for DD-WRT users",
  help: "Displays Bandwidth Graph in the preview pane for users of DD-WRT. If your router ip is different than 192.168.1.1 you can enter your router ip as an argument.",
  homepage: "http://blog.mcfearsome.com/verbs/",
  author: { name: "Jesse McPherson", email: "jesse@mcfearsome.com"},
  preview: function(pblock, din) {
        var ip = din.text;
        if(ip == null || ip.length == 0) {
            ip = '192.168.1.1';
        }
        var d = new Date();
        var date_queryparam = d.getMonth() + '-' + d.getFullYear();
        var url = 'http://' + ip + '/ttgraph.cgi?' + date_queryparam;
        var resp = jQuery.ajax({async:false,url:url});
        pblock.innerHTML = resp.responseText;
    },
    execute: function( ) {
        return false;
    }
});

Owner

mcfearsome

Revisions