UNPKG

@cocalc/static

Version:

CoCalc's static frontend Webpack-based build system and framework

58 lines 4.12 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const theme_1 = require("@cocalc/util/theme"); const app_base_path_1 = require("@cocalc/frontend/customize/app-base-path"); const path_1 = require("path"); const link_1 = __importDefault(require("./link")); const url_1 = __importDefault(require("@cocalc/frontend/support/url")); const icon_1 = require("@cocalc/frontend/components/icon"); const STYLE = { display: "none", zIndex: 10000, position: "absolute", overflow: "scroll", height: "90vh", width: "60vw", top: "5vh", left: "20vw", border: "1px solid #aaaaaa", boxShadow: "10px 10px 10px lightgrey", padding: "30px", borderRadius: "5px", fontSize: "12pt", backgroundColor: "white", color: "#444", }; function Crash() { const getSupport = (0, url_1.default)({ subject: "CoCalc Crashed", body: "CoCalc is crashing...", type: "question", hideExtra: true, }); const dismiss = () => { // Yes, this is a very non-react way to do this. This is a // port of something else that didn't use React. const crash = document.getElementById("cocalc-react-crash"); if (crash == null) return; crash.style.display = "none"; }; return ((0, jsx_runtime_1.jsxs)("div", { id: "cocalc-react-crash", style: STYLE, children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "close-circle-two-tone", style: { fontSize: "24px", position: "absolute", right: "4px", top: "5px", }, onClick: dismiss }), (0, jsx_runtime_1.jsxs)("h1", { style: { textAlign: "center", color: "white", background: "crimson", padding: "15px", }, children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { name: "robot" }), "\u00A0 CoCalc Crashed"] }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("p", { children: "Sorry to interrupt your work. An error happened in CoCalc's web application. Don't worry, all your files are securely stored on its servers!" }), (0, jsx_runtime_1.jsxs)("ul", { children: [(0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("p", { style: { fontWeight: "bold", fontSize: "115%" }, children: [(0, jsx_runtime_1.jsx)("a", { onClick: () => window.location.reload(), children: "Reload this browser tab" }), " ", "in order to recover from this. You might also try", " ", (0, jsx_runtime_1.jsx)("a", { href: (0, path_1.join)(app_base_path_1.appBasePath, `projects?session=${new Date().valueOf()}`), children: "a new session" }), "."] }) }), (0, jsx_runtime_1.jsx)("li", { children: (0, jsx_runtime_1.jsxs)("p", { style: { fontWeight: "bold", fontSize: "115%" }, children: [(0, jsx_runtime_1.jsx)("a", { onClick: dismiss, children: "Dismiss this error" }), " and continue using CoCalc."] }) })] })] }), (0, jsx_runtime_1.jsx)("hr", {}), (0, jsx_runtime_1.jsx)("div", { id: "cocalc-error-report-react" }), (0, jsx_runtime_1.jsx)("div", { id: "cocalc-error-report-startup" }), (0, jsx_runtime_1.jsxs)("p", { children: ["If this happens repeatedly for a specific file or action, please report all details in ", (0, jsx_runtime_1.jsx)(link_1.default, { href: getSupport, children: "a support ticket" }), ", via email to", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: `mailto:${theme_1.HELP_EMAIL}`, children: theme_1.HELP_EMAIL }), ", or consult our", " ", (0, jsx_runtime_1.jsx)(link_1.default, { href: (0, path_1.join)(app_base_path_1.appBasePath, "info"), children: "other support resources" }), ". Thank you! Unfortunately, if you don't explain how you hit this problem so we can reproduce it, then we probably will not be able to fix it."] })] })); } exports.default = Crash; //# sourceMappingURL=crash.js.map