2018-10-23 18:12:36 +05:30
|
|
|
<template>
|
2019-11-19 23:19:45 +05:30
|
|
|
<div class="px-12 py-10 flex-1 bg-white window-drag">
|
2019-10-13 17:33:01 +05:30
|
|
|
<h1 class="text-2xl font-semibold">{{ _('Welcome to Frappe Accounting') }}</h1>
|
|
|
|
<p
|
|
|
|
class="text-gray-600"
|
2019-10-24 10:47:01 +05:30
|
|
|
>{{ _('Do you need to create a new database or load an existing one?') }}</p>
|
2019-10-13 17:33:01 +05:30
|
|
|
<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-10-13 17:33:01 +05:30
|
|
|
>
|
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">
|
2019-11-19 23:19:45 +05:30
|
|
|
<feather-icon name="plus" class="text-white w-5 h-5"/>
|
2019-10-13 17:33:01 +05:30
|
|
|
</div>
|
2018-10-23 18:12:36 +05:30
|
|
|
</div>
|
2019-10-13 17:33:01 +05:30
|
|
|
<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-10-13 17:33:01 +05:30
|
|
|
>
|
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">
|
2019-11-19 23:19:45 +05:30
|
|
|
<feather-icon name="upload" class="w-4 h-4 text-white" />
|
2019-10-13 17:33:01 +05:30
|
|
|
</div>
|
2018-10-23 18:12:36 +05:30
|
|
|
</div>
|
2019-10-13 17:33:01 +05:30
|
|
|
<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>
|
2019-10-13 17:33:01 +05:30
|
|
|
import { _ } from 'frappejs';
|
2019-10-26 20:16:04 +05:30
|
|
|
import { createNewDatabase, loadExistingDatabase } from '@/utils';
|
2018-10-23 18:12:36 +05:30
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'DatabaseSelector',
|
|
|
|
methods: {
|
2019-10-26 20:16:04 +05:30
|
|
|
async newDatabase() {
|
|
|
|
let filePath = await createNewDatabase();
|
|
|
|
this.$emit('file', filePath);
|
2018-10-23 18:12:36 +05:30
|
|
|
},
|
2019-10-26 20:16:04 +05:30
|
|
|
async existingDatabase() {
|
|
|
|
let filePath = await loadExistingDatabase();
|
|
|
|
this.$emit('file', filePath);
|
2018-10-23 18:12:36 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2019-10-13 17:33:01 +05:30
|
|
|
</script>
|