2
0
mirror of https://github.com/frappe/books.git synced 2025-01-25 16:18:33 +00:00
books/src/pages/DatabaseSelector.vue

57 lines
2.0 KiB
Vue
Raw Normal View History

2018-10-23 18:12:36 +05:30
<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"
>{{ _('Do you need to create a new database or load an existing one?') }}</p>
<div class="flex mt-10">
<div
@click="newDatabase"
2019-12-11 15:08:20 +05:30
class="w-1/2 border rounded-xl flex flex-col items-center py-8 px-5 cursor-pointer hover:shadow"
>
2019-12-11 14:39:16 +05:30
<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 18:12:36 +05:30
</div>
<div class="mt-5 font-medium">{{ _('New Database') }}</div>
<div
class="mt-2 text-sm text-gray-600 text-center"
>{{ _('Create a new database file and store it in your computer.') }}</div>
</div>
<div
@click="existingDatabase"
2019-12-11 15:08:20 +05:30
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 14:39:16 +05:30
<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 18:12:36 +05:30
</div>
<div class="mt-5 font-medium">{{ _('Existing Database') }}</div>
<div
class="mt-2 text-sm text-gray-600 text-center"
>{{ _('Load an existing .db file from your computer.') }}</div>
2018-10-23 18:12:36 +05:30
</div>
</div>
</div>
</template>
<script>
import { _ } from 'frappejs';
import { createNewDatabase, loadExistingDatabase } from '@/utils';
2018-10-23 18:12:36 +05:30
export default {
name: 'DatabaseSelector',
methods: {
async newDatabase() {
let filePath = await createNewDatabase();
this.$emit('file', filePath);
2018-10-23 18:12:36 +05:30
},
async existingDatabase() {
let filePath = await loadExistingDatabase();
this.$emit('file', filePath);
2018-10-23 18:12:36 +05:30
}
}
};
</script>