mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
Website edit functionality.
This commit is contained in:
parent
30b87bc4c4
commit
00e232fee8
63 changed files with 301 additions and 94 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import Layout from 'components/layout/Layout';
|
||||
|
||||
export default function Custom404() {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import Account from 'components/Account';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,26 @@
|
|||
import { getWebsites } from 'lib/db';
|
||||
import { getWebsites, updateWebsite } from 'lib/db';
|
||||
import { useAuth } from 'lib/middleware';
|
||||
|
||||
export default async (req, res) => {
|
||||
await useAuth(req, res);
|
||||
|
||||
const { user_id } = req.auth;
|
||||
const { website_id } = req.body;
|
||||
|
||||
const websites = await getWebsites(user_id);
|
||||
if (req.method === 'GET') {
|
||||
const websites = await getWebsites(user_id);
|
||||
|
||||
return res.status(200).json({ websites });
|
||||
return res.status(200).json(websites);
|
||||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
if (website_id) {
|
||||
const { name, domain } = req.body;
|
||||
const website = await updateWebsite(website_id, { name, domain });
|
||||
|
||||
return res.status(200).json(website);
|
||||
}
|
||||
}
|
||||
|
||||
return res.status(405).end();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteList from 'components/WebsiteList';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import Login from 'components/Login';
|
||||
import Icon from 'components/Icon';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import LoginForm from 'components/forms/LoginForm';
|
||||
import Icon from 'components/interface/Icon';
|
||||
import Logo from 'assets/logo.svg';
|
||||
|
||||
export default function LoginPage() {
|
||||
return (
|
||||
<Layout title="login" header={false} footer={false} center middle>
|
||||
<Icon icon={<Logo />} size="XL" />
|
||||
<Login />
|
||||
<LoginForm />
|
||||
</Layout>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import Layout from 'components/Layout';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import Settings from 'components/Settings';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import Head from 'next/head';
|
||||
import Link from 'next/link';
|
||||
import Layout from 'components/Layout';
|
||||
import Layout from 'components/layout/Layout';
|
||||
|
||||
export default function Test({ websiteId }) {
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Layout from 'components/Layout';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import WebsiteDetails from 'components/WebsiteDetails';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue