bitRate.esp 6.84 KB
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../../css/frame.css" rel="stylesheet" />
    <link href="../../scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
    <link href="../../scripts/easyui/themes/icon.css" rel="stylesheet" />
    <style type="text/css">
        #bitRateForm {
            padding: 8px;
        }

        .tdTitle {
            width: 80px;
        }

        .tdMiddleTitle {
            text-align: left;
            padding-left: 20px;
        }
    </style>
</head>

<body>
    <form id="bitRateForm">
        <table class="settingsContainer">
            <tr>
                <td class="tdMiddleTitle" colspan="2">
                    主码流
                </td>
                <td class="tdMiddleTitle" colspan="2">
                    子码流
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label for="107">编码格式</label>
                </td>
                <td class="tdContent">
                    <select id="107" name="107" class="settingParameter " disabled="disabled">
                        <option value="0">h264</option>
                    </select>
                </td>
                <td class="tdTitle">
                    <label>编码格式</label>
                </td>
                <td class="tdContent">
                    <select id="112" name="112" class="settingParameter " disabled="disabled">
                        <option value="0">h264</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>码率类型</label>
                </td>
                <td class="tdContent">
                    <select id="108" name="108" class="settingParameter " disabled="disabled">
                        <option value="0">CBR</option>
                        <option value="1">VBR</option>
                    </select>
                </td>
                <td class="tdTitle">
                    <label>码率类型</label>
                </td>
                <td class="tdContent">
                    <select id="113" name="113" class="settingParameter " disabled="disabled">
                        <option value="0">CBR</option>
                        <option value="1">VBR</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>分辨率</label>
                </td>
                <td class="tdContent">
                    <select id="109" name="109" class="settingParameter " disabled="disabled">
                        <option value="0">全分辨率</option>
                        <option value="1">1080P</option>
                        <option value="2">720P</option>
                        <option value="3">D1</option>
                        <option value="4">Cif</option>
                    </select>
                </td>
                <td class="tdTitle">
                    <label>分辨率</label>
                </td>
                <td class="tdContent">
                    <select id="114" name="114" class="settingParameter " disabled="disabled">
                        <option value="0">全分辨率</option>
                        <option value="1">1080P</option>
                        <option value="2">720P</option>
                        <option value="3">D1</option>
                        <option value="4">Cif</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label class="needRebootHint" title="修改需重启生效">码率</label>
                </td>
                <td class="tdContent">
                    <input id="110" name="110" class="settingParameter needReboot" type="text" />
                </td>
                <td class="tdTitle">
                    <label class="needRebootHint" title="修改需重启生效">码率</label>
                </td>
                <td class="tdContent">
                    <input id="115" name="115" class="settingParameter needReboot" type="text" />
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>I帧间隔</label>
                </td>
                <td class="tdContent">
                    <input id="111" name="111" class="settingParameter " type="text" />
                </td>
                <td class="tdTitle">
                    <label>I帧间隔</label>
                </td>
                <td class="tdContent">
                    <input id="116" name="116" class="settingParameter " type="text" />
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    <a class="settingBtn" id="btnSave" href="#">保存</a>
                    <% inputSecurityToken(); %>
                </td>
            </tr>
        </table>
    </form>
    <script src="../../scripts/easyui/jquery.min.js"></script>
    <script src="../../scripts/easyui/jquery.easyui.min.js"></script>
    <script src="../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../scripts/utilities.js"></script>
    <script src="../../scripts/jquery.validate.min.js"></script>
    <script src="../../scripts/jquery.validate.extend.js"></script>
    <script type="text/javascript">
        var parameterAdaptor = new ParameterAdaptor();

        $().ready(function () {
            loadBitRateInfo();
            //保存参数
            $("#btnSave").click(saveParametersToServer);

            //验证
            var rules = {};
            rules[110] = {
                range: [1, 10000],
                digits: true,
                required: true
            };
            rules[115] = {
                range: [1, 3000],
                digits: true,
                required: true
            };
            rules[111] = rules[116] = {
                range: [0, 100],
                digits: true,
                required: true
            };
            $("#bitRateForm").validate({
                rules: rules
            });
        });

        //加载数据
        function loadBitRateInfo() {
            var RefererInfo = "bitRate";
            parameterAdaptor.getParameters(RefererInfo, function (data) {
                $("#bitRateForm").form("load", data.feedback);
            });
        };

        //保存参数
        function saveParametersToServer() {
            var formObj = $("#bitRateForm");
            if (!formObj.valid()) {
                $.messager.alert("提示", "参数验证有误,请修改后再提交!", "error");
                return;
            }
            parameterAdaptor.saveParameters(formObj);
        }
    </script>
</body>

</html>