Integrated Manticore sync, assuming responsibility from traxxx core/legacy.
This commit is contained in:
@@ -4,14 +4,18 @@
|
||||
@close="emit('close')"
|
||||
>
|
||||
<div class="dialog-body">
|
||||
<strong class="source">#{{ actor.id }} {{ actor.name }}<span v-if="actor.entity"> ({{ actor.entity.name }})</span></strong>
|
||||
|
||||
<span class="path">merging into</span>
|
||||
|
||||
<div
|
||||
v-if="targetActor"
|
||||
class="target"
|
||||
>
|
||||
<span class="target-name">
|
||||
<strong class="target-name">
|
||||
<span class="target-id">#{{ targetActor.id }}</span>
|
||||
{{ targetActor.name }}
|
||||
</span>
|
||||
</strong>
|
||||
|
||||
<Icon
|
||||
icon="cross2"
|
||||
@@ -29,6 +33,7 @@
|
||||
ref="actorInput"
|
||||
v-model="actorQuery"
|
||||
class="input"
|
||||
placeholder="Search target actor"
|
||||
@input="searchActors"
|
||||
>
|
||||
|
||||
@@ -89,13 +94,20 @@ async function searchActors() {
|
||||
const res = await get('/actors', {
|
||||
q: `${actorQuery.value}*`, // return partial matches
|
||||
limit: 10,
|
||||
global: true,
|
||||
});
|
||||
|
||||
actorResults.value = res.actors;
|
||||
}
|
||||
|
||||
async function merge() {
|
||||
console.log('MERGE', props.actor.id, targetActor.value.id);
|
||||
await post(`/actors/${targetActor.value.id}/merge/${props.actor.id}`, null, {
|
||||
successFeedback: `Merged ${props.actor.entity ? `${props.actor.name} (${props.actor.entity.name})` : props.actor.name} into ${targetActor.value.name}`,
|
||||
errorFeedback: `Failed to merge ${props.actor.entity ? `${props.actor.name} (${props.actor.entity.name})` : props.actor.name} into ${targetActor.value.name}`,
|
||||
appendErrorMessage: true,
|
||||
});
|
||||
|
||||
emit('close');
|
||||
}
|
||||
|
||||
function selectActor(actor) {
|
||||
@@ -111,19 +123,27 @@ onMounted(() => {
|
||||
|
||||
<style scoped>
|
||||
.dialog-body {
|
||||
width: 15rem;
|
||||
width: 20rem;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 1rem;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.dialog-actions {
|
||||
margin-top: 1rem;
|
||||
|
||||
.button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.path {
|
||||
color: var(--glass-strong-20);
|
||||
}
|
||||
|
||||
.target {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
Reference in New Issue
Block a user