diff options
author | nachoparker <nacho@ownyourbits.com> | 2018-04-05 01:24:05 +0300 |
---|---|---|
committer | nachoparker <nacho@ownyourbits.com> | 2018-04-05 01:31:12 +0300 |
commit | 60314405d854fb7e9ab09b0ea4d25045e1d8dea8 (patch) | |
tree | e90827fe00a31112e2fe3de9fa28d74786cc3764 /ncp-web | |
parent | 16e245cf697a88917d07fc0f72af4d27edc1e34b (diff) |
ncp-web: make config.php into a tablev0.53.21
Diffstat (limited to 'ncp-web')
-rw-r--r-- | ncp-web/index.php | 33 | ||||
-rw-r--r-- | ncp-web/ncp-launcher.php | 12 | ||||
-rw-r--r-- | ncp-web/ncp.css | 10 |
3 files changed, 34 insertions, 21 deletions
diff --git a/ncp-web/index.php b/ncp-web/index.php index 0f6f1451..575c5a3c 100644 --- a/ncp-web/index.php +++ b/ncp-web/index.php @@ -125,6 +125,11 @@ HTML; <div class="icon-dashboard"></div> </div> </div> + <div id="config-btn"> + <div id="expand"> + <div class="icon-config"></div> + </div> + </div> <?php if ( file_exists( 'wizard' ) ) echo <<<HTML @@ -137,11 +142,6 @@ HTML; </a> HTML; ?> - <div id="config-btn"> - <div id="expand"> - <div class="icon-config"></div> - </div> - </div> <a href="https://github.com/nextcloud/nextcloudpi/wiki" target="_blank" tabindex="1"> <div id="nc-button"> <div id="expand"> @@ -200,9 +200,26 @@ HTML; <h2 class="text-title"><?php echo $l->__("Nextcloud configuration"); ?></h2> <div id="nc-config-box" class="table-wrapper"> <?php - $config = file_get_contents( '/var/www/nextcloud/config/config.php' ); - $config = str_replace( "\n", "<br>", $config ); - echo "$config"; + // print Nextcloud config table + include( '/var/www/nextcloud/config/config.php' ); + + echo '<table class="dashtable">'; + foreach ( $CONFIG as $key => $val ) + { + echo '<tr>'; + if ( gettype( $val ) == "array" ) + { + echo "<td>$key</td>"; + echo "<td><table>"; + foreach ( $val as $k => $v ) + echo "<tr><td>$k</td><td class=\"val-field\">$v</td></tr>"; + echo '</table></td>'; + } + else + echo "<td>$key</td><td class=\"val-field\">$val</td>"; + echo '</tr>'; + } + echo '</table>'; ?> </div> </div> diff --git a/ncp-web/ncp-launcher.php b/ncp-web/ncp-launcher.php index 62bf09ef..9c870cd1 100644 --- a/ncp-web/ncp-launcher.php +++ b/ncp-web/ncp-launcher.php @@ -157,23 +157,23 @@ else exec( 'bash /usr/local/bin/ncp-diag', $output, $ret ); // info table - $table = '<table id="dashtable">'; + $table = '<table class="dashtable">'; foreach( $output as $line ) { $table .= "<tr>"; $fields = explode( "|", $line ); $table .= "<td>$fields[0]</td>"; - $class = ""; + $class = 'val-field'; if ( strpos( $fields[1], "up" ) !== false || strpos( $fields[1], "ok" ) !== false || strpos( $fields[1], "open" ) !== false ) - $class = 'class="ok-field"'; + $class = 'ok-field'; if ( strpos( $fields[1], "down" ) !== false || strpos( $fields[1], "error" ) !== false ) - $class = 'class="error-field"'; + $class = 'error-field'; - $table .= "<td $class>$fields[1]</td>"; + $table .= "<td class=\"$class\">$fields[1]</td>"; $table .= "</tr>"; } $table .= "</table>"; @@ -185,7 +185,7 @@ else exec( "bash /usr/local/bin/ncp-suggestions \"" . implode( "\n", $output ) . '"', $out, $ret ); foreach( $out as $line ) if ( $line != "" ) - $suggestions .= "<p class=\"warn-field\">‣ $line</p>"; + $suggestions .= "<p class=\"val-field\">‣ $line</p>"; } // return JSON diff --git a/ncp-web/ncp.css b/ncp-web/ncp.css index f3a6496a..2db2bb97 100644 --- a/ncp-web/ncp.css +++ b/ncp-web/ncp.css @@ -1275,16 +1275,16 @@ a#versionlink:hover { color: red; } -.warn-field{ +.val-field{ color: gray; } -#dashtable tr { +.dashtable tr { height: 25px; border-bottom: 1px solid #ebebeb; } -#dashtable td { +.dashtable td { border-bottom: 1px solid #ebebeb; } @@ -1292,10 +1292,6 @@ a#versionlink:hover { margin-bottom: 1em; } -#nc-config-box { - color: gray; -} - .hidden { display:none } |