able to skip checking RewriteEngine

pull/54/head
Crazy-White 2020-05-06 21:32:41 +08:00
parent 0e5320dd93
commit 9e5c12a8cf
2 changed files with 14 additions and 4 deletions

View File

@ -716,6 +716,10 @@ $constStr = [
'ko-kr' => '다시 쓰기 (의사 정적) 기능이 활성화되어 있는지 확인하십시오.', 'ko-kr' => '다시 쓰기 (의사 정적) 기능이 활성화되어 있는지 확인하십시오.',
'fa' => 'لطفاً مطمئن شوید که RewriteEngine روشن است.', 'fa' => 'لطفاً مطمئن شوید که RewriteEngine روشن است.',
], ],
'SkipCheckingRewrite' => [
'en-us' => 'Set RewriteEngine later.',
'zh-cn' => '待会再配置重写(伪静态)功能。'
],
'CopyUrl' => [ 'CopyUrl' => [
'en-us' => 'Copy URL', 'en-us' => 'Copy URL',
'zh-cn' => '复制链接', 'zh-cn' => '复制链接',

View File

@ -142,7 +142,8 @@ function install()
$title = 'Error'; $title = 'Error';
return message($html, $title, 201); return message($html, $title, 201);
}*/ }*/
$html .= '<button id="checkrewritebtn" onclick="checkrewrite();">'.getconstStr('MakesuerRewriteOn').'</button> $html .= '<button class="checkrewritebtn" onclick="checkrewrite();">'.getconstStr('MakesuerRewriteOn').'</button>
<button class="checkrewritebtn" onclick="showpassword();">'.getconstStr('SkipCheckingRewrite').'</button>
<div id="formdiv" style="display: none"> <div id="formdiv" style="display: none">
<form action="?install2" method="post" onsubmit="return notnull(this);"> <form action="?install2" method="post" onsubmit="return notnull(this);">
<input name="admin" type="password" placeholder="' . getconstStr('EnvironmentsDescription')['admin'] . '" size="' . strlen(getconstStr('EnvironmentsDescription')['admin']) . '"><br> <input name="admin" type="password" placeholder="' . getconstStr('EnvironmentsDescription')['admin'] . '" size="' . strlen(getconstStr('EnvironmentsDescription')['admin']) . '"><br>
@ -164,6 +165,13 @@ function install()
} }
return true; return true;
} }
function showpassword()
{
document.querySelectorAll(".checkrewritebtn").forEach(function(ele){ele.style.display = "none"});
document.getElementById("submitbtn").disabled = false;
document.getElementById("formdiv").style.display = "";
}
function checkrewrite() function checkrewrite()
{ {
url=location.protocol + "//" + location.host; url=location.protocol + "//" + location.host;
@ -179,9 +187,7 @@ function install()
xhr4.onload = function(e){ xhr4.onload = function(e){
console.log(xhr4.responseText+","+xhr4.status); console.log(xhr4.responseText+","+xhr4.status);
if (xhr4.status==201) { if (xhr4.status==201) {
document.getElementById("checkrewritebtn").style.display = "none"; showpassword();
document.getElementById("submitbtn").disabled = false;
document.getElementById("formdiv").style.display = "";
} else { } else {
alert(url+"\n"+xhr4.status); alert(url+"\n"+xhr4.status);
} }