import server from "../../services/server.js";
import utils from "../../services/utils.js";
import BasicWidget from "../basic_widget.js";
const TPL = `
`;
export default class AboutDialog extends BasicWidget {
doRender() {
this.$widget = $(TPL);
this.$appVersion = this.$widget.find(".app-version");
this.$dbVersion = this.$widget.find(".db-version");
this.$syncVersion = this.$widget.find(".sync-version");
this.$buildDate = this.$widget.find(".build-date");
this.$buildRevision = this.$widget.find(".build-revision");
this.$dataDirectory = this.$widget.find(".data-directory");
}
async refresh() {
const appInfo = await server.get('app-info');
this.$appVersion.text(appInfo.appVersion);
this.$dbVersion.text(appInfo.dbVersion);
this.$syncVersion.text(appInfo.syncVersion);
this.$buildDate.text(appInfo.buildDate);
this.$buildRevision.text(appInfo.buildRevision);
this.$buildRevision.attr('href', 'https://github.com/zadam/trilium/commit/' + appInfo.buildRevision);
this.$dataDirectory.text(appInfo.dataDirectory);
}
async openAboutDialogEvent() {
await this.refresh();
utils.openDialog(this.$widget);
}
}