#8: Add tooltips to settings [partial]

This commit is contained in:
2019-08-30 15:12:28 -05:00
parent adcc060d13
commit 297d7af060
5 changed files with 50 additions and 3 deletions

25
src/assets/settings.json Normal file
View File

@@ -0,0 +1,25 @@
{
"HostConfig": {
},
"Settings": {
"ApiAuth": "Password used to connect to Repertory API. Auto-generated by default.",
"ApiPort": "Repertory API port to use for JSON-RPC requests.",
"ApiUser": "Username used to connect to Repertory API. Default is 'repertory'.",
"ChunkDownloaderTimeoutSeconds": "Files that are not cached locally will download data in ChunkSize chunks when a read or write operation occurs. This timeout value specifies the amount of time chunks should continue downloading after the last file handle has been closed.",
"ChunkSize": "This is the minimum data size (converted to KiB - value of 8 means 8KiB) used for downloads. This value cannot be less than 8 and should also be a multiple of 8. Default is 2048.",
"EnableChunkDownloaderTimeout": "This setting applies to full allocation downloads. When set to true, downloads will timeout after ChunkDownloaderTimeoutSeconds if the file has no more open handles. If set to false, the entire file will always download.",
"EnableDriveEvents": "When set to true, additional logging for FUSE on UNIX or WinFSP on Windows will occur. It's best to leave this value set to 'false' unless troubleshooting an issue as enabling it may have an adverse affect on performance.",
"EnableMaxCacheSize": "If set to true, files will begin to be removed from the local cache as soon as MaxCacheSizeBytes and MinimumRedundancy have been met. This does not mean further attempts to write will fail when MaxCacheSizeBytes is reached. Writes will continue as long as there is enough local drive space to accommodate the operation.\n\nIf set to false, files will begin to be removed from the local cache as soon as MinimumRedundancy has been met.\n\nIn both cases, files that do not have any open handles will be chosen by oldest modification date for removal.",
"EventLevel": "Internally, events are fired during certain operations. This setting determines which events should be logged to repertory.log. Valid values are Error, Warn, Normal, Debug, and Verbose.",
"EvictionDelaySeconds": "Number of seconds to wait after all file handles are closed before allowing file to be evicted from cache.",
"EvictionDelayMinutes": "Number of minutes to wait after all file handles are closed before allowing file to be evicted from cache.",
"MaxCacheSizeBytes": "This value specifies the maximum amount of local space to consume before files are removed from cache. EnableMaxCacheSize must also be set to true for this value to to take affect.",
"MinimumRedundancy": "Files are elected for removal once this value has been reached. Be aware that this value cannot be set to less than 1.5x.",
"OnlineCheckRetrySeconds": "Number of seconds to wait for Sia/SiaPrime daemon to become available/connectable.",
"OrphanedFileRetentionDays": "Repertory attempts to keep modifications between Sia-UI and the mounted location in sync as much as possible. In the event a file is removed from Sia-UI, it will be marked as orphaned in Repertory and moved into an 'orphaned' directory within Repertory's data directory. This setting specifies the number of days this file is retained before final deletion.",
"PreferredDownloadType": "Repertory supports 3 download modes for reading files that are not cached locally: full file allocation, ring buffer mode and direct mode.\n\nFull file allocation mode pre-allocates the entire file prior to downloading. This mode is required for writes but also ensures the best performance when reading data.\n\nRing buffer mode utilizes a fixed size file buffer to enable a reasonable amount of seeking. This alleviates the need to fully allocate a file. By default, it is 512MiB. When the buffer is full, it attempts to maintain the ability to seek 50% ahead or behind the current read location without the need to re-download data from Sia/SiaPrime.\n\nDirect mode utilizes no disk space. All data is read directly from Sia/SiaPrime.\n\nPreferred download type modes are:\n\nFallback - If there isn't enough local space to allocate the full file, ring buffer mode is used. If there isn't enough local space to create the ring buffer's file, then direct mode is used.\nRingBuffer - Full file allocation is always bypassed; however, if there isn't enough space to create the ring buffer's file, then direct mode will be chosen.\nDirect - All files will be read directly from Sia/SiaPrime.",
"ReadAheadCount": "This value specifies the number of read-ahead chunks to use when downloading a file. This is a per-open file setting and will result in the creation of an equal number of threads.",
"RingBufferFileSize": "The size of the ring buffer file in MiB. Default is 512. Valid values are: 64, 128, 256, 512, 1024."
}
}

View File

@@ -34,3 +34,7 @@ input.ConfigurationItemInput {
border-color: rgba(10, 10, 20, 0.9); border-color: rgba(10, 10, 20, 0.9);
color: var(--text_color); color: var(--text_color);
} }
.ConfigurationInfo {
cursor: pointer;
}

View File

@@ -1,5 +1,8 @@
import React from 'react'; import React from 'react';
import './ConfigurationItem.css'; import './ConfigurationItem.css';
import settings from '../../assets/settings';
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
import {faInfoCircle} from '@fortawesome/free-solid-svg-icons';
export default props => { export default props => {
const handleChanged = (e) => { const handleChanged = (e) => {
@@ -10,6 +13,18 @@ export default props => {
props.changed(target); props.changed(target);
}; };
let infoDisplay;
if (settings[props.grouping] && settings[props.grouping][props.label]) {
const displayInfo = () => {
const description = settings[props.grouping][props.label];
alert(description);
};
infoDisplay = <a href={void(0)}
className={'ConfigurationInfo'}
onClick={()=>{displayInfo(); return false;}}><FontAwesomeIcon icon={faInfoCircle}/></a>;
}
let data; let data;
switch (props.template.type) { switch (props.template.type) {
case "bool": case "bool":
@@ -96,7 +111,9 @@ export default props => {
width='100%'> width='100%'>
<tbody> <tbody>
<tr> <tr>
<td width='100%'>{props.label}</td> {infoDisplay ?
<td width='100%'>{infoDisplay} {props.label}</td> :
<td width='100%'>{props.label}</td>}
<td>{data}</td> <td>{data}</td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -22,8 +22,7 @@ export default connect(mapStateToProps)(props => {
</td> </td>
<td> <td>
{props.AllowDownload ? {props.AllowDownload ?
<a <a href={void(0)}
href={void(0)}
className={'DependencyLink'} className={'DependencyLink'}
onClick={()=>{props.onDownload(); return false;}}><u>Install</u></a> : onClick={()=>{props.onDownload(); return false;}}><u>Install</u></a> :
'Installing...'} 'Installing...'}

View File

@@ -231,6 +231,7 @@ class Configuration extends IPCContainer {
((this.state.ShowAdvanced && k.advanced) || !k.advanced) ? ((this.state.ShowAdvanced && k.advanced) || !k.advanced) ?
<ConfigurationItem advanced={k.advanced} <ConfigurationItem advanced={k.advanced}
changed={e=>this.handleItemChanged(e, i)} changed={e=>this.handleItemChanged(e, i)}
grouping={'Settings'}
items={this.state.Template[k.label].items} items={this.state.Template[k.label].items}
key={i} key={i}
label={k.label} label={k.label}
@@ -251,6 +252,7 @@ class Configuration extends IPCContainer {
((this.state.ShowAdvanced && k.advanced) || !k.advanced) ? ((this.state.ShowAdvanced && k.advanced) || !k.advanced) ?
<ConfigurationItem advanced={k.advanced} <ConfigurationItem advanced={k.advanced}
changed={e=>this.handleObjectItemChanged(e, key, i)} changed={e=>this.handleObjectItemChanged(e, key, i)}
grouping={key}
items={this.state.Template[key].template[k.label].items} items={this.state.Template[key].template[k.label].items}
key={i} key={i}
label={k.label} label={k.label}