mirror of
https://github.com/tsightler/ring-mqtt.git
synced 2025-09-26 21:01:12 +08:00
114 lines
3.2 KiB
HTML
114 lines
3.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Ring-MQTT Web Authenticator</title>
|
|
<style>
|
|
:root {
|
|
--primary-color: #47a9e6;
|
|
--primary-hover: #315b82;
|
|
--bg-color: #f2f2f2;
|
|
--error-color: #dc3545;
|
|
--success-color: #39ff14;
|
|
--text-color: #333;
|
|
--spacing: 1rem;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
|
|
max-width: 500px;
|
|
margin: 0 auto;
|
|
padding: var(--spacing);
|
|
color: white;
|
|
background-color: #666;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
h2 {
|
|
margin: 0 0 var(--spacing) 0;
|
|
}
|
|
|
|
h3 {
|
|
margin: 0 0 var(--spacing) 0;
|
|
}
|
|
|
|
.display-name {
|
|
margin: calc(var(--spacing) / 2) 0;
|
|
padding: 0;
|
|
border-radius: 4px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
|
|
.display-name span {
|
|
color: var(--success-color);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.container {
|
|
margin-top: var(--spacing);
|
|
padding: var(--spacing) 0;
|
|
}
|
|
|
|
.message {
|
|
margin: var(--spacing) 0;
|
|
}
|
|
|
|
.btn {
|
|
background-color: var(--primary-color);
|
|
color: white;
|
|
padding: calc(var(--spacing) / 2) var(--spacing);
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-size: 1rem;
|
|
transition: background-color 0.2s;
|
|
min-width: 200px;
|
|
}
|
|
|
|
.btn:hover {
|
|
background-color: var(--primary-hover);
|
|
}
|
|
|
|
.btn:focus {
|
|
outline: none;
|
|
box-shadow: 0 0 0 2px rgba(71, 169, 230, 0.4);
|
|
}
|
|
|
|
@media (max-width: 600px) {
|
|
body {
|
|
padding: calc(var(--spacing) / 2);
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h2>Ring-MQTT Addon Connected</h2>
|
|
<div id="displayName" class="display-name">Device Name: <span></span></div>
|
|
<div class="message">
|
|
It appears that <strong>ring-mqtt</strong> is already connected to the Ring API, no additional action is required.
|
|
</div>
|
|
<div class="message">
|
|
If you wish to force reauthentication, for example, to change the account used by this addon, clicking the button below will restart the authentication process.
|
|
</div>
|
|
<div class="container">
|
|
<form action="./force-token-generation" method="get">
|
|
<input type="submit" value="Force Reauthentication" class="btn">
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
function getCookie(key) {
|
|
const value = document.cookie.match('(^|;) ?' + key + '=([^;]*)(;|$)');
|
|
return value ? decodeURIComponent(value[2]) : null;
|
|
}
|
|
|
|
const displayName = getCookie('displayName');
|
|
if (displayName) {
|
|
document.querySelector('#displayName span').textContent = displayName;
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |