<?import org.cryptomator.ui.controls.FontAwesome5IconView?>
<?import org.cryptomator.ui.controls.ThroughputLabel?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.layout.VBox?>
<VBox xmlns:fx="http://javafx.com/fxml"
	  xmlns="http://javafx.com/javafx"
	  fx:controller="org.cryptomator.ui.mainwindow.VaultDetailUnlockedController"
	  alignment="TOP_CENTER"
	  spacing="9">
	<Label text="%main.vaultDetail.accessLocation"/>
	<Button styleClass="button-large" contentDisplay="GRAPHIC_ONLY" minWidth="120" onAction="#revealAccessLocation" defaultButton="${controller.vault.unlocked}">
		<graphic>
			<HBox spacing="12" alignment="CENTER">
				<FontAwesome5IconView glyph="HDD" glyphSize="24"/>
				<VBox spacing="4" alignment="CENTER_LEFT">
					<Label text="%main.vaultDetail.revealBtn"/>
					<Label styleClass="label-extra-small" text="${controller.vault.accessPoint}" textOverrun="CENTER_ELLIPSIS"
						   visible="${controller.vault.accessPointPresent}" managed="${controller.vault.accessPointPresent}"/>
				</VBox>
			</HBox>
		</graphic>
		<tooltip>
			<Tooltip text="${controller.vault.accessPoint}"/>
		</tooltip>
	</Button>
	<Button text="%main.vaultDetail.lockBtn" minWidth="120" onAction="#lock">
		<graphic>
			<FontAwesome5IconView glyph="KEY"/>
		</graphic>
	</Button>

	<Region VBox.vgrow="ALWAYS"/>

	<HBox alignment="BOTTOM_RIGHT">
		<Button text="%main.vaultDetail.stats" minWidth="120" onAction="#showVaultStatistics" contentDisplay="BOTTOM">
			<graphic>
				<VBox spacing="6">
					<HBox alignment="CENTER_RIGHT" spacing="6">
						<Label styleClass="label-small,label-muted" text="%main.vaultDetail.bytesPerSecondRead"/>
						<ThroughputLabel styleClass="label-small,label-muted" alignment="CENTER_RIGHT" minWidth="60" idleFormat="%main.vaultDetail.throughput.idle" kibsFormat="%main.vaultDetail.throughput.kbps" mibsFormat="%main.vaultDetail.throughput.mbps" bytesPerSecond="${controller.vault.stats.bytesPerSecondRead}"/>
					</HBox>
					<HBox alignment="CENTER_RIGHT" spacing="6">
						<Label styleClass="label-small,label-muted" text="%main.vaultDetail.bytesPerSecondWritten"/>
						<ThroughputLabel styleClass="label-small,label-muted" alignment="CENTER_RIGHT" minWidth="60" idleFormat="%main.vaultDetail.throughput.idle" kibsFormat="%main.vaultDetail.throughput.kbps" mibsFormat="%main.vaultDetail.throughput.mbps" bytesPerSecond="${controller.vault.stats.bytesPerSecondWritten}"/>
					</HBox>
				</VBox>
			</graphic>
		</Button>
	</HBox>
</VBox>