mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-23 19:37:23 +08:00
tag and installer&updater use english
This commit is contained in:
@@ -24,7 +24,6 @@ if ($currentStep == 1) {
|
||||
|
||||
if ($currentStep == 2) {
|
||||
$envExampleFile = $rootpath . ".env.example";
|
||||
// $dbstructureFile = $rootpath . "_db/dbstructure_v1.6.sql";
|
||||
$envExampleData = readEnvFile($envExampleFile);
|
||||
$envFormControls = $install->listEnvFormControls();
|
||||
$newData = array_column($envFormControls, 'value', 'name');
|
||||
@@ -45,12 +44,6 @@ if ($currentStep == 2) {
|
||||
'current' => $envExampleFile,
|
||||
'result' => $install->yesOrNo(file_exists($envExampleFile) && is_readable($envExampleFile)),
|
||||
],
|
||||
// [
|
||||
// 'label' => basename($dbstructureFile),
|
||||
// 'required' => 'exists && readable',
|
||||
// 'current' => $dbstructureFile,
|
||||
// 'result' => $install->yesOrNo(file_exists($dbstructureFile) && is_readable($dbstructureFile)),
|
||||
// ],
|
||||
];
|
||||
$fails = array_filter($tableRows, function ($value) {return $value['result'] == 'NO';});
|
||||
$pass = empty($fails);
|
||||
@@ -134,10 +127,10 @@ if ($currentStep == 5) {
|
||||
}
|
||||
}
|
||||
$userFormControls = [
|
||||
['label' => '用户名', 'name' => 'username', 'value' => $_POST['username'] ?? ''],
|
||||
['label' => '邮箱', 'name' => 'email', 'value' => $_POST['email'] ?? ''],
|
||||
['label' => '密码', 'name' => 'password', 'value' => $_POST['password'] ?? ''],
|
||||
['label' => '确认密码', 'name' => 'confirm_password', 'value' => $_POST['confirm_password'] ?? ''],
|
||||
['label' => 'Username', 'name' => 'username', 'value' => $_POST['username'] ?? ''],
|
||||
['label' => 'Email', 'name' => 'email', 'value' => $_POST['email'] ?? ''],
|
||||
['label' => 'Password', 'name' => 'password', 'value' => $_POST['password'] ?? ''],
|
||||
['label' => 'Re-password', 'name' => 'confirm_password', 'value' => $_POST['confirm_password'] ?? ''],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -164,10 +157,10 @@ if (!empty($error)) {
|
||||
<?php
|
||||
echo'<div class="step-' . $currentStep . ' text-center">';
|
||||
$header = [
|
||||
'label' => '项目',
|
||||
'required' => '要求',
|
||||
'current' => '当前',
|
||||
'result' => '结果'
|
||||
'label' => 'Item',
|
||||
'required' => 'Require',
|
||||
'current' => 'Current',
|
||||
'result' => 'Result'
|
||||
];
|
||||
if ($currentStep == 1) {
|
||||
echo $install->renderTable($header, $requirements['table_rows']);
|
||||
@@ -176,23 +169,23 @@ if (!empty($error)) {
|
||||
echo $install->renderForm($envFormControls);
|
||||
|
||||
} elseif ($currentStep == 3) {
|
||||
echo '<h1 class="mb-4 text-lg font-bold">需要新建以下数据表</h1>';
|
||||
echo '<h1 class="mb-4 text-lg font-bold">The following new table will be created</h1>';
|
||||
if (empty($shouldCreateTable)) {
|
||||
echo '<div class="text-green-600 text-center">恭喜,需要的表均已创建!</div>';
|
||||
echo '<div class="text-green-600 text-center">Congratulations, all the required tables have been created!</div>';
|
||||
} else {
|
||||
echo sprintf('<div class="h-64 text-left inline-block w-2/3"><code class="bolck w-px-100">%s</code></div>', implode(', ', array_keys($shouldCreateTable)));
|
||||
}
|
||||
} elseif ($currentStep == 4) {
|
||||
echo $install->renderTable($header, $tableRows);
|
||||
echo '<div class="text-blue-500 pt-10">';
|
||||
echo sprintf('这一步会把 <code>%s</code> 的数据合并到 <code>%s</code>, 然后插入数据库中。', $tableRows[1]['label'], $tableRows[0]['label']);
|
||||
echo sprintf('This step will merge <code>%s</code> to <code>%s</code>, then insert into database', $tableRows[1]['label'], $tableRows[0]['label']);
|
||||
echo '</div>';
|
||||
} elseif ($currentStep == 5) {
|
||||
echo $install->renderForm($userFormControls, '1/3', '1/4', '3/4');
|
||||
} elseif ($currentStep > $maxStep) {
|
||||
echo '<div class="text-green-900 text-6xl p-10">恭喜,一切就绪!</div>';
|
||||
echo '<div class="mb-6">有问题可查阅安装日志:<code>' . $install->getLogFile() . '</code></div>';
|
||||
echo '<div class="text-red-500">为安全起见,请删除以下目录</div>';
|
||||
echo '<div class="text-green-900 text-6xl p-10">Congratulations, everything is ready!</div>';
|
||||
echo '<div class="mb-6">For questions, consult the installation log at: <code>' . $install->getLogFile() . '</code></div>';
|
||||
echo '<div class="text-red-500">For security reasons, please delete the following directories</div>';
|
||||
echo '<div class="text-red-500"><code>' . $install->getInsallDirectory() . '</code></div>';
|
||||
}
|
||||
echo'</div>';
|
||||
@@ -207,18 +200,18 @@ if (!empty($error)) {
|
||||
}
|
||||
?>
|
||||
<div class="mt-10 text-center">
|
||||
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">上一步</button>
|
||||
<button class="bg-blue-500 p-2 m-4 text-white rounded" type="button" onclick="goBack()">Prev</button>
|
||||
<?php if ($currentStep <= $maxStep) {?>
|
||||
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>下一步</button>
|
||||
<button class="bg-blue-<?php echo $pass ? 500 : 200;?> p-2 m-4 text-white rounded" type="submit" <?php echo $pass ? '' : 'disabled';?>>Next</button>
|
||||
<?php } else {?>
|
||||
<a class="bg-blue-500 p-2 m-4 text-white rounded" href="<?php echo getSchemeAndHttpHost()?>">回首页</a>
|
||||
<a class="bg-blue-500 p-2 m-4 text-white rounded" href="<?php echo getSchemeAndHttpHost()?>">Go to homepage</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m-10 text-center">
|
||||
欢迎使用 NexusPHP 安装程序,如有疑问,点击<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">这里</a>获取帮助。
|
||||
Welcome to the NexusPHP installer, if you have any questions, click<a href="https://nexusphp.org/" target="_blank" class="text-blue-500 p-1">here</a>for help.
|
||||
</div>
|
||||
</body>
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user