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-01 18:05:51 +05:30
|
|
|
import Vue from 'vue'
|
|
|
|
import App from './App'
|
|
|
|
import router from './router'
|
2018-06-11 15:16:25 +05:30
|
|
|
|
|
|
|
// frappejs imports
|
|
|
|
import frappe from 'frappejs';
|
|
|
|
import HTTPClient from 'frappejs/backends/http';
|
|
|
|
import Observable from 'frappejs/utils/observable';
|
|
|
|
import common from 'frappejs/common';
|
|
|
|
import coreModels from 'frappejs/models';
|
|
|
|
import models from '../models';
|
|
|
|
import io from 'socket.io-client';
|
|
|
|
|
|
|
|
// vue components
|
2018-06-01 18:05:51 +05:30
|
|
|
import NotFound from './components/NotFound';
|
2018-06-04 14:58:45 +05:30
|
|
|
import FeatherIcon from './components/FeatherIcon';
|
2018-06-08 12:04:08 +05:30
|
|
|
import FrappeControl from './components/controls/FrappeControl';
|
2018-06-11 15:16:25 +05:30
|
|
|
import Button from './components/Button';
|
|
|
|
import Indicator from './components/Indicator';
|
|
|
|
|
|
|
|
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.registerModels(models);
|
|
|
|
frappe.docs = new Observable();
|
|
|
|
frappe.getSingle('SystemSettings');
|
|
|
|
|
|
|
|
frappe.getSingle('AccountingSettings')
|
|
|
|
.then(accountingSettings => {
|
|
|
|
if (accountingSettings.companyName) {
|
|
|
|
router.push('/list/ToDo');
|
|
|
|
} else {
|
|
|
|
router.push('/setup-wizard');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
window.frappe = frappe;
|
2018-06-01 18:05:51 +05:30
|
|
|
|
|
|
|
Vue.config.productionTip = false
|
|
|
|
|
|
|
|
Vue.component('not-found', NotFound);
|
2018-06-04 14:58:45 +05:30
|
|
|
Vue.component('feather-icon', FeatherIcon);
|
2018-06-08 12:04:08 +05:30
|
|
|
Vue.component('frappe-control', FrappeControl);
|
2018-06-11 15:16:25 +05:30
|
|
|
Vue.component('f-button', Button);
|
|
|
|
Vue.component('indicator', Indicator);
|
2018-06-01 18:05:51 +05:30
|
|
|
|
|
|
|
/* eslint-disable no-new */
|
|
|
|
new Vue({
|
|
|
|
el: '#app',
|
|
|
|
router,
|
|
|
|
components: { App },
|
|
|
|
template: '<App/>'
|
|
|
|
})
|