def render_GET(self, request): uniName = request.args.get('name') if uniName is None:request.redirect("/") ip,grpName,procName = splitProcName(uniName[0]) def procInfo(result): yamContent = result[0][0] request.write(getTemplateContent('procConfInfo',clientSideArgs=self._initClientSideArgs(ip),\ grpName=grpName,procName=procName,ip=ip,yamContent=yamContent,\ monLog=getMonLog(uniName[0]),uniName=uniName[0],**activeCssDict)) getDb().runQuery('SELECT procInfo FROM Process WHERE clientIp = ? and procGroup = ? and procName = ?',\ [ip,grpName,procName]).addCallback(procInfo).addBoth(finishRequest,request) return NOT_DONE_YET
def render_GET(self, request): uniName = request.args.get('name') if uniName is None:request.redirect("/") curPage = request.args.get('curPage') if curPage is not None: curPage = int(curPage[0]) pageSize = 8192 clientip,pgName,psName = splitProcName(uniName[0]) defQueue = defer.DeferredQueue(1,1) defQueue.get().addCallback(lambda x:request.write(getTemplateContent(self.templateName,\ clientSideArgs=self._initClientSideArgs(clientip),grpName=pgName,procName=psName,ip=clientip,monLog=getMonLog(uniName[0]),\ uniName=uniName[0],logInfo=x,curPage=curPage,pageSize=pageSize,showPageSize=False,**activeCssDict))).addBoth(finishRequest,request) jsonArgs = {'action':'procOp','op':self.opName,'grp':pgName,'name':psName} jsonArgs.update(convertPage(curPage,pageSize)) clientIpDict[clientip]['protocol'].asyncSendJson(jsonArgs,defQueue) return NOT_DONE_YET