2023-11-18 10:47:01 +00:00
|
|
|
import { ReactElement } from "react";
|
|
|
|
import useSWR from "swr";
|
|
|
|
import { observer } from "mobx-react-lite";
|
|
|
|
// layouts
|
2023-11-25 15:53:50 +00:00
|
|
|
import { InstanceAdminLayout } from "layouts/admin-layout";
|
2023-11-18 10:47:01 +00:00
|
|
|
// types
|
|
|
|
import { NextPageWithLayout } from "types/app";
|
|
|
|
// store
|
|
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
2023-11-20 15:16:49 +00:00
|
|
|
// ui
|
|
|
|
import { Loader } from "@plane/ui";
|
2023-11-18 10:47:01 +00:00
|
|
|
// components
|
|
|
|
import { InstanceGeneralForm } from "components/instance";
|
|
|
|
|
|
|
|
const InstanceAdminPage: NextPageWithLayout = observer(() => {
|
|
|
|
// store
|
|
|
|
const {
|
|
|
|
instance: { fetchInstanceInfo, instance },
|
|
|
|
} = useMobxStore();
|
|
|
|
|
|
|
|
useSWR("INSTANCE_INFO", () => fetchInstanceInfo());
|
|
|
|
|
2023-11-20 15:16:49 +00:00
|
|
|
return (
|
2023-11-25 15:53:50 +00:00
|
|
|
<div className="flex flex-col gap-8 my-8 mx-12">
|
|
|
|
<div className="pb-3 mb-2 border-b border-custom-border-100">
|
|
|
|
<div className="text-custom-text-100 font-medium text-xl pb-1">ID your instance easily</div>
|
|
|
|
<div className="text-custom-text-300 font-normal text-sm">
|
|
|
|
Change the name of your instance and instance admin e-mail addresses. If you have a paid subscription, you
|
|
|
|
will find your license key here.
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-11-20 15:16:49 +00:00
|
|
|
{instance ? (
|
|
|
|
<InstanceGeneralForm instance={instance} />
|
|
|
|
) : (
|
2023-11-25 15:53:50 +00:00
|
|
|
<Loader className="space-y-4">
|
2023-11-20 15:16:49 +00:00
|
|
|
<Loader.Item height="50px" />
|
|
|
|
<Loader.Item height="50px" width="50%" />
|
|
|
|
<Loader.Item height="50px" width="25%" />
|
|
|
|
</Loader>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
);
|
2023-11-18 10:47:01 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
InstanceAdminPage.getLayout = function getLayout(page: ReactElement) {
|
2023-11-25 15:53:50 +00:00
|
|
|
return <InstanceAdminLayout>{page}</InstanceAdminLayout>;
|
2023-11-18 10:47:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default InstanceAdminPage;
|