Merge branch 'master' of github.com:akaunting/akaunting
# Conflicts: # resources/views/banking/reconciliations/create.blade.php
This commit is contained in:
33
resources/assets/js/views/install/update.js
vendored
33
resources/assets/js/views/install/update.js
vendored
@ -57,9 +57,10 @@ const app = new Vue({
|
||||
},
|
||||
|
||||
methods: {
|
||||
onChangelog() {
|
||||
axios.get(url + '/install/updates/changelog')
|
||||
.then(response => {
|
||||
async onChangelog() {
|
||||
let changelog_promise = Promise.resolve(axios.get(url + '/install/updates/changelog'));
|
||||
|
||||
changelog_promise.then(response => {
|
||||
this.changelog.show = true;
|
||||
this.changelog.html = response.data;
|
||||
})
|
||||
@ -71,14 +72,15 @@ const app = new Vue({
|
||||
});
|
||||
},
|
||||
|
||||
steps() {
|
||||
async steps() {
|
||||
let name = document.getElementById('name').value;
|
||||
|
||||
axios.post(url + '/install/updates/steps', {
|
||||
let steps_promise = Promise.resolve(axios.post(url + '/install/updates/steps', {
|
||||
name: name,
|
||||
version: version
|
||||
})
|
||||
.then(response => {
|
||||
}));
|
||||
|
||||
steps_promise.then(response => {
|
||||
if (response.data.error) {
|
||||
this.update.status = 'exception';
|
||||
this.update.html = '<div class="text-danger">' + response.data.message + '</div>';
|
||||
@ -96,7 +98,7 @@ const app = new Vue({
|
||||
});
|
||||
},
|
||||
|
||||
next() {
|
||||
async next() {
|
||||
let data = this.update.steps.shift();
|
||||
|
||||
let name = document.getElementById('name').value;
|
||||
@ -105,18 +107,19 @@ const app = new Vue({
|
||||
let installed = document.getElementById('installed').value;
|
||||
|
||||
if (data) {
|
||||
this.update.total = (100 - ((this.update.steps.length / this.update.steps_total) * 100)).toFixed(0);
|
||||
this.update.total = parseInt((100 - ((this.update.steps.length / this.update.steps_total) * 100)).toFixed(0));
|
||||
|
||||
this.update.html = '<span class="text-default"><i class="fa fa-spinner fa-spin update-spin"></i> ' + data['text'] + '</span> </br>';
|
||||
|
||||
axios.post(data.url, {
|
||||
let step_promise = Promise.resolve(axios.post(data.url, {
|
||||
name: name,
|
||||
alias: alias,
|
||||
version: version,
|
||||
installed: installed,
|
||||
path: this.update.path,
|
||||
})
|
||||
.then(response => {
|
||||
}));
|
||||
|
||||
step_promise.then(response => {
|
||||
if (response.data.error) {
|
||||
this.update.status = 'exception';
|
||||
this.update.html = '<div class="text-danger"><i class="fa fa-times update-error"></i> ' + response.data.message + '</div>';
|
||||
@ -131,11 +134,9 @@ const app = new Vue({
|
||||
}
|
||||
|
||||
if (!response.data.error && !response.data.redirect) {
|
||||
let self = this;
|
||||
|
||||
setTimeout(function() {
|
||||
self.next();
|
||||
}, 800);
|
||||
this.next();
|
||||
}.bind(this), 800);
|
||||
}
|
||||
|
||||
if (response.data.redirect) {
|
||||
|
2
resources/assets/js/views/modules/apps.js
vendored
2
resources/assets/js/views/modules/apps.js
vendored
@ -34,7 +34,7 @@ const app = new Vue({
|
||||
onChangeCategory(category) {
|
||||
let path = document.getElementById('category_page').value;
|
||||
|
||||
if (category) {
|
||||
if (category != '*') {
|
||||
path += '/' + encodeURIComponent(category);
|
||||
} else {
|
||||
path = app_home;
|
||||
|
57
resources/assets/js/views/modules/item.js
vendored
57
resources/assets/js/views/modules/item.js
vendored
@ -32,12 +32,19 @@ const app = new Vue({
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.onGetReviews('', 1);
|
||||
this.onReviews(1);
|
||||
},
|
||||
|
||||
data: function () {
|
||||
return {
|
||||
reviews: '',
|
||||
reviews: {
|
||||
status: false,
|
||||
html: '',
|
||||
pagination: {
|
||||
current_page: 1,
|
||||
last_page: 1
|
||||
}
|
||||
},
|
||||
faq: false,
|
||||
installation: {
|
||||
show: false,
|
||||
@ -56,7 +63,7 @@ const app = new Vue({
|
||||
onChangeCategory(category) {
|
||||
let path = document.getElementById('category_page').value;
|
||||
|
||||
if (category) {
|
||||
if (category != '*') {
|
||||
path += '/' + encodeURIComponent(category);
|
||||
} else {
|
||||
path = app_home;
|
||||
@ -65,13 +72,19 @@ const app = new Vue({
|
||||
location = path;
|
||||
},
|
||||
|
||||
onGetReviews (path, page) {
|
||||
axios.post(url + '/apps/' + app_slug + '/reviews', {
|
||||
patth: path,
|
||||
async onReviews(page) {
|
||||
let reviews_promise = Promise.resolve(window.axios.post(url + '/apps/' + app_slug + '/reviews', {
|
||||
page: page
|
||||
})
|
||||
.then(response => {
|
||||
this.reviews = response.data.html;
|
||||
}));
|
||||
|
||||
reviews_promise.then(response => {
|
||||
if (response.data.success) {
|
||||
this.reviews.status= true;
|
||||
this.reviews.html = response.data.html;
|
||||
|
||||
this.reviews.pagination.current_page = page;
|
||||
this.reviews.pagination.last_page = response.data.data.last_page;
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
});
|
||||
@ -81,17 +94,18 @@ const app = new Vue({
|
||||
this.faq = true;
|
||||
},
|
||||
|
||||
onInstall(path, name, version) {
|
||||
async onInstall(path, name, version) {
|
||||
this.installation.show = true;
|
||||
this.installation.total = 0;
|
||||
this.installation.path = path;
|
||||
this.installation.version = version;
|
||||
|
||||
axios.post(url + '/apps/steps', {
|
||||
let steps_promise = Promise.resolve(axios.post(url + '/apps/steps', {
|
||||
name: name,
|
||||
version: version
|
||||
})
|
||||
.then(response => {
|
||||
}));
|
||||
|
||||
steps_promise.then(response => {
|
||||
if (response.data.error) {
|
||||
this.installation.status = 'exception';
|
||||
this.installation.html = '<div class="text-danger">' + response.data.message + '</div>';
|
||||
@ -109,19 +123,20 @@ const app = new Vue({
|
||||
});
|
||||
},
|
||||
|
||||
next() {
|
||||
async next() {
|
||||
let data = this.installation.steps.shift();
|
||||
|
||||
if (data) {
|
||||
this.installation.total = (100 - ((this.installation.steps.length / this.installation.steps_total) * 100)).toFixed(0);
|
||||
this.installation.total = parseInt((100 - ((this.installation.steps.length / this.installation.steps_total) * 100)).toFixed(0));
|
||||
|
||||
this.installation.html = '<span class="text-default"><i class="fa fa-spinner fa-spin update-spin"></i> ' + data['text'] + '</span> </br>';
|
||||
|
||||
axios.post(data.url, {
|
||||
let step_promise = Promise.resolve(axios.post(data.url, {
|
||||
version: this.installation.version,
|
||||
path: this.installation.path,
|
||||
})
|
||||
.then(response => {
|
||||
}));
|
||||
|
||||
step_promise.then(response => {
|
||||
if (response.data.error) {
|
||||
this.installation.status = 'exception';
|
||||
this.installation.html = '<div class="text-danger"><i class="fa fa-times update-error"></i> ' + response.data.message + '</div>';
|
||||
@ -136,11 +151,9 @@ const app = new Vue({
|
||||
}
|
||||
|
||||
if (!response.data.error && !response.data.redirect) {
|
||||
let self = this;
|
||||
|
||||
setTimeout(function() {
|
||||
self.next();
|
||||
}, 800);
|
||||
this.next();
|
||||
}.bind(this), 800);
|
||||
}
|
||||
|
||||
if (response.data.redirect) {
|
||||
|
Reference in New Issue
Block a user