Beispiel #1
0
    def GET(sef,domain_recordId):
        string = domain_recordId.encode()
        domain = string.split('-')[0]
        recordId = string.split('-')[1]
        domainId = processData.domainInfo(
                                        web.cookies().email,
                                        web.cookies().password,
                                        domain=domain
                                        )

        message = processData.delRecord(
                                        web.cookies().email,
                                        web.cookies().password,
                                        did=domainId,
                                        rid=recordId
                                        )        
        if message == '1':
            recordList = processData.recordList(
                                                web.cookies().email,
                                                web.cookies().password,
                                                id=domainId
                                                )
            return render.record(domain,recordList,delMsg='删除成功')
        else:
            recordList = processData.recordList(
                                                web.cookies().email,
                                                web.cookies().password,
                                                id=domainId
                                                )
            return render.record(domain,recordList,delMsg=message)
Beispiel #2
0
 def POST(self,domain):
     domainId = processData.domainInfo(
                                     web.cookies().email,
                                     web.cookies().password,
                                     domain=domain
                                     )#获取域名ID
     i = web.input()
     message = processData.addRecord(
                                     web.cookies().email,#邮箱
                                     web.cookies().password,#密码
                                     domain_id=domainId,#域名ID
                                     sub_domain = i.hostrecord.encode(),#主机记录        
                                     record_type = i.recordType.encode(),#记录类型
                                     route_line = i.routeType.encode('utf-8'),#线路类型
                                     value = i.recordValue.encode(),#记录值
                                     mx = i.MX.encode(),#MX值
                                     ttl = i.TTL.encode()#TTL
                                     )        
     if message == '1':
         recordList = processData.recordList(
                                     web.cookies().email,
                                     web.cookies().password,
                                     id=domainId
                                     )
         return render.record(domain,recordList,delMsg='添加成功')
     else:
         recordList = processData.recordList(
                                     web.cookies().email,
                                     web.cookies().password,
                                     id=domainId
                                     )
         return render.record(domain,recordList,delMsg=message)
Beispiel #3
0
 def GET(self,domain):
     domainId = processData.domainInfo(
                                     web.cookies().email,
                                     web.cookies().password,
                                     domain=domain
                                     )#获取域名ID
     
     recordList = processData.recordList(
                                     web.cookies().email,
                                     web.cookies().password,
                                     id=domainId
                                     )#获取记录列表
     fileHead = '主机|类型|线路|记录值|MX优先级|TTL'#导出文件的头部
     s = ''
     s += fileHead + '\n'
     for i in recordList:
         s += i['name'].encode() + '\t'
         s += str(i['type']) + '\t'
         s += i['line'].encode('utf-8') + '\t'
         s += str(i['value']) + '\t'
         s += str(i['mx']) + '\t'
         s += str(i['ttl']) + '\n'
     web.header('Content-Type','static/txt')
     web.header('Content-Disposition',"attachment;filename="+domain+".txt")
     return s
Beispiel #4
0
    def GET(self,domain):
        #获取指定域名ID
        domainID = processData.domainInfo(
                                        web.cookies().email,
                                        web.cookies().password,
                                        domain=domain
                                        )

        recordList = processData.recordList(
                                        web.cookies().email,
                                        web.cookies().password,
                                        id=domainID
                                        )

        return render.record(domain,recordList)