def asset_list(): _asset_list = [] for i in asset.get_list(): _rt_list = asset.get_by_id(i.get('idc_id')) i['idc_id'] = _rt_list[0][1] #((2L, u'\u6570\u5317', 0L),) _asset_list.append(i) return render_template('asset/asset_list.html',asset_list=_asset_list)
def asset_list(): _asset_list = [] for i in asset.get_list(): _rt_list = asset.get_by_id(i.get('idc_id')) i['idc_id'] = _rt_list[0][1] _asset_list.append(i) return render_template('assets.html', asset_list=_asset_list)
def perform_asset(): _id = request.args.get('id', '') _count, _asset = asset.get_by_id(_id) _asset = _asset[0] datetime_list, cpu_list, ram_list = Performs.get_list(_asset['ip']) return render_template('asset_perform.html', datetime_list=json.dumps(datetime_list), cpu_list=json.dumps(cpu_list), ram_list=json.dumps(ram_list))
def cmd_execute_asset(): _is_ok, _errors = Command.validate(request.form) _id = request.form.get('id', '') _count, _asset = asset.get_by_id(_id) _success = '' if _is_ok: _success = Command.execute(request.form, _asset[0]) print _success return json.dumps({ 'is_ok': _is_ok, 'errors': _errors, 'success': _success })
def asset_modify(): _id = request.args.get('id', '') _asset = asset.get_by_id(_id) return render_template('asset_modify.html', asset=_asset, idcs=asset.get_idc_list())
def modify_asset(): _id = request.args.get('id', '') _count, _asset = asset.get_by_id(_id) _idcs = asset.get_idc_list() return render_template('asset_modify.html', asset=_asset[0], idcs=_idcs)