2
0
mirror of https://github.com/frappe/books.git synced 2025-01-11 02:36:14 +00:00
books/src/pages/DatabaseSelector.vue

63 lines
2.2 KiB
Vue
Raw Normal View History

2018-10-23 12:42:36 +00:00
<template>
<div class="px-12 py-10 flex-1 bg-white window-drag">
<h1 class="text-2xl font-semibold">
{{ _('Welcome to Frappe Accounting') }}
</h1>
<p class="text-gray-600">
{{ _('Create a new file or load an existing one from your computer') }}
</p>
<div class="flex mt-10 window-no-drag">
<div
@click="newDatabase"
2019-12-11 09:38:20 +00:00
class="w-1/2 border rounded-xl flex flex-col items-center py-8 px-5 cursor-pointer hover:shadow"
>
2019-12-11 09:09:16 +00:00
<div class="w-14 h-14 rounded-full bg-blue-200 relative flex-center">
<div class="w-12 h-12 absolute rounded-full bg-blue-500 flex-center">
<feather-icon name="plus" class="text-white w-5 h-5" />
</div>
2018-10-23 12:42:36 +00:00
</div>
<div class="mt-5 font-medium">{{ _('New File') }}</div>
<div class="mt-2 text-sm text-gray-600 text-center">
{{ _('Create a new file and store it in your computer.') }}
</div>
</div>
<div
@click="existingDatabase"
2019-12-11 09:38:20 +00:00
class="ml-6 w-1/2 border rounded-xl flex flex-col items-center py-8 px-5 cursor-pointer hover:shadow"
>
2019-12-11 09:09:16 +00:00
<div class="w-14 h-14 rounded-full bg-green-200 relative flex-center">
<div class="w-12 h-12 rounded-full bg-green-500 flex-center">
<feather-icon name="upload" class="w-4 h-4 text-white" />
</div>
2018-10-23 12:42:36 +00:00
</div>
<div class="mt-5 font-medium">{{ _('Existing File') }}</div>
<div class="mt-2 text-sm text-gray-600 text-center">
{{ _('Load an existing .db file from your computer.') }}
</div>
2018-10-23 12:42:36 +00:00
</div>
</div>
<p class="mt-4 flex-center text-sm text-gray-600">
<feather-icon name="info" class="-ml-8 mr-1 w-4 h-4 inline" />
<!-- prettier-ignore -->
{{ _('This file will be used as a database to store data like Customers, Invoices and Settings.') }}
</p>
2018-10-23 12:42:36 +00:00
</div>
</template>
<script>
import { createNewDatabase, loadExistingDatabase } from '@/utils';
2018-10-23 12:42:36 +00:00
export default {
name: 'DatabaseSelector',
methods: {
async newDatabase() {
let filePath = await createNewDatabase();
this.$emit('file', filePath);
2018-10-23 12:42:36 +00:00
},
async existingDatabase() {
let filePath = await loadExistingDatabase();
this.$emit('file', filePath);
2018-10-23 12:42:36 +00:00
}
}
};
</script>