elif name == req["addServer"]: print("<td><input name='name' size=8 value='" + name + "'/></td>") print("<td><input name='ip_port' value='" + ip_port + "'/></td>") print("<td><input name='cookie' size=8 value='" + cookie + "'/></td>") print("<td><input name='settings' value='" + settings + "'/></td>") print("<td class='actions'><a href='javascript:saveAddServer()'>" + loc.str('btn_save') + "</a><a href='javascript:setRefresh(10)'>" + loc.str('btn_cancel') + "</a></td>") else: print("<td>" + name + "</td>") print("<td>" + ip_port + "</td>") print("<td>" + cookie +"</td>") print("<td>" + settings + "</td>") print("<td class='actions'><a href='javascript:editServer(" + '"' + name + '"' + ")'>" + loc.str('btn_edit') + "</a>") if isUp: print("<span class='disabled'>" + loc.str('btn_delete') + "</span></td>") else: msg = loc.str_name('delete_server_message', name) print("<a href='javascript:deleteServer(" + '"' + name + '", "' + msg + '"' + ")'>" + loc.str('btn_delete') + "</a></td>") # display stats: if stat: if isUp: print("<td class='actions'>" + stat["status"] + " <a href='javascript:downServer(" + '"' + backend_name + "/" + name + '"' + ")'>down</a></td>") else: print("<td class='actions'>" + stat["status"] + " <a href='javascript:upServer(" + '"' + backend_name + "/" + name + '"' + ")'>up</a></td>") if name == req["weightServer"]: print("<td><input type=text name='weightValue' size=3 value=" + stat["weight"] + " /></td>") print("<td class='actions'><a href='javascript:doEditWeight(" + '"' + backend_name + "/" + name + '"' + ")'>" + loc.str('submit') + "</a></td>") print("</form>") else: print("<td>" + stat["weight"] + "</td>") print("<td class='actions'><a href='javascript:editWeight(" + '"' + name + '"' + ")'>" + loc.str('btn_change') + "</a></td>")
### contents ##### print("<div id='outer'>") print("<div id='container'>") if message: print message print("<table>") print("<tr><th width=200>" + loc.str("Service") + "</th><th width=200>" + loc.str("Application") + "</th><th width=200>" + loc.str("Host") + "</th><th width=200>" + loc.str("ssh_login") + "</th><td> </td></tr>" ) for i in range(0, len(menu.items)): item = menu.items[i] print("<tr>") print("<td>" + item.label + "</td><td>" + item.service + "</td><td>" + item.host + "</td>") if item.auth_check == "Not Authenticated": print("<td class='actions'><b><font color=red>" + item.auth_check + "</font></b> <a href='javascript:doAuth(" + str(i) + ', "' + loc.str_name('ssh_auth_message', item.host) + '"' + ")'>" + loc.str('ssh_auth') + "</a></td>") else: if item.auth_check == "OK": print("<td><b><font color=green>" + item.auth_check + "</font></b></td>") else: print("<td><b><font color=gray>" + item.auth_check + "</font></b></td>") print("<td class='actions' style='text-align: left;'><a href='javascript:deleteService(" + str(i) + ', "' + loc.str_name('delete_service_message', item.service, item.host) + '"' + ")'>" + loc.str('btn_delete') + "</a></td>") print("</tr>" ) if len(menu.items) == 0: print("<tr><td colspan=5>" + loc.str('no_cp_msg') + "</td></tr>") print("</table>") print("<h1>" + loc.str('add_cp') + "</h1>") print("<table class='notfull'>") print("<tr><th width=200>" + loc.str("Service") + "</th><td width=200><select name='service'>") print("<option value='iptables'>" + loc.str("menu_iptables") + "(iptables)</option>")