Open Media Library.app
This commit is contained in:
commit
c72189069e
9 changed files with 270 additions and 0 deletions
|
|
@ -0,0 +1,38 @@
|
|||
function load() {
|
||||
var base = 'http://[::1]:9842',
|
||||
img = new Image();
|
||||
img.onload = function(event) {
|
||||
document.location.href = base;
|
||||
};
|
||||
img.src = base + '/static/oxjs/build/Ox.UI/png/transparent.png?' + new Date;
|
||||
};
|
||||
|
||||
function update() {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onload = function() {
|
||||
var response = JSON.parse(this.responseText);
|
||||
if (response.installing) {
|
||||
var status = response.installing;
|
||||
if (response.progress) {
|
||||
status = parseInt(response.progress * 100) + '% ' + status;
|
||||
}
|
||||
document.getElementById('status').innerHTML = status;
|
||||
setTimeout(update, 1000);
|
||||
} else {
|
||||
document.getElementById('status').innerHTML = "done";
|
||||
load();
|
||||
}
|
||||
};
|
||||
xhr.onerror = function() {
|
||||
var status = document.getElementById('status').innerHTML;
|
||||
if (['done', 'setup'].indexOf(status) == -1) {
|
||||
document.getElementById('status').innerHTML = "error";
|
||||
}
|
||||
load();
|
||||
}
|
||||
xhr.open('get', '/status');
|
||||
xhr.send();
|
||||
|
||||
}
|
||||
|
||||
update();
|
||||
Loading…
Add table
Add a link
Reference in a new issue