mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-31 02:21:35 +00:00
Make pgp keys read-only on admin panel. Improve homepage copy button behaviour.
This commit is contained in:
parent
44f8712e18
commit
6f2aed095d
@ -132,6 +132,7 @@ class UserProfileAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
|
||||
change_links = ["user"]
|
||||
readonly_fields = ["avatar_tag"]
|
||||
search_fields = ["user__username","id"]
|
||||
readonly_fields = ("public_key", "encrypted_private_key")
|
||||
|
||||
|
||||
@admin.register(Currency)
|
||||
|
@ -225,7 +225,11 @@ class UserGenPage extends Component {
|
||||
<Grid item xs={6}>
|
||||
<Tooltip enterTouchDelay={250} title={t("Save token and PGP credentials to file")}>
|
||||
<span>
|
||||
<IconButton color="primary" disabled={getCookie('robot_token')==null || !this.props.avatarLoaded} onClick= {()=> saveAsJson(this.state.nickname+'.json', this.createJsonFile())}>
|
||||
<IconButton
|
||||
color="primary"
|
||||
disabled={!(getCookie('robot_token')==this.state.token) || !this.props.avatarLoaded}
|
||||
onClick={()=> saveAsJson(this.state.nickname+'.json', this.createJsonFile())}
|
||||
>
|
||||
<DownloadIcon sx={{width:22, height:22}}/>
|
||||
</IconButton>
|
||||
</span>
|
||||
@ -233,8 +237,12 @@ class UserGenPage extends Component {
|
||||
</Grid>
|
||||
<Grid item xs={6}>
|
||||
<Tooltip disableHoverListener enterTouchDelay={0} title={t("Copied!")}>
|
||||
<IconButton onClick= {()=> (navigator.clipboard.writeText(this.state.token) & this.props.setAppState({copiedToken:true}))}>
|
||||
<ContentCopy color={this.props.avatarLoaded & !this.props.copiedToken & !this.state.bad_request ? 'primary' : 'inherit' } sx={{width:18, height:18}}/>
|
||||
<IconButton
|
||||
color="primary"
|
||||
disabled={!(getCookie('robot_token')==this.state.token) || !this.props.avatarLoaded}
|
||||
onClick={()=> (navigator.clipboard.writeText(getCookie('robot_token')) & this.props.setAppState({copiedToken:true}))}
|
||||
>
|
||||
<ContentCopy sx={{width:18, height:18}}/>
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
</Grid>
|
||||
|
Loading…
Reference in New Issue
Block a user