UNPKG

@eotl/core

Version:

Assortment of data structures, Vue.js components, and utilities across EOTL apps and sites.

122 lines (121 loc) 5.05 kB
import { resolveComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, createVNode, withCtx, createTextVNode } from "vue"; import { ssrIdentity } from "@eotl/simple-signed-records"; import { A as AccountNew } from "./AccountNew-C3Kon05d.js"; import { A as AccountRestore } from "./AccountRestore-D7BfWASB.js"; import { useEotlCore } from "./store.js"; import { u as useAuthSsr } from "./authSsr-BedulHkH.js"; import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js"; const _sfc_main = { components: { AccountNew, AccountRestore }, data: function() { const store = useEotlCore(); const authSsr = useAuthSsr(); if (authSsr.account.status == "active") { this.$router.push({ path: "home" }); } return { store, authSsr, start: { title: "Welcome", welcomeText: "Welcome to an EOTL application", about: "This Is A Tool", aboutText: "EOTL is not a business or startup, it is a collection of open-source tools to connect people who have items for sale and/or transport with other suppliers or logistics workers. EOTL software can be run by communities, collectives, individuals, or companies." }, restoreSeed: "", account: authSsr.account }; }, methods: { restoreAccount() { let status = "active"; let keys = { secretKey: this.authSsr.identity.secretKey, publicKey: this.authSsr.identity.publicKey }; let cert = ssrIdentity.generateCert(keys); this.store.dispatch("restoreAccount", { status, cert }); }, btnShowRestore() { this.authSsr.account.status = "restore"; } } }; const _hoisted_1 = { key: 0 }; const _hoisted_2 = /* @__PURE__ */ createElementVNode("h3", null, "Authenticated", -1); const _hoisted_3 = /* @__PURE__ */ createElementVNode("p", null, "You are being redirected now...", -1); const _hoisted_4 = [ _hoisted_2, _hoisted_3 ]; const _hoisted_5 = { key: 1, class: "mt-5 row" }; const _hoisted_6 = { class: "col-md-6 mb-5" }; const _hoisted_7 = /* @__PURE__ */ createElementVNode("div", { class: "bg-light mb-5 p-4" }, " [Image or other media] ", -1); const _hoisted_8 = { class: "col-md-5 offset-md-1 mb-5" }; const _hoisted_9 = /* @__PURE__ */ createElementVNode("h2", null, "Get Started", -1); const _hoisted_10 = { class: "form-group" }; const _hoisted_11 = { key: 2 }; const _hoisted_12 = { key: 3 }; const _hoisted_13 = /* @__PURE__ */ createElementVNode("h4", null, "Oops", -1); function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { const _component_router_link = resolveComponent("router-link"); const _component_AccountNew = resolveComponent("AccountNew"); const _component_AccountRestore = resolveComponent("AccountRestore"); return openBlock(), createElementBlock("div", null, [ _ctx.authSsr.account.status == "active" ? (openBlock(), createElementBlock("div", _hoisted_1, _hoisted_4)) : _ctx.authSsr.account.status == "new" ? (openBlock(), createElementBlock("div", _hoisted_5, [ createElementVNode("div", _hoisted_6, [ createElementVNode("h2", null, toDisplayString(_ctx.start.title), 1), createElementVNode("p", null, toDisplayString(_ctx.start.welcomeText), 1), _hoisted_7, createElementVNode("h4", null, toDisplayString(_ctx.start.about), 1), createElementVNode("p", null, toDisplayString(_ctx.start.aboutText), 1), createVNode(_component_router_link, { to: { path: "/about" }, class: "btn btn-primary" }, { default: withCtx(() => [ createTextVNode(" Learn More ") ]), _: 1 }) ]), createElementVNode("div", _hoisted_8, [ _hoisted_9, createVNode(_component_AccountNew, { account: _ctx.authSsr.account, config: _ctx.store.config }, null, 8, ["account", "config"]), createElementVNode("div", _hoisted_10, [ createElementVNode("button", { onClick: _cache[0] || (_cache[0] = (...args) => $options.btnShowRestore && $options.btnShowRestore(...args)), class: "btn btn-link btn-block" }, " Restore an account ") ]) ]) ])) : _ctx.authSsr.account.status == "restore" ? (openBlock(), createElementBlock("div", _hoisted_11, [ createElementVNode("h2", null, toDisplayString(_ctx.$t("auth.myAccount")), 1), createElementVNode("p", null, toDisplayString(_ctx.$t("auth.haveKey")), 1), createVNode(_component_AccountRestore, { account: _ctx.authSsr.account, config: _ctx.store.config }, null, 8, ["account", "config"]) ])) : (openBlock(), createElementBlock("div", _hoisted_12, [ _hoisted_13, createElementVNode("p", null, toDisplayString(_ctx.$t("auth.restoreError")), 1) ])) ]); } const Gateway = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); export { Gateway as default }; //# sourceMappingURL=Gateway-_ClOWupz.js.map