import { defineComponent, ref, reactive, computed, unref, useSSRContext } from "vue"; import { ssrRenderAttrs, ssrInterpolate, ssrRenderAttr, ssrRenderList, ssrRenderClass, ssrIncludeBooleanAttr } from "vue/server-renderer"; import "/app/node_modules/hookable/dist/index.mjs"; import "/app/node_modules/klona/dist/index.mjs"; import { a as useI18n } from "../server.mjs"; import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js"; import "/app/node_modules/ofetch/dist/node.mjs"; import "#internal/nuxt/paths"; import "/app/node_modules/unctx/dist/index.mjs"; import "/app/node_modules/h3/dist/index.mjs"; import "pinia"; import "/app/node_modules/defu/dist/defu.mjs"; import "vue-router"; import "/app/node_modules/ufo/dist/index.mjs"; import "/app/node_modules/cookie-es/dist/index.mjs"; import "/app/node_modules/destr/dist/index.mjs"; import "/app/node_modules/ohash/dist/index.mjs"; import "/app/node_modules/@unhead/vue/dist/index.mjs"; import "@vue/devtools-api"; 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 "—"; 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(`—`); } _push(` | `); if (entry.xp) { _push(`${ssrInterpolate(entry.xp)}`); } else { _push(`—`); } _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(`—`);
}
_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(`