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} */
|
/** @type {boolean} */
|
||||||
this.isDeleted = !!row.isDeleted;
|
this.isDeleted = !!row.isDeleted;
|
||||||
|
|
||||||
|
if (this.etapiTokenId) {
|
||||||
this.becca.etapiTokens[this.etapiTokenId] = this;
|
this.becca.etapiTokens[this.etapiTokenId] = this;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
if (this.etapiTokenId) {
|
if (this.etapiTokenId) {
|
||||||
|
@ -62,12 +62,12 @@ export default class EtapiOptions {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const {token} = await server.post('etapi-tokens', {tokenName});
|
const {authToken} = await server.post('etapi-tokens', {tokenName});
|
||||||
|
|
||||||
await promptDialog.ask({
|
await promptDialog.ask({
|
||||||
title: "ETAPI token created",
|
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.',
|
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();
|
this.refreshTokens();
|
||||||
|
@ -51,7 +51,8 @@ $dialog.on("hidden.bs.modal", () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$form.on('submit', () => {
|
$form.on('submit', e => {
|
||||||
|
e.preventDefault();
|
||||||
resolve($answer.val());
|
resolve($answer.val());
|
||||||
|
|
||||||
$dialog.modal('hide');
|
$dialog.modal('hide');
|
||||||
|
@ -9,9 +9,7 @@ function getTokens() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createToken(req) {
|
function createToken(req) {
|
||||||
return {
|
return etapiTokenService.createToken(req.body.tokenName);
|
||||||
authToken: etapiTokenService.createToken(req.body.tokenName)
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function patchToken(req) {
|
function patchToken(req) {
|
||||||
|
@ -93,8 +93,7 @@ function deleteToken(etapiTokenId) {
|
|||||||
return; // ok, already deleted
|
return; // ok, already deleted
|
||||||
}
|
}
|
||||||
|
|
||||||
etapiToken.isDeleted = true;
|
etapiToken.markAsDeletedSimple();
|
||||||
etapiToken.save();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div id="prompt-dialog" class="modal mx-auto" tabindex="-1" role="dialog">
|
<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">
|
<div class="modal-content">
|
||||||
<form id="prompt-dialog-form">
|
<form id="prompt-dialog-form">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user