2019-10-26 14:46:04 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2020-01-28 08:20:01 +00:00
|
|
|
<div class="flex items-center justify-between">
|
|
|
|
<div class="flex items-center">
|
|
|
|
<svg
|
|
|
|
class="h-12"
|
|
|
|
viewBox="0 0 40 48"
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
>
|
|
|
|
<path
|
|
|
|
d="M37.73 0c1.097 0 1.986.89 1.986 1.986v43.688c0 1.096-.889 1.986-1.986 1.986H1.986A1.986 1.986 0 010 45.674V1.986C0 .889.89 0 1.986 0zm-7.943 27.404c-2.283 1.688-6.156 2.383-9.929 2.383-3.773 0-7.645-.695-9.929-2.383v4.369l.006.156c.196 2.575 5.25 3.816 9.923 3.816 4.766 0 9.93-1.291 9.93-3.972zm0-7.943c-2.283 1.688-6.156 2.383-9.929 2.383-3.773 0-7.645-.695-9.929-2.383v4.369l.006.156c.196 2.575 5.25 3.815 9.923 3.815 4.766 0 9.93-1.29 9.93-3.971zm-9.929-7.546c-4.766 0-9.929 1.29-9.929 3.972 0 2.68 5.163 3.971 9.93 3.971 4.765 0 9.928-1.29 9.928-3.971s-5.163-3.972-9.929-3.972z"
|
|
|
|
fill="#2490EF"
|
|
|
|
fill-rule="evenodd"
|
|
|
|
/>
|
|
|
|
</svg>
|
2020-04-30 11:13:06 +00:00
|
|
|
<div class="flex flex-col w-56 ml-4 truncate">
|
2020-01-28 08:20:01 +00:00
|
|
|
<span class="font-semibold">{{ companyName }}</span>
|
|
|
|
<span class="text-xs text-gray-600">{{ dbPath }}</span>
|
|
|
|
</div>
|
2019-10-26 14:46:04 +00:00
|
|
|
</div>
|
2020-01-28 08:20:01 +00:00
|
|
|
<Button class="text-sm" @click="changeFile">
|
2019-12-23 08:24:18 +00:00
|
|
|
{{ _('Change File') }}
|
|
|
|
</Button>
|
2019-10-26 14:46:04 +00:00
|
|
|
</div>
|
2020-01-28 08:20:01 +00:00
|
|
|
|
2019-12-16 13:52:14 +00:00
|
|
|
<TwoColumnForm
|
|
|
|
class="mt-6"
|
|
|
|
v-if="doc"
|
|
|
|
:doc="doc"
|
|
|
|
:fields="fields"
|
|
|
|
:autosave="true"
|
|
|
|
/>
|
2019-12-27 06:37:39 +00:00
|
|
|
<div class="mt-6">
|
|
|
|
<FormControl
|
2020-04-30 11:13:06 +00:00
|
|
|
:show-label="true"
|
2019-12-27 06:37:39 +00:00
|
|
|
:df="AccountingSettings.meta.getField('autoUpdate')"
|
|
|
|
@change="value => AccountingSettings.update('autoUpdate', value)"
|
|
|
|
:value="AccountingSettings.autoUpdate"
|
|
|
|
/>
|
|
|
|
<p class="pl-6 mt-1 text-sm text-gray-600">
|
|
|
|
<!-- prettier-ignore -->
|
|
|
|
{{ _('Automatically check for updates and download them if available. The update will be applied after you restart the app.') }}
|
|
|
|
</p>
|
|
|
|
</div>
|
2019-10-26 14:46:04 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import frappe from 'frappejs';
|
|
|
|
import TwoColumnForm from '@/components/TwoColumnForm';
|
2019-12-27 06:37:39 +00:00
|
|
|
import FormControl from '@/components/Controls/FormControl';
|
2019-10-26 14:46:04 +00:00
|
|
|
import Button from '@/components/Button';
|
2020-01-28 08:20:01 +00:00
|
|
|
import config from '@/config';
|
2019-10-26 14:46:04 +00:00
|
|
|
import { remote } from 'electron';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'TabSystem',
|
|
|
|
components: {
|
|
|
|
TwoColumnForm,
|
2019-12-27 06:37:39 +00:00
|
|
|
FormControl,
|
2019-10-26 14:46:04 +00:00
|
|
|
Button
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
companyName: null,
|
|
|
|
doc: null
|
|
|
|
};
|
|
|
|
},
|
|
|
|
async mounted() {
|
2019-12-16 13:52:14 +00:00
|
|
|
this.doc = frappe.SystemSettings;
|
|
|
|
this.companyName = frappe.AccountingSettings.companyName;
|
2019-10-26 14:46:04 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2020-01-28 08:20:01 +00:00
|
|
|
changeFile() {
|
|
|
|
config.set('lastSelectedFilePath', null);
|
2019-10-26 14:46:04 +00:00
|
|
|
frappe.events.trigger('reload-main-window');
|
|
|
|
remote.getCurrentWindow().close();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
fields() {
|
|
|
|
let meta = frappe.getMeta('SystemSettings');
|
|
|
|
return meta.getQuickEditFields();
|
|
|
|
},
|
|
|
|
dbPath() {
|
2020-01-28 08:20:01 +00:00
|
|
|
return frappe.db.dbPath;
|
2019-12-27 06:37:39 +00:00
|
|
|
},
|
|
|
|
AccountingSettings() {
|
|
|
|
return frappe.AccountingSettings;
|
2019-10-26 14:46:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|