Beispiel #1
0
def get_tableInfo():
    pageIndex = 0
    pageSize = 10
    enterprise_list = []
    ret_json = {}

    if request.method == 'POST':
        request_args = json.loads(request.get_data())
        if request_args.has_key('item_name'):
            pageIndex = request_args.get('pageIndex')
            pageSize = request_args.get('pageSize')
            keyword = request_args.get('keyword')
            if request_args.get('item_name') == 'buildAndroidModule':
                data_list = EntModule.get_enterprise_list(
                    pageIndex, pageSize, keyword)
                count = EntModule.get_enterprise_count()

            elif request_args.get('item_name') == 'buildConfigModule':
                data_list = ConfigureSettingModule.get_all_configureInfo(
                    pageIndex, pageSize)
                count = ConfigureSettingModule.get_config_count()

            elif request_args.get('item_name') == 'repositoryModule':
                data_list = RepositoryModule.get_all_repository(
                    pageIndex, pageSize)
                count = RepositoryModule.get_repository_count()

            ret_json = {'count': count, 'data_list': data_list}
            return jsonify(ret_json)
        else:
            abort(404)
Beispiel #2
0
def get_current_switch():
    """
		获取配置文件存档,用于开关设置>查看开关文件
		- Author: cpu
		- Args:
		- Returns: 
		- Modify

	"""
    if request.method == 'POST':
        request_args = json.loads(request.get_data())
        file_nick_name = request_args['file_nick_name']
        configInfo = ConfigureSettingModule.get_current_switch(file_nick_name)
        return jsonify({"configInfo": configInfo})
    else:
        abort(404)
Beispiel #3
0
def get_config_info():
    """
		获取配置文件存档详情,用于开关设置>查看开关文件
		- Author: cpu
		- Args:
		- Returns: 
		- Modify

	"""
    if request.method == 'POST':
        request_args = json.loads(request.get_data())
        android_or_ios = request_args['android_or_ios']
        configInfo = ConfigureSettingModule.get_configureInfo(android_or_ios)
        return jsonify({"configInfo": configInfo})
    else:
        abort(404)
Beispiel #4
0
def delete_config_file():
    """
		清空配置文件存档,用于开关设置>删除此配置
		- Author: cpu
		- Args:
		- Returns: 
		- Modify

	"""
    if request.method == 'POST':
        request_args = json.loads(request.get_data())
        file_nick_name = request_args['file_nick_name']
        err = ConfigureSettingModule.delete_config_file(file_nick_name)
        if err is None:
            return make_response(jsonify({"result": '删除成功!'}), 200)
        else:
            return make_response(jsonify({"result": 'err!'}), 400)
    else:
        abort(404)
Beispiel #5
0
def add_config_file():
    """
		新增配置文件存档,用于开关设置>新增开关文件
		- Author: cpu
		- Args:
		- Returns: 
		- Modify

	"""
    if request.method == 'POST':
        request_args = json.loads(request.get_data())
        config_file = request_args['add_config_file']
        err = ConfigureSettingModule.add_config_file(config_file)
        if err is None:
            return make_response(jsonify({"result": '新增成功!'}), 200)
        else:
            return make_response(jsonify({"result": 'err!'}), 400)
    else:
        abort(404)
Beispiel #6
0
def modify_swith():
    """
		修改配置文件存档,用于开关设置>编辑开关文件
		- Author: cpu
		- Args:
		- Returns: 
		- Modify

	"""
    if request.method == 'POST':
        request_args = json.loads(request.get_data())
        file_items = request_args['modify_switch']
        file_nick_name = request_args['file_nick_name']
        err = ConfigureSettingModule.modify_switch(file_nick_name, file_items)
        if err is None:
            return make_response(jsonify({"result": '新增成功!'}), 200)
        else:
            return make_response(jsonify({"result": 'err!'}), 400)
    else:
        abort(404)
Beispiel #7
0
 def get_configure_setting(self):
     from models.enterprise import ConfigureSettingModule as Config
     self.conf_setting = Config.get_configureInfo(self.os_mode)