|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | +<head> |
| 4 | + <title>Contest Import Tool</title> |
| 5 | + <style> |
| 6 | + body { |
| 7 | + font-family: Arial, sans-serif; |
| 8 | + margin: 20px; |
| 9 | + line-height: 1.6; |
| 10 | + } |
| 11 | + .container { |
| 12 | + max-width: 1200px; |
| 13 | + margin: 0 auto; |
| 14 | + } |
| 15 | + .form-group { |
| 16 | + margin-bottom: 15px; |
| 17 | + } |
| 18 | + label { |
| 19 | + display: inline-block; |
| 20 | + width: 200px; |
| 21 | + font-weight: bold; |
| 22 | + } |
| 23 | + input[type="number"] { |
| 24 | + width: 100px; |
| 25 | + padding: 5px; |
| 26 | + } |
| 27 | + button { |
| 28 | + background-color: #4CAF50; |
| 29 | + color: white; |
| 30 | + padding: 10px 15px; |
| 31 | + border: none; |
| 32 | + border-radius: 4px; |
| 33 | + cursor: pointer; |
| 34 | + font-size: 16px; |
| 35 | + } |
| 36 | + button:hover { |
| 37 | + background-color: #45a049; |
| 38 | + } |
| 39 | + #result-container { |
| 40 | + margin-top: 20px; |
| 41 | + border: 1px solid #ddd; |
| 42 | + border-radius: 5px; |
| 43 | + padding: 20px; |
| 44 | + min-height: 400px; |
| 45 | + } |
| 46 | + iframe { |
| 47 | + width: 100%; |
| 48 | + height: 600px; |
| 49 | + border: none; |
| 50 | + } |
| 51 | + .info-box { |
| 52 | + background-color: #e7f3fe; |
| 53 | + border-left: 6px solid #2196F3; |
| 54 | + padding: 10px; |
| 55 | + margin-bottom: 15px; |
| 56 | + } |
| 57 | + </style> |
| 58 | +</head> |
| 59 | +<body> |
| 60 | +<div class="container"> |
| 61 | + <h1>Contest Import Tool</h1> |
| 62 | + |
| 63 | + <div class="info-box"> |
| 64 | + <p>This tool allows you to import contests from one category to another. The results will stream in real-time as each contest is processed.</p> |
| 65 | + </div> |
| 66 | + |
| 67 | + <form id="importForm"> |
| 68 | + <div class="form-group"> |
| 69 | + <label for="sourceId">Source Category ID:</label> |
| 70 | + <input type="number" id="sourceId" required min="1"> |
| 71 | + </div> |
| 72 | + <div class="form-group"> |
| 73 | + <label for="destId">Destination Category ID:</label> |
| 74 | + <input type="number" id="destId" required min="1"> |
| 75 | + </div> |
| 76 | + <div class="form-group"> |
| 77 | + <label for="dryRun">Dry Run (no actual changes):</label> |
| 78 | + <input type="checkbox" id="dryRun" checked> |
| 79 | + </div> |
| 80 | + <button type="submit">Start Import</button> |
| 81 | + </form> |
| 82 | + |
| 83 | + <div id="result-container"> |
| 84 | + <div id="placeholder">Import results will appear here...</div> |
| 85 | + <iframe id="resultFrame" style="display: none;"></iframe> |
| 86 | + </div> |
| 87 | +</div> |
| 88 | + |
| 89 | +<script> |
| 90 | + document.getElementById('importForm').addEventListener('submit', function(e) { |
| 91 | + e.preventDefault(); |
| 92 | + |
| 93 | + const sourceId = document.getElementById('sourceId').value; |
| 94 | + const destId = document.getElementById('destId').value; |
| 95 | + const dryRun = document.getElementById('dryRun').checked; |
| 96 | + |
| 97 | + if (!sourceId || !destId) { |
| 98 | + alert('Please enter both source and destination category IDs'); |
| 99 | + return; |
| 100 | + } |
| 101 | + |
| 102 | + const url = `/api/temp/ImportContestsFromCategory?sourceContestCategoryId=${sourceId}&destinationContestCategoryId=${destId}&dryRun=${dryRun}&stream=true`; |
| 103 | + |
| 104 | + const iframe = document.getElementById('resultFrame'); |
| 105 | + iframe.style.display = 'block'; |
| 106 | + document.getElementById('placeholder').style.display = 'none'; |
| 107 | + iframe.src = url; |
| 108 | + }); |
| 109 | +</script> |
| 110 | +</body> |
| 111 | +</html> |
0 commit comments