Skip to content

Commit

Permalink
feat: add server install script usage guide
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed Jun 15, 2024
1 parent f06e788 commit 4943d2d
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 25 deletions.
58 changes: 42 additions & 16 deletions src/client/components/server/InstallScript.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,57 @@
import { useCurrentWorkspaceId } from '@/store/user';
import { useTranslation } from '@i18next-toolkit/react';
import { Typography } from 'antd';
import React from 'react';
import React, { useState } from 'react';
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from '../ui/select';

export const InstallScript: React.FC = React.memo(() => {
const { t } = useTranslation();
const workspaceId = useCurrentWorkspaceId();
const command = `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | bash`;
const [commandType, setCommandType] = useState('install');
const commandMap: Record<string, string> = {
install: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | bash`,
uninstall: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | bash -s -- uninstall`,
restart: `curl -o- ${window.location.origin}/serverStatus/${workspaceId}/install.sh?url=${window.location.origin} | bash -s -- reset_conf`,
};
const command = commandMap[commandType] ?? commandMap['install'];

return (
<div>
<div>{t('Run this command in your linux machine')}</div>
<Select value={commandType} onValueChange={setCommandType}>
<SelectTrigger className="w-[180px]">
<SelectValue placeholder="Command" />
</SelectTrigger>
<SelectContent>
<SelectItem value="install">{t('Install')}</SelectItem>
<SelectItem value="uninstall">{t('Uninstall')}</SelectItem>
<SelectItem value="restart">{t('Restart')}</SelectItem>
</SelectContent>
</Select>

<Typography.Paragraph
copyable={{
format: 'text/plain',
text: command,
}}
className="flex h-[96px] overflow-auto rounded border border-black border-opacity-10 bg-black bg-opacity-5 p-2"
>
<span>{command}</span>
</Typography.Paragraph>
<div className="px-2 pt-2">
<div>{t('Run this command in your linux machine')}</div>

<div>
{t(
'Or you wanna report server status in windows server? switch to Manual tab'
)}
<Typography.Paragraph
copyable={{
format: 'text/plain',
text: command,
}}
className="flex h-[96px] overflow-auto rounded border border-black border-opacity-10 bg-black bg-opacity-5 p-2"
>
<span>{command}</span>
</Typography.Paragraph>

<div>
{t(
'Or you wanna report server status in windows server? switch to Manual tab'
)}
</div>
</div>
</div>
);
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/de/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "E-Mail",
"k28059d49": "Aktuelle Arbeitsbereichs-ID",
"k2813d1f7": "Dieser Monat",
"k28441b9b": "Neustart",
"k2a6a7d8f": "UNTEN",
"k2b1255ec": "Beispielcode",
"k2b2d40d4": "Testcode",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "Letzte 24 Stunden",
"k93374bc9": "Website löschen",
"k951a939a": "Akzeptierte Zählung der Website",
"k97ddb155": "Aktuelle Antwort anzeigen",
"k98f433ee": "Reporter herunterladen von",
"k9991c290": "Gemeinschaft",
"k9a272ecf": "Sind das Ihre Server?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "Benachrichtigung",
"ka7fe5937": "Festplattenlesen/-schreiben",
"ka8e41156": "Suche und schneller Sprung",
"ka90bc019": "Deinstallieren",
"ka9d081ac": "Überprüfungsintervall(s)",
"kaa0788e9": "Layout erfolgreich gespeichert",
"kaa0ccaab": "Von E-Mail",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}} Benutzer",
"kd92fa3e7": "Host-Name",
"kdaa949e5": "Ereignisse von {{monitorName}}",
"kdaff25a6": "Zeige den neuesten Wert",
"kdb61adbb": "Offline verbergen",
"kdc51b5db": "Webseiten",
"kdd44ac01": "Anzuzeigender Telemetrie-Name",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "Geräte",
"kdeecbfea": "Resolver-Server",
"kdf5da1d2": "Keine / STARTTLS",
"ke07784e5": "Installieren",
"ke188f24b": "Absprungrate",
"ke1b5ca71": "Seiten",
"ke20a92c7": "Ressourceneintragstyp",
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "Email",
"k28059d49": "Current Workspace Id",
"k2813d1f7": "This Month",
"k28441b9b": "Restart",
"k2a6a7d8f": "DOWN",
"k2b1255ec": "Example code",
"k2b2d40d4": "Test Code",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "Last 24 Hours",
"k93374bc9": "Delete Website",
"k951a939a": "Website Accepted Count",
"k97ddb155": "Show Current Response",
"k98f433ee": "Download reporter from",
"k9991c290": "Community",
"k9a272ecf": "Is this your servers?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "Notification",
"ka7fe5937": "Disk read/write",
"ka8e41156": "Search and quick jump",
"ka90bc019": "Uninstall",
"ka9d081ac": "Check Interval(s)",
"kaa0788e9": "Layout saved success",
"kaa0ccaab": "From Email",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}} users",
"kd92fa3e7": "Host Name",
"kdaa949e5": "{{monitorName}}'s Events",
"kdaff25a6": "Show Latest Value",
"kdb61adbb": "Hide Offline",
"kdc51b5db": "Websites",
"kdd44ac01": "Telemetry Name to Display",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "Devices",
"kdeecbfea": "Resolver Server",
"kdf5da1d2": "None / STARTTLS",
"ke07784e5": "Install",
"ke188f24b": "bounce rate",
"ke1b5ca71": "Pages",
"ke20a92c7": "Resouce Record Type",
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "Email",
"k28059d49": "ID de l'espace de travail actuel",
"k2813d1f7": "Ce mois-ci",
"k28441b9b": "Redémarrer",
"k2a6a7d8f": "HORS LIGNE",
"k2b1255ec": "Code d'exemple",
"k2b2d40d4": "Code de test",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "24 dernières heures",
"k93374bc9": "Supprimer le site Web",
"k951a939a": "Compte accepté par le site Web",
"k97ddb155": "Afficher la réponse actuelle",
"k98f433ee": "Télécharger le rapporteur de",
"k9991c290": "Communauté",
"k9a272ecf": "S'agit-il de vos serveurs ?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "Notification",
"ka7fe5937": "Lecture/écriture de disque",
"ka8e41156": "Rechercher et sauter rapidement",
"ka90bc019": "Désinstaller",
"ka9d081ac": "Intervalle de vérification (s)",
"kaa0788e9": "Disposition enregistrée avec succès",
"kaa0ccaab": "De l'email",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}} utilisateurs",
"kd92fa3e7": "Nom de l'hôte",
"kdaa949e5": "Événements de {{monitorName}}",
"kdaff25a6": "Afficher la dernière valeur",
"kdb61adbb": "Masquer hors ligne",
"kdc51b5db": "Sites Web",
"kdd44ac01": "Nom de la télémétrie à afficher",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "Appareils",
"kdeecbfea": "Serveur de résolveur",
"kdf5da1d2": "Aucun / STARTTLS",
"ke07784e5": "Installer",
"ke188f24b": "taux de rebond",
"ke1b5ca71": "Pages",
"ke20a92c7": "Type d'enregistrement de ressource",
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/jp/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "メール",
"k28059d49": "現在のワークスペースID",
"k2813d1f7": "今月",
"k28441b9b": "再起動",
"k2a6a7d8f": "ダウン",
"k2b1255ec": "サンプルコード",
"k2b2d40d4": "テストコード",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "過去24時間",
"k93374bc9": "ウェブサイトを削除",
"k951a939a": "ウェブサイト承認カウント",
"k97ddb155": "現在の応答を表示",
"k98f433ee": "からレポーターをダウンロード",
"k9991c290": "コミュニティ",
"k9a272ecf": "これはあなたのサーバーですか?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "通知",
"ka7fe5937": "ディスク読み取り/書き込み",
"ka8e41156": "検索して素早く移動",
"ka90bc019": "アンインストール",
"ka9d081ac": "チェック間隔(秒)",
"kaa0788e9": "レイアウトが正常に保存されました",
"kaa0ccaab": "送信者メール",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}}人のユーザー",
"kd92fa3e7": "ホスト名",
"kdaa949e5": "{{monitorName}}のイベント",
"kdaff25a6": "最新値を表示",
"kdb61adbb": "オフラインを隠す",
"kdc51b5db": "ウェブサイト",
"kdd44ac01": "表示するテレメトリー名",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "デバイス",
"kdeecbfea": "リゾルバーサーバー",
"kdf5da1d2": "なし/STARTTLS",
"ke07784e5": "インストール",
"ke188f24b": "直帰率",
"ke1b5ca71": "ページ",
"ke20a92c7": "リソースレコードタイプ",
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/pl/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "Email",
"k28059d49": "Obecne ID obszaru roboczego",
"k2813d1f7": "Ten miesiąc",
"k28441b9b": "Restart",
"k2a6a7d8f": "NIE DZIAŁA",
"k2b1255ec": "Przykładowy kod",
"k2b2d40d4": "Kod testowy",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "Ostatnie 24 godziny",
"k93374bc9": "Usuń stronę internetową",
"k951a939a": "Liczba zaakceptowanych stron internetowych",
"k97ddb155": "Pokaż aktualną odpowiedź",
"k98f433ee": "Pobierz reporter z",
"k9991c290": "Społeczność",
"k9a272ecf": "Czy to twoje serwery?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "Powiadomienie",
"ka7fe5937": "Odczyt/zapis dysku",
"ka8e41156": "Wyszukiwanie i szybkie przeskakiwanie",
"ka90bc019": "Odinstaluj",
"ka9d081ac": "Interwał sprawdzania (s)",
"kaa0788e9": "Zapisano układ pomyślnie",
"kaa0ccaab": "Od adresu e-mail",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}} użytkowników",
"kd92fa3e7": "Nazwa hosta",
"kdaa949e5": "Wydarzenia {{monitorName}}",
"kdaff25a6": "Pokaż najnowszą wartość",
"kdb61adbb": "Ukryj wyłączone",
"kdc51b5db": "Strony internetowe",
"kdd44ac01": "Nazwa telemetrii do wyświetlenia",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "Urządzenia",
"kdeecbfea": "Serwer resolvera",
"kdf5da1d2": "Brak / STARTTLS",
"ke07784e5": "Zainstaluj",
"ke188f24b": "Wskaźnik odbicia",
"ke1b5ca71": "Strony",
"ke20a92c7": "Typ rekordu zasobu",
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/pt/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "Email",
"k28059d49": "ID da área de trabalho atual",
"k2813d1f7": "Este mês",
"k28441b9b": "Reiniciar",
"k2a6a7d8f": "INATIVO",
"k2b1255ec": "Código de exemplo",
"k2b2d40d4": "Código de teste",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "Últimas 24 horas",
"k93374bc9": "Eliminar sítio Web",
"k951a939a": "Contagem de sites aceites",
"k97ddb155": "Mostrar resposta atual",
"k98f433ee": "Descarregar repórter de",
"k9991c290": "Comunidade",
"k9a272ecf": "Estes são os vossos servidores?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "Notificação",
"ka7fe5937": "Leitura/escrita de disco",
"ka8e41156": "Pesquisa e salto rápido",
"ka90bc019": "Desinstalar",
"ka9d081ac": "Intervalo(s) de verificação",
"kaa0788e9": "Layout guardado com sucesso",
"kaa0ccaab": "De e-mail",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}} utilizadores",
"kd92fa3e7": "Nome do anfitrião",
"kdaa949e5": "Eventos de {{monitorName}}",
"kdaff25a6": "Mostrar valor mais recente",
"kdb61adbb": "Ocultar offline",
"kdc51b5db": "Sites",
"kdd44ac01": "Nome de telemetria a apresentar",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "Dispositivos",
"kdeecbfea": "Servidor de resolução",
"kdf5da1d2": "Nenhum / STARTTLS",
"ke07784e5": "Instalar",
"ke188f24b": "taxa de ressalto",
"ke1b5ca71": "Páginas",
"ke20a92c7": "Tipo de registo de recurso",
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "Электронная почта",
"k28059d49": "ID текущей рабочей области",
"k2813d1f7": "Этот месяц",
"k28441b9b": "Перезапуск",
"k2a6a7d8f": "НИЖЕ",
"k2b1255ec": "Пример кода",
"k2b2d40d4": "Тестовый код",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "Последние 24 часа",
"k93374bc9": "Удалить веб-сайт",
"k951a939a": "Количество принятых сайтом",
"k97ddb155": "Показать текущий ответ",
"k98f433ee": "Скачать репортер с",
"k9991c290": "Сообщество",
"k9a272ecf": "Это ваши серверы?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "Уведомления",
"ka7fe5937": "Чтение/запись на диск",
"ka8e41156": "Поиск и быстрый переход",
"ka90bc019": "Удалить",
"ka9d081ac": "Интервал проверки (с)",
"kaa0788e9": "Макет успешно сохранен",
"kaa0ccaab": "Email отправителя",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}} пользователей",
"kd92fa3e7": "Имя хоста",
"kdaa949e5": "События {{monitorName}}",
"kdaff25a6": "Показать последнее значение",
"kdb61adbb": "Скрыть офлайн",
"kdc51b5db": "Веб-сайты",
"kdd44ac01": "Отображаемое имя телеметрии",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "Устройства",
"kdeecbfea": "Сервер разрешителя",
"kdf5da1d2": "Нет / STARTTLS",
"ke07784e5": "Установить",
"ke188f24b": "коэффициент отказов",
"ke1b5ca71": "Страницы",
"ke20a92c7": "Тип ресурсной записи",
Expand Down
5 changes: 4 additions & 1 deletion src/client/public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"k26535370": "电子邮件",
"k28059d49": "当前工作区 ID",
"k2813d1f7": "本月",
"k28441b9b": "重启",
"k2a6a7d8f": "下线",
"k2b1255ec": "示例代码",
"k2b2d40d4": "测试代码",
Expand Down Expand Up @@ -162,7 +163,6 @@
"k90b668e5": "最近24小时",
"k93374bc9": "删除网站",
"k951a939a": "网站接受计数",
"k97ddb155": "显示当前响应",
"k98f433ee": "从这里下载报告器",
"k9991c290": "社区",
"k9a272ecf": "这是您的服务器吗?",
Expand All @@ -188,6 +188,7 @@
"ka765ad32": "通知",
"ka7fe5937": "磁盘读/写",
"ka8e41156": "搜索和快速跳转",
"ka90bc019": "卸载",
"ka9d081ac": "检查间隔(秒)",
"kaa0788e9": "布局保存成功",
"kaa0ccaab": "发件人邮箱",
Expand Down Expand Up @@ -246,6 +247,7 @@
"kd7985726": "{{num}}个用户",
"kd92fa3e7": "主机名",
"kdaa949e5": "{{monitorName}}的事件",
"kdaff25a6": "显示最新值",
"kdb61adbb": "隐藏离线",
"kdc51b5db": "网站",
"kdd44ac01": "显示的遥测名称",
Expand All @@ -254,6 +256,7 @@
"kdeba7706": "设备",
"kdeecbfea": "解析器服务器",
"kdf5da1d2": "无/STARTTLS",
"ke07784e5": "安装",
"ke188f24b": "跳出率",
"ke1b5ca71": "页面",
"ke20a92c7": "资源记录类型",
Expand Down
Loading

0 comments on commit 4943d2d

Please sign in to comment.