From: Gabriel Goller <g.goller@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/2] close #4589: allow multi-line comments in datastore notes
Date: Fri, 15 Sep 2023 11:46:34 +0200 [thread overview]
Message-ID: <20230915094635.61759-2-g.goller@proxmox.com> (raw)
In-Reply-To: <20230915094635.61759-1-g.goller@proxmox.com>
Converting '\n' to '<br>' tags then store it in the config
(`datastore.cfg`) file.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
pbs-api-types/src/datastore.rs | 6 +++---
www/datastore/Notes.js | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 73c4890e..4e555d0c 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -11,8 +11,8 @@ use proxmox_schema::{
use crate::{
Authid, CryptMode, Fingerprint, MaintenanceMode, Userid, DATASTORE_NOTIFY_STRING_SCHEMA,
- GC_SCHEDULE_SCHEMA, PROXMOX_SAFE_ID_FORMAT, PRUNE_SCHEDULE_SCHEMA, SHA256_HEX_REGEX,
- SINGLE_LINE_COMMENT_SCHEMA, UPID,
+ GC_SCHEDULE_SCHEMA, MULTI_LINE_COMMENT_SCHEMA, PROXMOX_SAFE_ID_FORMAT, PRUNE_SCHEDULE_SCHEMA,
+ SHA256_HEX_REGEX, SINGLE_LINE_COMMENT_SCHEMA, UPID,
};
const_regex! {
@@ -241,7 +241,7 @@ pub const DATASTORE_TUNING_STRING_SCHEMA: Schema = StringSchema::new("Datastore
},
comment: {
optional: true,
- schema: SINGLE_LINE_COMMENT_SCHEMA,
+ schema: MULTI_LINE_COMMENT_SCHEMA,
},
"gc-schedule": {
optional: true,
diff --git a/www/datastore/Notes.js b/www/datastore/Notes.js
index 2928b7ec..300603fc 100644
--- a/www/datastore/Notes.js
+++ b/www/datastore/Notes.js
@@ -21,10 +21,11 @@ Ext.define('PBS.DataStoreNotes', {
title: gettext('Comment'),
width: 600,
resizable: true,
+ convertNewlines: true,
layout: 'fit',
defaultButton: undefined,
items: {
- xtype: 'textfield',
+ xtype: 'textareafield',
name: 'comment',
value: '',
hideLabel: true,
@@ -42,7 +43,7 @@ Ext.define('PBS.DataStoreNotes', {
setNotes: function(value) {
let me = this;
var data = value || '';
- me.update(Ext.htmlEncode(data));
+ me.update(data);
if (me.collapsible && me.collapseMode === 'auto') {
me.setCollapsed(data === '');
--
2.39.2
next prev parent reply other threads:[~2023-09-15 9:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 9:46 [pbs-devel] [PATCH proxmox-backup 0/2] support multi-line comments in Gabriel Goller
2023-09-15 9:46 ` Gabriel Goller [this message]
2023-09-15 9:46 ` [pbs-devel] [PATCH widget-toolkit 2/2] window: edit: added `convertNewlines` config Gabriel Goller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230915094635.61759-2-g.goller@proxmox.com \
--to=g.goller@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox