upd
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { useMask } from "@react-input/mask";
|
||||
|
||||
interface InputProps {
|
||||
type?: "text" | "email" | "password" | "time" | "tel";
|
||||
type?: "text" | "email" | "password" | "time" | "tel" | "number";
|
||||
value?: string;
|
||||
placeholder?: string;
|
||||
autoFocus?: boolean;
|
||||
|
||||
@@ -32,7 +32,7 @@ function ModalContainer() {
|
||||
>
|
||||
{(state) => (
|
||||
<div
|
||||
className={`min-h-screen p-8 absolute z-20 top-0 left-0 w-full flex justify-center items-center bg-black bg-opacity-30 overflow-auto transition-opacity ${state}`}
|
||||
className={`min-h-screen p-8 z-20 top-0 left-0 w-full flex justify-center items-center bg-black bg-opacity-30 overflow-auto transition-opacity fixed inset-0 ${state}`}
|
||||
>
|
||||
{modal}
|
||||
</div>
|
||||
|
||||
@@ -5,6 +5,7 @@ import api from "../../utils/api";
|
||||
import IError from "../../types/IError";
|
||||
import IBuild from "../../types/IBuild";
|
||||
import useModalStore from "../../stores/useModalStore";
|
||||
import Select3 from "../Select3";
|
||||
|
||||
interface Props {
|
||||
companyId: string;
|
||||
@@ -13,7 +14,6 @@ interface Props {
|
||||
function CreateBuildModal({ companyId }: Props) {
|
||||
const [name, setName] = useState<string>("");
|
||||
const [build, setBuild] = useState<string>("");
|
||||
const [sessionLimit, setSessionLimit] = useState<number>(1);
|
||||
const { setModal } = useModalStore();
|
||||
|
||||
function handleSubmit(e: FormEvent) {
|
||||
@@ -30,7 +30,6 @@ function CreateBuildModal({ companyId }: Props) {
|
||||
companyId,
|
||||
name,
|
||||
build,
|
||||
sessionLimit,
|
||||
},
|
||||
})
|
||||
.json();
|
||||
@@ -57,17 +56,39 @@ function CreateBuildModal({ companyId }: Props) {
|
||||
autoFocus
|
||||
required
|
||||
/>
|
||||
<Input
|
||||
placeholder="Сборка приложения"
|
||||
className="w-64"
|
||||
handleChange={(value) => setBuild(value)}
|
||||
required
|
||||
/>
|
||||
<Input
|
||||
placeholder="Кол-во слотов"
|
||||
className="w-64"
|
||||
value={sessionLimit?.toString()}
|
||||
handleChange={(value) => setSessionLimit(+value)}
|
||||
<Select3
|
||||
options={[
|
||||
"nksJukovaDev",
|
||||
"Avgust",
|
||||
"DNScity",
|
||||
"DreamRiva",
|
||||
"GalleryEkb",
|
||||
"Ivazowsky",
|
||||
"IzdanieBrusnika",
|
||||
"Kama",
|
||||
"lifeResidence",
|
||||
"MasharovDev",
|
||||
"MayakPruds",
|
||||
"MirapolisDev",
|
||||
"Myatnyi",
|
||||
"novatorDev",
|
||||
"orientDev",
|
||||
"PortovayaDev",
|
||||
"Prokshino",
|
||||
"RockCityDev",
|
||||
"SevernyPort",
|
||||
"Sezar",
|
||||
"ShipyardSaudiDev",
|
||||
"StroyProject",
|
||||
"StroyProject2",
|
||||
"TyoplyeQuDev",
|
||||
"upsideTowersDev",
|
||||
"VoiceInHeart",
|
||||
"WillTowers",
|
||||
"ZolotoyRog",
|
||||
"Zoolog",
|
||||
]}
|
||||
onSelect={(option) => setBuild(option)}
|
||||
required
|
||||
/>
|
||||
<div className="flex self-end gap-2">
|
||||
|
||||
@@ -8,6 +8,7 @@ import useModalStore from "../../stores/useModalStore";
|
||||
|
||||
function CreateCompanyModal() {
|
||||
const [name, setName] = useState<string>("");
|
||||
const [sessionLimit, setSessionLimit] = useState<number>(1);
|
||||
const { setModal } = useModalStore();
|
||||
|
||||
function handleSubmit(e: FormEvent) {
|
||||
@@ -22,6 +23,7 @@ function CreateCompanyModal() {
|
||||
.post(`admin/companies`, {
|
||||
json: {
|
||||
name,
|
||||
sessionLimit,
|
||||
},
|
||||
})
|
||||
.json();
|
||||
@@ -48,6 +50,14 @@ function CreateCompanyModal() {
|
||||
autoFocus
|
||||
required
|
||||
/>
|
||||
<Input
|
||||
placeholder="Кол-во серверов"
|
||||
className="w-64"
|
||||
type="number"
|
||||
required
|
||||
value={sessionLimit?.toString()}
|
||||
handleChange={(value) => setSessionLimit(+value)}
|
||||
/>
|
||||
<div className="flex self-end gap-2">
|
||||
<Button variant="secondary" onClick={() => setModal(null)}>
|
||||
Отмена
|
||||
|
||||
@@ -112,10 +112,6 @@ function AdminCompanyPage() {
|
||||
Сборка приложения:{" "}
|
||||
<span className="font-semibold">{build.build}</span>
|
||||
</p>
|
||||
<p className="">
|
||||
Кол-во слотов:{" "}
|
||||
<span className="font-semibold">{build.sessionLimit}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -3,7 +3,6 @@ interface IBuild {
|
||||
companyId: string;
|
||||
build: string;
|
||||
name: string;
|
||||
sessionLimit: number;
|
||||
}
|
||||
|
||||
export default IBuild;
|
||||
|
||||
@@ -9,16 +9,10 @@ const buildSchema = new Schema(
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
build: {
|
||||
type: String,
|
||||
required: true,
|
||||
unique: true,
|
||||
},
|
||||
sessionLimit: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -173,7 +173,7 @@ router.post("/", async (req, res) => {
|
||||
// send mail with defined transport object
|
||||
try {
|
||||
await transporter.sendMail({
|
||||
from: "stream@graff.tech", // sender address
|
||||
from: "GRAFF.estate Stream <stream@graff.tech>", // sender address
|
||||
to: client.email, // list of receivers
|
||||
subject: "Приглашение на демонстрацию - stream.graff.tech", // Subject line
|
||||
html: `<div>
|
||||
@@ -246,9 +246,9 @@ router.delete("/:id", async (req, res) => {
|
||||
const now = new Date();
|
||||
|
||||
if (now > tenMinutesAfterStart) {
|
||||
return res.json({
|
||||
status: "error",
|
||||
message: "Cannot delete session after 10 minutes from start"
|
||||
return res.json({
|
||||
status: "error",
|
||||
message: "Cannot delete session after 10 minutes from start",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user