def delete(request): path = request.GET['path'] path = str(path).replace("//", '/') try: znode = ZNode(path) znode.delete() sPath = path.split('/')[:-1] toPath = '/'.join(sPath) toPath = "/tree" + toPath return redirect(toPath) except Exception as err: return render_to_response('zktree/error.html', {'error': str(err)})
def delete(request): path = request.GET['path'] path = str(path).replace("//", '/') try: znode = ZNode(path) znode.delete() sPath = path.split('/')[:-1] toPath = '/'.join(sPath) toPath = "/tree"+toPath return redirect(toPath) except Exception as err: return render_to_response('zktree/error.html', {'error':str(err)})
def index(request, path=""): path = "/" + path try: znode = ZNode(path) znode.children.sort() if znode.data and not istext(znode.data): znode.data = "0x" + "".join(["%d" % (ord(d)) for d in znode.data]) znode.datatype = "bin" else: znode.datatype = "str" return render_to_response('zktree/index.html', {'znode': znode}) except Exception as err: traceback.print_exc() return render_to_response('zktree/error.html', {'error': str(err)})
def index(request, path=""): path = "/" + path try: znode = ZNode(path) znode.children.sort() if znode.data and not istext(znode.data): znode.data = "0x" + "".join(["%d" % (ord(d)) for d in znode.data]) znode.datatype = "bin" else: znode.datatype = "str" return render_to_response("zktree/index.html", {"znode": znode}) except Exception as err: traceback.print_exc() return render_to_response("zktree/error.html", {"error": str(err)})
def index(request, path=''): try: znode = ZNode('/' + path) znode.children.sort() if not istext(znode.data): znode.data = '0x' + ''.join(['%d' % (ord(d)) for d in znode.data]) znode.datatype = 'bin' else: znode.datatype = 'str' return render_to_response('zktree/index.html', {'znode':znode}) except Exception as err: return render_to_response('zktree/error.html', {'error':str(err)})
def index(request, path=""): print(path) path = "/" + path try: znode = ZNode(path) znode.children.sort() if not istext(znode.data): znode.data = "0x" + "".join(["%d" % (ord(d)) for d in znode.data]) znode.datatype = "bin" else: znode.datatype = "str" return render_to_response('zktree/index.html', {'znode':znode}) except Exception as err: return render_to_response('zktree/error.html', {'error':str(err)})
def index(request): server_data = [] for i, server in enumerate(ZOOKEEPER_SERVERS): zkserver = ZKServer(server) zkserver.id = i server_data.append(zkserver) rootNode = ZNode() children = rootNode.getExtendedChildren() quotaNode = ZNode("/zookeeper/quota") return render_to_response('zkadmin/index.html', {'ZOOKEEPER_SERVERS':ZOOKEEPER_SERVERS, 'server_data':server_data, 'rootNode':rootNode, 'children':children, 'quotaNode':quotaNode})
def index(request): server_data = [] for i, server in enumerate(ZOOKEEPER_SERVERS): zkserver = ZKServer(server) zkserver.id = i server_data.append(zkserver) rootNode = ZNode() children = rootNode.getExtendedChildren() quotaNode = ZNode("/zookeeper/quota") return render_to_response( 'zkadmin/index.html', { 'ZOOKEEPER_SERVERS': ZOOKEEPER_SERVERS, 'server_data': server_data, 'rootNode': rootNode, 'children': children, 'quotaNode': quotaNode })
def index(request, path=""): print(path) path = "/" + path try: znode = ZNode(path) znode.children.sort() if not istext(znode.data): znode.data = "0x" + "".join(["%d" % (ord(d)) for d in znode.data]) znode.datatype = "bin" else: znode.datatype = "str" return render_to_response('zktree/index.html', {'znode':znode, 'isZKPath':str(znode.path).startswith("/zookeeper"), 'zchildren':znode.getExtendedChildren()}) except Exception as err: tback = traceback.format_exc(err) return render_to_response('zktree/error.html', {'error':str(err), 'traceback':tback})
def index(request, path=""): print(path) path = "/" + path try: znode = ZNode(path) znode.children.sort() if not istext(znode.data): znode.data = "0x" + "".join(["%d" % (ord(d)) for d in znode.data]) znode.datatype = "bin" else: znode.datatype = "str" return render_to_response( 'zktree/index.html', { 'znode': znode, 'isZKPath': str(znode.path).startswith("/zookeeper"), 'zchildren': znode.getExtendedChildren() }) except Exception as err: tback = traceback.format_exc(err) return render_to_response('zktree/error.html', { 'error': str(err), 'traceback': tback })