350 lines
7.9 KiB
HTML
350 lines
7.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>GallerySubscriber Settings</title>
|
|
<style>
|
|
/* Light theme (default) */
|
|
:root {
|
|
--primary-color: #1976d2;
|
|
--primary-hover: #1565c0;
|
|
--success-color: #4caf50;
|
|
--error-color: #f44336;
|
|
--bg-color: #f5f5f5;
|
|
--card-bg: #ffffff;
|
|
--text-color: #212121;
|
|
--text-secondary: #757575;
|
|
--border-color: #e0e0e0;
|
|
--input-bg: #ffffff;
|
|
--btn-secondary-bg: #f5f5f5;
|
|
--btn-secondary-hover: #eeeeee;
|
|
--instructions-bg: #e3f2fd;
|
|
--instructions-title: #1565c0;
|
|
--code-bg: rgba(0,0,0,0.08);
|
|
--result-success-bg: #e8f5e9;
|
|
--result-success-text: #2e7d32;
|
|
--result-error-bg: #ffebee;
|
|
--result-error-text: #c62828;
|
|
}
|
|
|
|
/* Dark theme */
|
|
[data-theme="dark"] {
|
|
--primary-color: #64b5f6;
|
|
--primary-hover: #42a5f5;
|
|
--success-color: #81c784;
|
|
--error-color: #e57373;
|
|
--bg-color: #121212;
|
|
--card-bg: #1e1e1e;
|
|
--text-color: #e0e0e0;
|
|
--text-secondary: #9e9e9e;
|
|
--border-color: #424242;
|
|
--input-bg: #2d2d2d;
|
|
--btn-secondary-bg: #2d2d2d;
|
|
--btn-secondary-hover: #3d3d3d;
|
|
--instructions-bg: #1a2a3a;
|
|
--instructions-title: #64b5f6;
|
|
--code-bg: rgba(255,255,255,0.1);
|
|
--result-success-bg: #1b3d1b;
|
|
--result-success-text: #81c784;
|
|
--result-error-bg: #3d1b1b;
|
|
--result-error-text: #e57373;
|
|
}
|
|
|
|
/* Auto-detect system theme preference */
|
|
@media (prefers-color-scheme: dark) {
|
|
:root:not([data-theme="light"]) {
|
|
--primary-color: #64b5f6;
|
|
--primary-hover: #42a5f5;
|
|
--success-color: #81c784;
|
|
--error-color: #e57373;
|
|
--bg-color: #121212;
|
|
--card-bg: #1e1e1e;
|
|
--text-color: #e0e0e0;
|
|
--text-secondary: #9e9e9e;
|
|
--border-color: #424242;
|
|
--input-bg: #2d2d2d;
|
|
--btn-secondary-bg: #2d2d2d;
|
|
--btn-secondary-hover: #3d3d3d;
|
|
--instructions-bg: #1a2a3a;
|
|
--instructions-title: #64b5f6;
|
|
--code-bg: rgba(255,255,255,0.1);
|
|
--result-success-bg: #1b3d1b;
|
|
--result-success-text: #81c784;
|
|
--result-error-bg: #3d1b1b;
|
|
--result-error-text: #e57373;
|
|
}
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
font-size: 14px;
|
|
color: var(--text-color);
|
|
background: var(--bg-color);
|
|
padding: 24px;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.container {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 24px;
|
|
font-weight: 500;
|
|
margin-bottom: 24px;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
.card {
|
|
background: var(--card-bg);
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
margin-bottom: 16px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.card h2 {
|
|
font-size: 16px;
|
|
font-weight: 600;
|
|
margin-bottom: 16px;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.form-group:last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
font-weight: 500;
|
|
margin-bottom: 6px;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
input[type="text"],
|
|
input[type="url"],
|
|
input[type="password"] {
|
|
width: 100%;
|
|
padding: 10px 12px;
|
|
border: 1px solid var(--border-color);
|
|
border-radius: 6px;
|
|
font-size: 14px;
|
|
background: var(--input-bg);
|
|
color: var(--text-color);
|
|
transition: border-color 0.15s;
|
|
}
|
|
|
|
input:focus {
|
|
outline: none;
|
|
border-color: var(--primary-color);
|
|
}
|
|
|
|
.help-text {
|
|
font-size: 12px;
|
|
color: var(--text-secondary);
|
|
margin-top: 4px;
|
|
}
|
|
|
|
.input-with-button {
|
|
display: flex;
|
|
gap: 8px;
|
|
}
|
|
|
|
.input-with-button input {
|
|
flex: 1;
|
|
}
|
|
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 10px 20px;
|
|
border: none;
|
|
border-radius: 6px;
|
|
font-size: 14px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition: background 0.15s ease;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--primary-color);
|
|
color: white;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: var(--primary-hover);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: var(--btn-secondary-bg);
|
|
color: var(--text-color);
|
|
border: 1px solid var(--border-color);
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: var(--btn-secondary-hover);
|
|
}
|
|
|
|
.btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.btn-small {
|
|
padding: 8px 12px;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.actions {
|
|
display: flex;
|
|
gap: 12px;
|
|
align-items: center;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.result {
|
|
font-size: 13px;
|
|
padding: 4px 8px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.result.success {
|
|
background: var(--result-success-bg);
|
|
color: var(--result-success-text);
|
|
}
|
|
|
|
.result.error {
|
|
background: var(--result-error-bg);
|
|
color: var(--result-error-text);
|
|
}
|
|
|
|
.connection-test {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
margin-top: 12px;
|
|
}
|
|
|
|
.status-dot {
|
|
width: 10px;
|
|
height: 10px;
|
|
border-radius: 50%;
|
|
background: var(--text-secondary);
|
|
}
|
|
|
|
.status-dot.connected {
|
|
background: var(--success-color);
|
|
}
|
|
|
|
.status-dot.error {
|
|
background: var(--error-color);
|
|
}
|
|
|
|
.instructions {
|
|
background: var(--instructions-bg);
|
|
border-radius: 6px;
|
|
padding: 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.instructions h3 {
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
margin-bottom: 8px;
|
|
color: var(--instructions-title);
|
|
}
|
|
|
|
.instructions ol {
|
|
margin-left: 20px;
|
|
font-size: 13px;
|
|
color: var(--text-color);
|
|
}
|
|
|
|
.instructions li {
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.instructions code {
|
|
background: var(--code-bg);
|
|
padding: 2px 6px;
|
|
border-radius: 3px;
|
|
font-family: monospace;
|
|
font-size: 12px;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>GallerySubscriber Extension Settings</h1>
|
|
|
|
<div class="instructions">
|
|
<h3>Setup Instructions</h3>
|
|
<ol>
|
|
<li>Open your GallerySubscriber web interface</li>
|
|
<li>Go to <strong>Settings</strong> page</li>
|
|
<li>Copy the <strong>Extension API Key</strong></li>
|
|
<li>Paste the API URL and key below</li>
|
|
</ol>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<h2>Backend Connection</h2>
|
|
|
|
<div class="form-group">
|
|
<label for="api-url">API URL</label>
|
|
<input
|
|
type="url"
|
|
id="api-url"
|
|
placeholder="http://localhost:8080/api"
|
|
>
|
|
<p class="help-text">
|
|
The URL of your GallerySubscriber backend. Include <code>/api</code> at the end.
|
|
</p>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="api-key">Extension API Key</label>
|
|
<div class="input-with-button">
|
|
<input
|
|
type="password"
|
|
id="api-key"
|
|
placeholder="Your API key from Settings page"
|
|
>
|
|
<button type="button" id="toggle-key-btn" class="btn btn-secondary btn-small">
|
|
Show
|
|
</button>
|
|
</div>
|
|
<p class="help-text">
|
|
Find this in GallerySubscriber: Settings > Extension API Key
|
|
</p>
|
|
</div>
|
|
|
|
<div class="connection-test">
|
|
<button id="test-btn" class="btn btn-secondary btn-small">Test Connection</button>
|
|
<span id="test-status" class="status-dot"></span>
|
|
<span id="test-message"></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="actions">
|
|
<button id="save-btn" class="btn btn-primary">Save Settings</button>
|
|
<span id="save-result" class="result"></span>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="options.js"></script>
|
|
</body>
|
|
</html>
|