<!DOCTYPE html>
<html lang="en">
<head>
    <?php
    $partial = new Partial('head');
    $partial->prepare('baseDir', $BASEDIR);
    $partial->render();
    ?>
    <title><?php echo $TITLE ?></title>
</head>
<body class="no-transitions">
    <div class="row no-gutters main">
        <div class="col-md-3 d-sm-none"></div>
        <div class="col-md-3 nav-container">
            <?php
            $partial = new Partial('menu');
            $partial->prepare('item', 'log');
            $partial->prepare('langMng',$LANGMNG);
            $partial->prepare('debugMod',$DEBUGMOD);
            $partial->render();
            ?>
        </div>
        <div class="col-md-9 main-body">
            <div class="col-12 col-sm-9 mx-auto mt-4">
                <label><?php echo $LANGMNG->get('l_logMaxLiveTime') . " " . $LOGTOLIVETIME . " days";?></label></br>

                <label>CPU: <?php echo $CPU;?></label></br>
					 <progress value="<?php echo $CPU;?>" max="1"> <?php echo $RAMFREE;?> </progress></br>
                <label>UPTIME: <?php echo $UPTIME;?></label></br>
                <label>RAM TOTAL: <?php echo $RAMTOTAL;?></label></br>
                <label>RAM FREE: <?php echo $RAMFREE;?></label></br>
					 <progress value="<?php echo explode(" ", $RAMFREE)[0];?>" max="<?php echo explode(" ", $RAMTOTAL)[0];?>"> <?php echo $RAMFREE;?> </progress></br>

                <label>DISKTOTAL: <?php echo $DISKTOTAL;?> bytes available</label></br>
                 <label>SERVER TIME: <?php echo $SERVERTIME;?></label></br>



                <form method="post" action="">
                    <div class="field">
                        <select class="input" name="LogFile">
                            <?php foreach ($LOGSFILES as $key => $value) { ?>
                                <option value="<?php echo $value; ?>"><?php echo $value; ?></option>
                            <?php } ?>
                        </select>
                    </div>
                    <div class="field">
                        <input type="submit" class="button" name="selectFile" value="<?php $LANGMNG->echo('b_select');?>"/>
                    </div>
                </form>
                <?php
                if (isset($_POST['LogFile'])) {
                    $file_lines = file('./app/logs/' . $_POST['LogFile']);
                    echo '<pre style="overflow: auto;">';
                    foreach ($file_lines as $line) {
                        echo $line;
                    }
                    echo '</pre>';
                }
                ?>
            </div>
        </div>

        <?php
        $partial = new Partial('footer');
        $partial->render();
        //TODO js do main.js
        ?>
    </body>
    </html>
