mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix multiple UI bugs, closes #2616
This commit is contained in:
parent
1c4358086d
commit
0ca9bff61b
@ -42,8 +42,10 @@ class EtapiToken extends AbstractEntity {
|
||||
/** @type {boolean} */
|
||||
this.isDeleted = !!row.isDeleted;
|
||||
|
||||
if (this.etapiTokenId) {
|
||||
this.becca.etapiTokens[this.etapiTokenId] = this;
|
||||
}
|
||||
}
|
||||
|
||||
init() {
|
||||
if (this.etapiTokenId) {
|
||||
|
@ -62,12 +62,12 @@ export default class EtapiOptions {
|
||||
return;
|
||||
}
|
||||
|
||||
const {token} = await server.post('etapi-tokens', {tokenName});
|
||||
const {authToken} = await server.post('etapi-tokens', {tokenName});
|
||||
|
||||
await promptDialog.ask({
|
||||
title: "ETAPI token created",
|
||||
message: 'Copy the created token into clipboard. Trilium stores the token hashed and this is the last time you see it.',
|
||||
defaultValue: token
|
||||
defaultValue: authToken
|
||||
});
|
||||
|
||||
this.refreshTokens();
|
||||
|
@ -51,7 +51,8 @@ $dialog.on("hidden.bs.modal", () => {
|
||||
}
|
||||
});
|
||||
|
||||
$form.on('submit', () => {
|
||||
$form.on('submit', e => {
|
||||
e.preventDefault();
|
||||
resolve($answer.val());
|
||||
|
||||
$dialog.modal('hide');
|
||||
|
@ -9,9 +9,7 @@ function getTokens() {
|
||||
}
|
||||
|
||||
function createToken(req) {
|
||||
return {
|
||||
authToken: etapiTokenService.createToken(req.body.tokenName)
|
||||
};
|
||||
return etapiTokenService.createToken(req.body.tokenName);
|
||||
}
|
||||
|
||||
function patchToken(req) {
|
||||
|
@ -93,8 +93,7 @@ function deleteToken(etapiTokenId) {
|
||||
return; // ok, already deleted
|
||||
}
|
||||
|
||||
etapiToken.isDeleted = true;
|
||||
etapiToken.save();
|
||||
etapiToken.markAsDeletedSimple();
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
|
@ -1,5 +1,5 @@
|
||||
<div id="prompt-dialog" class="modal mx-auto" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-dialog modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<form id="prompt-dialog-form">
|
||||
<div class="modal-header">
|
||||
|
Loading…
x
Reference in New Issue
Block a user