From 06517bc2192696bb142cd947403a01c71348aa59 Mon Sep 17 00:00:00 2001 From: David Ulloa Date: Thu, 23 Jan 2025 20:29:54 -0500 Subject: [PATCH 1/6] Add ability to click tree lines to exlcude / include in pattern input --- src/server/templates/components/result.jinja | 37 ++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/src/server/templates/components/result.jinja b/src/server/templates/components/result.jinja index cd0a9783..be67de04 100644 --- a/src/server/templates/components/result.jinja +++ b/src/server/templates/components/result.jinja @@ -1,3 +1,33 @@ + {% if result %}
@@ -61,8 +91,11 @@
- +
+ {% for line in tree.splitlines()%} +
{{ line }}
+ {% endfor %} +
From 73e9dbf795183ce62d6d7b28144fe99b1ad7450c Mon Sep 17 00:00:00 2001 From: David Ulloa Date: Thu, 23 Jan 2025 20:30:19 -0500 Subject: [PATCH 2/6] Support visual change for swapping between include and exclude pattern --- .../templates/components/git_form.jinja | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/server/templates/components/git_form.jinja b/src/server/templates/components/git_form.jinja index 0d1d8047..103ba9d6 100644 --- a/src/server/templates/components/git_form.jinja +++ b/src/server/templates/components/git_form.jinja @@ -1,3 +1,24 @@ + +
@@ -34,6 +55,7 @@
-
- {% for line in tree.splitlines()%} -
{{ line }}
+
+ {% for line in tree.splitlines() %} +
{{ line }}
{% endfor %}
From e90cbb1a85c1a631acc07d7ae2215cf8df62db5d Mon Sep 17 00:00:00 2001 From: cyclotruc Date: Tue, 4 Feb 2025 01:37:44 +0000 Subject: [PATCH 5/6] fix copy directory structure button --- src/server/templates/components/result.jinja | 164 ++++++++++--------- src/static/js/utils.js | 21 ++- 2 files changed, 102 insertions(+), 83 deletions(-) diff --git a/src/server/templates/components/result.jinja b/src/server/templates/components/result.jinja index 62e40a46..79dc6d6f 100644 --- a/src/server/templates/components/result.jinja +++ b/src/server/templates/components/result.jinja @@ -29,102 +29,108 @@ } {% if result %} -
-
-
-
- -
- -
-
-

Summary

-
-
-
- +
+
+
+
+ +
+ +
+
+

Summary

+
+
+
- {% if ingest_id %} - -
-
- -
- {% endif %} +
- -
-
-

Directory Structure

-
-
- -
+ {% if ingest_id %} +
+
-
-
-
- {% for line in tree.splitlines() %} -
{{ line }}
- {% endfor %} -
+ + + + + Download + +
+
+
+
+ {% endif %}
- -
+ +
-

Files Content

+

Directory Structure

-
-
-
- +
+
+
+ + {% for line in tree.splitlines() %} +
{{ line }}
+ {% endfor %} +
+
+
+
+ +
+
+

Files Content

+
+
+
+
+
+
+ +
-{% endif %} +
+{% endif %} \ No newline at end of file diff --git a/src/static/js/utils.js b/src/static/js/utils.js index 991b8839..be74c916 100644 --- a/src/static/js/utils.js +++ b/src/static/js/utils.js @@ -1,11 +1,24 @@ // Copy functionality function copyText(className) { - const textarea = document.querySelector('.' + className); + let textToCopy; + + if (className === 'directory-structure') { + // For directory structure, get the hidden input value + const hiddenInput = document.getElementById('directory-structure-content'); + if (!hiddenInput) return; + textToCopy = hiddenInput.value; + } else { + // For other elements, get the textarea value + const textarea = document.querySelector('.' + className); + if (!textarea) return; + textToCopy = textarea.value; + } + const button = document.querySelector(`button[onclick="copyText('${className}')"]`); - if (!textarea || !button) return; + if (!button) return; // Copy text - navigator.clipboard.writeText(textarea.value) + navigator.clipboard.writeText(textToCopy) .then(() => { // Store original content const originalContent = button.innerHTML; @@ -110,7 +123,7 @@ function handleSubmit(event, showLoading = false) { } function copyFullDigest() { - const directoryStructure = document.querySelector('.directory-structure').value; + const directoryStructure = document.getElementById('directory-structure-content').value; const filesContent = document.querySelector('.result-text').value; const fullDigest = `${directoryStructure}\n\nFiles Content:\n\n${filesContent}`; const button = document.querySelector('[onclick="copyFullDigest()"]'); From 46b3f32ca3e3a75d18eb6f7738bdf25db1b8f536 Mon Sep 17 00:00:00 2001 From: cyclotruc Date: Tue, 4 Feb 2025 01:39:02 +0000 Subject: [PATCH 6/6] fix pre-commit --- src/server/templates/components/result.jinja | 166 +++++++++---------- 1 file changed, 81 insertions(+), 85 deletions(-) diff --git a/src/server/templates/components/result.jinja b/src/server/templates/components/result.jinja index 79dc6d6f..a2c7e584 100644 --- a/src/server/templates/components/result.jinja +++ b/src/server/templates/components/result.jinja @@ -29,108 +29,104 @@ } {% if result %} -
-
-
-
- -
- -
-
-

Summary

-
-
-
+
+
+
+
+ +
+ +
+
+

Summary

- -
- {% if ingest_id %} -
-
+
+
+
- - - - - Download - + {% if ingest_id %} + +
+
+ +
+ {% endif %}
-
-
+ +
+
+

Directory Structure

+
+
+ +
+
+
+
+
+ + {% for line in tree.splitlines() %} +
{{ line }}
+ {% endfor %} +
-
- {% endif %}
- -
+ +
-

Directory Structure

+

Files Content

-
-
-
-
-
-
- - {% for line in tree.splitlines() %} -
{{ line }}
- {% endfor %} -
-
-
-
- -
-
-

Files Content

-
-
-
- +
+
-
-
- -
-
-{% endif %} \ No newline at end of file +{% endif %}