import { defineComponent, ref, reactive, computed, unref, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrInterpolate, ssrRenderAttr, ssrRenderList, ssrRenderClass, ssrIncludeBooleanAttr } from 'vue/server-renderer'; import { a as useI18n } from './server.mjs'; import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'vue-router'; import 'node:url'; import 'pinia'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/utils'; import 'unhead/plugins'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "ledger", __ssrInlineRender: true, setup(__props) { const { t } = useI18n(); const loading = ref(true); const error = ref(false); const entries = ref([]); const total = ref(0); const offset = ref(0); const limit = ref(50); const toast = ref(""); const filters = reactive({ user_id: null, date_from: "", date_to: "", reason_search: "" }); const currentPage = computed(() => Math.floor(offset.value / limit.value) + 1); const totalPages = computed(() => Math.max(1, Math.ceil(total.value / limit.value))); function formatDate(dateStr) { if (!dateStr) return "\u2014"; const d = new Date(dateStr); return d.toLocaleDateString("hu-HU", { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit" }); } return (_ctx, _push, _parent, _attrs) => { _push(`
${ssrInterpolate(unref(t)("gamification.ledger.subtitle"))}
${ssrInterpolate(unref(t)("gamification.ledger.load_error"))}
${ssrInterpolate(unref(t)("gamification.ledger.no_results"))}
${ssrInterpolate(unref(t)("gamification.ledger.no_results_hint"))}
| ${ssrInterpolate(unref(t)("gamification.ledger.col_id"))} | ${ssrInterpolate(unref(t)("gamification.ledger.col_user"))} | ${ssrInterpolate(unref(t)("gamification.ledger.col_points"))} | ${ssrInterpolate(unref(t)("gamification.ledger.col_penalty"))} | ${ssrInterpolate(unref(t)("gamification.ledger.col_xp"))} | ${ssrInterpolate(unref(t)("gamification.ledger.col_reason"))} | ${ssrInterpolate(unref(t)("gamification.ledger.col_source"))} | ${ssrInterpolate(unref(t)("gamification.ledger.col_date"))} |
|---|---|---|---|---|---|---|---|
| ${ssrInterpolate(entry.id)} | ${ssrInterpolate(entry.user_name)}#${ssrInterpolate(entry.user_id)} | ${ssrInterpolate(entry.points > 0 ? "+" : "")}${ssrInterpolate(entry.points)} | `); if (entry.penalty_change) { _push(` +${ssrInterpolate(entry.penalty_change)}`); } else { _push(`\u2014`); } _push(` | `); if (entry.xp) { _push(`${ssrInterpolate(entry.xp)}`); } else { _push(`\u2014`); } _push(` | ${ssrInterpolate(entry.reason)} | `);
if (entry.source_type) {
_push(` ${ssrInterpolate(entry.source_type)}`);
if (entry.source_id) {
_push(`#${ssrInterpolate(entry.source_id)}`);
} else {
_push(``);
}
_push(` `);
} else {
_push(`\u2014`);
}
_push(` | ${ssrInterpolate(formatDate(entry.created_at))} |
${ssrInterpolate(unref(total))} ${ssrInterpolate(unref(t)("gamification.ledger.total_results"))} ${ssrInterpolate(unref(entries).length)} ${ssrInterpolate(unref(t)("gamification.ledger.shown"))} `); if (unref(filters).user_id || unref(filters).date_from || unref(filters).date_to || unref(filters).reason_search) { _push(` (${ssrInterpolate(unref(t)("gamification.ledger.filtered"))}) `); } else { _push(``); } _push(`