save changes
This commit is contained in:
Vendored
+2
-2
@@ -7,8 +7,8 @@
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<title>CITPL Admin</title>
|
||||
<script type="module" crossorigin src="/citpl_website/assets/admin-CVv7hj2c.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-gyvy4NrT.js">
|
||||
<script type="module" crossorigin src="/citpl_website/assets/admin-Dt4w1w-p.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-CWfp5ET4.js">
|
||||
<link rel="stylesheet" crossorigin href="/citpl_website/assets/admin-yhMCgkf-.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{r as i,t as a}from"./App-BAlDiH2W.js";var o=r(n(),1),s=t(),c=e();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{r as i,t as a}from"./App-Bde043lQ.js";var o=e(r(),1),s=t(),c=n();(0,s.createRoot)(document.getElementById(`root`)).render((0,c.jsx)(o.StrictMode,{children:(0,c.jsx)(i,{children:(0,c.jsx)(a,{})})}));
|
||||
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{c as e,d as t,f as n,g as r}from"./x-gyvy4NrT.js";import{n as i,r as a,t as o}from"./App-BAlDiH2W.js";var s=r(n(),1),c=t(),l=e();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
import{_ as e,f as t,l as n,p as r}from"./x-CWfp5ET4.js";import{n as i,r as a,t as o}from"./App-Bde043lQ.js";var s=e(r(),1),c=t(),l=n();function u(){return(0,s.useEffect)(()=>(document.body.classList.add(`admin-preview-embed`),()=>document.body.classList.remove(`admin-preview-embed`)),[]),(0,l.jsx)(o,{previewMode:!0})}(0,c.createRoot)(document.getElementById(`root`)).render((0,l.jsx)(s.StrictMode,{children:(0,l.jsx)(i.Provider,{value:!0,children:(0,l.jsx)(a,{previewMode:!0,children:(0,l.jsx)(u,{})})})}));
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+3
-3
@@ -8,9 +8,9 @@
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<title>Cavin Infotech | One Trusted Technology Partner</title>
|
||||
<script type="module" crossorigin src="/citpl_website/assets/main-CVVqQI0V.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-gyvy4NrT.js">
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-BAlDiH2W.js">
|
||||
<script type="module" crossorigin src="/citpl_website/assets/main-RYqL6rGL.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-CWfp5ET4.js">
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-Bde043lQ.js">
|
||||
<link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Vendored
+3
-3
@@ -7,9 +7,9 @@
|
||||
<meta http-equiv="Pragma" content="no-cache" />
|
||||
<meta http-equiv="Expires" content="0" />
|
||||
<title>CITPL Preview</title>
|
||||
<script type="module" crossorigin src="/citpl_website/assets/preview-zh4TDIbq.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-gyvy4NrT.js">
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-BAlDiH2W.js">
|
||||
<script type="module" crossorigin src="/citpl_website/assets/preview-BCSYkIPC.js"></script>
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/x-CWfp5ET4.js">
|
||||
<link rel="modulepreload" crossorigin href="/citpl_website/assets/App-Bde043lQ.js">
|
||||
<link rel="stylesheet" crossorigin href="/citpl_website/assets/App-DpUt8oMg.css">
|
||||
<link rel="stylesheet" crossorigin href="/citpl_website/assets/preview-DknkzKsF.css">
|
||||
</head>
|
||||
|
||||
+29
-5
@@ -70,13 +70,37 @@ export const adminApi = {
|
||||
return apiFetch('/api/auth/me');
|
||||
},
|
||||
|
||||
getContent: () => apiFetch('/api/content'),
|
||||
getContent: async () => {
|
||||
try {
|
||||
return await apiFetch('/api/content');
|
||||
} catch {
|
||||
const saved = localStorage.getItem('static_content');
|
||||
if (saved) return JSON.parse(saved);
|
||||
const { default: seed } = await import('../../server/seed/default-content.json');
|
||||
return seed;
|
||||
}
|
||||
},
|
||||
|
||||
updateSection: (section, data) =>
|
||||
apiFetch(`/api/content/${section}`, { method: 'PUT', body: JSON.stringify(data) }),
|
||||
updateSection: async (section, data) => {
|
||||
try {
|
||||
return await apiFetch(`/api/content/${section}`, { method: 'PUT', body: JSON.stringify(data) });
|
||||
} catch {
|
||||
const saved = localStorage.getItem('static_content');
|
||||
const { default: seed } = await import('../../server/seed/default-content.json');
|
||||
const current = saved ? JSON.parse(saved) : seed;
|
||||
const updated = { ...current, [section]: data, _updatedAt: new Date().toISOString() };
|
||||
localStorage.setItem('static_content', JSON.stringify(updated));
|
||||
return { message: `${section} updated (local)`, updatedAt: updated._updatedAt };
|
||||
}
|
||||
},
|
||||
|
||||
changePassword: (currentPassword, newPassword) =>
|
||||
apiFetch('/api/auth/password', { method: 'PUT', body: JSON.stringify({ currentPassword, newPassword }) }),
|
||||
changePassword: async (currentPassword, newPassword) => {
|
||||
try {
|
||||
return await apiFetch('/api/auth/password', { method: 'PUT', body: JSON.stringify({ currentPassword, newPassword }) });
|
||||
} catch {
|
||||
return { message: 'Password change requires the server to be running.' };
|
||||
}
|
||||
},
|
||||
|
||||
upload: async (file) => {
|
||||
// Try Node API first; fall back to local data URL when server is unavailable.
|
||||
|
||||
@@ -33,6 +33,15 @@ export function ContentProvider({ children, previewMode = false }) {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.warn('Using fallback content:', err.message);
|
||||
const saved = localStorage.getItem('static_content');
|
||||
if (saved) {
|
||||
try {
|
||||
const { _updatedAt, ...rest } = JSON.parse(saved);
|
||||
setContent(prefixAssets(rest));
|
||||
setUpdatedAt(_updatedAt ?? null);
|
||||
return;
|
||||
} catch { /* ignore parse error */ }
|
||||
}
|
||||
setError(err.message);
|
||||
})
|
||||
.finally(() => setLoading(false));
|
||||
|
||||
Reference in New Issue
Block a user