'Unusage codes ejected'
This commit is contained in:
parent
928086f9bf
commit
3f7cef3de6
8
resources/assets/js/mixins/spa-global.js
vendored
8
resources/assets/js/mixins/spa-global.js
vendored
@ -10,7 +10,7 @@ export default {
|
|||||||
select: "",
|
select: "",
|
||||||
enabled: 1
|
enabled: 1
|
||||||
},
|
},
|
||||||
error_field_name: ''
|
error_field: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ export default {
|
|||||||
addItem() {
|
addItem() {
|
||||||
this.newDatas = true;
|
this.newDatas = true;
|
||||||
this.currentTab = undefined;
|
this.currentTab = undefined;
|
||||||
this.error_field_name = '';
|
this.error_field = '';
|
||||||
|
|
||||||
if (this.model) {
|
if (this.model) {
|
||||||
this.model.name = '';
|
this.model.name = '';
|
||||||
@ -30,7 +30,7 @@ export default {
|
|||||||
handeClickEdit(item, index) {
|
handeClickEdit(item, index) {
|
||||||
this.newDatas = false;
|
this.newDatas = false;
|
||||||
this.currentTab = index;
|
this.currentTab = index;
|
||||||
this.error_field_name = '';
|
this.error_field = '';
|
||||||
|
|
||||||
if (this.model) {
|
if (this.model) {
|
||||||
this.model.name = item.name ? item.name : '';
|
this.model.name = item.name ? item.name : '';
|
||||||
@ -168,7 +168,7 @@ export default {
|
|||||||
this.onSuccessDelete(event);
|
this.onSuccessDelete(event);
|
||||||
},
|
},
|
||||||
onFailError(error) {
|
onFailError(error) {
|
||||||
this.error_field_name = error.response.data.errors;
|
this.error_field = error.response.data.errors;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -120,12 +120,12 @@
|
|||||||
prepend-icon="fas fa-font"
|
prepend-icon="fas fa-font"
|
||||||
form-classes="col-md-3"
|
form-classes="col-md-3"
|
||||||
class="required"
|
class="required"
|
||||||
:error="error_field_name.name"
|
:error="error_field.name"
|
||||||
v-model="model.name"
|
v-model="model.name"
|
||||||
/>
|
/>
|
||||||
<base-input
|
<base-input
|
||||||
:label="translations.currencies.code"
|
:label="translations.currencies.code"
|
||||||
:error="error_field_name.code"
|
:error="error_field.code"
|
||||||
class="required"
|
class="required"
|
||||||
form-classes="col-md-3"
|
form-classes="col-md-3"
|
||||||
>
|
>
|
||||||
@ -160,7 +160,7 @@
|
|||||||
prepend-icon="fas fa-percentage"
|
prepend-icon="fas fa-percentage"
|
||||||
form-classes="col-md-3"
|
form-classes="col-md-3"
|
||||||
class="required"
|
class="required"
|
||||||
:error="error_field_name.rate"
|
:error="error_field.rate"
|
||||||
v-model="model.rate"
|
v-model="model.rate"
|
||||||
/>
|
/>
|
||||||
<div class="mt-4 col-md-3 current-tab-btn">
|
<div class="mt-4 col-md-3 current-tab-btn">
|
||||||
@ -190,9 +190,9 @@
|
|||||||
prepend-icon="fas fa-font"
|
prepend-icon="fas fa-font"
|
||||||
class="required"
|
class="required"
|
||||||
v-model="model.name"
|
v-model="model.name"
|
||||||
:error="error_field_name.name"
|
:error="error_field.name"
|
||||||
/>
|
/>
|
||||||
<base-input :label="translations.currencies.code" class="required" :error="error_field_name.code">
|
<base-input :label="translations.currencies.code" class="required" :error="error_field.code">
|
||||||
<el-select
|
<el-select
|
||||||
name="code"
|
name="code"
|
||||||
v-model="model.select"
|
v-model="model.select"
|
||||||
@ -225,7 +225,7 @@
|
|||||||
prepend-icon="fas fa-percentage"
|
prepend-icon="fas fa-percentage"
|
||||||
class="required"
|
class="required"
|
||||||
v-model="model.rate"
|
v-model="model.rate"
|
||||||
:error="error_field_name.rate"
|
:error="error_field.rate"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
@ -283,7 +283,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Step, Steps, Select, Option } from "element-ui";
|
import { Step, Steps, Select, Option } from "element-ui";
|
||||||
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
|
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
|
||||||
import Form from "./../../plugins/form";
|
|
||||||
import BulkAction from "./../../plugins/bulk-action";
|
import BulkAction from "./../../plugins/bulk-action";
|
||||||
import MixinsGlobal from "./../../mixins/global";
|
import MixinsGlobal from "./../../mixins/global";
|
||||||
import MixinsSpaGlobal from "./../../mixins/spa-global";
|
import MixinsSpaGlobal from "./../../mixins/spa-global";
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
prepend-icon="fas fa-font"
|
prepend-icon="fas fa-font"
|
||||||
form-classes="col-md-4"
|
form-classes="col-md-4"
|
||||||
class="required"
|
class="required"
|
||||||
:error="error_field_name.name"
|
:error="error_field.name"
|
||||||
v-model="model.name"
|
v-model="model.name"
|
||||||
/>
|
/>
|
||||||
<base-input
|
<base-input
|
||||||
@ -122,7 +122,7 @@
|
|||||||
prepend-icon="fas fa-percentage"
|
prepend-icon="fas fa-percentage"
|
||||||
form-classes="col-md-4"
|
form-classes="col-md-4"
|
||||||
class="required"
|
class="required"
|
||||||
:error="error_field_name.rate"
|
:error="error_field.rate"
|
||||||
v-model="model.rate"
|
v-model="model.rate"
|
||||||
/>
|
/>
|
||||||
<div class="mt-4 col-md-4 current-tab-btn">
|
<div class="mt-4 col-md-4 current-tab-btn">
|
||||||
@ -149,7 +149,7 @@
|
|||||||
data-name="name"
|
data-name="name"
|
||||||
:placeholder="translations.taxes.name"
|
:placeholder="translations.taxes.name"
|
||||||
prepend-icon="fas fa-font"
|
prepend-icon="fas fa-font"
|
||||||
:error="error_field_name.name"
|
:error="error_field.name"
|
||||||
class="required"
|
class="required"
|
||||||
v-model="model.name"
|
v-model="model.name"
|
||||||
/>
|
/>
|
||||||
@ -159,7 +159,7 @@
|
|||||||
data-name="rate"
|
data-name="rate"
|
||||||
:placeholder="translations.taxes.rate"
|
:placeholder="translations.taxes.rate"
|
||||||
prepend-icon="fas fa-percentage"
|
prepend-icon="fas fa-percentage"
|
||||||
:error="error_field_name.rate"
|
:error="error_field.rate"
|
||||||
class="required"
|
class="required"
|
||||||
v-model="model.rate"
|
v-model="model.rate"
|
||||||
/>
|
/>
|
||||||
@ -217,7 +217,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import { Step, Steps } from "element-ui";
|
import { Step, Steps } from "element-ui";
|
||||||
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
|
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
|
||||||
import Form from "./../../plugins/form";
|
|
||||||
import BulkAction from "./../../plugins/bulk-action";
|
import BulkAction from "./../../plugins/bulk-action";
|
||||||
import MixinsGlobal from "./../../mixins/global";
|
import MixinsGlobal from "./../../mixins/global";
|
||||||
import MixinsSpaGlobal from "./../../mixins/spa-global";
|
import MixinsSpaGlobal from "./../../mixins/spa-global";
|
||||||
|
152
resources/assets/js/views/wizard/update.js
vendored
152
resources/assets/js/views/wizard/update.js
vendored
@ -1,152 +0,0 @@
|
|||||||
/**
|
|
||||||
* First we will load all of this project's JavaScript dependencies which
|
|
||||||
* includes Vue and other libraries. It is a great starting point when
|
|
||||||
* building robust, powerful web applications using Vue and Laravel.
|
|
||||||
*/
|
|
||||||
|
|
||||||
require('../../bootstrap');
|
|
||||||
|
|
||||||
import Vue from 'vue';
|
|
||||||
|
|
||||||
import DashboardPlugin from './../../plugins/dashboard-plugin';
|
|
||||||
|
|
||||||
import Global from './../../mixins/global';
|
|
||||||
|
|
||||||
import {Progress} from 'element-ui';
|
|
||||||
|
|
||||||
Vue.use(Progress);
|
|
||||||
|
|
||||||
// plugin setup
|
|
||||||
Vue.use(DashboardPlugin);
|
|
||||||
|
|
||||||
const app = new Vue({
|
|
||||||
el: '#app',
|
|
||||||
|
|
||||||
mixins: [
|
|
||||||
Global
|
|
||||||
],
|
|
||||||
|
|
||||||
components: {
|
|
||||||
[Progress.name]: Progress,
|
|
||||||
},
|
|
||||||
|
|
||||||
data: function () {
|
|
||||||
return {
|
|
||||||
changelog: {
|
|
||||||
show:false,
|
|
||||||
html: null
|
|
||||||
},
|
|
||||||
update: {
|
|
||||||
steps: [],
|
|
||||||
steps_total: 0,
|
|
||||||
total: 0,
|
|
||||||
path: '',
|
|
||||||
status: 'success',
|
|
||||||
html: ''
|
|
||||||
},
|
|
||||||
page: 'check',
|
|
||||||
name: null,
|
|
||||||
version: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mounted() {
|
|
||||||
if (document.getElementById('page') != null && document.getElementById('page').value == 'update') {
|
|
||||||
this.steps();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
methods: {
|
|
||||||
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;
|
|
||||||
})
|
|
||||||
.catch(e => {
|
|
||||||
this.errors.push(e)
|
|
||||||
})
|
|
||||||
.finally(function () {
|
|
||||||
// always executed
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
async steps() {
|
|
||||||
let name = document.getElementById('name').value;
|
|
||||||
|
|
||||||
let steps_promise = Promise.resolve(axios.post(url + '/install/updates/steps', {
|
|
||||||
name: name,
|
|
||||||
version: version
|
|
||||||
}));
|
|
||||||
|
|
||||||
steps_promise.then(response => {
|
|
||||||
if (response.data.error) {
|
|
||||||
this.update.status = 'exception';
|
|
||||||
this.update.html = '<div class="text-danger">' + response.data.message + '</div>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set steps
|
|
||||||
if (response.data.data) {
|
|
||||||
this.update.steps = response.data.data;
|
|
||||||
this.update.steps_total = this.update.steps.length;
|
|
||||||
|
|
||||||
this.next();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
async next() {
|
|
||||||
let data = this.update.steps.shift();
|
|
||||||
|
|
||||||
let name = document.getElementById('name').value;
|
|
||||||
let alias = document.getElementById('alias').value;
|
|
||||||
let version = document.getElementById('version').value;
|
|
||||||
let installed = document.getElementById('installed').value;
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
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>';
|
|
||||||
|
|
||||||
let step_promise = Promise.resolve(axios.post(data.url, {
|
|
||||||
name: name,
|
|
||||||
alias: alias,
|
|
||||||
version: version,
|
|
||||||
installed: installed,
|
|
||||||
path: this.update.path,
|
|
||||||
}));
|
|
||||||
|
|
||||||
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>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.data.success) {
|
|
||||||
this.update.status = 'success';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.data.data.path) {
|
|
||||||
this.update.path = response.data.data.path;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!response.data.error && !response.data.redirect) {
|
|
||||||
setTimeout(function() {
|
|
||||||
this.next();
|
|
||||||
}.bind(this), 800);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.data.redirect) {
|
|
||||||
window.location = response.data.redirect;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
@ -7,13 +7,6 @@
|
|||||||
@stack('body_start')
|
@stack('body_start')
|
||||||
|
|
||||||
<div id="app">
|
<div id="app">
|
||||||
{!! Form::open([
|
|
||||||
'url' => url()->current(),
|
|
||||||
'role' => 'form',
|
|
||||||
'id' => 'form-wizard',
|
|
||||||
'@submit.prevent' => 'onSubmit',
|
|
||||||
'@keydown' => 'form.errors.clear($event.target.name)',
|
|
||||||
]) !!}
|
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="document-loading" v-if="!page_loaded">
|
<div class="document-loading" v-if="!page_loaded">
|
||||||
<div><i class="fas fa-spinner fa-pulse fa-7x"></i></div>
|
<div><i class="fas fa-spinner fa-pulse fa-7x"></i></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user