{{:ModuleInclude('public/header')}}

<!-- right content start  -->
<div class="content-right">
    <div class="content">
        <!-- form start -->
        <form class="am-form form-validation am-form-popup-sticky" action="{{:MyUrl('admin/site/save')}}" method="POST" request-type="ajax-view" request-value="{{:MyUrl('admin/site/index', ['nav_type'=>'cache'])}}" enctype="multipart/form-data">
            {{:ModuleInclude('public/nav_switch_btn', [
                'nav_data' => [
                    [
                        'name' => MyLang('site.base_item_session_cache_title'),
                        'key'  => 'session-cache',
                    ],
                    [
                        'name' => MyLang('site.base_item_data_cache_title'),
                        'key'  => 'data-cache',
                    ],
                    [
                        'name' => MyLang('site.base_item_redis_cache_title'),
                        'key'  => 'redis-cache',
                    ]
                ]
            ])}}
            <div class="nav-content">
                {{if is_array(MyLang('site.site_cache_tips_list'))}}
                    <div class="am-operate-stretch-tips">
                        <div class="title">
                            <i class="iconfont icon-tips"></i>
                            <strong title="{{:MyLang('operate_list_tips_msg')}}">{{:MyLang('operate_list_tips_button_text')}}</strong>
                            <i class="iconfont icon-retract-diagonal contract" title="{{:MyLang('operate_list_tips_retract_text')}}"></i> 
                        </div>
                        <p>{{:implode('</p><p>', MyLang('site.site_cache_tips_list'))}}</p>
                    </div>
                {{/if}}
                <!-- Session缓存配置 -->
                <div class="item am-active" data-key="session-cache">
                    <div class="am-form-group">
                        <label>{{$data.common_session_is_use_cache.name}}<span class="am-form-group-label-tips">{{$data.common_session_is_use_cache.describe}}</span></label>
                        <div class="am-radio-group">
                            {{foreach $common_is_text_list as $v}}
                                <label class="am-radio-inline">
                                    <input type="radio" value="{{$v.id}}" name="{{$data.common_session_is_use_cache.only_tag}}" data-validation-message="{{$data.common_session_is_use_cache.error_tips}}" required {{if isset($data['common_session_is_use_cache']['value']) and $data['common_session_is_use_cache']['value'] eq $v['id']}}checked{{/if}} data-am-ucheck>{{$v.name}}
                                </label>
                            {{/foreach}}
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_cache_session_redis_prefix.name}}<span class="am-form-group-label-tips">{{$data.common_cache_session_redis_prefix.describe}}</span></label>
                        <input type="text" name="{{$data.common_cache_session_redis_prefix.only_tag}}" placeholder="{{$data.common_cache_session_redis_prefix.describe}}" data-validation-message="{{$data.common_cache_session_redis_prefix.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cache_session_redis_prefix.value}}"{{/if}} />
                    </div>
                </div>

                <!-- 数据缓存配置 -->
                <div class="item" data-key="data-cache">
                    <div class="am-form-group">
                        <label>{{$data.common_data_is_use_cache.name}}<span class="am-form-group-label-tips">{{$data.common_data_is_use_cache.describe}}</span></label>
                        <div class="am-radio-group">
                            {{foreach $common_is_text_list as $v}}
                                <label class="am-radio-inline">
                                    <input type="radio" value="{{$v.id}}" name="{{$data.common_data_is_use_cache.only_tag}}" data-validation-message="{{$data.common_data_is_use_cache.error_tips}}" required {{if isset($data['common_data_is_use_cache']['value']) and $data['common_data_is_use_cache']['value'] eq $v['id']}}checked{{/if}} data-am-ucheck>{{$v.name}}
                                </label>
                            {{/foreach}}
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_cache_data_redis_prefix.name}}<span class="am-form-group-label-tips">{{$data.common_cache_data_redis_prefix.describe}}</span></label>
                        <input type="text" name="{{$data.common_cache_data_redis_prefix.only_tag}}" placeholder="{{$data.common_cache_data_redis_prefix.describe}}" data-validation-message="{{$data.common_cache_data_redis_prefix.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cache_data_redis_prefix.value}}"{{/if}} />
                    </div>
                </div>

                <!-- redis缓存配置 -->
                <div class="item" data-key="redis-cache">
                    <div class="am-form-group">
                        <label>{{$data.common_data_is_use_redis_cache.name}}<span class="am-form-group-label-tips">{{$data.common_data_is_use_redis_cache.describe}}</span></label>
                        <div class="am-radio-group">
                            {{foreach $common_is_text_list as $v}}
                                <label class="am-radio-inline">
                                    <input type="radio" value="{{$v.id}}" name="{{$data.common_data_is_use_redis_cache.only_tag}}" data-validation-message="{{$data.common_data_is_use_redis_cache.error_tips}}" required {{if isset($data['common_data_is_use_redis_cache']['value']) and $data['common_data_is_use_redis_cache']['value'] eq $v['id']}}checked{{/if}} data-am-ucheck>{{$v.name}}
                                </label>
                            {{/foreach}}
                        </div>
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_cache_data_redis_host.name}}<span class="am-form-group-label-tips">{{$data.common_cache_data_redis_host.describe}}</span></label>
                        <input type="text" name="{{$data.common_cache_data_redis_host.only_tag}}" placeholder="{{$data.common_cache_data_redis_host.describe}}" data-validation-message="{{$data.common_cache_data_redis_host.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cache_data_redis_host.value}}"{{/if}} />
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_cache_data_redis_port.name}}<span class="am-form-group-label-tips">{{$data.common_cache_data_redis_port.describe}}</span></label>
                        <input type="text" name="{{$data.common_cache_data_redis_port.only_tag}}" placeholder="{{$data.common_cache_data_redis_port.describe}}" data-validation-message="{{$data.common_cache_data_redis_port.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cache_data_redis_port.value}}"{{/if}} />
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_cache_data_redis_password.name}}<span class="am-form-group-label-tips">{{$data.common_cache_data_redis_password.describe}}</span></label>
                        <input type="text" name="{{$data.common_cache_data_redis_password.only_tag}}" placeholder="{{$data.common_cache_data_redis_password.describe}}" data-validation-message="{{$data.common_cache_data_redis_password.error_tips}}" class="am-radius" {{if !empty($data)}}value="{{$data.common_cache_data_redis_password.value}}"{{/if}} />
                    </div>
                    <div class="am-form-group">
                        <label>{{$data.common_cache_data_redis_expire.name}}<span class="am-form-group-label-tips">{{$data.common_cache_data_redis_expire.describe}}</span></label>
                        <div class="am-input-group am-input-group-sm">
                            <input type="number" min="0" name="{{$data.common_cache_data_redis_expire.only_tag}}" placeholder="{{$data.common_cache_data_redis_expire.name}}" data-validation-message="{{$data.common_cache_data_redis_expire.error_tips}}" class="am-radius am-form-field" {{if !empty($data)}}value="{{$data.common_cache_data_redis_expire.value}}"{{/if}} />
                            <span class="am-input-group-label am-radius">{{:MyLang('second_title')}}</span>
                        </div>
                    </div>
                </div>
            </div>

            <div class="am-form-popup-submit">
                <input type="hidden" name="nav_type" value="{{$nav_type}}" />
                <button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('save_title')}}'}">
                    <i class="am-icon-save"></i>
                    <span>{{:MyLang('save_title')}}</span>
                </button>
            </div>
        </form>
        <!-- form end -->
    </div>
</div>
<!-- right content end  -->

<!-- footer start -->
{{:ModuleInclude('public/footer')}}