cronjob de manejo de invitados listo

This commit is contained in:
2025-09-26 19:28:58 -06:00
parent 0d4b0cbf67
commit 7d7a845a75
6 changed files with 102 additions and 9 deletions

View File

@@ -10,6 +10,12 @@
<input v-model="state.password" placeholder="contraseña" style="width:100%; background:transparent; border:none; outline:none; color:inherit;"/>
</label>
</div>
<div class="row">
<label class="toggle" style="flex:1;">
<div class="muted" style="font-size:12px;">Etiquetas (separadas por coma)</div>
<input v-model="etiquetasText" placeholder="invitado, vip" style="width:100%; background:transparent; border:none; outline:none; color:inherit;" />
</label>
</div>
<div class="row">
<label class="toggle" style="flex:1;">
<div class="muted" style="font-size:12px;">VLAN</div>
@@ -28,7 +34,7 @@
</template>
<script setup>
import { reactive, watch, computed } from 'vue';
import { reactive, watch, computed, ref } from 'vue';
const props = defineProps({
modelValue: { type: Object, default: () => ({ username:'', password:'', vlan:'', disabled:false }) },
@@ -38,13 +44,16 @@ const emit = defineEmits(['update:modelValue', 'submit', 'cancel']);
const state = reactive({ username:'', password:'', vlan:'', disabled:false });
const isEdit = computed(() => props.mode === 'edit');
const etiquetasText = ref('');
watch(() => props.modelValue, (v) => {
Object.assign(state, v || {});
const tags = Array.isArray(v?.etiquetas) ? v.etiquetas : [];
etiquetasText.value = tags.join(', ');
}, { immediate: true, deep: true });
function submit() {
emit('submit', { ...state });
const tags = etiquetasText.value.split(',').map(s => s.trim()).filter(Boolean).slice(0, 100);
emit('submit', { ...state, etiquetas: tags });
}
</script>