@eotl/core
Version:
Assortment of data structures, Vue.js components, and utilities across EOTL apps and sites.
114 lines (113 loc) • 4.62 kB
JavaScript
"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const simpleSignedRecords = require("@eotl/simple-signed-records");
const store = require("./store.cjs");
const vue = require("vue");
const _pluginVue_exportHelper = require("./_plugin-vue_export-helper-DM9IkUGy.cjs");
const _sfc_main = {
components: {},
data: function() {
const store$1 = store.useEotlCore();
return {
store: store$1,
invites: [],
new_invite_code: ""
};
},
created() {
let vm = this;
simpleSignedRecords.ssrFetcher.Get("invites").then((data) => {
vm.invites = data;
});
},
methods: {
btnGenerateInvite() {
const invite = simpleSignedRecords.ssrIdentity.generateInvite();
this.new_invite_code = invite.join(" ");
},
btnCreateInvite() {
let vm = this;
let invite = { invite_code: this.new_invite_code };
simpleSignedRecords.ssrFetcher.Post("invites", invite).then((data) => {
vm.invites.push(data);
vm.new_invite_code = "";
});
}
}
};
const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("h2", { class: "mb-3" }, "Invites", -1);
const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("hr", { class: "thick mb-5" }, null, -1);
const _hoisted_3 = /* @__PURE__ */ vue.createElementVNode("p", null, "Invite tokens are used to allow new accounts to be automatically verified. You can manually give these tokens, print them, or other automated sending methods.", -1);
const _hoisted_4 = { class: "row" };
const _hoisted_5 = { class: "col-6" };
const _hoisted_6 = { class: "col-3" };
const _hoisted_7 = { class: "col-3" };
const _hoisted_8 = /* @__PURE__ */ vue.createElementVNode("hr", { class: "mt-5 mb-5" }, null, -1);
const _hoisted_9 = /* @__PURE__ */ vue.createElementVNode("h4", null, "Existing Invites", -1);
const _hoisted_10 = { class: "list-unstyled" };
const _hoisted_11 = { class: "row" };
const _hoisted_12 = { class: "col-6" };
const _hoisted_13 = ["value"];
const _hoisted_14 = { class: "col-6" };
const _hoisted_15 = /* @__PURE__ */ vue.createElementVNode("br", null, null, -1);
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return vue.openBlock(), vue.createElementBlock("div", null, [
_hoisted_1,
_hoisted_2,
_hoisted_3,
vue.createElementVNode("div", _hoisted_4, [
vue.createElementVNode("div", _hoisted_5, [
vue.withDirectives(vue.createElementVNode("input", {
type: "text",
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.new_invite_code = $event),
class: "form-control",
placeholder: "type custom invite words"
}, null, 512), [
[vue.vModelText, _ctx.new_invite_code]
])
]),
vue.createElementVNode("div", _hoisted_6, [
vue.createElementVNode("button", {
onClick: _cache[1] || (_cache[1] = (...args) => $options.btnGenerateInvite && $options.btnGenerateInvite(...args)),
class: "btn btn-secondary btn-block"
}, " Generate ")
]),
vue.createElementVNode("div", _hoisted_7, [
vue.createElementVNode("button", {
onClick: _cache[2] || (_cache[2] = (...args) => $options.btnCreateInvite && $options.btnCreateInvite(...args)),
class: "btn btn-primary btn-block"
}, " Create Invite ")
])
]),
_hoisted_8,
_hoisted_9,
vue.createElementVNode("ul", _hoisted_10, [
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.invites, (invite) => {
return vue.openBlock(), vue.createElementBlock("li", {
key: invite.id,
class: "mt-5 mb-5"
}, [
vue.createElementVNode("div", _hoisted_11, [
vue.createElementVNode("div", _hoisted_12, [
vue.createElementVNode("input", {
value: invite.invite_code,
readonly: "",
class: "form-control"
}, null, 8, _hoisted_13)
]),
vue.createElementVNode("div", _hoisted_14, [
vue.createElementVNode("small", null, [
vue.createTextVNode(" ID: " + vue.toDisplayString(invite.id), 1),
_hoisted_15,
vue.createTextVNode(" Identity: " + vue.toDisplayString(invite.invite_key_id), 1)
])
])
])
]);
}), 128))
])
]);
}
const Invites = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
exports.default = Invites;
//# sourceMappingURL=Invites-B124T5od.cjs.map