diff --git a/.gitignore b/.gitignore index 4d20a53..6965039 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +public/robots.txt # build output dist/ # generated types diff --git a/astro.config.mjs b/astro.config.mjs index 0f4809b..4d645ef 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,13 +3,20 @@ import { defineConfig } from 'astro/config'; import tailwind from '@astrojs/tailwind'; import react from '@astrojs/react'; -// https://astro.build/config export default defineConfig({ - site: 'https://siliconpin.com', + site: 'https://siliconpin.cs1.hz.siliconpin.com', + vite: { + server: { + allowedHosts: ['siliconpin.cs1.hz.siliconpin.com'], + }, + preview: { + allowedHosts: ['siliconpin.cs1.hz.siliconpin.com'], + }, + }, integrations: [tailwind(), react()], server: { host: '0.0.0.0', - port: 3000 + port: 4000 }, output: 'static', }); diff --git a/package-lock.json b/package-lock.json index 6ae6710..ee1d46c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "pocketbase": "^0.25.2", "postcss": "^8.5.3", "react-qr-code": "^2.0.15", - "react-router-dom": "^7.4.1", + "react-router-dom": "^7.5.0", "react-to-print": "^3.0.5", "tailwind-merge": "^3.0.2", "tailwindcss": "^3.4.17", @@ -6174,9 +6174,9 @@ } }, "node_modules/react-router": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.4.1.tgz", - "integrity": "sha512-Vmizn9ZNzxfh3cumddqv3kLOKvc7AskUT0dC1prTabhiEi0U4A33LmkDOJ79tXaeSqCqMBXBU/ySX88W85+EUg==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.5.0.tgz", + "integrity": "sha512-estOHrRlDMKdlQa6Mj32gIks4J+AxNsYoE0DbTTxiMy2mPzZuWSDU+N85/r1IlNR7kGfznF3VCUlvc5IUO+B9g==", "license": "MIT", "dependencies": { "@types/cookie": "^0.6.0", @@ -6198,12 +6198,12 @@ } }, "node_modules/react-router-dom": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.4.1.tgz", - "integrity": "sha512-L3/4tig0Lvs6m6THK0HRV4eHUdpx0dlJasgCxXKnavwhh4tKYgpuZk75HRYNoRKDyDWi9QgzGXsQ1oQSBlWpAA==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.5.0.tgz", + "integrity": "sha512-fFhGFCULy4vIseTtH5PNcY/VvDJK5gvOWcwJVHQp8JQcWVr85ENhJ3UpuF/zP1tQOIFYNRJHzXtyhU1Bdgw0RA==", "license": "MIT", "dependencies": { - "react-router": "7.4.1" + "react-router": "7.5.0" }, "engines": { "node": ">=20.0.0" diff --git a/package.json b/package.json index 5a5fe36..dcf0164 100644 --- a/package.json +++ b/package.json @@ -3,9 +3,9 @@ "type": "module", "version": "0.0.1", "scripts": { - "dev": "astro dev", + "dev": "astro dev --port 4000 --host", "build": "astro build", - "preview": "astro preview", + "preview": "astro preview --port 4000", "astro": "astro", "push-s33": "rsync -rv --exclude .hta_config/conf.php dist/ dev2@siliconpin.s33.siliconpin.com:/home/dev2/domains/siliconpin.s33.siliconpin.com/public_html/" }, @@ -28,7 +28,7 @@ "pocketbase": "^0.25.2", "postcss": "^8.5.3", "react-qr-code": "^2.0.15", - "react-router-dom": "^7.4.1", + "react-router-dom": "^7.5.0", "react-to-print": "^3.0.5", "tailwind-merge": "^3.0.2", "tailwindcss": "^3.4.17", diff --git a/public/robots.txt b/public/robots.txt index 4fbb134..92857c0 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -1,7 +1,3 @@ User-agent: * -Disallow: /secret-location/ +Disallow: /* -User-agent: * -Allow: / - -Sitemap: https://siliconpin.com/sitemap.xml \ No newline at end of file diff --git a/src/components/DomainSetupForm.jsx b/src/components/DomainSetupForm.jsx index adbd070..a59ea28 100644 --- a/src/components/DomainSetupForm.jsx +++ b/src/components/DomainSetupForm.jsx @@ -34,9 +34,9 @@ export const DomainSetupForm = ({ defaultSubdomain }) => { const [userEmail, setUserEmail] = useState(''); const [panelType, setPanelType] = useState(''); - const API_URL = 'http://192.168.1.197:2058/v1/users/index.php'; - const SERVICES_API_URL = 'http://192.168.1.197:2058/v1/services/index.php'; - // const BILLING_API_URL = 'http://192.168.1.197:2058/v1/users/index.php'; + const API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/'; + const SERVICES_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/services/'; + // const BILLING_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/index.php'; const [selectedTenure, setSelectedTenure] = useState(''); const [selectedPrice, setSelectedPrice] = useState(0); diff --git a/src/components/Login.tsx b/src/components/Login.tsx index b38f04b..8bc1be5 100644 --- a/src/components/Login.tsx +++ b/src/components/Login.tsx @@ -118,7 +118,7 @@ const LoginPage = () => { const syncSessionWithBackend = async (authData: AuthResponse, avatarUrl: string) => { try { - const response = await fetch('http://192.168.1.197:2058/v1/users/?query=login', { + const response = await fetch('https://host-api.cs1.hz.siliconpin.com/v1/users/?query=login', { method: 'POST', credentials: 'include', // Important for cookies headers: { 'Content-Type': 'application/json' }, diff --git a/src/components/MakePayment.jsx b/src/components/MakePayment.jsx index 47be175..7e05965 100644 --- a/src/components/MakePayment.jsx +++ b/src/components/MakePayment.jsx @@ -5,8 +5,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle} from "./ui/dialog"; import { Toast } from './Toast'; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "./ui/card"; -const API_URL = 'http://192.168.1.197:2058/v1/users/index.php'; - +const API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/index.php'; export default function MakePayment(){ const [initialOrderData, setInitialOrderData] = useState(null); const [isLoading, setIsLoading] = useState(true); @@ -96,10 +95,11 @@ export default function MakePayment(){ Object.entries(initialOrderData.payment_data).forEach(([key, value]) => { const input = document.createElement('input'); - input.type = 'hidden'; + input.type = 'text'; input.name = key; input.value = value; form.appendChild(input); + console.log(`Adding field: ${key}=${value}`); }); document.body.appendChild(form); @@ -151,7 +151,7 @@ export default function MakePayment(){ OR - Applicabel 2% Transaction Charge if using Payment Gateway + Applicable 2% Transaction Charge if using Payment Gateway diff --git a/src/components/PaymentSuccessfully.jsx b/src/components/PaymentSuccessfully.jsx new file mode 100644 index 0000000..6572515 --- /dev/null +++ b/src/components/PaymentSuccessfully.jsx @@ -0,0 +1,54 @@ +import React, { useState } from 'react'; + +export default function HestiaCredentialsFetcher() { + const [creds, setCreds] = useState(null); + const [loading, setLoading] = useState(false); + const [error, setError] = useState(''); + + const fetchCredentials = async () => { + setLoading(true); + setError(''); + try { + const response = await fetch('https://host-api.cs1.hz.siliconpin.com/v1/services/index.php?query=get-hestia-cred', { + method: 'GET', // Changed to GET to match backend + credentials: 'include' + }); + + const data = await response.json(); + + if (!response.ok || data.error) { + throw new Error(data.error || data.details || 'Failed to fetch credentials'); + } + + setCreds(data); + } catch (err) { + console.error(err); + setError(err.message); + } finally { + setLoading(false); + } + }; + + return ( +
+

Get Hestia Credentials

+ + + {creds && ( +
+

Username: {creds.username}

+

Password: {creds.password}

+

Output:

{creds.output}

+
+ )} + + {error &&

{error}

} +
+ ); +} diff --git a/src/components/Ticket.tsx b/src/components/Ticket.tsx index a05b03b..29cb41e 100644 --- a/src/components/Ticket.tsx +++ b/src/components/Ticket.tsx @@ -27,7 +27,7 @@ interface Message { user_type: string; } -const API_URL = 'http://192.168.1.197:2058/v1/ticket/index.php'; +const API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/ticket/index.php'; function Ticketing() { const [tickets, setTickets] = useState([]); diff --git a/src/components/Topic.tsx b/src/components/Topic.tsx deleted file mode 100644 index 72364b0..0000000 --- a/src/components/Topic.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React, {useEffect, useState} from "react"; -import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "./ui/card"; - -export default function TopicCreation(){ - const API_URL = 'http://192.168.1.197:2058/v1/users/index.php'; - // useEffect(() => { - // fetch(`${API_URL}?query=get-topic`) - // .then(response => response.json()) - // .then{(data: any) => { - // console.log(data); - // }} - // }) - return( - <> -
-
- - - Lorem ipsum dolor sit amet consectetur adipisicing elit. Quo, excepturi ipsum et animi debitis doloremque quam aliquid quaerat. Totam officiis iste laudantium amet corrupti, doloribus sunt minima dolor odit. Ipsum. - - -
-
- - ) -} diff --git a/src/components/TopicDetail.jsx b/src/components/TopicDetail.jsx new file mode 100644 index 0000000..3cad595 --- /dev/null +++ b/src/components/TopicDetail.jsx @@ -0,0 +1,19 @@ +import React from "react"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card"; + +export default function TopicDetail(props) { +console.log('All topic Form allTopic', props.allTopic) + if (!props.topic) { + return
Topic not found
; + } + + return ( +
+
+ {props.topic.title} +

{props.topic.title}

+

+
+
+ ); +} \ No newline at end of file diff --git a/src/components/TopicItem.jsx b/src/components/TopicItem.jsx new file mode 100644 index 0000000..feb53ee --- /dev/null +++ b/src/components/TopicItem.jsx @@ -0,0 +1,33 @@ +import React from "react"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "./ui/card"; + +export default function TopicItems(props) { + return ( +
+
+

+ {props.title} +

+

+ {props.description} +

+
+ +
+ {props.topics.map((topic) => ( + + + {topic.title} + + {topic.title} + + {topic.description} + + + + + ))} +
+
+ ); +} \ No newline at end of file diff --git a/src/components/Topics.jsx b/src/components/Topics.jsx new file mode 100644 index 0000000..c022c78 --- /dev/null +++ b/src/components/Topics.jsx @@ -0,0 +1,10 @@ +import React, {useEffect, useState} from "react"; +import TopicItems from "./TopicItem"; + let topicPageDesc = 'Cutting-edge discussions on tech, digital services, news, and digital freedom. Stay informed on AI, cybersecurity, privacy, and the future of innovation.'; +export default function TopicCreation(props){ + return( + <> + + + ) +} \ No newline at end of file diff --git a/src/components/UserProfile.tsx b/src/components/UserProfile.tsx index 1bed53b..21bf6bc 100644 --- a/src/components/UserProfile.tsx +++ b/src/components/UserProfile.tsx @@ -25,8 +25,8 @@ export default function ProfilePage() { const [userData, setUserData] = useState(null); const [invoiceList, setInvoiceList] = useState([]); const [error, setError] = useState(null); - const USER_API_URL = 'http://192.168.1.197:2058/v1/users/index.php'; - const INVOICE_API_URL = 'http://192.168.1.197:2058/v1/invoice/'; + const USER_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/users/index.php'; + const INVOICE_API_URL = 'https://host-api.cs1.hz.siliconpin.com/v1/invoice/'; useEffect(() => { const fetchSessionData = async () => { try { diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 4e79136..1073016 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -96,6 +96,7 @@ const organizationSchema = {