def interfaceAddPage(request,context): langDict = getLangTextDict(request) context["option"] = "add" context["dubbo_addHTTPInterface"] = "current-page" if not isRelease: context["env"] = "test" # 文本 text = {} text["pageTitle"] = langDict["dubbo"]["interfacePageHeadings_%s" % context["option"]] text["subPageTitle"] = langDict["dubbo"]["interfaceSubPageTitle_%s" % context["option"]] context["text"] = text # 页面所需参数 ##httoConfList #dubugInfos envConfList = DubboInterfaceService.queryDubboConfSort(request) context["envConfList"] = envConfList ################################################### context.update(ConfigServiceForDubbo.getConfigs(request)) context.update(getServiceConf(request)) context["debugBtnCount"] = commonWebConfig.debugBtnCount # 调试按钮 getDebugBtnList = ConfigServiceForDubbo.getDebugBtn(request) context.update(getDebugBtnList) addUserLog(request, "DUBBO单接口管理->添加用例->页面展示->成功", "PASS") context["title"] = "添加DUBBO接口" return render(request, "dubbo/interface/interfaceAddPage.html", context)
def operationInterface(request, context): langDict = getLangTextDict(request) context["id"] = request.GET.get("id", -1) context["option"] = request.GET.get("option") try: if int(context["id"]) <= 0: interfaceId = request.GET.get("interfaceId") interObj = DubboInterfaceService.getInterfaceByInterfaceId( interfaceId) return redirect("/dubbo/operationInterface?id=%s&option=%s" % (interObj.id, context["option"])) except: return render(request, "permission/page_404.html") context["addHTTPInterface"] = "current-page" if not isRelease: context["env"] = "test" try: if VersionService.isCurrentVersion(request): context["addBy"] = DubboInterfaceService.getInterfaceById( request.GET.get("id")).addBy.loginName else: context["addBy"] = DubboInterfaceService.getInterfaceById( request.GET.get("id")).addBy.loginName except Exception as e: return HttpResponse("参数id错误 %s" % e) ####httoConfList ##dubugInfos envConfList = DubboInterfaceService.queryDubboConfSort(request) context["envConfList"] = envConfList ################################################### # if context["option"] == 'edit' and request.session.get("loginName") != context["dataAddBy"]: # return HttpResponse("只能修改自己创建的接口") # 文本 text = {} try: text["pageTitle"] = langDict["dubbo"]["interfacePageHeadings_%s" % context["option"]] text["subPageTitle"] = langDict["dubbo"]["interfaceSubPageTitle_%s" % context["option"]] except Exception as e: return HttpResponse("参数错误 %s" % e) context["text"] = text # 页面所需参数 context.update(ConfigServiceForDubbo.getConfigs(request)) context.update(getServiceConf(request)) context["debugBtnCount"] = commonWebConfig.debugBtnCount # 调试按钮 getDebugBtnList = ConfigServiceForDubbo.getDebugBtn(request) context.update(getDebugBtnList) addUserLog(request, "DUBBO单接口管理->%s用例->页面展示->成功" % context["option"], "PASS") context["serviceJson"] = json.dumps( ServiceConfService.queryServiceConfSort(request)) context["title"] = "DUBBO接口-" + request.GET.get("id") return render(request, "dubbo/interface/interfaceAddPage.html", context)
def testCaseStepDetailPage(request): context = {} context.update(getConfigs(request)) context.update(getServiceConf(request)) context["debugBtnCount"] = commonWebConfig.debugBtnCount context.update(ConfigServiceForDubbo.getConfigs(request)) envConfList = DubboInterfaceService.queryDubboConfSort(request) context["envConfList"] = envConfList return render(request, "dubbo/testcase/SubPages/testcase_step_detail_page.html", context)
def interfaceQuickDebugPage(request): langDict = getLangTextDict(request) context = {} context["option"] = "add" context["dubbo_quickDebug"] = "current-page" if not isRelease: context["env"] = "test" # 文本 text = {} text["pageTitle"] = "DUBBO快速调试" text["subPageTitle"] = "DUBBO调试小工具" context["text"] = text envConfList = DubboInterfaceService.queryDubboConfSort(request) context["envConfList"] = envConfList ################################################### context.update(ConfigServiceForDubbo.getConfigs(request)) context.update(getServiceConf(request)) # 调试按钮 getDebugBtnList = ConfigServiceForDubbo.getDebugBtn(request) context.update(getDebugBtnList) addUserLog(request, "DUBBO单接口管理->添加用例->页面展示->成功", "PASS") return render(request, "dubbo/interface/interfaceQuickDebugPage.html", context)