Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // from index.js
- $('#sabnzbd .speed_input').live( {
- mouseenter: function() {
- $.get('/xhr/sabnzbd/get_maxspeed', function(data) {
- $(this).value = data;
- });
- },
- mouseleave: function() {
- $.get('/xhr/sabnzbd/get_speed', function(data) {
- $(this).value = data;
- });
- }
- });
- //from sabnzbd.py
- @app.route('/xhr/sabnzbd/get_speed')
- @requires_auth
- def get_speed():
- try:
- sabnzbd = get_json('simple')
- speed = sabnzbd['kbpersec']
- paused = sabnzbd['paused']
- result = [paused, speed]
- except:
- result = None
- return result
- @app.route('/xhr/sabnzbd/get_maxspeed')
- @requires_auth
- def get_maxspeed():
- try:
- sabnzbd = get_json()
- result = sabnzbd['speedlimit']
- except:
- result = None
- return result
Add Comment
Please, Sign In to add comment