2
0
mirror of https://github.com/frappe/books.git synced 2024-11-09 23:30:56 +00:00

Add electron commands and files

This commit is contained in:
Faris Ansari 2018-03-30 00:22:46 +05:30
parent ba32967956
commit 7e8a6fe2f8
3 changed files with 14 additions and 38 deletions

View File

@ -1,33 +1,12 @@
const client = require('frappejs/client/electron');
const electron = require('frappejs/client/electron');
const appClient = require('../client');
// start server
client.start({
electron.start({
dbPath: 'test.db',
columns: 3
}).then(() => {
columns: 3,
models: require('../models')
}).then((frappe) => {
// require modules
frappe.registerModels(require('../models'), 'client');
frappe.registerView('List', 'ToDo', require('frappejs/models/doctype/ToDo/ToDoList.js'));
frappe.registerView('Form', 'FilterSelector', require('frappejs/models/doctype/FilterSelector/FilterSelectorForm.js'));
frappe.registerView('List', 'Account', require('../models/doctype/Account/AccountList.js'));
frappe.registerView('Form', 'Account', require('../models/doctype/Account/AccountForm.js'));
frappe.registerView('List', 'Invoice', require('../models/doctype/Invoice/InvoiceList.js'));
frappe.registerView('List', 'Customer', require('../models/doctype/Party/CustomerList.js'));
frappe.desk.menu.addItem('ToDo', '#list/ToDo');
frappe.desk.menu.addItem('Accounts', '#list/Account');
frappe.desk.menu.addItem('Items', '#list/Item');
frappe.desk.menu.addItem('Customers', '#list/Customer');
frappe.desk.menu.addItem('Invoice', '#list/Invoice');
frappe.desk.menu.addItem('Settings', () => frappe.desk.showFormModal('SystemSettings'));
frappe.router.default = '#list/ToDo';
frappe.router.show(window.location.hash);
});
module.exports = false;
module.exports = false;
appClient.start(frappe);
});

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link href="../dist/css/style.css" rel="stylesheet">
<link href="../www/dist/css/style.css" rel="stylesheet">
</head>
<body>
<script src="./client.js"></script>

View File

@ -8,15 +8,12 @@
"test": "mocha tests",
"start": "nodemon server.js",
"watch": "rollup -c --watch",
"start-electron": "electron electron/main.js",
"electron-dev": "yarn run start-electron & yarn run watch",
"postinstall": "electron-builder install-app-deps",
"electron-pack": "electron-packager . --overwrite"
"electron": "electron electron/main.js",
"electron-pack": "electron-packager electron/main.js --overwrite",
"postinstall": "electron-builder install-app-deps"
},
"dependencies": {
"frappejs": "^0.0.5",
"nunjucks": "^3.1.2",
"sqlite3": "^4.0.0"
"frappejs": "../frappejs"
},
"devDependencies": {
"electron": "1.8.4",