def get_vps_detail(vid): ''' Get the details about one certain VPS Server ''' (result, result_data) = _get_vps_details(vid) if result: _id, vender, ac, ip, os, root_passwd, cpanel_addr, cpanel_user, cpanel_passwd, remark, status, _type, score, created_time, updated_time, price = result_data[0] if score < 80: score = '<font color="red">' + str(score) + '</font>' else: score = '<font color="#00FF00">' + str(score) + '</font>' if status.lower() == 'running': status = '<font color="#00FF00">' + status + '</font>' elif status.lower() == 'new added': status = '<font color="blue">' + status + '</font>' else: status = '<font color="red">' + status + '</font>' if not cpanel_addr.startswith('http'): cpanel_addr = 'http://' + cpanel_addr cpanel_addr = '<a href="%s" target="blank">' % cpanel_addr + cpanel_addr + '</a>' return template('./template/vpsdetail.tpl', dict(vps_id=_id, vps_vender=vender, vps_ac=ac, vps_ip=ip, vps_os=os, vps_root_passwd=root_passwd, vps_cpanel_addr=cpanel_addr, vps_cpanel_user=cpanel_user, vps_cpanel_passwd=cpanel_passwd, vps_remark=remark, vps_status=status, vps_type=_type, vps_score=score, vps_created_time=created_time, vps_updated_time=updated_time, vps_price=price)) else: return result_data
def get_edit_vps(vid): (result, result_data) = _get_vps_details(vid) if result: _id, vender, ac, ip, os, root_passwd, cpanel_addr, cpanel_user, cpanel_passwd, remark, status, _type, score, created_time, updated_time, price = result_data[0] return template('./template/editvps.tpl', dict(vps_id=_id, vps_vender=vender, vps_ac=ac, vps_ip=ip, vps_os=os, vps_root_passwd=root_passwd, vps_cpanel_addr=cpanel_addr, vps_cpanel_user=cpanel_user, vps_cpanel_passwd=cpanel_passwd, vps_remark=remark, vps_status=status, vps_type=_type, vps_score=score, vps_created_time=created_time, vps_updated_time=updated_time, vps_price=price))