<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('asr引擎设置')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
    <style>
    </style>
</head>

<body>
<div class="main-content">
    <div id="baseConfigs" th:object="${mod}">
        <div className="row">
            <div class="col-sm-12">
                <label class="col-sm-2 control-label" th:text="#{switchconf.asr.engine.header}"></label>
                <div class="col-sm-6">
                    <select name="asrengine" id="asrengine" class="form-control m-b" th:field="*{modValue}">
                        <option value="" th:text="#{switchconf.asr.engine.option1}"></option>
                        <option value="mod_funasr" th:text="#{switchconf.asr.engine.option2}"></option>
                        <option value="mod_aliyun_asr" th:text="#{switchconf.asr.engine.option3}"></option>
                        <option value="mod_ali_asr" th:text="#{switchconf.asr.engine.option4}"></option>
                        <option value="mod_xunfei_asr" th:text="#{switchconf.asr.engine.option5}"></option>
                        <option value="mod_chinatelecom_asr" th:text="#{switchconf.asr.engine.option6}"></option>
                        <option value="mod_tx_asr" th:text="#{switchconf.asr.engine.option7}"></option>
                        <option value="mod_tx_asr1" th:text="#{switchconf.asr.engine.option8}"></option>
                    </select>
                </div>
            </div>
        </div>
    </div>

    <!-- 保存按钮 -->
    <div class="row" ></div>
    <div class="row" >
        <div class="col-sm-offset-5 col-sm-10">
            <button id="saveConfig" type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
        </div>
    </div>
</div>



<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<script>
    // 页面加载完成后，发送AJAX请求获取配置数据
    var prefix = ctx + "cc/fsconf";

    // 保存配置
    $('#saveConfig').click(function() {
        $.ajax({
            url: prefix + '/setAsrengine?asrengine=' + $("#asrengine").val(), // 假设后端保存配置的接口是 /setConfig
            type: 'GET',
            contentType: 'application/json',
            beforeSend: function () {
                $.modal.loading(i18n("common.tip.loading"));
                $.modal.disable();
            },
            success: function(response) {
                processAjaxReponseJson(response);
            },
            error: function(error) {

            }
        });
    });

</script>

</body>
</html>
