Change more things
This commit is contained in:
parent
53d2264351
commit
0a406ac071
@ -222,10 +222,16 @@ class Client extends Component {
|
||||
</PrefTable>
|
||||
)
|
||||
|
||||
get hasInstances() {
|
||||
return this.state.instances.length > 0
|
||||
}
|
||||
|
||||
renderPrefButtons = () => <>
|
||||
<div className="buttons">
|
||||
{!this.isNew && (
|
||||
<button className="delete" onClick={this.delete} disabled={this.loading}>
|
||||
<button className={`delete ${this.hasInstances ? "disabled-bg" : ""}`}
|
||||
onClick={this.delete} disabled={this.loading || this.hasInstances}
|
||||
title={this.hasInstances ? "Can't delete client that is in use" : ""}>
|
||||
{this.state.deleting ? <Spinner/> : "Delete"}
|
||||
</button>
|
||||
)}
|
||||
@ -238,7 +244,7 @@ class Client extends Component {
|
||||
|
||||
renderInstances = () => !this.isNew && (
|
||||
<div className="instances">
|
||||
<h3>{this.state.instances.length > 0 ? "Instances" : "No instances :("}</h3>
|
||||
<h3>{this.hasInstances ? "Instances" : "No instances :("}</h3>
|
||||
{this.state.instances.map(instance => (
|
||||
<Link className="instance" key={instance.id} to={`/instance/${instance.id}`}>
|
||||
{instance.id}
|
||||
|
@ -26,6 +26,9 @@
|
||||
box-sizing: border-box
|
||||
font-size: 1rem
|
||||
|
||||
&.disabled-bg
|
||||
background-color: $background-dark
|
||||
|
||||
&:not(:disabled)
|
||||
cursor: pointer
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user