mirror of
https://github.com/lone-cloud/prism
synced 2026-06-03 08:43:10 -07:00
45 lines
2.7 KiB
HTML
45 lines
2.7 KiB
HTML
{{if .NotConfigured}}
|
|
<p><strong>Setup Telegram Bot:</strong></p>
|
|
<ol class="link-instructions" aria-label="Steps to set up Telegram bot">
|
|
<li>Message <a href="https://t.me/BotFather" target="_blank" rel="noopener noreferrer">@BotFather</a> on Telegram</li>
|
|
<li>Send <code>/newbot</code> and follow the prompts</li>
|
|
<li>Copy the bot token from BotFather</li>
|
|
<li>Message <a href="https://t.me/userinfobot" target="_blank" rel="noopener noreferrer">@userinfobot</a> to get your Chat ID</li>
|
|
<li>Enter both below:</li>
|
|
</ol>
|
|
<form class="auth-form" data-handler="telegram">
|
|
<div class="form-group">
|
|
<label for="telegram-bot-token">Bot Token:</label>
|
|
<div class="password-wrapper">
|
|
<input type="password" id="telegram-bot-token" name="bot_token" placeholder="123456789:ABCdefGHIjklMNOpqrsTUVwxyz" required autocomplete="off">
|
|
<button type="button" class="password-toggle" data-action="toggle-password" aria-label="Show password">
|
|
<svg class="eye-icon eye-show" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/></svg>
|
|
<svg class="eye-icon eye-hide" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-10-7-10-7a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 10 7 10 7a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"/><line x1="1" y1="1" x2="23" y2="23"/></svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="telegram-chat-id">Chat ID:</label>
|
|
<input type="text" id="telegram-chat-id" name="chat_id" placeholder="123456789" required>
|
|
</div>
|
|
<button type="submit" class="btn-primary">Link</button>
|
|
<div id="telegram-auth-status" class="auth-status"></div>
|
|
</form>
|
|
{{else if .Error}}
|
|
<p>Error: {{.Error}}</p>
|
|
<button class="btn-secondary" data-action="reload">Retry</button>
|
|
{{else if .NeedsChatID}}
|
|
<p><strong>Complete Setup:</strong></p>
|
|
<p>Bot is configured, but Chat ID is missing.</p>
|
|
<form class="auth-form" data-handler="telegram-chatid" data-bot-token="{{.BotToken}}">
|
|
<div class="form-group">
|
|
<label for="telegram-chat-id-only">Chat ID:</label>
|
|
<input type="text" id="telegram-chat-id-only" name="chat_id" placeholder="Get from @userinfobot" required>
|
|
</div>
|
|
<button type="submit" class="btn-primary">Save Chat ID</button>
|
|
<div id="telegram-chatid-status" class="auth-status"></div>
|
|
</form>
|
|
{{else}}
|
|
<button class="btn-danger" data-action="delete-telegram">Unlink</button>
|
|
{{end}}
|
|
|