'Unusage codes ejected'

This commit is contained in:
Burak Civan 2021-05-21 16:46:58 +03:00
parent 928086f9bf
commit 3f7cef3de6
5 changed files with 15 additions and 176 deletions

View File

@ -10,7 +10,7 @@ export default {
select: "",
enabled: 1
},
error_field_name: ''
error_field: {}
}
},
@ -18,7 +18,7 @@ export default {
addItem() {
this.newDatas = true;
this.currentTab = undefined;
this.error_field_name = '';
this.error_field = '';
if (this.model) {
this.model.name = '';
@ -30,7 +30,7 @@ export default {
handeClickEdit(item, index) {
this.newDatas = false;
this.currentTab = index;
this.error_field_name = '';
this.error_field = '';
if (this.model) {
this.model.name = item.name ? item.name : '';
@ -168,7 +168,7 @@ export default {
this.onSuccessDelete(event);
},
onFailError(error) {
this.error_field_name = error.response.data.errors;
this.error_field = error.response.data.errors;
}
},
}

View File

@ -1,7 +1,7 @@
<template>
<div>
<h1 class="text-white">
{{ translations.currencies.title }}
{{ translations.currencies.title }}
</h1>
<div class="card">
@ -120,12 +120,12 @@
prepend-icon="fas fa-font"
form-classes="col-md-3"
class="required"
:error="error_field_name.name"
:error="error_field.name"
v-model="model.name"
/>
<base-input
:label="translations.currencies.code"
:error="error_field_name.code"
:error="error_field.code"
class="required"
form-classes="col-md-3"
>
@ -160,7 +160,7 @@
prepend-icon="fas fa-percentage"
form-classes="col-md-3"
class="required"
:error="error_field_name.rate"
:error="error_field.rate"
v-model="model.rate"
/>
<div class="mt-4 col-md-3 current-tab-btn">
@ -190,9 +190,9 @@
prepend-icon="fas fa-font"
class="required"
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
name="code"
v-model="model.select"
@ -225,7 +225,7 @@
prepend-icon="fas fa-percentage"
class="required"
v-model="model.rate"
:error="error_field_name.rate"
:error="error_field.rate"
/>
<div>
<div class="d-flex">
@ -283,7 +283,6 @@
<script>
import { Step, Steps, Select, Option } from "element-ui";
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
import Form from "./../../plugins/form";
import BulkAction from "./../../plugins/bulk-action";
import MixinsGlobal from "./../../mixins/global";
import MixinsSpaGlobal from "./../../mixins/spa-global";

View File

@ -111,7 +111,7 @@
prepend-icon="fas fa-font"
form-classes="col-md-4"
class="required"
:error="error_field_name.name"
:error="error_field.name"
v-model="model.name"
/>
<base-input
@ -122,7 +122,7 @@
prepend-icon="fas fa-percentage"
form-classes="col-md-4"
class="required"
:error="error_field_name.rate"
:error="error_field.rate"
v-model="model.rate"
/>
<div class="mt-4 col-md-4 current-tab-btn">
@ -149,7 +149,7 @@
data-name="name"
:placeholder="translations.taxes.name"
prepend-icon="fas fa-font"
:error="error_field_name.name"
:error="error_field.name"
class="required"
v-model="model.name"
/>
@ -159,7 +159,7 @@
data-name="rate"
:placeholder="translations.taxes.rate"
prepend-icon="fas fa-percentage"
:error="error_field_name.rate"
:error="error_field.rate"
class="required"
v-model="model.rate"
/>
@ -217,7 +217,6 @@
<script>
import { Step, Steps } from "element-ui";
import AkauntingRadioGroup from "./../../components/forms/AkauntingRadioGroup";
import Form from "./../../plugins/form";
import BulkAction from "./../../plugins/bulk-action";
import MixinsGlobal from "./../../mixins/global";
import MixinsSpaGlobal from "./../../mixins/spa-global";

View File

@ -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 => {
});
}
}
}
});

View File

@ -7,13 +7,6 @@
@stack('body_start')
<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="document-loading" v-if="!page_loaded">
<div><i class="fas fa-spinner fa-pulse fa-7x"></i></div>