2018-06-01 18:05:51 +05:30
|
|
|
// The Vue build version to load with the `import` command
|
|
|
|
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
|
2018-06-11 15:16:25 +05:30
|
|
|
|
|
|
|
// vue imports
|
2018-06-26 16:43:05 +05:30
|
|
|
import Vue from 'vue';
|
|
|
|
import App from './App';
|
|
|
|
import router from './router';
|
2018-07-14 13:02:01 +05:30
|
|
|
import frappeVue from 'frappejs/ui/plugins/frappeVue';
|
2018-06-11 15:16:25 +05:30
|
|
|
|
|
|
|
// frappejs imports
|
|
|
|
import frappe from 'frappejs';
|
2018-07-14 18:45:21 +05:30
|
|
|
import io from 'socket.io-client';
|
2018-06-11 15:16:25 +05:30
|
|
|
import HTTPClient from 'frappejs/backends/http';
|
|
|
|
import common from 'frappejs/common';
|
|
|
|
import coreModels from 'frappejs/models';
|
|
|
|
import models from '../models';
|
2018-06-11 16:50:34 +05:30
|
|
|
import registerReportMethods from '../reports';
|
2018-06-11 15:16:25 +05:30
|
|
|
|
|
|
|
frappe.init();
|
|
|
|
frappe.registerLibs(common);
|
|
|
|
frappe.registerModels(coreModels);
|
|
|
|
frappe.registerModels(models);
|
|
|
|
const server = 'localhost:8000';
|
|
|
|
frappe.fetch = window.fetch.bind();
|
|
|
|
frappe.db = new HTTPClient({ server });
|
|
|
|
const socket = io.connect(`http://${server}`);
|
|
|
|
frappe.db.bindSocketClient(socket);
|
|
|
|
frappe.getSingle('SystemSettings');
|
2018-06-26 16:43:05 +05:30
|
|
|
registerReportMethods();
|
2018-06-11 15:16:25 +05:30
|
|
|
|
|
|
|
frappe.getSingle('AccountingSettings')
|
|
|
|
.then(accountingSettings => {
|
2018-07-09 18:33:38 +05:30
|
|
|
if (router.currentRoute.fullPath !== '/') return;
|
|
|
|
|
2018-06-11 15:16:25 +05:30
|
|
|
if (accountingSettings.companyName) {
|
|
|
|
router.push('/list/ToDo');
|
|
|
|
} else {
|
|
|
|
router.push('/setup-wizard');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
window.frappe = frappe;
|
2018-06-01 18:05:51 +05:30
|
|
|
|
2018-06-26 16:43:05 +05:30
|
|
|
Vue.config.productionTip = false;
|
2018-07-14 13:02:01 +05:30
|
|
|
Vue.use(frappeVue);
|
2018-06-26 16:43:05 +05:30
|
|
|
|
2018-06-01 18:05:51 +05:30
|
|
|
/* eslint-disable no-new */
|
|
|
|
new Vue({
|
|
|
|
el: '#app',
|
|
|
|
router,
|
|
|
|
components: { App },
|
|
|
|
template: '<App/>'
|
2018-06-26 16:43:05 +05:30
|
|
|
});
|