Skip to content

Commit

Permalink
ncp-web: display info for each option
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Sep 10, 2017
1 parent 1f055f8 commit 70aac8e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 17 deletions.
33 changes: 19 additions & 14 deletions ncp-web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,28 +88,33 @@
foreach($files as $file)
{
$script = pathinfo( $file , PATHINFO_FILENAME );
$fh = fopen( $path . $file ,'r');
$txt = file_get_contents( $path . $file );

$active = "";
while ($line = fgets($fh))
{
if ( $line == "ACTIVE_=yes\n" )
$active = "";
if ( preg_match('/^DESCRIPTION="(.*)"$/', $line, $matches) )
{
echo "<li id=\"$script\" class=\"nav-recent\">";
echo "<a href=\"#\"> $script$active </a>";
echo "<input type=\"hidden\" value=\"$matches[1]\" />";
echo "</li>";
}
}
fclose($fh);
if ( preg_match('/^ACTIVE_=yes$/m', $txt, $matches) )
$active = "";

echo "<li id=\"$script\" class=\"nav-recent\">";
echo "<a href=\"#\"> $script$active </a>";

if ( preg_match('/^DESCRIPTION="(.*)"$/m', $txt, $matches) )
echo "<input id=\"$script-desc\" type=\"hidden\" value=\"$matches[1]\" />";

if ( preg_match('/^INFO="(.*)"/msU', $txt, $matches) )
echo "<input id=\"$script-info\" type=\"hidden\" value=\"$matches[1]\" />";

if ( preg_match('/^INFOTITLE="(.*)"/msU', $txt, $matches) )
echo "<input id=\"$script-infotitle\" type=\"hidden\" value=\"$matches[1]\" />";

echo "</li>";
}
?>
</ul>
</div>

<div id="app-content">
<h2 id="config-box-title">Configure NextCloudPi features</h2>
<div id="config-box-info"></div>
<br/>
<div id="config-box-wrapper" class="hidden">
<form>
Expand Down
6 changes: 5 additions & 1 deletion ncp-web/ncp.css
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,11 @@ select {
text-align: center;
}

#config-box-info {
white-space: pre;
text-align: center;
}

#config-button-wrapper {
display: flex;
align-items: center;
Expand Down Expand Up @@ -1124,7 +1129,6 @@ select {
padding: 8px;
}


#expand #expandDisplayName {
padding: 8px;
opacity: 0.6;
Expand Down
5 changes: 3 additions & 2 deletions ncp-web/ncp.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ $(function()
if ( ret.token )
$('#csrf-token').set( { value: ret.token } );
$('#circle-retstatus').hide();
$('#config-box').ht( ret.output );
$('#config-box-title').fill( $( 'input' , '#' + selectedID ).get( '.value' ) );
$('#config-box').ht( ret.output );
$('#config-box-title').fill( $( '#' + selectedID + '-desc' ).get( '.value' ) );
$('#config-box-info' ).fill( $( '#' + selectedID + '-info' ).get( '.value' ) );
$('#config-box-wrapper').show();
confLock = false;
}).error( errorMsg );
Expand Down

0 comments on commit 70aac8e

Please sign in to comment.