You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
476 lines
15 KiB
476 lines
15 KiB
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Daily Notification - Electron Test</title>
|
|
<style>
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
margin: 0;
|
|
padding: 20px;
|
|
background-color: #f5f5f5;
|
|
}
|
|
.container {
|
|
max-width: 600px;
|
|
margin: 0 auto;
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 20px;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
}
|
|
h1 {
|
|
color: #333;
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
}
|
|
.status {
|
|
background: #fff3e0;
|
|
padding: 15px;
|
|
border-radius: 8px;
|
|
margin-bottom: 20px;
|
|
text-align: center;
|
|
font-weight: bold;
|
|
color: #f57c00;
|
|
}
|
|
.button-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 10px;
|
|
margin-bottom: 20px;
|
|
}
|
|
button {
|
|
background: #f57c00;
|
|
color: white;
|
|
border: none;
|
|
padding: 12px 16px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 14px;
|
|
transition: background-color 0.2s;
|
|
}
|
|
button:hover {
|
|
background: #ef6c00;
|
|
}
|
|
button:disabled {
|
|
background: #ccc;
|
|
cursor: not-allowed;
|
|
}
|
|
.log-container {
|
|
background: #f8f9fa;
|
|
border: 1px solid #dee2e6;
|
|
border-radius: 6px;
|
|
padding: 15px;
|
|
height: 300px;
|
|
overflow-y: auto;
|
|
font-family: 'Courier New', monospace;
|
|
font-size: 12px;
|
|
}
|
|
.timestamp {
|
|
color: #666;
|
|
font-weight: bold;
|
|
}
|
|
pre {
|
|
background: #e9ecef;
|
|
padding: 8px;
|
|
border-radius: 4px;
|
|
margin: 5px 0;
|
|
overflow-x: auto;
|
|
}
|
|
.clear-button {
|
|
background: #dc3545;
|
|
margin-top: 10px;
|
|
width: 100%;
|
|
}
|
|
.clear-button:hover {
|
|
background: #c82333;
|
|
}
|
|
.ui-section {
|
|
margin-bottom: 30px;
|
|
padding: 20px;
|
|
border: 1px solid #e0e0e0;
|
|
border-radius: 8px;
|
|
background: #fafafa;
|
|
}
|
|
.ui-section h3 {
|
|
margin: 0 0 15px 0;
|
|
color: #f57c00;
|
|
border-bottom: 2px solid #f57c00;
|
|
padding-bottom: 8px;
|
|
}
|
|
.btn-secondary {
|
|
background: #f5f5f5;
|
|
color: #333;
|
|
border: 1px solid #ddd;
|
|
}
|
|
.btn-secondary:hover {
|
|
background: #e0e0e0;
|
|
}
|
|
.btn-tertiary {
|
|
background: transparent;
|
|
color: #666;
|
|
}
|
|
.btn-tertiary:hover {
|
|
background: #f5f5f5;
|
|
}
|
|
.permission-status {
|
|
padding: 16px;
|
|
border-radius: 8px;
|
|
margin: 16px 0;
|
|
}
|
|
.status-granted {
|
|
background: #e8f5e8;
|
|
border: 1px solid #4caf50;
|
|
}
|
|
.status-denied {
|
|
background: #ffebee;
|
|
border: 1px solid #f44336;
|
|
}
|
|
.status-indicator {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
margin-bottom: 12px;
|
|
}
|
|
.status-icon {
|
|
font-size: 20px;
|
|
font-weight: bold;
|
|
}
|
|
.permission-details {
|
|
margin: 12px 0;
|
|
}
|
|
.permission-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
margin: 8px 0;
|
|
}
|
|
.granted {
|
|
color: #4caf50;
|
|
font-weight: bold;
|
|
}
|
|
.denied {
|
|
color: #f44336;
|
|
font-weight: bold;
|
|
}
|
|
.settings-panel {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
margin: 16px 0;
|
|
}
|
|
.setting-group {
|
|
margin: 20px 0;
|
|
}
|
|
.setting-label {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
.checkbox-group {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 12px;
|
|
margin-top: 8px;
|
|
}
|
|
.preference-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr 1fr;
|
|
gap: 16px;
|
|
margin-top: 8px;
|
|
}
|
|
.setting-actions {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-top: 24px;
|
|
}
|
|
.status-dashboard {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
margin: 16px 0;
|
|
}
|
|
.status-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 16px;
|
|
margin: 20px 0;
|
|
}
|
|
.status-item {
|
|
padding: 16px;
|
|
background: #f8f9fa;
|
|
border-radius: 8px;
|
|
}
|
|
.status-label {
|
|
font-size: 14px;
|
|
color: #666;
|
|
margin-bottom: 8px;
|
|
}
|
|
.status-value {
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
.status-value.active {
|
|
color: #4caf50;
|
|
}
|
|
.status-value.warning {
|
|
color: #ff9800;
|
|
}
|
|
.status-value.error {
|
|
color: #f44336;
|
|
}
|
|
.performance-metrics {
|
|
margin: 24px 0;
|
|
padding: 16px;
|
|
background: #f8f9fa;
|
|
border-radius: 8px;
|
|
}
|
|
.metrics-grid {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 16px;
|
|
margin-top: 12px;
|
|
}
|
|
.metric-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
.metric-label {
|
|
color: #666;
|
|
}
|
|
.metric-value {
|
|
font-weight: bold;
|
|
color: #333;
|
|
}
|
|
.error-display {
|
|
background: #ffebee;
|
|
border: 1px solid #f44336;
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
margin: 16px 0;
|
|
}
|
|
.error-icon {
|
|
font-size: 24px;
|
|
margin-bottom: 12px;
|
|
}
|
|
.error-content h3 {
|
|
margin: 0 0 8px 0;
|
|
color: #d32f2f;
|
|
}
|
|
.error-message {
|
|
color: #666;
|
|
margin: 8px 0;
|
|
}
|
|
.error-code {
|
|
font-size: 12px;
|
|
color: #999;
|
|
font-family: monospace;
|
|
}
|
|
.error-actions {
|
|
display: flex;
|
|
gap: 12px;
|
|
margin-top: 16px;
|
|
}
|
|
.dialog-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1000;
|
|
}
|
|
.dialog-content {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 24px;
|
|
max-width: 400px;
|
|
margin: 20px;
|
|
}
|
|
.dialog-content h2 {
|
|
margin: 0 0 16px 0;
|
|
color: #333;
|
|
}
|
|
.dialog-content p {
|
|
margin: 0 0 16px 0;
|
|
color: #666;
|
|
line-height: 1.5;
|
|
}
|
|
.dialog-content ul {
|
|
margin: 0 0 24px 0;
|
|
padding-left: 20px;
|
|
}
|
|
.dialog-content li {
|
|
margin: 8px 0;
|
|
color: #666;
|
|
}
|
|
.dialog-actions {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
.hidden {
|
|
display: none;
|
|
}
|
|
@media (max-width: 768px) {
|
|
.status-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.preference-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.checkbox-group {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
.metrics-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<h1>⚡ TimeSafari Daily Notification - Electron Test</h1>
|
|
|
|
<div class="status" id="status">Ready</div>
|
|
|
|
<!-- Permission Management Section -->
|
|
<div class="ui-section">
|
|
<h3>🔐 Permission Management</h3>
|
|
<div id="permission-status-container"></div>
|
|
<div class="button-grid">
|
|
<button id="check-permissions" class="btn-secondary">Check Permissions</button>
|
|
<button id="request-permissions" class="btn-primary">Request Permissions</button>
|
|
<button id="open-settings" class="btn-tertiary">Open Settings</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Configuration Section -->
|
|
<div class="ui-section">
|
|
<h3>⚙️ Configuration</h3>
|
|
<div id="settings-container"></div>
|
|
<div class="button-grid">
|
|
<button id="configure">Configure TimeSafari</button>
|
|
<button id="test-notification" class="btn-secondary">Test Notification</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Status Monitoring Section -->
|
|
<div class="ui-section">
|
|
<h3>📊 Status Monitoring</h3>
|
|
<div id="status-container"></div>
|
|
<div class="button-grid">
|
|
<button id="check-status">Check Status</button>
|
|
<button id="refresh-status" class="btn-secondary">Refresh</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Platform-Specific Section -->
|
|
<div class="ui-section">
|
|
<h3>⚡ Electron-Specific Features</h3>
|
|
<div id="service-worker-dialog-container"></div>
|
|
<div class="button-grid">
|
|
<button id="service-worker-status">Check Service Worker</button>
|
|
<button id="push-notification-status">Check Push Notifications</button>
|
|
<button id="debug-info">Debug Info</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Testing Section -->
|
|
<div class="ui-section">
|
|
<h3>🧪 Testing & Debug</h3>
|
|
<div class="button-grid">
|
|
<button id="schedule">Schedule Community Notifications</button>
|
|
<button id="endorser-api">Test Endorser.ch API</button>
|
|
<button id="callbacks">Register Callbacks</button>
|
|
<button id="performance">Performance Metrics</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Phase 4: TimeSafari Components Testing -->
|
|
<div class="ui-section">
|
|
<h3>🚀 Phase 4: TimeSafari Components</h3>
|
|
<div class="button-grid">
|
|
<button id="test-security-manager" class="btn-primary">Test SecurityManager</button>
|
|
<button id="test-endorser-api-client" class="btn-primary">Test EndorserAPIClient</button>
|
|
<button id="test-notification-manager" class="btn-primary">Test NotificationManager</button>
|
|
<button id="test-phase4-integration" class="btn-secondary">Test Complete Integration</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Static Daily Reminders Testing -->
|
|
<div class="ui-section">
|
|
<h3>⏰ Static Daily Reminders</h3>
|
|
<div class="button-grid">
|
|
<button id="schedule-reminder" class="btn-primary">Schedule Daily Reminder</button>
|
|
<button id="cancel-reminder" class="btn-primary">Cancel Reminder</button>
|
|
<button id="get-reminders" class="btn-primary">Get Scheduled Reminders</button>
|
|
<button id="update-reminder" class="btn-primary">Update Reminder</button>
|
|
</div>
|
|
<div class="form-section">
|
|
<h4>Reminder Configuration</h4>
|
|
<div class="form-group">
|
|
<label for="reminder-id">Reminder ID:</label>
|
|
<input type="text" id="reminder-id" value="morning_checkin" placeholder="e.g., morning_checkin">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="reminder-title">Title:</label>
|
|
<input type="text" id="reminder-title" value="Good Morning!" placeholder="Reminder title">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="reminder-body">Body:</label>
|
|
<input type="text" id="reminder-body" value="Time to check your TimeSafari community updates" placeholder="Reminder message">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="reminder-time">Time (HH:mm):</label>
|
|
<input type="text" id="reminder-time" value="09:00" placeholder="09:00">
|
|
</div>
|
|
<div class="form-group">
|
|
<label>
|
|
<input type="checkbox" id="reminder-sound" checked> Sound
|
|
</label>
|
|
<label>
|
|
<input type="checkbox" id="reminder-vibration" checked> Vibration
|
|
</label>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="reminder-priority">Priority:</label>
|
|
<select id="reminder-priority">
|
|
<option value="low">Low</option>
|
|
<option value="normal" selected>Normal</option>
|
|
<option value="high">High</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label>
|
|
<input type="checkbox" id="reminder-repeat" checked> Repeat Daily
|
|
</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Error Handling Section -->
|
|
<div class="ui-section">
|
|
<h3>⚠️ Error Handling</h3>
|
|
<div id="error-container"></div>
|
|
</div>
|
|
|
|
<!-- Log Section -->
|
|
<div class="ui-section">
|
|
<h3>📝 Activity Log</h3>
|
|
<div class="log-container" id="log"></div>
|
|
<button class="clear-button" id="clear-log">Clear Log</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Permission Dialog -->
|
|
<div id="permission-dialog-container"></div>
|
|
|
|
<script type="module" src="index.js"></script>
|
|
</body>
|
|
</html>
|
|
|