73 lines
4.9 KiB
JavaScript
73 lines
4.9 KiB
JavaScript
import { _ as __nuxt_component_0 } from "./nuxt-link-C5PnX__I.js";
|
|
import { defineComponent, ref, mergeProps, unref, withCtx, createTextVNode, useSSRContext } from "vue";
|
|
import { ssrRenderAttrs, ssrRenderAttr, ssrInterpolate, ssrIncludeBooleanAttr, ssrRenderComponent } from "vue/server-renderer";
|
|
import { publicAssetsURL } from "#internal/nuxt/paths";
|
|
import "/app/node_modules/hookable/dist/index.mjs";
|
|
import { a as useRouter, b as useAuthStore } from "../server.mjs";
|
|
import "/app/node_modules/ufo/dist/index.mjs";
|
|
import "/app/node_modules/defu/dist/defu.mjs";
|
|
import "/app/node_modules/ofetch/dist/node.mjs";
|
|
import "/app/node_modules/unctx/dist/index.mjs";
|
|
import "/app/node_modules/h3/dist/index.mjs";
|
|
import "pinia";
|
|
import "vue-router";
|
|
import "/app/node_modules/klona/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 _imports_0 = publicAssetsURL("/sf_logo.png");
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "login",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const email = ref("");
|
|
const password = ref("");
|
|
useRouter();
|
|
const authStore = useAuthStore();
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_NuxtLink = __nuxt_component_0;
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "min-h-screen bg-slate-900 flex items-center justify-center px-4" }, _attrs))}><div class="w-full max-w-md"><div class="text-center mb-8"><div class="flex items-center justify-center gap-3 mb-4"><img${ssrRenderAttr("src", _imports_0)} class="h-12 w-auto drop-shadow-md" alt="ServiceFinder Logo"><span class="text-3xl font-extrabold tracking-wider"><span class="text-white">SERVICE</span><span class="text-cyan-400">FINDER</span></span></div><h1 class="text-xl font-semibold text-slate-300">Staff Portal</h1><p class="text-sm text-slate-500 mt-1">Authorised personnel only</p></div><div class="bg-slate-800 rounded-xl shadow-2xl border border-slate-700 p-8">`);
|
|
if (unref(authStore).error) {
|
|
_push(`<div class="mb-6 p-3 rounded-lg bg-red-900/40 border border-red-700 text-red-300 text-sm">${ssrInterpolate(unref(authStore).error)}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<form class="space-y-5"><div><label for="email" class="block text-sm font-medium text-slate-300 mb-1.5"> Email Address </label><input id="email"${ssrRenderAttr("value", unref(email))} type="email" autocomplete="email" required placeholder="admin@example.com" class="w-full px-4 py-2.5 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-transparent transition"></div><div><label for="password" class="block text-sm font-medium text-slate-300 mb-1.5"> Password </label><input id="password"${ssrRenderAttr("value", unref(password))} type="password" autocomplete="current-password" required placeholder="••••••••" class="w-full px-4 py-2.5 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:border-transparent transition"></div><button type="submit"${ssrIncludeBooleanAttr(unref(authStore).isLoading) ? " disabled" : ""} class="w-full py-2.5 px-4 bg-cyan-600 hover:bg-cyan-500 disabled:bg-cyan-800 disabled:cursor-not-allowed text-white font-semibold rounded-lg transition duration-200 flex items-center justify-center gap-2">`);
|
|
if (unref(authStore).isLoading) {
|
|
_push(`<svg class="animate-spin h-5 w-5 text-white" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<span>${ssrInterpolate(unref(authStore).isLoading ? "Signing in..." : "Sign In")}</span></button></form><div class="mt-6 text-center">`);
|
|
_push(ssrRenderComponent(_component_NuxtLink, {
|
|
to: "/",
|
|
class: "text-sm text-slate-500 hover:text-cyan-400 transition"
|
|
}, {
|
|
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
if (_push2) {
|
|
_push2(` ← Back to ServiceFinder `);
|
|
} else {
|
|
return [
|
|
createTextVNode(" ← Back to ServiceFinder ")
|
|
];
|
|
}
|
|
}),
|
|
_: 1
|
|
}, _parent));
|
|
_push(`</div></div></div></div>`);
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/login.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
export {
|
|
_sfc_main as default
|
|
};
|
|
//# sourceMappingURL=login-DOiXgKDi.js.map
|