Compare commits

..
5 Commits
Author SHA1 Message Date
braginini 9875bb0fcd Fix setup key create popup 2023-05-07 23:16:55 +02:00
braginini ae586b4dfe Fix add PAT popup 2023-05-07 19:59:57 +02:00
braginini c0a6965310 Fix user edit view 2023-05-07 19:59:47 +02:00
braginini f12a923c61 Fix user edit view 2023-05-07 19:32:14 +02:00
braginini ad798bbab4 Fix invite and add user popups 2023-05-07 18:55:34 +02:00
2 changed files with 80 additions and 56 deletions

No files matched your search

+79 -55
View File
@@ -292,7 +292,7 @@ const SetupKeyNew = () => {
textAlign: "start",
whiteSpace: "pre-line",
marginTop: "-23px",
paddingBottom: "15px",
paddingBottom: "25px",
}}>
{"Use this key to register new machines in your network"}
</Paragraph>
@@ -323,7 +323,7 @@ const SetupKeyNew = () => {
<Col span={24}>
<Form.Item
style={{marginBottom: "0px", marginTop: "10px"}}
style={{marginBottom: "0px", marginTop: "-10px"}}
name="name"
rules={[{required: true, message: "Please enter key name."}]}
>
@@ -382,9 +382,9 @@ const SetupKeyNew = () => {
>
Reusable
</Paragraph>
<Paragraph type={"secondary"} style={{whiteSpace: "pre-line", margin: 0}}>
<Text type={"secondary"}>
Use this type to enroll multiple peers
</Paragraph>
</Text>
</Col>
<Col span={6}>
<Row justify={"end"}>
@@ -410,10 +410,10 @@ const SetupKeyNew = () => {
<Paragraph style={{whiteSpace: "pre-line", margin: 0, fontWeight: "bold"}}>
{formSetupKey.type === "one-off" ? "One-off" : "Reusable"}
</Paragraph>
<Text type={"secondary"} style={{marginLeft: "5px"}}>key</Text>
<Text type={"secondary"} style={{marginLeft: "5px"}}>type</Text>
</Row>)}
<Row style={{marginTop: isEditMode? "20px" : "10px"}}>
<Row style={{marginTop: "10px"}}>
<Col span={24}>
<Paragraph
style={{whiteSpace: "pre-line", margin: 0, fontWeight: "bold"}}
@@ -421,67 +421,40 @@ const SetupKeyNew = () => {
{isEditMode ? "Available uses" : "Usage limit"}
</Paragraph>
</Col>
{isEditMode && (
<Col>
<Col>
{isEditMode ? (
<Input
disabled
value={formSetupKey.usage_limit - formSetupKey.used_times}
value={formSetupKey.usage_limit}
suffix={<LockOutlined style={{color: "#BFBFBF"}}/>}
style={{width: "104px", marginTop: "5px"}}
style={{width: "104px"}}
/>
</Col>
)}
{!isEditMode && (
<Col>
) : (
<Form.Item
style={{marginTop: "5px", width: "112px", marginBottom: "5px"}}
name="usage_limit"
>
<InputNumber
type={"number"}
style={{marginTop: "5px", width: "112px"}}
disabled={setupKey.id || formSetupKey.type !== "reusable"}
controls={false}
min={0}
/>
</Form.Item>
<Paragraph type={"secondary"} style={{marginTop: "-18px", marginBottom: 0}}>
)}
</Col>
{isEditMode ? (
<></>
) : (
<Col span={24}>
<Text type={"secondary"}>
For example, set to 30 if you want to enroll 30 peers
</Paragraph>
</Text>
</Col>
)}
</Row>
{!isEditMode && (
<Row style={{marginTop: "20px"}}>
<Col span={24}>
<Paragraph
style={{whiteSpace: "pre-line", margin: 0, fontWeight: "bold"}}
>
Expires in
</Paragraph>
</Col>
<Col>
<Form.Item
name="expiresIn"
rules={[{required: true, message: "Please enter expiration date"}]}
>
<InputNumber defaultValue={7} placeholder={`2`} type="number" addonAfter=" Days"
style={{width: "160px", marginTop: "5px"}}/>
</Form.Item>
<Paragraph type={"secondary"} style={{marginTop: "-18px", marginBottom: 0}}>
Should be between 1 and 180 days
</Paragraph>
</Col>
</Row>)}
{isEditMode && (
<Row style={{marginTop: "20px"}}>
<Row style={{marginTop: "15px"}}>
{isEditMode ? (
<Container style={{width: "100%", padding: 0, margin: 0}}>
<Row>
<Col span={11}>
@@ -490,7 +463,6 @@ const SetupKeyNew = () => {
</Paragraph>
<Row>
<Input
style={{marginTop: "5px"}}
disabled
suffix={<LockOutlined style={{color: "#BFBFBF"}}/>}
value={customExpiresFormat(new Date(formSetupKey.expires))!}
@@ -504,7 +476,6 @@ const SetupKeyNew = () => {
<Row>
<Input
disabled
style={{marginTop: "5px"}}
suffix={<LockOutlined style={{color: "#BFBFBF"}}/>}
value={customLastUsedFormat(new Date(formSetupKey.last_used))!}
/>
@@ -512,8 +483,62 @@ const SetupKeyNew = () => {
</Col>
</Row>
</Container>
) : (
<>
<Col span={24}>
<Paragraph
style={{
whiteSpace: "pre-line",
margin: 0,
fontWeight: "bold",
}}
>
Expires in
</Paragraph>
</Col>
<Col>
<Form.Item
style={{
marginTop: "5px",
width: "112px",
marginBottom: "0px",
}}
name="expiresIn"
rules={[{required: true, message: "Please enter expiration date."}]}
>
<Col
style={{
display: "flex",
flexDirection: "row",
}}
>
<InputNumber
type="number"
controls={false}
placeholder={`0`}
min={0}
max={180}
/>
<Col
style={{
marginLeft: "7px",
padding: "4px 12px",
border: "1px solid #D9D9D9",
borderRadius: "2px",
}}
>
Days
</Col>
</Col>
</Form.Item>
</Col>
</Row>)}
<Col span={24} style={{marginTop: "5px"}}>
<Text type={"secondary"}>Should be between 1 and 180 days</Text>
</Col>
</>
)}
</Row>
<Row style={{marginTop: "20px"}}>
<Col span={24}>
@@ -564,8 +589,7 @@ const SetupKeyNew = () => {
</Form>
</Container>
</Modal>
)
;
);
};
export default SetupKeyNew;
export default SetupKeyNew;
+1 -1
View File
@@ -592,4 +592,4 @@ export const SetupKeys = () => {
);
};
export default SetupKeys;
export default SetupKeys;