* [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements
@ 2024-11-25 11:15 Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 1/6] api: admin: sync: add direction to sync job status Dominik Csapak
` (7 more replies)
0 siblings, 8 replies; 9+ messages in thread
From: Dominik Csapak @ 2024-11-25 11:15 UTC (permalink / raw)
To: pbs-devel
this series aims to improve the pull/push sync job ui a bit, by:
* unifying both types into one list
* adding a helpful tooltip for local owner/user
* adding a filter for the sync jobs
* adding a 'all' mode for listing all jobs on the /admin/sync api
Dominik Csapak (6):
api: admin: sync: add direction to sync job status
api: admin: sync: add optional 'all' sync type for listing
cli: manager: sync: add 'sync-direction' parameter to list
ui: sync jobs: revert to single list for pull/push jobs
ui: sync jobs: change default sorting to 'store' -> 'direction' ->
'id'
ui: sync jobs: add search box
pbs-api-types/src/jobs.rs | 6 ++
src/api2/admin/sync.rs | 65 ++++++++----
src/api2/config/datastore.rs | 9 +-
src/api2/config/notifications/mod.rs | 2 +-
src/bin/proxmox_backup_manager/sync.rs | 6 +-
www/Makefile | 1 -
www/config/SyncPullPushView.js | 61 -----------
www/config/SyncView.js | 134 ++++++++++++++++++++-----
www/datastore/DataStoreList.js | 2 +-
www/datastore/Panel.js | 2 +-
10 files changed, 178 insertions(+), 110 deletions(-)
delete mode 100644 www/config/SyncPullPushView.js
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 1/6] api: admin: sync: add direction to sync job status
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
@ 2024-11-25 11:15 ` Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 2/6] api: admin: sync: add optional 'all' sync type for listing Dominik Csapak
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2024-11-25 11:15 UTC (permalink / raw)
To: pbs-devel
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
pbs-api-types/src/jobs.rs | 6 ++++++
src/api2/admin/sync.rs | 1 +
2 files changed, 7 insertions(+)
diff --git a/pbs-api-types/src/jobs.rs b/pbs-api-types/src/jobs.rs
index 52520811b..e18197fb1 100644
--- a/pbs-api-types/src/jobs.rs
+++ b/pbs-api-types/src/jobs.rs
@@ -660,6 +660,9 @@ impl SyncJobConfig {
status: {
type: JobScheduleStatus,
},
+ direction: {
+ type: SyncDirection,
+ },
},
)]
#[derive(Serialize, Deserialize, Clone, PartialEq)]
@@ -670,6 +673,9 @@ pub struct SyncJobStatus {
pub config: SyncJobConfig,
#[serde(flatten)]
pub status: JobScheduleStatus,
+
+ /// The direction of the job
+ pub direction: SyncDirection,
}
/// These are used separately without `ns`/`max-depth` sometimes in the API, specifically in the API
diff --git a/src/api2/admin/sync.rs b/src/api2/admin/sync.rs
index 3a41aa2c7..479f1a958 100644
--- a/src/api2/admin/sync.rs
+++ b/src/api2/admin/sync.rs
@@ -84,6 +84,7 @@ pub fn list_config_sync_jobs(
list.push(SyncJobStatus {
config: job,
status,
+ direction: sync_direction,
});
}
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 2/6] api: admin: sync: add optional 'all' sync type for listing
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 1/6] api: admin: sync: add direction to sync job status Dominik Csapak
@ 2024-11-25 11:15 ` Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 3/6] cli: manager: sync: add 'sync-direction' parameter to list Dominik Csapak
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2024-11-25 11:15 UTC (permalink / raw)
To: pbs-devel
so that one can list all sync jobs, both pull and push, at the same
time. To not confuse existing clients that only know of pull syncs, show
only them by default and make the 'all' parameter opt-in. (But add a
todo for 4.x to change that)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/api2/admin/sync.rs | 66 ++++++++++++++++++++--------
src/api2/config/datastore.rs | 9 ++--
src/api2/config/notifications/mod.rs | 2 +-
3 files changed, 54 insertions(+), 23 deletions(-)
diff --git a/src/api2/admin/sync.rs b/src/api2/admin/sync.rs
index 479f1a958..2b8fce484 100644
--- a/src/api2/admin/sync.rs
+++ b/src/api2/admin/sync.rs
@@ -1,7 +1,7 @@
//! Datastore Synchronization Job Management
use anyhow::{bail, format_err, Error};
-use serde::Deserialize;
+use serde::{Deserialize, Serialize};
use serde_json::Value;
use proxmox_router::{
@@ -23,6 +23,30 @@ use crate::{
server::sync::do_sync_job,
};
+// FIXME: 4.x make 'all' the default
+#[api()]
+#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)]
+#[serde(rename_all = "kebab-case")]
+/// The direction of the listed sync jobs: push, pull or all.
+pub enum ListSyncDirection {
+ /// All directions
+ All,
+ /// Sync direction push
+ Push,
+ /// Sync direction pull
+ #[default]
+ Pull,
+}
+
+impl From<SyncDirection> for ListSyncDirection {
+ fn from(value: SyncDirection) -> Self {
+ match value {
+ SyncDirection::Pull => ListSyncDirection::Pull,
+ SyncDirection::Push => ListSyncDirection::Push,
+ }
+ }
+}
+
#[api(
input: {
properties: {
@@ -31,7 +55,7 @@ use crate::{
optional: true,
},
"sync-direction": {
- type: SyncDirection,
+ type: ListSyncDirection,
optional: true,
},
},
@@ -49,7 +73,7 @@ use crate::{
/// List all configured sync jobs
pub fn list_config_sync_jobs(
store: Option<String>,
- sync_direction: Option<SyncDirection>,
+ sync_direction: Option<ListSyncDirection>,
_param: Value,
rpcenv: &mut dyn RpcEnvironment,
) -> Result<Vec<SyncJobStatus>, Error> {
@@ -59,23 +83,27 @@ pub fn list_config_sync_jobs(
let (config, digest) = sync::config()?;
let sync_direction = sync_direction.unwrap_or_default();
- let job_config_iter = config
- .convert_to_typed_array(sync_direction.as_config_type_str())?
- .into_iter()
- .filter(|job: &SyncJobConfig| {
- if let Some(store) = &store {
- &job.store == store
- } else {
- true
- }
- })
- .filter(|job: &SyncJobConfig| {
- check_sync_job_read_access(&user_info, &auth_id, job, sync_direction)
- });
- let mut list = Vec::new();
+ let mut list = Vec::with_capacity(config.sections.len());
+ for (_, (sync_type, job)) in config.sections.into_iter() {
+ let job: SyncJobConfig = serde_json::from_value(job)?;
+ let direction = SyncDirection::from_config_type_str(&sync_type)?;
+
+ match &store {
+ Some(store) if &job.store != store => continue,
+ _ => {}
+ }
+
+ match &sync_direction {
+ ListSyncDirection::Pull if direction != SyncDirection::Pull => continue,
+ ListSyncDirection::Push if direction != SyncDirection::Push => continue,
+ _ => {}
+ }
+
+ if !check_sync_job_read_access(&user_info, &auth_id, &job, direction) {
+ continue;
+ }
- for job in job_config_iter {
let last_state = JobState::load("syncjob", &job.id)
.map_err(|err| format_err!("could not open statefile for {}: {}", &job.id, err))?;
@@ -84,7 +112,7 @@ pub fn list_config_sync_jobs(
list.push(SyncJobStatus {
config: job,
status,
- direction: sync_direction,
+ direction,
});
}
diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs
index 37d1528c7..8c307a233 100644
--- a/src/api2/config/datastore.rs
+++ b/src/api2/config/datastore.rs
@@ -526,9 +526,12 @@ pub async fn delete_datastore(
delete_verification_job(job.config.id, None, rpcenv)?
}
for direction in [SyncDirection::Pull, SyncDirection::Push] {
- for job in
- list_config_sync_jobs(Some(name.clone()), Some(direction), Value::Null, rpcenv)?
- {
+ for job in list_config_sync_jobs(
+ Some(name.clone()),
+ Some(direction.into()),
+ Value::Null,
+ rpcenv,
+ )? {
delete_sync_job(job.config.id, None, rpcenv)?
}
}
diff --git a/src/api2/config/notifications/mod.rs b/src/api2/config/notifications/mod.rs
index f156c8cfd..2081b7b75 100644
--- a/src/api2/config/notifications/mod.rs
+++ b/src/api2/config/notifications/mod.rs
@@ -155,7 +155,7 @@ pub fn get_values(
}
for direction in [SyncDirection::Pull, SyncDirection::Push] {
- let sync_jobs = list_config_sync_jobs(None, Some(direction), param.clone(), rpcenv)?;
+ let sync_jobs = list_config_sync_jobs(None, Some(direction.into()), param.clone(), rpcenv)?;
for job in sync_jobs {
values.push(MatchableValue {
field: "job-id".into(),
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 3/6] cli: manager: sync: add 'sync-direction' parameter to list
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 1/6] api: admin: sync: add direction to sync job status Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 2/6] api: admin: sync: add optional 'all' sync type for listing Dominik Csapak
@ 2024-11-25 11:15 ` Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 4/6] ui: sync jobs: revert to single list for pull/push jobs Dominik Csapak
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2024-11-25 11:15 UTC (permalink / raw)
To: pbs-devel
so one can list pull and push jobs
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
not really happy with this, ideally we would also allow 'all' here, but
then we'd have to show the type in the return value too, which is not
really possible with the 'SyncJobConfig' type (as that get's
deserialized) where the direction is part of the config section type
alternatively we could here switch to the '/admin/sync' api from the
'/config/sync' api which does contain the sync-direction (and also
the status). then it'd be easy to show all types
src/bin/proxmox_backup_manager/sync.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/bin/proxmox_backup_manager/sync.rs b/src/bin/proxmox_backup_manager/sync.rs
index 005cce6f3..b08bfb58b 100644
--- a/src/bin/proxmox_backup_manager/sync.rs
+++ b/src/bin/proxmox_backup_manager/sync.rs
@@ -4,7 +4,7 @@ use serde_json::Value;
use proxmox_router::{cli::*, ApiHandler, RpcEnvironment};
use proxmox_schema::api;
-use pbs_api_types::JOB_ID_SCHEMA;
+use pbs_api_types::{SyncDirection, JOB_ID_SCHEMA};
use proxmox_backup::api2;
@@ -20,6 +20,10 @@ fn render_group_filter(value: &Value, _record: &Value) -> Result<String, Error>
#[api(
input: {
properties: {
+ "sync-direction": {
+ type: SyncDirection,
+ optional: true,
+ },
"output-format": {
schema: OUTPUT_FORMAT,
optional: true,
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 4/6] ui: sync jobs: revert to single list for pull/push jobs
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
` (2 preceding siblings ...)
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 3/6] cli: manager: sync: add 'sync-direction' parameter to list Dominik Csapak
@ 2024-11-25 11:15 ` Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 5/6] ui: sync jobs: change default sorting to 'store' -> 'direction' -> 'id' Dominik Csapak
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2024-11-25 11:15 UTC (permalink / raw)
To: pbs-devel
but add a separate column for the direction so one still sees the
separate jobs.
change the 'local owner/user' to a single column, but add a tooltip in
the header to explain when it does what.
This makes the 'SyncJobsPullPushView' unnecessary, so delete it.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
not really sure about the tooltip helptext for the owner/user, but did
not come up with something better for now...
www/Makefile | 1 -
www/config/SyncPullPushView.js | 61 -----------------------------
www/config/SyncView.js | 70 +++++++++++++++++++++++-----------
www/datastore/DataStoreList.js | 2 +-
www/datastore/Panel.js | 2 +-
5 files changed, 50 insertions(+), 86 deletions(-)
delete mode 100644 www/config/SyncPullPushView.js
diff --git a/www/Makefile b/www/Makefile
index d35e81283..609a0ba67 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -61,7 +61,6 @@ JSSRC= \
config/TrafficControlView.js \
config/ACLView.js \
config/SyncView.js \
- config/SyncPullPushView.js \
config/VerifyView.js \
config/PruneView.js \
config/GCView.js \
diff --git a/www/config/SyncPullPushView.js b/www/config/SyncPullPushView.js
deleted file mode 100644
index 3460bc662..000000000
--- a/www/config/SyncPullPushView.js
+++ /dev/null
@@ -1,61 +0,0 @@
-Ext.define('PBS.config.SyncPullPush', {
- extend: 'Ext.panel.Panel',
- alias: 'widget.pbsSyncJobPullPushView',
- title: gettext('Sync Jobs'),
-
- mixins: ['Proxmox.Mixin.CBind'],
-
- layout: {
- type: 'vbox',
- align: 'stretch',
- multi: true,
- bodyPadding: 5,
- },
- defaults: {
- collapsible: false,
- margin: 5,
- },
- scrollable: true,
- items: [
- {
- xtype: 'pbsSyncJobView',
- itemId: 'syncJobsPull',
- syncDirection: 'pull',
- cbind: {
- datastore: '{datastore}',
- },
- minHeight: 125, // shows at least one line of content
- },
- {
- xtype: 'splitter',
- performCollapse: false,
- },
- {
- xtype: 'pbsSyncJobView',
- itemId: 'syncJobsPush',
- syncDirection: 'push',
- cbind: {
- datastore: '{datastore}',
- },
- flex: 1,
- minHeight: 125, // shows at least one line of content
- },
- ],
- initComponent: function() {
- let me = this;
-
- let subPanelIds = me.items.map(el => el.itemId).filter(id => !!id);
-
- me.callParent();
-
- for (const itemId of subPanelIds) {
- let component = me.getComponent(itemId);
- component.relayEvents(me, ['activate', 'deactivate', 'destroy']);
- }
- },
-
- cbindData: function(initialConfig) {
- let me = this;
- me.datastore = initialConfig.datastore ? initialConfig.datastore : undefined;
- },
-});
diff --git a/www/config/SyncView.js b/www/config/SyncView.js
index c8b2181c4..7f68bf7cc 100644
--- a/www/config/SyncView.js
+++ b/www/config/SyncView.js
@@ -26,26 +26,25 @@ Ext.define('PBS.config.SyncJobView', {
stateful: true,
stateId: 'grid-sync-jobs-v1',
- title: gettext('Sync Jobs - Pull Direction'),
- ownerHeader: gettext('Owner'),
-
- cbindData: function(initialConfig) {
- let me = this;
- if (me.syncDirection === 'push') {
- me.title = gettext('Sync Jobs - Push Direction');
- me.ownerHeader = gettext('Local User');
- }
- },
+ title: gettext('Sync Jobs'),
controller: {
xclass: 'Ext.app.ViewController',
- addSyncJob: function() {
+ addPullSyncJob: function() {
+ this.addSyncJob('pull');
+ },
+
+ addPushSyncJob: function() {
+ this.addSyncJob('push');
+ },
+
+ addSyncJob: function(syncDirection) {
let me = this;
let view = me.getView();
Ext.create('PBS.window.SyncJobEdit', {
datastore: view.datastore,
- syncDirection: view.syncDirection,
+ syncDirection,
listeners: {
destroy: function() {
me.reload();
@@ -63,7 +62,7 @@ Ext.define('PBS.config.SyncJobView', {
Ext.create('PBS.window.SyncJobEdit', {
datastore: view.datastore,
id: selection[0].data.id,
- syncDirection: view.syncDirection,
+ syncDirection: selection[0].data.direction,
listeners: {
destroy: function() {
me.reload();
@@ -125,9 +124,7 @@ Ext.define('PBS.config.SyncJobView', {
if (view.datastore !== undefined) {
params.store = view.datastore;
}
- if (view.syncDirection !== undefined) {
- params["sync-direction"] = view.syncDirection;
- }
+ params['sync-direction'] = 'all';
view.getStore().rstore.getProxy().setExtraParams(params);
Proxmox.Utils.monStoreErrors(view, view.getStore().rstore);
},
@@ -158,10 +155,21 @@ Ext.define('PBS.config.SyncJobView', {
tbar: [
{
- xtype: 'proxmoxButton',
text: gettext('Add'),
- handler: 'addSyncJob',
- selModel: false,
+ menu: [
+ {
+ text: gettext('Add Pull Sync Job'),
+ iconCls: "fa fa-fw fa-download",
+ handler: 'addPullSyncJob',
+ selModel: false,
+ },
+ {
+ text: gettext('Add Push Sync Job'),
+ iconCls: "fa fa-fw fa-upload",
+ handler: 'addPushSyncJob',
+ selModel: false,
+ },
+ ],
},
{
xtype: 'proxmoxButton',
@@ -205,6 +213,23 @@ Ext.define('PBS.config.SyncJobView', {
flex: 1,
sortable: true,
},
+ {
+ header: gettext('Direction'),
+ dataIndex: 'direction',
+ renderer: function(value) {
+ let iconCls, text;
+ if (value === 'pull') {
+ iconCls = 'download';
+ text = gettext('Pull');
+ } else {
+ iconCls = 'upload';
+ text = gettext('Push');
+ }
+ return `<i class="fa fa-fw fa-${iconCls}"></i> ${text}`;
+ },
+ width: 100,
+ sortable: true,
+ },
{
header: gettext('Local Store'),
dataIndex: 'store',
@@ -245,9 +270,10 @@ Ext.define('PBS.config.SyncJobView', {
sortable: true,
},
{
- cbind: {
- header: '{ownerHeader}',
- },
+ header: `${gettext('Local Owner/User')} <i class="fa fa-question-circle" data-qtip="
+ ${gettext("Pull: The local owner.")}<br>
+ ${gettext("Push: The local user used for access control.")}
+ "></i>`,
dataIndex: 'owner',
renderer: 'render_optional_owner',
flex: 2,
diff --git a/www/datastore/DataStoreList.js b/www/datastore/DataStoreList.js
index 22ef18540..fc68cfc10 100644
--- a/www/datastore/DataStoreList.js
+++ b/www/datastore/DataStoreList.js
@@ -239,7 +239,7 @@ Ext.define('PBS.datastore.DataStores', {
{
iconCls: 'fa fa-refresh',
itemId: 'syncjobs',
- xtype: 'pbsSyncJobPullPushView',
+ xtype: 'pbsSyncJobView',
},
{
iconCls: 'fa fa-check-circle',
diff --git a/www/datastore/Panel.js b/www/datastore/Panel.js
index e1da7cfac..ad9fc10fe 100644
--- a/www/datastore/Panel.js
+++ b/www/datastore/Panel.js
@@ -68,7 +68,7 @@ Ext.define('PBS.DataStorePanel', {
{
iconCls: 'fa fa-refresh',
itemId: 'syncjobs',
- xtype: 'pbsSyncJobPullPushView',
+ xtype: 'pbsSyncJobView',
cbind: {
datastore: '{datastore}',
},
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 5/6] ui: sync jobs: change default sorting to 'store' -> 'direction' -> 'id'
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
` (3 preceding siblings ...)
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 4/6] ui: sync jobs: revert to single list for pull/push jobs Dominik Csapak
@ 2024-11-25 11:15 ` Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 6/6] ui: sync jobs: add search box Dominik Csapak
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2024-11-25 11:15 UTC (permalink / raw)
To: pbs-devel
instead of just the id, which makes the list in the global datastore
view a bit more easier to digest (since it's now sorted by store first)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/config/SyncView.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/www/config/SyncView.js b/www/config/SyncView.js
index 7f68bf7cc..3471100b6 100644
--- a/www/config/SyncView.js
+++ b/www/config/SyncView.js
@@ -140,7 +140,7 @@ Ext.define('PBS.config.SyncJobView', {
type: 'diff',
autoDestroy: true,
autoDestroyRstore: true,
- sorters: 'id',
+ sorters: ['store', 'direction', 'id'],
rstore: {
type: 'update',
storeid: 'pbs-sync-jobs-status',
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pbs-devel] [PATCH proxmox-backup 6/6] ui: sync jobs: add search box
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
` (4 preceding siblings ...)
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 5/6] ui: sync jobs: change default sorting to 'store' -> 'direction' -> 'id' Dominik Csapak
@ 2024-11-25 11:15 ` Dominik Csapak
2024-11-25 11:30 ` [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Christian Ebner
2024-11-26 15:03 ` [pbs-devel] applied-series: " Thomas Lamprecht
7 siblings, 0 replies; 9+ messages in thread
From: Dominik Csapak @ 2024-11-25 11:15 UTC (permalink / raw)
To: pbs-devel
filter by (remote) store, remote, id, owner, direction.
Local store is only included on the globabl view not the datastore
specific one.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
www/config/SyncView.js | 62 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/www/config/SyncView.js b/www/config/SyncView.js
index 3471100b6..ca1f7ecd6 100644
--- a/www/config/SyncView.js
+++ b/www/config/SyncView.js
@@ -31,6 +31,40 @@ Ext.define('PBS.config.SyncJobView', {
controller: {
xclass: 'Ext.app.ViewController',
+ search: function(tf, value) {
+ let me = this;
+ let view = me.getView();
+ let store = view.getStore();
+ if (!value && value !== 0) {
+ store.clearFilter();
+ tf.triggers.clear.setVisible(false);
+ return;
+ }
+ tf.triggers.clear.setVisible(true);
+ if (value.length < 2) return;
+
+ store.clearFilter();
+
+ let fieldsToSearch = ['direction', 'id', 'remote', 'remote-store', 'owner'];
+ if (!view.datastore) {
+ fieldsToSearch.push('store');
+ }
+ value = value.toLowerCase();
+
+
+ store.addFilter(function(rec) {
+ let found = false;
+ for (const field of fieldsToSearch) {
+ let recValue = rec.data[field] ?? '';
+ if (recValue.toString().toLowerCase().indexOf(value) !== -1) {
+ found = true;
+ break;
+ }
+ }
+ return found;
+ });
+ },
+
addPullSyncJob: function() {
this.addSyncJob('pull');
},
@@ -197,6 +231,34 @@ Ext.define('PBS.config.SyncJobView', {
handler: 'runSyncJob',
disabled: true,
},
+ '->',
+ {
+ xtype: 'tbtext',
+ html: gettext('Search'),
+ },
+ {
+ xtype: 'textfield',
+ reference: 'searchbox',
+ emptyText: gettext('(remote) store, remote, id, owner, direction'),
+ minWidth: 300,
+ triggers: {
+ clear: {
+ cls: 'pmx-clear-trigger',
+ weight: -1,
+ hidden: true,
+ handler: function() {
+ this.triggers.clear.setVisible(false);
+ this.setValue('');
+ },
+ },
+ },
+ listeners: {
+ change: {
+ fn: 'search',
+ buffer: 500,
+ },
+ },
+ },
],
viewConfig: {
--
2.39.5
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
` (5 preceding siblings ...)
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 6/6] ui: sync jobs: add search box Dominik Csapak
@ 2024-11-25 11:30 ` Christian Ebner
2024-11-26 15:03 ` [pbs-devel] applied-series: " Thomas Lamprecht
7 siblings, 0 replies; 9+ messages in thread
From: Christian Ebner @ 2024-11-25 11:30 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Dominik Csapak
On 11/25/24 12:15, Dominik Csapak wrote:
> this series aims to improve the pull/push sync job ui a bit, by:
>
> * unifying both types into one list
Not sure if you are aware of this, but we decided early on [0] to
explicitly separate the list for both directions to reduce possible
misconfiguration for the user. That is also why the sync jobs in push
direction have their dedicated config type instead of having the
direction as property of the sync job.
[0]
https://lore.proxmox.com/pbs-devel/5be4c3d1-593f-4eec-b21b-33cb3afc9216@proxmox.com/
> * adding a helpful tooltip for local owner/user
> * adding a filter for the sync jobs
> * adding a 'all' mode for listing all jobs on the /admin/sync api
>
> Dominik Csapak (6):
> api: admin: sync: add direction to sync job status
> api: admin: sync: add optional 'all' sync type for listing
> cli: manager: sync: add 'sync-direction' parameter to list
> ui: sync jobs: revert to single list for pull/push jobs
> ui: sync jobs: change default sorting to 'store' -> 'direction' ->
> 'id'
> ui: sync jobs: add search box
>
> pbs-api-types/src/jobs.rs | 6 ++
> src/api2/admin/sync.rs | 65 ++++++++----
> src/api2/config/datastore.rs | 9 +-
> src/api2/config/notifications/mod.rs | 2 +-
> src/bin/proxmox_backup_manager/sync.rs | 6 +-
> www/Makefile | 1 -
> www/config/SyncPullPushView.js | 61 -----------
> www/config/SyncView.js | 134 ++++++++++++++++++++-----
> www/datastore/DataStoreList.js | 2 +-
> www/datastore/Panel.js | 2 +-
> 10 files changed, 178 insertions(+), 110 deletions(-)
> delete mode 100644 www/config/SyncPullPushView.js
>
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* [pbs-devel] applied-series: [PATCH proxmox-backup 0/6] sync job ui improvements
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
` (6 preceding siblings ...)
2024-11-25 11:30 ` [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Christian Ebner
@ 2024-11-26 15:03 ` Thomas Lamprecht
7 siblings, 0 replies; 9+ messages in thread
From: Thomas Lamprecht @ 2024-11-26 15:03 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Dominik Csapak
Am 25.11.24 um 12:15 schrieb Dominik Csapak:
> this series aims to improve the pull/push sync job ui a bit, by:
>
> * unifying both types into one list
> * adding a helpful tooltip for local owner/user
> * adding a filter for the sync jobs
> * adding a 'all' mode for listing all jobs on the /admin/sync api
>
> Dominik Csapak (6):
> api: admin: sync: add direction to sync job status
> api: admin: sync: add optional 'all' sync type for listing
> cli: manager: sync: add 'sync-direction' parameter to list
> ui: sync jobs: revert to single list for pull/push jobs
> ui: sync jobs: change default sorting to 'store' -> 'direction' ->
> 'id'
> ui: sync jobs: add search box
>
> pbs-api-types/src/jobs.rs | 6 ++
> src/api2/admin/sync.rs | 65 ++++++++----
> src/api2/config/datastore.rs | 9 +-
> src/api2/config/notifications/mod.rs | 2 +-
> src/bin/proxmox_backup_manager/sync.rs | 6 +-
> www/Makefile | 1 -
> www/config/SyncPullPushView.js | 61 -----------
> www/config/SyncView.js | 134 ++++++++++++++++++++-----
> www/datastore/DataStoreList.js | 2 +-
> www/datastore/Panel.js | 2 +-
> 10 files changed, 178 insertions(+), 110 deletions(-)
> delete mode 100644 www/config/SyncPullPushView.js
>
applied series, thanks!
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-11-26 15:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-25 11:15 [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 1/6] api: admin: sync: add direction to sync job status Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 2/6] api: admin: sync: add optional 'all' sync type for listing Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 3/6] cli: manager: sync: add 'sync-direction' parameter to list Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 4/6] ui: sync jobs: revert to single list for pull/push jobs Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 5/6] ui: sync jobs: change default sorting to 'store' -> 'direction' -> 'id' Dominik Csapak
2024-11-25 11:15 ` [pbs-devel] [PATCH proxmox-backup 6/6] ui: sync jobs: add search box Dominik Csapak
2024-11-25 11:30 ` [pbs-devel] [PATCH proxmox-backup 0/6] sync job ui improvements Christian Ebner
2024-11-26 15:03 ` [pbs-devel] applied-series: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox