return a proper error alert, bugfix for bludit installation inside a directory

This commit is contained in:
Diego Najar 2021-06-10 20:38:20 +02:00
parent a98e5e4582
commit 2982a94f5f
3 changed files with 36 additions and 19 deletions

View file

@ -78,7 +78,7 @@
<div class="row">
<nav class="navbar navbar-dark p-1">
<a class="navbar-brand" href="#">
<img src="/bl-kernel/img/logo.svg" alt="" width="30" height="24" class="d-inline-block align-top">
<img src="<?php echo DOMAIN_BASE ?>bl-kernel/img/logo.svg" alt="" width="30" height="24" class="d-inline-block align-top">
Bludit
</a>
</nav>

View file

@ -22,8 +22,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -42,8 +43,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -68,8 +70,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -93,8 +96,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -113,8 +117,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -138,8 +143,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -163,8 +169,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -188,8 +195,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -213,8 +221,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -238,8 +247,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -263,8 +273,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -285,8 +296,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -310,8 +322,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -335,8 +348,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -360,8 +374,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -385,8 +400,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}
@ -410,8 +426,9 @@ class API {
var json = await response.json();
return json;
} catch (err) {
console.log(response);
console.log(err);
return true;
return {'message': 'Error from API. Open the inspector from the browser for more details.'};
}
}

View file

@ -26,7 +26,7 @@ echo 'var tokenCSRF = "'.$security->getTokenCSRF().'";'.PHP_EOL;
echo 'var UPLOAD_MAX_FILESIZE = '.Text::toBytes( ini_get('upload_max_filesize') ).';'.PHP_EOL;
echo 'var DEBUG_MODE = '.(DEBUG_MODE?'true':'false').';'.PHP_EOL;
echo 'var PASSWORD_LENGTH = '.PASSWORD_LENGTH.';'.PHP_EOL;
echo 'var api = new API("'.DOMAIN.'/api/", "'.$plugins['all']['pluginAPI']->token().'", "'.$login->tokenAuth().'", tokenCSRF);'.PHP_EOL;
echo 'var api = new API("'.DOMAIN_BASE.'api/", "'.$plugins['all']['pluginAPI']->token().'", "'.$login->tokenAuth().'", tokenCSRF);'.PHP_EOL;
echo '</script>'.PHP_EOL;
?>