2018-01-16 06:09:17 +00:00
|
|
|
const common = require('frappejs/common');
|
|
|
|
const RESTClient = require('frappejs/backends/rest_client');
|
|
|
|
const frappe = require('frappejs');
|
2018-01-12 12:25:07 +00:00
|
|
|
frappe.ui = require('./ui');
|
|
|
|
const Desk = require('./desk');
|
|
|
|
|
|
|
|
module.exports = {
|
2018-02-14 16:44:50 +00:00
|
|
|
async start({server, columns = 2}) {
|
2018-01-12 12:25:07 +00:00
|
|
|
window.frappe = frappe;
|
|
|
|
frappe.init();
|
|
|
|
common.init_libs(frappe);
|
|
|
|
|
|
|
|
frappe.fetch = window.fetch.bind();
|
2018-01-15 11:55:31 +00:00
|
|
|
frappe.db = await new RESTClient({server: server});
|
|
|
|
|
|
|
|
frappe.flags.cache_docs = true;
|
2018-01-12 12:25:07 +00:00
|
|
|
|
2018-02-14 16:44:50 +00:00
|
|
|
frappe.desk = new Desk(columns);
|
2018-01-12 12:25:07 +00:00
|
|
|
await frappe.login();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|