<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>上传测试脚本</title>
    <script src="static/js/jquery-3.4.1.min.js" type="text/javascript"></script>
    <script src="static/js/bootstrap.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="static/js/fileinput.min.js"></script>

    <link rel="stylesheet" href="{{static_url('css/bootstrap.min.css')}}"/>
    <link type="text/css" rel="stylesheet" href="static/css/fileinput.min.css"/>

    <style>
    </style>
</head>
<body>
<div id="main">
<div class="row " >
    <div class="col-md-4">
    </div>
    <div class="col-md-4">
        <label>app code</label>
        <input type="text" class="form-control border border-secondary" id="app_code" value="">
    </div>
</div>
<div class="row">
    <div class="col-md-4">
    </div>
    <div class="col-md-4">
        <label>moniter path</label>
        <input type="text" class="form-control border border-secondary" id="moniter_path" value="">
    </div>
</div>
<div class="row">
    <div class="col-md-4">
    </div>
    <div class="col-md-4 mt-2 mb-2">
        <input type="file" name="aj_file" id="file">
    </div>
</div>
<div class="row">
    <div class="col-md-4">
    </div>
    <div class="col-md-4 mt-2 mb-2">
        <input type="button" class="btn btn-large btn-dark" value="提交" id="btn">
    </div>
</div>
</div>
<script type="text/javascript">
    $("#btn").click(function () {
        var formdata = new FormData();
        formdata.append('app_code',$("#app_code").val());
        formdata.append('moniter_path',$("#moniter_path").val());
        formdata.append('file_obj',$('[name=aj_file]')[0].files[0]);
        $.ajax({
            url:'/',
            type:'post',
            data:formdata,
            processData: false ,
            contentType: false,
            success:function (data) {
                 alert(data.msg);
            },
            error:function (data) {
                console.log(data);
            }
        })
    })
</script>
</body>
</html>