mirror of
https://github.com/frappe/books.git
synced 2024-12-23 03:19:01 +00:00
Add electron commands and files
This commit is contained in:
parent
ba32967956
commit
7e8a6fe2f8
@ -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);
|
||||
});
|
@ -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>
|
||||
|
11
package.json
11
package.json
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user