diff --git a/timesketch/frontend-ng/src/components/LeftPanel/SavedSearches.vue b/timesketch/frontend-ng/src/components/LeftPanel/SavedSearches.vue index e28ad33f42..01ea012a19 100644 --- a/timesketch/frontend-ng/src/components/LeftPanel/SavedSearches.vue +++ b/timesketch/frontend-ng/src/components/LeftPanel/SavedSearches.vue @@ -32,29 +32,49 @@ limitations under the License.
-
{{ savedSearch.name }}
- + + + + Copy link to this search + - + + + mdi-identifier + + Copy saved search ID + mdi-link-variant - Copy link to this search + Copy link to this search @@ -75,6 +95,7 @@ export default { data: function () { return { expanded: false, + c_key: -1, } }, computed: { @@ -89,13 +110,22 @@ export default { setView: function (savedSearch) { EventBus.$emit('setActiveView', savedSearch) }, + copySavedSearchIdToClipboard(savedSearchId) { + try { + navigator.clipboard.writeText(savedSearchId) + this.infoSnackBar('Saved Search ID copied to clipboard') + } catch (error) { + this.errorSnackBar('Failed to load Saved Search ID into the clipboard!') + console.error(error) + } + }, copySavedSearchUrlToClipboard(savedSearchId) { try { let searchUrl = window.location.origin + this.$route.path + '?view=' + savedSearchId navigator.clipboard.writeText(searchUrl) - this.infoSnackBar('Event URL copied to clipboard') + this.infoSnackBar('Saved Search URL copied to clipboard') } catch (error) { - this.errorSnackBar('Failed to load Event URL into the clipboard') + this.errorSnackBar('Failed to load Saved Search URL into the clipboard!') console.error(error) } },