mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fixes, cleaned up noise in the developer console
This commit is contained in:
parent
9acf723a9a
commit
81f4966a1a
@ -44,4 +44,6 @@ app.on('will-quit', () => {
|
|||||||
globalShortcut.unregisterAll();
|
globalShortcut.unregisterAll();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
|
||||||
|
|
||||||
require('./src/www');
|
require('./src/www');
|
||||||
|
File diff suppressed because one or more lines are too long
31
package-lock.json
generated
31
package-lock.json
generated
@ -639,9 +639,12 @@
|
|||||||
"integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA=="
|
"integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA=="
|
||||||
},
|
},
|
||||||
"agent-base": {
|
"agent-base": {
|
||||||
"version": "5.1.1",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.0.tgz",
|
||||||
"integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g=="
|
"integrity": "sha512-j1Q7cSCqN+AwrmDd+pzgqc0/NpC655x2bUf5ZjRIO77DcNBFmh+OgRNzF6OKdCC9RSCb19fGd99+bhXFdkRNqw==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "4"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"ajv": {
|
"ajv": {
|
||||||
"version": "6.10.2",
|
"version": "6.10.2",
|
||||||
@ -2015,9 +2018,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cross-zip": {
|
"cross-zip": {
|
||||||
"version": "2.1.6",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/cross-zip/-/cross-zip-2.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/cross-zip/-/cross-zip-3.0.0.tgz",
|
||||||
"integrity": "sha512-xLIETNkzRcU6jGRzenJyRFxahbtP4628xEKMTI/Ql0Vu8m4h8M7uRLVi7E5OYHuJ6VQPsG4icJumKAFUvfm0+A==",
|
"integrity": "sha512-cm+l8PJ6WiSQmKZ/x8DGvUm2u/3FX2JFs1AFd18gdHaVhP5Lf4oE6Jrj2Jd05JYSioz5x+nIRVp0zBQuzuCRcQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"rimraf": "^3.0.0"
|
"rimraf": "^3.0.0"
|
||||||
@ -3089,14 +3092,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"electron-packager": {
|
"electron-packager": {
|
||||||
"version": "14.2.0",
|
"version": "14.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-14.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/electron-packager/-/electron-packager-14.2.1.tgz",
|
||||||
"integrity": "sha512-6JHv0zfRpxpFta4MJBt7RtcS6zhtl4f76ombZKqicgl5I3Ighx8WBQRYUKMdAO3tNYEq/B0i1FYsBp6oXzlTfA==",
|
"integrity": "sha512-g6y3BVrAOz/iavKD+VMFbehrQcwCWuA3CZvVbmmbQuCfegGA1ytwWn0BNIDDrEdbuz31Fti7mnNHhb5L+3Wq9A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@electron/get": "^1.6.0",
|
"@electron/get": "^1.6.0",
|
||||||
"asar": "^2.0.1",
|
"asar": "^2.0.1",
|
||||||
"cross-zip": "^2.1.5",
|
"cross-zip": "^3.0.0",
|
||||||
"debug": "^4.0.1",
|
"debug": "^4.0.1",
|
||||||
"electron-notarize": "^0.2.0",
|
"electron-notarize": "^0.2.0",
|
||||||
"electron-osx-sign": "^0.4.11",
|
"electron-osx-sign": "^0.4.11",
|
||||||
@ -4876,11 +4879,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"https-proxy-agent": {
|
"https-proxy-agent": {
|
||||||
"version": "4.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
|
||||||
"integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==",
|
"integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"agent-base": "5",
|
"agent-base": "6",
|
||||||
"debug": "4"
|
"debug": "4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
"html": "1.0.0",
|
"html": "1.0.0",
|
||||||
"html2plaintext": "2.1.2",
|
"html2plaintext": "2.1.2",
|
||||||
"http-proxy-agent": "4.0.0",
|
"http-proxy-agent": "4.0.0",
|
||||||
"https-proxy-agent": "4.0.0",
|
"https-proxy-agent": "5.0.0",
|
||||||
"image-type": "4.1.0",
|
"image-type": "4.1.0",
|
||||||
"imagemin": "7.0.1",
|
"imagemin": "7.0.1",
|
||||||
"imagemin-giflossy": "5.1.10",
|
"imagemin-giflossy": "5.1.10",
|
||||||
@ -78,7 +78,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"electron": "8.0.0",
|
"electron": "8.0.0",
|
||||||
"electron-builder": "22.3.2",
|
"electron-builder": "22.3.2",
|
||||||
"electron-packager": "14.2.0",
|
"electron-packager": "14.2.1",
|
||||||
"electron-rebuild": "1.10.0",
|
"electron-rebuild": "1.10.0",
|
||||||
"jsdoc": "3.6.3",
|
"jsdoc": "3.6.3",
|
||||||
"lorem-ipsum": "2.0.3"
|
"lorem-ipsum": "2.0.3"
|
||||||
|
@ -32,6 +32,8 @@ import options from "./services/options.js";
|
|||||||
import noteContentRenderer from "./services/note_content_renderer.js";
|
import noteContentRenderer from "./services/note_content_renderer.js";
|
||||||
import appContext from "./services/app_context.js";
|
import appContext from "./services/app_context.js";
|
||||||
|
|
||||||
|
window.glob.PROFILING_LOG = false;
|
||||||
|
|
||||||
window.glob.isDesktop = utils.isDesktop;
|
window.glob.isDesktop = utils.isDesktop;
|
||||||
window.glob.isMobile = utils.isMobile;
|
window.glob.isMobile = utils.isMobile;
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ export default class LinkMap {
|
|||||||
.addClass('link-' + edge.target.id);
|
.addClass('link-' + edge.target.id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log(`connection not created for`, edge);
|
console.debug(`connection not created for`, edge);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -78,7 +78,9 @@ async function call(method, url, data, headers = {}) {
|
|||||||
|
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
|
|
||||||
|
if (glob.PROFILING_LOG) {
|
||||||
console.log(`${method} ${url} took ${end - start}ms`);
|
console.log(`${method} ${url} took ${end - start}ms`);
|
||||||
|
}
|
||||||
|
|
||||||
const maxSyncIdStr = resp.headers['trilium-max-sync-id'];
|
const maxSyncIdStr = resp.headers['trilium-max-sync-id'];
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ class TabContext extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isActive() {
|
isActive() {
|
||||||
return this.appContext.activeTabId === this.tabId;
|
return this.tabManager.activeTabId === this.tabId;
|
||||||
}
|
}
|
||||||
|
|
||||||
getTabState() {
|
getTabState() {
|
||||||
@ -99,7 +99,7 @@ class TabContext extends Component {
|
|||||||
return {
|
return {
|
||||||
tabId: this.tabId,
|
tabId: this.tabId,
|
||||||
notePath: this.notePath,
|
notePath: this.notePath,
|
||||||
active: this.appContext.activeTabId === this.tabId
|
active: this.tabManager.activeTabId === this.tabId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,18 @@ export default class CalendarWidget extends CollapsibleWidget {
|
|||||||
&& this.note.hasOwnedLabel("dateNote");
|
&& this.note.hasOwnedLabel("dateNote");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTabContextListener({tabContext}) {
|
||||||
|
super.setTabContextListener({tabContext});
|
||||||
|
|
||||||
|
console.log("set tab context", tabContext.tabId, "to", this.componentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
async refresh() {
|
||||||
|
super.refresh();
|
||||||
|
|
||||||
|
//console.trace("tab", this.tabContext.tabId);
|
||||||
|
}
|
||||||
|
|
||||||
async doRenderBody() {
|
async doRenderBody() {
|
||||||
await libraryLoader.requireLibrary(libraryLoader.CALENDAR_WIDGET);
|
await libraryLoader.requireLibrary(libraryLoader.CALENDAR_WIDGET);
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ export default class Component {
|
|||||||
|
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
|
|
||||||
if (end - start > 10) {
|
if (end - start > 10 && glob.PROFILING_LOG) {
|
||||||
console.log(`Event ${name} in component ${this.componentId} took ${end-start}ms`);
|
console.log(`Event ${name} in component ${this.componentId} took ${end-start}ms`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ export default class TabAwareWidget extends BasicWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async isEnabled() {
|
async isEnabled() {
|
||||||
return !!this.note;
|
return !!this.note && this.tabContext.isActive();
|
||||||
}
|
}
|
||||||
|
|
||||||
async refresh() {
|
async refresh() {
|
||||||
@ -56,7 +56,7 @@ export default class TabAwareWidget extends BasicWidget {
|
|||||||
|
|
||||||
const end = Date.now();
|
const end = Date.now();
|
||||||
|
|
||||||
if (end - start > 10) {
|
if (glob.PROFILING_LOG && end - start > 10) {
|
||||||
console.log(`Refresh of ${this.componentId} took ${end-start}ms`);
|
console.log(`Refresh of ${this.componentId} took ${end-start}ms`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -409,12 +409,6 @@ export default class TabRowWidget extends BasicWidget {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
get activeTabId() {
|
|
||||||
const tabEl = this.activeTabEl;
|
|
||||||
|
|
||||||
return tabEl ? tabEl.getAttribute('data-tab-id') : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
get activeTabEl() {
|
get activeTabEl() {
|
||||||
return this.$widget.find('.note-tab[active]')[0];
|
return this.$widget.find('.note-tab[active]')[0];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user