Allow direct search links into the eventlog
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup>
|
||||
|
||||
import { ref, reactive, onMounted, watch } from 'vue';
|
||||
import { ref, reactive, onMounted, onUnmounted, watch } from 'vue';
|
||||
import moment from 'moment';
|
||||
import { Button, TextInput, MultiSelect } from '@cloudron/pankow';
|
||||
import { useDebouncedRef, copyToClipboard } from '@cloudron/pankow/utils';
|
||||
@@ -135,12 +135,22 @@ function onCopySource(eventlog) {
|
||||
watch(actions, onRefresh);
|
||||
watch(search, onRefresh);
|
||||
|
||||
async function onHashChange() {
|
||||
const params = new URLSearchParams(window.location.hash.slice(window.location.hash.indexOf('?')));
|
||||
search.value = params.get('search') || '';
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const [error, result] = await appsModel.list();
|
||||
if (error) console.error(error);
|
||||
else apps.value = result;
|
||||
|
||||
await onRefresh();
|
||||
window.addEventListener('hashchange', onHashChange);
|
||||
onHashChange();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('hashchange', onHashChange);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user