-
Notifications
You must be signed in to change notification settings - Fork 655
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pompurin404
committed
Aug 4, 2024
1 parent
09ca8c2
commit 60fb73b
Showing
8 changed files
with
132 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { | ||
Modal, | ||
ModalContent, | ||
ModalHeader, | ||
ModalBody, | ||
ModalFooter, | ||
Button, | ||
Input | ||
} from '@nextui-org/react' | ||
import React, { useState } from 'react' | ||
|
||
interface Props { | ||
onCancel: () => void | ||
onConfirm: (script: string) => void | ||
} | ||
|
||
const BasePasswordModal: React.FC<Props> = (props) => { | ||
const { onCancel, onConfirm } = props | ||
const [password, setPassword] = useState('') | ||
|
||
return ( | ||
<Modal hideCloseButton isOpen={true}> | ||
<ModalContent> | ||
<ModalHeader className="flex">请输入root密码</ModalHeader> | ||
<ModalBody> | ||
<Input fullWidth type="password" value={password} onValueChange={setPassword} /> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button variant="light" onPress={onCancel}> | ||
取消 | ||
</Button> | ||
<Button color="primary" onPress={() => onConfirm(password)}> | ||
确认 | ||
</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
) | ||
} | ||
|
||
export default BasePasswordModal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters