Repo for the search and displace core module including the interface to select files and search and displace operations to run on them.
https://searchanddisplace.com
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
1.4 KiB
65 lines
1.4 KiB
<template>
|
|
<div style="display: flex; flex-direction: row;">
|
|
<div v-for="(searcher, id) in searchers"
|
|
:key="id"
|
|
@click="onSelect(id)"
|
|
class="box flex-column"
|
|
:class="{selected: id === selectedSearcherId}"
|
|
style="margin-left: 1rem;">
|
|
<div>
|
|
<span> {{ searcher.name }} </span>
|
|
</div>
|
|
|
|
<div style="margin-top: 5px; color: dodgerblue;">
|
|
<a @click.stop="onOpen(id)"> View </a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import {Component, Vue} from "vue-property-decorator";
|
|
|
|
@Component({
|
|
})
|
|
export default class Create extends Vue {
|
|
private searchers: any = {};
|
|
private selectedSearcherId: string = '';
|
|
|
|
async boot() {
|
|
try {
|
|
const { data } = await (window as any).axios.get('/searchers');
|
|
|
|
this.searchers = data.searchers;
|
|
} catch (e) {
|
|
|
|
}
|
|
}
|
|
|
|
onSelect(id: string) {
|
|
if (this.selectedSearcherId === id) {
|
|
this.selectedSearcherId = '';
|
|
|
|
this.$emit('selected', {});
|
|
|
|
return;
|
|
}
|
|
|
|
this.selectedSearcherId = id;
|
|
|
|
this.$emit('selected', this.searchers[id]);
|
|
}
|
|
|
|
onOpen(id: string) {
|
|
window.open(this.getURL(id), '_blank');
|
|
}
|
|
|
|
getURL(id: string) {
|
|
return `/searchers/${id}`;
|
|
}
|
|
|
|
created() {
|
|
this.boot();
|
|
}
|
|
};
|
|
</script>
|