-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmigrate.html
More file actions
47 lines (44 loc) · 1.9 KB
/
migrate.html
File metadata and controls
47 lines (44 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Migration Progress</title>
<script>
function startMigration() {
document.getElementById("status").innerText = "Starting...";
fetch("migrate.php").then(response => response.json()).then(data => {
console.log("Migration started", data);
updateProgress();
});
}
function updateProgress() {
fetch("migrate.php?action=progress").then(response => response.json()).then(data => {
document.getElementById("progress").innerText = `${data.processed} / ${data.total}`;
document.getElementById("status").innerText = `Status: ${data.status}`;
if (data.status === "paused") {
document.getElementById("continue-btn").style.display = "block";
} else if (data.status === "in_progress") {
setTimeout(updateProgress, 5000);
} else if (data.status === "completed") {
document.getElementById("status").innerText = "✅ Migration Completed!";
}
});
}
function continueMigration() {
document.getElementById("continue-btn").style.display = "none";
fetch("migrate.php?action=resume").then(response => response.json()).then(data => {
console.log("Migration resumed", data);
updateProgress();
});
}
</script>
</head>
<body>
<h2>Database Migration</h2>
<p id="status">Ready to start.</p>
<p>Progress: <span id="progress">0 / 0</span></p>
<button onclick="startMigration()">Start Migration</button>
<button id="continue-btn" onclick="continueMigration()" style="display:none;">Continue</button>
</body>
</html>