Skip to content

Commit

Permalink
Fix input number min value
Browse files Browse the repository at this point in the history
  • Loading branch information
everoddandeven committed Oct 9, 2024
1 parent e536a2e commit 125b43f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 24 deletions.
6 changes: 2 additions & 4 deletions src/app/pages/blockchain/blockchain.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h6>Block Additional Details</h6>

<div *ngIf="!getBlockByHash" class="col-sm-3">
<label for="get-block-height" class="form-label">Block height</label>
<input type="number" class="form-control" id="get-block-height" placeholder="" [(ngModel)]="getBlockHeight" [ngModelOptions]="{standalone: true}" [disabled]="getBlockByHash">
<input type="number" min="0" class="form-control" id="get-block-height" placeholder="" [(ngModel)]="getBlockHeight" [ngModelOptions]="{standalone: true}" [disabled]="getBlockByHash">
<small class="text-body-secondary">Block height</small>
</div>
</div>
Expand Down Expand Up @@ -377,7 +377,7 @@ <h6>Miscellaneous</h6>

<div *ngIf="!getBlockHeaderByHash" class="col-sm-3">
<label for="get-block-header-height" class="form-label">Block header height</label>
<input type="number" class="form-control" id="get-block-header-height" placeholder="" [(ngModel)]="getBlockHeaderHeight" [ngModelOptions]="{standalone: true}" [disabled]="getBlockHeaderByHash">
<input type="number" min="0" class="form-control" id="get-block-header-height" placeholder="" [(ngModel)]="getBlockHeaderHeight" [ngModelOptions]="{standalone: true}" [disabled]="getBlockHeaderByHash">
<small class="text-body-secondary">Block header height</small>
</div>
</div>
Expand Down Expand Up @@ -489,8 +489,6 @@ <h4><i class="bi bi-check-circle m-2"></i></h4>&nbsp;&nbsp;

</div>



</div>
<app-daemon-not-running></app-daemon-not-running>
<app-daemon-stopping></app-daemon-stopping>
12 changes: 6 additions & 6 deletions src/app/pages/mining/mining.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ <h4 class="mb-3">Start mining on the daemon</h4>

<div class="col-sm-3">
<label for="start-mining-threads-count" class="form-label">Threads Count</label>
<input type="number" class="form-control" id="start-mining-threads-count" placeholder="" [(ngModel)]="startMiningThreadsCount" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="start-mining-threads-count" placeholder="" [(ngModel)]="startMiningThreadsCount" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Number of mining thread to run</small>
</div>

Expand Down Expand Up @@ -205,7 +205,7 @@ <h4><i class="bi bi-exclamation-triangle m-2"></i></h4>&nbsp;&nbsp;

<div class="col-sm-3">
<label for="get-block-header-reserve-size" class="form-label">Reserve size</label>
<input type="number" class="form-control" min="0" id="get-block-header-reserve-size" placeholder="" [(ngModel)]="getBlockTemplateReserveSize" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="get-block-header-reserve-size" placeholder="" [(ngModel)]="getBlockTemplateReserveSize" [ngModelOptions]="{standalone: true}">
</div>
</div>
</div>
Expand Down Expand Up @@ -237,13 +237,13 @@ <h4><i class="bi bi-check-circle m-2"></i></h4>&nbsp;&nbsp;
<h4 class="mb-3">Calculate PoW hash for a block candidate</h4>
<div class="col-sm-6">
<label for="calc-pow-major-version" class="form-label">Major version</label>
<input type="number" class="form-control" min="0" id="calc-pow-major-version" placeholder="" [(ngModel)]="calcPowMajorVersion" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" min="0" id="calc-pow-major-version" placeholder="" [(ngModel)]="calcPowMajorVersion" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">The major version of the monero protocol at this block height</small>
</div>

<div class="col-sm-6">
<label for="calc-pow-height" class="form-label">Height</label>
<input type="number" class="form-control" min="0" id="calc-pow-height" placeholder="" [(ngModel)]="calcPowHeight" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" min="0" id="calc-pow-height" placeholder="" [(ngModel)]="calcPowHeight" [ngModelOptions]="{standalone: true}">
</div>

<div class="col-sm-12">
Expand Down Expand Up @@ -432,13 +432,13 @@ <h5 class="card-title">Status: {{ generatedBlocks.status }}</h5>
<h4 class="mb-3">Generate a block and specify the address to receive the coinbase reward</h4>
<div class="col-sm-6">
<label for="generate-blocks-starting-nonce" class="form-label">Starting Nonce</label>
<input type="number" class="form-control" min="0" id="generate-blocks-starting-nonce" placeholder="" [(ngModel)]="generateStartingNonce" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" min="0" id="generate-blocks-starting-nonce" placeholder="" [(ngModel)]="generateStartingNonce" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Increased by miner until it finds a matching result that solves a block</small>
</div>

<div class="col-sm-6">
<label for="generate-blocks-amount-of-blocks" class="form-label">Amount of blocks</label>
<input type="number" class="form-control" min="0" id="generate-blocks-amount-of-blocks" placeholder="" [(ngModel)]="generateBlocksAmountOfBlocks" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" min="0" id="generate-blocks-amount-of-blocks" placeholder="" [(ngModel)]="generateBlocksAmountOfBlocks" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Number of blocks to be generated</small>
</div>

Expand Down
28 changes: 14 additions & 14 deletions src/app/pages/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h4 class="mb-3">General</h4>

<div class="col-md-6">
<label for="rpc-bind-port" class="form-label">Bind port</label>
<input type="number" class="form-control" id="rpc-bind-port" placeholder="18081" [(ngModel)]="currentSettings.rpcBindPort" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="rpc-bind-port" placeholder="18081" [(ngModel)]="currentSettings.rpcBindPort" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">18081 for mainnet, 28081 for testnet, 38081 for stagenet</small>
</div>

Expand Down Expand Up @@ -163,7 +163,7 @@ <h4 class="mb-3">ZMQ</h4>

<div class="col-md-6">
<label for="zmq-rpc-bind-port" class="form-label">Bind port</label>
<input type="number" class="form-control" id="zmq-rpc-bind-port" placeholder="18082" [(ngModel)]="currentSettings.zmqRpcBindPort" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="zmq-rpc-bind-port" placeholder="18082" [(ngModel)]="currentSettings.zmqRpcBindPort" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">18082 for mainnet, 28082 for testnet, 38082 for stagenet</small>
</div>

Expand All @@ -188,13 +188,13 @@ <h4 class="mb-3">Payment</h4>

<div class="col-md-6">
<label for="rpc-payment-difficulty" class="form-label">Difficulty</label>
<input type="number" class="form-control" id="rpc-payment-difficulty" placeholder="1000" [(ngModel)]="currentSettings.rpcPaymentDifficuly" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="rpc-payment-difficulty" placeholder="1000" [(ngModel)]="currentSettings.rpcPaymentDifficuly" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Restrict RPC to clients sending micropayment at this difficulty</small>
</div>

<div class="col-md-6">
<label for="rpc-payment-credits" class="form-label">Credits</label>
<input type="number" class="form-control" id="rpc-payment-credits" placeholder="100" [(ngModel)]="currentSettings.rpcPaymentCredits" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="rpc-payment-credits" placeholder="100" [(ngModel)]="currentSettings.rpcPaymentCredits" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Restrict RPC to clients sending micropayment, yelds that many credits per payment</small>
</div>

Expand Down Expand Up @@ -288,13 +288,13 @@ <h4 class="mb-3">General</h4>

<div class="col-md-6">
<label for="p2p-bind-port" class="form-label">Bind port</label>
<input type="number" class="form-control" id="p2p-bind-port" placeholder="18080" [(ngModel)]="currentSettings.p2pBindPort" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="p2p-bind-port" placeholder="18080" [(ngModel)]="currentSettings.p2pBindPort" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">18080 for mainnet, 28080 for testnet, 38080 for stagenet</small>
</div>

<div class="col-md-6">
<label for="p2p-external-port" class="form-label">External port</label>
<input type="number" class="form-control" id="p2p-external-port" placeholder="18080" [(ngModel)]="currentSettings.p2pExternalPort" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="p2p-external-port" placeholder="18080" [(ngModel)]="currentSettings.p2pExternalPort" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">External port for p2p network protocol (if port forwarding used with NAT)</small>
</div>

Expand All @@ -311,7 +311,7 @@ <h4 class="mb-3">IPv6</h4>

<div class="col-md-6">
<label for="p2p-bind-port-ipv6" class="form-label">Bind IPv6 port</label>
<input type="number" class="form-control" id="p2p-bind-port-ipv6" placeholder="18080" [(ngModel)]="currentSettings.p2pBindPortIpv6" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="p2p-bind-port-ipv6" placeholder="18080" [(ngModel)]="currentSettings.p2pBindPortIpv6" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">18080 for mainnet, 28080 for testnet, 38080 for stagenet</small>
</div>

Expand Down Expand Up @@ -406,12 +406,12 @@ <h4 class="mb-3">Synchronization</h4>

<div class="col-md-4">
<label for="block-sync-size" class="form-label">Block sync size</label>
<input type="number" class="form-control" id="block-sync-size" placeholder="" [(ngModel)]="currentSettings.blockSyncSize" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="block-sync-size" placeholder="" [(ngModel)]="currentSettings.blockSyncSize" [ngModelOptions]="{standalone: true}">
</div>

<div class="col-md-4">
<label for="block-download-max-size" class="form-label">Block download max size</label>
<input type="number" class="form-control" id="block-download-max-size" placeholder="" [(ngModel)]="currentSettings.blockDownloadMaxSize" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="block-download-max-size" placeholder="" [(ngModel)]="currentSettings.blockDownloadMaxSize" [ngModelOptions]="{standalone: true}">
</div>

<div class="col-md-4">
Expand Down Expand Up @@ -470,19 +470,19 @@ <h4 class="mb-3">Background mining</h4>

<div class="col-md-4">
<label for="bg-mining-min-idle-interval" class="form-label">Minimum idle interval</label>
<input type="number" class="form-control" id="bg-mining-min-idle-interval" placeholder="" [(ngModel)]="currentSettings.bgMiningMinIdleInterval" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="bg-mining-min-idle-interval" placeholder="" [(ngModel)]="currentSettings.bgMiningMinIdleInterval" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Specify min lookback interval in seconds for determining idle state</small>
</div>

<div class="col-md-4">
<label for="bg-mining-idle-threshold" class="form-label">Idle threshold</label>
<input type="number" class="form-control" id="bg-mining-idle-threshold" placeholder="" [(ngModel)]="currentSettings.bgMiningIdleThreshold" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="bg-mining-idle-threshold" placeholder="" [(ngModel)]="currentSettings.bgMiningIdleThreshold" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Specify minimum avg idle percentage over lookback interval</small>
</div>

<div class="col-md-4">
<label for="bg-mining-miner-target" class="form-label">Miner target</label>
<input type="number" class="form-control" id="bg-mining-miner-target" placeholder="" [(ngModel)]="currentSettings.bgMiningMinerTarget" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="bg-mining-miner-target" placeholder="" [(ngModel)]="currentSettings.bgMiningMinerTarget" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Specify maximum percentage cpu use by miners</small>
</div>

Expand Down Expand Up @@ -514,13 +514,13 @@ <h4 class="mb-3">General</h4>

<div class="col-md-4">
<label for="max-log-file-size" class="form-label">Max log file size</label>
<input type="number" class="form-control" id="max-log-file-size" placeholder="104850000" [(ngModel)]="currentSettings.maxLogFileSize" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="max-log-file-size" placeholder="104850000" [(ngModel)]="currentSettings.maxLogFileSize" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Specify maximum log file size [B]</small>
</div>

<div class="col-md-4">
<label for="max-log-files" class="form-label">Max log files</label>
<input type="number" class="form-control" id="max-log-files" placeholder="50" [(ngModel)]="currentSettings.maxLogFiles" [ngModelOptions]="{standalone: true}">
<input type="number" min="0" class="form-control" id="max-log-files" placeholder="50" [(ngModel)]="currentSettings.maxLogFiles" [ngModelOptions]="{standalone: true}">
<small class="text-body-secondary">Specify maximum number of rotated log files to be saved (no limit by setting to 0)</small>
</div>
</div>
Expand Down

0 comments on commit 125b43f

Please sign in to comment.