<!--#include file="html_fun.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="<%=sitepath%>css/bootstrap.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/font-awesome.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/animate.min.css" rel="stylesheet">
<link href="<%=sitepath%>css/style.min.css" rel="stylesheet">
<link href="<%=sitepath&adminPath%>css/adminstyle.css" rel="stylesheet">
<link href="<%=sitepath%>plugins/switchery/switchery.css" rel="stylesheet">
<link href="<%=sitepath%>plugins/colorpicker/bootstrap-colorpicker.min.css" rel="stylesheet">
<script src="<%=sitepath%>js/jquery.min.js"></script>
<script src="<%=sitepath%>plugins/colorpicker/bootstrap-colorpicker.min.js"></script>
<!--[if lte IE 9]>
<script src="<%=sitepath%>js/respond.min.js"></script>
<script src="<%=sitepath%>js/html5.js"></script>
<![endif]-->
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content">
<div class="ibox float-e-margins">
<div class="row row-lg">
<div class="col-md-6">
							<div class="panel">
								<div class="panel-heading">
									<h3 class="panel-title">模式设置</h3>
									<div class="panel-aj">
										<button type="button" class="btn-toggle-collapse"><i class="fa fa-chevron-down"></i></button>
										<button type="button" class="btn-remove"><i class="fa fa-times"></i></button>
									</div>
								</div>
<div class="panel-body">
<div class="panel-body no-padding">		

<form method="post" action="?act=editsystem" class="form-horizontal" id="contentform">
        <div class="ibox-content">
          <div class="row m-t">
            <div class="col-sm-12">
              <%if isObjInstalled("Scripting.FileSystemObject") then%>
              <div class="form-group">
                <label class="col-sm-2 control-label">FSO权限</label>
                <span class='badge badge-primary'>支持</span> </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">网站运行模式</label>
                <div class="col-sm-2">
                <select name="runMode" id="runMode" class="form-control">
                <option value="0" <%if(runMode=0) then echo "selected"%>>动态</option>
                 <option value="1" <%if(runMode=1) then echo "selected"%>>静态</option>
                 <option value="2" <%if(runMode=2) then echo "selected"%> <%if sitepath<>"/" then echo "disabled"%>>伪静态+动态</option>
                 <option value="3" <%if(runMode=3) then echo "selected"%> <%if sitepath<>"/" then echo "disabled"%>>伪静态+静态</option>
                </select>
                  <span class="help-block m-b-none">
                  <%if sitepath<>"/" then echo "二级目录不支持使用伪静态"%>
                  </span> </div>
                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 动态模式所见即所得，静态模式为带问号的自动静态，伪静态为去掉问号（需服务器或支持rewrite的空间）</span> </div>
              <div <%if runMode=0 or runMode=2 then echo "class=show-1" else echo "class=show-0" end if%> id="showrunMode">
                <div class="form-group">
                  <label class="col-sm-2 control-label">缓存开关</label>
                  <div class="col-sm-2" id="IsCache">
                    <input type="checkbox"  name="IsCache"  value="1" class="js-switch"  <%if(IsCache=1) then echo "checked"%>>
                    <span class="help-block m-b-none">
                    <%if(IsCache=0) then echo "关闭缓存" else echo "开启缓存"%>
                    </span> </div>
                  <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 动态模式运行，启用缓存后可提高访问速度和降低服务器负担，降低当机的几率</span> </div>
              </div>
            
                  
              <div class="show-<%=IsCache%>" id="showCache">               
                <div class="form-group">
                  <label class="col-sm-2 control-label">缓存路径</label>
                  <div class="col-sm-2">
                    <input type="text" value="<%=CachePath%>" readonly name="CachePath" id="CachePath" class="form-control">
                  </div>
                  <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 默认为:"Cache/htmlcache/"</span> </div>
              </div>
              <div <%if runMode=1 or runMode=3 then echo "class=show-1" else echo "class=show-0" end if%> id="showhtmldir">
                <div class="form-group">
                  <label class="col-sm-2 control-label">静态路径</label>
                  <div class="col-sm-2">
                    <input type="text" value="<%=htmlDir%>" name="htmlDir" id="htmlDir" class="form-control">
                  </div>
                  <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 默认为:"a/"，不建议设置为根目录，根目录请留空</span> </div>
              </div>
              <%else%>
              <div class="form-group">
                <label class="col-sm-2 control-label">FSO权限</label>
                <span class='badge badge-primary'>您空间不支持FSO权限，不能开启静态和缓存功能</span> </div>
              <%end if%>
                
               <div class="form-group">
                  <label class="col-sm-2 control-label">缓存/静态更新频率</label>
                  <div class="col-sm-2">
                    <input type="text" value="<%=cacheTime%>" name="cacheTime" id="cacheTime" class="form-control">
                  </div>
                  <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 缓存/静态模式开启后，触发自动更新频率，默认为:"24小时，单位为小时"</span> </div>
            </div>
          </div>
        </div>
        <div class="ibox-content">
          <div class="row">
            <div class=" col-sm-10 col-md-offset-1">
              <button class="btn btn-primary" type="submit"><i class="fa fa-floppy-o"></i>　保存内容</button>
            </div>
          </div>
        </div>
      </form>

</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="<%=sitepath%>js/klorofil-common.js"></script>
<script src="<%=sitepath%>js/bootstrap.min.js"></script> 
<script src="<%=sitepath%>plugins/switchery/switchery.js"></script>
<script src="<%=sitepath%>plugins/layer/layer.min.js"></script> 
<script src="<%=sitepath&adminPath%>js/content.min.js"></script> 
<script>
$(function () {
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
	elems.forEach(function(html) {
  var switchery = new Switchery(html);
});
 $("#runMode").change(function () {
		    runMode=$("#runMode").val()
			if(runMode =="1" || runMode =="3") {
				$("#IsCache input").val(0)				
				$("#showhtmldir").show();
				$("#showrunMode").hide();
            }else {
				$("#IsCache").show()
                $("#showhtmldir").hide();			
				$("#showrunMode").show();
            }
        });
 $("#IsCache").click(function () {
		    if ($("#IsCache input").is(":checked")) {
                $("#showCache").show();
				$("#IsCache .help-block").text("开启缓存");
            }
            else {
                $("#showCache").hide();
				$("#IsCache .help-block").text("关闭缓存");
            }
        });

});
</script>
</body>
</html>