From 4c28d00a918d227eb24b1264b7d5e13aa878df8e Mon Sep 17 00:00:00 2001 From: cat Date: Tue, 18 Dec 2012 11:41:13 +0100 Subject: [PATCH] The Local Settings Page now uses the connector API to determine which parameters are required for protocols --- lsp/functions.js | 6 +- lsp/main.js | 285 +++++++++++++++++++++++++++++++++++++---------- lsp/style.css | 19 +++- 3 files changed, 245 insertions(+), 65 deletions(-) diff --git a/lsp/functions.js b/lsp/functions.js index 9b607f83..81993f1d 100644 --- a/lsp/functions.js +++ b/lsp/functions.js @@ -112,7 +112,8 @@ { 'username': settings.credentials.username, 'password': (settings.credentials.authstring != "" ? MD5(MD5(settings.credentials.password) + settings.credentials.authstring) : "" ) - } + }, + 'capabilities': {} }; $.ajax( @@ -131,6 +132,7 @@ var ret = $.extend(true, { "streams": {}, + "capabilities": {}, "statistics": {} }, d); @@ -356,11 +358,11 @@ "version": "" }, "streams": {}, + "capabilities": {}, "log": {}, "statistics": {} }, d); } - if(callback) { callback(errorstr); diff --git a/lsp/main.js b/lsp/main.js index 8d36de59..2c56d083 100644 --- a/lsp/main.js +++ b/lsp/main.js @@ -259,7 +259,7 @@ case 'protocols': $table = $(''); - $table.html(""); + $table.html(""); $tbody = $(''); var tr, i, protocol, @@ -274,11 +274,22 @@ tr = $('').attr('id', 'protocol-' + i); tr.append( $('').attr('class', 'outsidetable'); - // protocol select - $pname = $('
ProtocolPortInterface
ProtocolSettings
').text( protocol.connector ) ); - tr.append( $('').text( protocol.port ) ); + + s = ""; + for (option in protocol) { + if ((option != 'connector') && (option != 'online')) { + s += option+': '+protocol[option]+', '; + } + } + s = s.slice(0,-2); + + tr.append( $('').text( s ) ); - tr.append( $('').text( protocol['interface'] ) ); // interface is a reserved JS keyword - - tr.append( $('').attr('class', 'center').append( $('').attr('class', 'center').append( $('
').append($pname) ); - // the port value - $nprot.append( $('').append( $('').attr('type', 'number').attr('id', 'new-protocol-val') ) ); - - // interface - $nprot.append( $('').append( $('').attr('type', 'text').attr('id', 'new-protocol-interface') ) ); - - $nprot.append( - $('').attr('class', 'center').append( - $('