Added site index file and created_at
This commit is contained in:
@@ -31,7 +31,9 @@ export interface Site {
|
||||
enabled: boolean;
|
||||
spa: boolean;
|
||||
not_found_file: string;
|
||||
last_deployed: string;
|
||||
index_file: string;
|
||||
trailing_slash: boolean | null;
|
||||
created_at: string;
|
||||
forward_rules: ForwardRule[];
|
||||
custom_headers: CustomHeaders[];
|
||||
}
|
||||
@@ -45,6 +47,8 @@ export interface CreateSiteRequest {
|
||||
domain: string;
|
||||
enabled: boolean;
|
||||
spa: boolean;
|
||||
not_found_file: string;
|
||||
index_file: string;
|
||||
}
|
||||
|
||||
export interface GetAllSitesResponse {
|
||||
|
||||
@@ -100,6 +100,8 @@ const NewSite = () => {
|
||||
domain,
|
||||
spa,
|
||||
enabled: true,
|
||||
not_found_file: '',
|
||||
index_file: '',
|
||||
});
|
||||
console.log('Created site:', data);
|
||||
};
|
||||
|
||||
@@ -79,7 +79,7 @@ const OverviewTab = ({ site }: { site: Site }) => (
|
||||
<Separator />
|
||||
<div className="flex justify-between">
|
||||
<span className="text-muted-foreground">Last Deployed</span>
|
||||
<span>{formatDate(site.last_deployed)}</span>
|
||||
<span>{formatDate('2024-01-01T12:00:00Z')}</span>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -35,6 +35,9 @@ const SettingsTab = ({ site }: { site: Site }) => {
|
||||
const [domain, setDomain] = useState(site.domain);
|
||||
const [branch, setBranch] = useState(site.branch);
|
||||
const [spa, setSpa] = useState(site.spa);
|
||||
const [notFoundFile, setNotFoundFile] = useState(site.not_found_file);
|
||||
const [indexFile, setIndexFile] = useState(site.index_file);
|
||||
|
||||
const [confirmName, setConfirmName] = useState('');
|
||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||
|
||||
@@ -44,6 +47,8 @@ const SettingsTab = ({ site }: { site: Site }) => {
|
||||
domain,
|
||||
branch,
|
||||
spa,
|
||||
not_found_file: notFoundFile,
|
||||
index_file: indexFile,
|
||||
enabled: site.enabled,
|
||||
git_server: site.git_server,
|
||||
owner: site.owner,
|
||||
@@ -74,6 +79,7 @@ const SettingsTab = ({ site }: { site: Site }) => {
|
||||
<Input
|
||||
id="settings-name"
|
||||
value={name}
|
||||
placeholder="e.g. My Awesome Site"
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
@@ -82,6 +88,7 @@ const SettingsTab = ({ site }: { site: Site }) => {
|
||||
<Input
|
||||
id="settings-domain"
|
||||
value={domain}
|
||||
placeholder="e.g. www.example.com"
|
||||
onChange={(e) => setDomain(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
@@ -90,9 +97,30 @@ const SettingsTab = ({ site }: { site: Site }) => {
|
||||
<Input
|
||||
id="settings-branch"
|
||||
value={branch}
|
||||
placeholder="e.g. gh-pages"
|
||||
onChange={(e) => setBranch(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex items-center gap-4">
|
||||
<div className="space-y-2 grow">
|
||||
<Label htmlFor="settings-index-file">Custom Index File</Label>
|
||||
<Input
|
||||
id="settings-index-file"
|
||||
value={indexFile}
|
||||
placeholder="e.g. index.html"
|
||||
onChange={(e) => setIndexFile(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-2 grow">
|
||||
<Label htmlFor="settings-not-found">Custom 404 Page</Label>
|
||||
<Input
|
||||
id="settings-not-found"
|
||||
value={notFoundFile}
|
||||
placeholder="e.g. 404.html"
|
||||
onChange={(e) => setNotFoundFile(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center justify-between rounded-lg border p-4">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="settings-spa">Single Page Application</Label>
|
||||
|
||||
Reference in New Issue
Block a user