def index_activity(cls): activity = {} activity.update(st_instance.ins_activity) total, rows = data_paging(activity, cls.KEY_NAME) info_normal(m='rows', lo={'total': total}, func='index_activity') for i, row in enumerate(rows): row['i'] = i + 1 return {'rows': rows, 'total': total, 'status': True}
def index_user(cls): """索引用户""" user = {} user.update(st_instance.ins_user) total, rows = data_paging(user, cls.KEY_NAME, exclude=['password']) info_normal(m='rows', lo={'total': total}, func='index_user') for i, row in enumerate(rows): row['i'] = i + 1 return {'rows': rows, 'total': total, 'status': True}
def index_task(cls): """索引任务""" task = {} task.update(st_instance.ins_task) total, rows = data_paging(task, cls.KEY_NAME) info_normal(m='rows', lo={'total': total}, func='index_task') for i, row in enumerate(rows): row['i'] = i + 1 return {'rows': rows, 'total': total, 'status': True}
def index_proxy(cls): """索引代理""" proxy = {} proxy.update(st_instance.ins_proxy) total, rows = data_paging(proxy, cls.KEY_NAME, fields=['proxy', 'status']) info_normal(m='rows', lo={'total': total}, func='index_proxy') for i, row in enumerate(rows): row['i'] = i + 1 return {'rows': rows, 'total': total, 'status': True}
def index_master(cls): """节点索引主控""" master = {} master.update(st_instance.ins_master) total, rows = data_paging(master, cls.KEY_NAME) info_normal( m='rows', lo={'total': total}, func='index_master' ) for i, row in enumerate(rows): row['i'] = i + 1 return {'rows': rows, 'total': total, 'status': True}
def index_node(cls): """索引节点""" node = {} node.update(st_instance.ins_node) total, rows = data_paging(node, cls.KEY_NAME, fields=['name', 'key', 'status']) info_normal( m='rows', lo={'total': total}, func='index_node' ) for i, row in enumerate(rows): row['i'] = i + 1 return {'rows': rows, 'total': total, 'status': True}