Browse Source

fix: html format

master
dnomd343 2 years ago
parent
commit
31f51f3464
  1. 2
      src/KmsCli.php
  2. 28
      src/KmsWeb.php

2
src/KmsCli.php

@ -60,5 +60,3 @@ function showOfficeCli(string $host): void { // show office commands in shell
echo "These commands are only applicable to the VL version of Office.\n";
echo "If it is a Retail version, please convert it to Volume first.\n\n";
}
showOfficeCli('kms.343.re');

28
src/KmsWeb.php

@ -1,10 +1,10 @@
<?php
function showKeysHtml(array $kmsKeys, string $header): void { // show kms keys in html
echo '<!DOCTYPE html><html><head><meta charset="utf-8">';
echo '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8">';
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
echo '<link rel="stylesheet" href="./assets/style.css" /></head>';
echo "<title>$header</title><body><div>";
echo '<link rel="stylesheet" href="./assets/style.css" />';
echo "<title>$header</title></head><body><div>";
foreach ($kmsKeys as $title => $keys) {
echo "<h2>$title</h2>";
echo '<table><thead><tr><th>操作系统</th><th>KMS密钥</th></tr></thead><tbody>';
@ -18,22 +18,22 @@ function showKeysHtml(array $kmsKeys, string $header): void { // show kms keys i
function showHelpHtml(string $host): void { // show help message in html
echo '<!DOCTYPE html><html><head><meta charset="utf-8">';
echo '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8">';
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
echo '<link rel="stylesheet" href="./assets/style.css" /></head>';
echo '<title>Windows Activation</title>';
echo '<link rel="stylesheet" href="./assets/style.css" />';
echo "<title>Windows Activation</title></head>\n";
echo '<body><div><h2>Windows KMS Activation</h2><pre>';
echo '<code> slmgr /upk\n slmgr /ipk KMS_KEY\n slmgr /skms ' . $host . '\n slmgr /ato\n slmgr /dlv </code>';
echo '</pre><p><a href="http://' . $host . '/office">KMS (Office)</a><br>';
echo '<a href="http://' . $host . '/win">KMS_KEY (Windows)</a><br>';
echo '<a href="http://' . $host . '/win-server">KMS_KEY (Windows Server)</a></p></div></body></html>';
echo "<code> slmgr /upk\n slmgr /ipk KMS_KEY\n slmgr /skms $host\n slmgr /ato\n slmgr /dlv </code>";
echo '</pre><p><a href="./office">KMS (Office)</a><br>';
echo '<a href="./win">KMS_KEY (Windows)</a><br>';
echo '<a href="./win-server">KMS_KEY (Windows Server)</a></p></div></body></html>';
}
function showOfficeHtml(string $host): void { // show office commands in html
echo '<!DOCTYPE html><html><head><meta charset="utf-8">';
echo '<!DOCTYPE html><html lang="en"><head><meta charset="utf-8">';
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
echo '<link rel="stylesheet" href="./assets/style.css" /></head><body><div>';
echo "<title>Office KMS Server</title>";
echo '<link rel="stylesheet" href="./assets/style.css" />';
echo "<title>Office KMS Server</title></head>\n<body><div>";
foreach (officeInfo() as $version => $officeInfo) {
echo "<h2>Office Professional Plus $version VL</h2>\n";
echo "<pre><code>" . officeCommand($officeInfo[0], $officeInfo[1], $host) . "</code></pre>\n";
@ -48,5 +48,3 @@ function showOfficeHtml(string $host): void { // show office commands in html
echo "<p>以上命令仅用于激活VL版本的Office,如果当前为Retail版本,请先转化为批量授权版本。</p>\n";
echo "</div></body></html>";
}
showOfficeHtml('kms.343.re');

Loading…
Cancel
Save