mirror of
https://github.com/opensupports/opensupports.git
synced 2025-07-31 01:35:15 +02:00
Hide logs
This commit is contained in:
parent
e47df8e6dc
commit
e8365fc24e
@ -38,7 +38,7 @@
|
|||||||
"gulp-rename": "^1.2.2",
|
"gulp-rename": "^1.2.2",
|
||||||
"gulp-sass": "^4.0.1",
|
"gulp-sass": "^4.0.1",
|
||||||
"gulp-sass-bulk-import": "^1.0.1",
|
"gulp-sass-bulk-import": "^1.0.1",
|
||||||
"gulp-sourcemaps": "^1.5.2",
|
"gulp-sourcemaps": "^2.6.4",
|
||||||
"gulp-streamify": "0.0.5",
|
"gulp-streamify": "0.0.5",
|
||||||
"gulp-uglify": "^2.1.2",
|
"gulp-uglify": "^2.1.2",
|
||||||
"gulp-util": "^3.0.6",
|
"gulp-util": "^3.0.6",
|
||||||
|
@ -2,3 +2,4 @@ opensupports_version = '4.3.2';
|
|||||||
root = 'http://localhost:3000';
|
root = 'http://localhost:3000';
|
||||||
apiRoot = 'http://localhost:3000/api';
|
apiRoot = 'http://localhost:3000/api';
|
||||||
globalIndexPath = '';
|
globalIndexPath = '';
|
||||||
|
showLogs = true;
|
||||||
|
@ -29,7 +29,7 @@ let renderApplication = function () {
|
|||||||
window.store = store;
|
window.store = store;
|
||||||
|
|
||||||
let unsubscribe = store.subscribe(() => {
|
let unsubscribe = store.subscribe(() => {
|
||||||
console.log(store.getState());
|
if(showLogs) console.log(store.getState());
|
||||||
|
|
||||||
if (store.getState().session.initDone && store.getState().config.initDone) {
|
if (store.getState().session.initDone && store.getState().config.initDone) {
|
||||||
unsubscribe();
|
unsubscribe();
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
root = "<?=$url ?>";
|
root = "<?=$url ?>";
|
||||||
apiRoot = '<?=$url ?>/api';
|
apiRoot = '<?=$url ?>/api';
|
||||||
globalIndexPath = "<?=$path ?>";
|
globalIndexPath = "<?=$path ?>";
|
||||||
|
showLogs = false;
|
||||||
</script>
|
</script>
|
||||||
<?php if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)): ?>
|
<?php if (preg_match('~MSIE|Internet Explorer~i', $_SERVER['HTTP_USER_AGENT']) || (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') !== false)): ?>
|
||||||
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=String.prototype.startsWith,Array.from,Array.prototype.fill,Array.prototype.keys,Array.prototype.find,Array.prototype.findIndex,Array.prototype.includes,String.prototype.repeat,Number.isInteger,Promise&flags=gated"></script>
|
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=String.prototype.startsWith,Array.from,Array.prototype.fill,Array.prototype.keys,Array.prototype.find,Array.prototype.findIndex,Array.prototype.includes,String.prototype.repeat,Number.isInteger,Promise&flags=gated"></script>
|
||||||
|
@ -26,11 +26,11 @@ function processData (data, dataAsForm = false) {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
call: function ({path, data, plain, dataAsForm}) {
|
call: function ({path, data, plain, dataAsForm}) {
|
||||||
console.log('request ' + path, data);
|
if(showLogs) console.log('request ' + path, data);
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
APIUtils.post(apiRoot + path, processData(data, dataAsForm), dataAsForm)
|
APIUtils.post(apiRoot + path, processData(data, dataAsForm), dataAsForm)
|
||||||
.then(function (result) {
|
.then(function (result) {
|
||||||
console.log(result);
|
if(showLogs) console.log(result);
|
||||||
|
|
||||||
if (plain || result.status === 'success') {
|
if (plain || result.status === 'success') {
|
||||||
resolve(result);
|
resolve(result);
|
||||||
@ -39,7 +39,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(function (result) {
|
.catch(function (result) {
|
||||||
console.log('INVALID REQUEST');
|
console.log('INVALID REQUEST to: ' + path);
|
||||||
console.log(result);
|
console.log(result);
|
||||||
reject({
|
reject({
|
||||||
status: 'fail',
|
status: 'fail',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user