sysinfo.php

View Snippet
                    <?php error_reporting(0); ?><!DOCTYPE html>
<html lang="ru-RU">
    <title>System Info</title>
    <style type="text/css">
        html, body {margin:40px;padding:0;text-align:center;font-family:Tahoma,Verdana,Arial;font-size:40px;color:#333}
    </style>
<head>
</head>
<body>
    <div id="data">
        FreeMemory: <strong><?php
            echo exec("sudo awk '/MemFree/ {printf( "%.2f\n", $2 / 1024 )}' /proc/meminfo");
        ?></strong>Mb <small>of <?php
            echo exec("sudo awk '/MemTotal/ {printf( "%.2f\n", $2 / 1024 )}' /proc/meminfo");
        ?>Mb</small>
        <br />
        CPU Usage: <strong><?php
            echo exec("cat /proc/loadavg | awk '{print $1}'");
        ?></strong>% for last minute
        <br />
        HDD Temperature: <strong><?php
            echo exec("sudo hddtemp -n /dev/sda");
        ?></strong> ºC
    </div>
</body>
</html>
                  

index.html

View Snippet
                    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ru-RU">
    <title>Follow The White Rabbit</title>
    <style type="text/css">
        html,body{text-align:center;font-family:Tahoma,Verdana,Arial;color:#666}
        #sysinfo{position:fixed;top:10px;width:300px;height:auto;margin-left:-150px;left:50%;
          font-size:11px;color:#666;-moz-opacity:0;-khtml-opacity:0;opacity:0;
          -webkit-transition:all 150ms ease-out;-moz-transition:all 150ms ease-out;
          transition:all 150ms ease-out}
        .trans{-moz-opacity:0.2!important;-khtml-opacity:0.2!important;opacity:0.2!important}
        #sysinfo:hover{-moz-opacity:1!important;-khtml-opacity:1!important;opacity:1!important}
        .center{position:absolute;width:530px;height:25px;top:50%;left:50%;margin-left:-265px;margin-top:30px;color:#ccc}
        .center a{padding:80px 20px 0;color:#222;text-decoration:none}
        .center a.web{
          background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/services.png) no-repeat top center;}
        .center a.torrent{
          background:url(http://cdn1.iconfinder.com/data/icons/windows-8-metro-style/64/utorrent.png) no-repeat top center;}
        .center a.filez{
          background:url(http://cdn1.iconfinder.com/data/icons/jolly-icons-free/64/folder_64.png) no-repeat top center;}
    </style>
    <link rel="icon" type="image/png" href="http://www.freefavicon.com/freefavicons/openclipart/loading-wheel-modern-icon-152-191739.png" />
<head>
</head>
<body>
    <div id="sysinfo"></div>
    <div class="center">
        <a href="/UI" class="web">WD Web Interface</a> | <script type="text/javascript">
            var d=document,
                wl=window.location,
                port_num = '9091',
                client_url = 'transmission/web/',
                link_label = 'Torrent Client';
            d.write('<a href="'+wl.protocol+'//'+wl.hostname+':'+port_num+'/'+client_url+'" class="torrent">'+link_label+'</a>');
        </script> | <a href="/shared/Public/" class="filez">Files Storage</a>
    </div>

    <iframe id="loader" name="loader" src="/sysinfo.php" style="display:none;"></iframe>

    <script type="text/javascript">
    var readyStateCheckInterval=setInterval(function(){if(document.readyState==='complete'){
        function update_data(){
            var d = document,
                f = d.getElementById('loader'),
                s = d.getElementById('sysinfo');
            f.src = f.src;
            if(!s.className.match(/(?:^|\s)MyClass(?!\S)/)) s.className+=' trans';
            try {
                s.innerHTML = window.frames['loader'].document.getElementById('data').innerHTML;
            }catch(e){
                s.innerHTML = '<span style="color:#e00;font-weight:bold;">Get data error</span>';
            }
        }

        update_data();

        setInterval(function(){
            update_data();
        }, 4000);

        clearInterval(readyStateCheckInterval);
    }},50);
    </script>
</body>
</html>

                  

options.json

View Snippet
                    /*
h5ai 0.24.0
http://larsjung.de/h5ai/

Options
*/

{
        /*
        Spacing of the main content.

        Left and right will be added to a minimum of 30px. Top and bottom
        are calculated relative to the top and bottom bar heights.
        */
        "spacing": {
                "maxWidth": 960,
                "top": 50,
                "right": "auto",
                "bottom": 50,
                "left": "auto"
        },

        /*
        General view options.

        - modes: array, subset of ["details", "grid", "icons"]
                the first value indicates the default view mode. If only one value
                is given the view mode is fixed and the selector buttons are hidden.
                The user selected view mode is also stored local in modern browsers
                so that it will be persistent.
        - sizes: array, subset of [16, 24, 32, 48, 64, 96]
                the first value indicates the default view mode. If only one value
                is given the view mode is fixed and the selector buttons are hidden.
                The user selected view mode is also stored local in modern browsers
                so that it will be persistent.
        - setParentFolderLabels: set parent folder labels to real folder names
        - hideParentFolderLinks: hide parent folder links in the main view
        - hideFolders: hide all folders in the main view
        - binaryPrefix: set to true uses 1024B=1KiB when formatting file sizes (see http://en.wikipedia.org/wiki/Binary_prefix)
        - indexFiles: consider folder with those files as non h5ai folders
        - ignore: don't list items matching these regular expressions
        - smartBrowsing: use History API if available (no need to reload the whole page)
        - extInNewWindow: open non-h5ai links in new window/tab
        */
        "view": {
                "modes": ["icons", "details", "grid"],
                "sizes": [48/*, 24, 96*/],
                "setParentFolderLabels": true,
                "hideParentFolderLinks": false,
                "hideFolders": false,
                "binaryPrefix": false,
                "indexFiles": ["index.html", "index.htm", "index.php"],
                "ignore": ["^\.", "^_h5ai"],
                "smartBrowsing": true,
                "extInNewWindow": false
        },



        /*** Extensions (in alphabetical order) ***/

        /*
        Watch and update current folder content.

        - interval: number, update interval in milliseconds, at least 1000
        */
        "autorefresh": {
                "enabled": true,
                "interval": 10000
        },

        /*
        Show a clickable breadcrumb.
        */
        "crumb": {
                "enabled": true
        },

        /*
        Allow customized header and footer files.
        First looks for files "_h5ai.header.html" and "_h5ai.footer.html" in the current directory.
        If not found it looks in all parent     directories (starting in the current directory) for
        files "_h5ai.headers.html" and "_h5ai.footers.html"     until it finds one.     Note the different
        filenames: "header" (only current) - "headers" (current and sub directories)!
        The file's content will be placed inside a <div/> tag above/below the main content.
        */
        "custom": {
                "enabled": true
        },

        /* [EXPERIMENTAL]
        Allow file deletion.
        */
        "delete": {
                "enabled": false
        },

        /* [EXPERIMENTAL]
        File upload via drag'n'drop. Folders are not supported.
        The working file size seems to be very browser dependent.

        - maxfiles: number, max number of files per upload
        - maxfilesize: number, file size is in MB
        */
        "dropbox": {
                "enabled": true,
                "maxfiles": 100,
                "maxfilesize": 10000
        },

        /*
        Enable packaged download of selected entries.

        - type: "php-tar", "shell-tar" or "shell-zip"
        - packageName: basename of the download package, null for current foldername
        */
        "download": {
                "enabled": false,
                "type": "shell-zip",
                "packageName": null
        },

        /*
        Allow filtering the displayed files and folders.
        Will check entries for right order of characters, i.e.
        "ab" matches "ab", "axb", "xaxbx" but not "ba".
        Space separated sequences get OR-ed.

        Filters will be treated as JavaScript regular expressions
        if you prefix them with "re:".
        */
        "filter": {
                "enabled": false
        },

        /*
        Calc the size of folders.
        */
        "foldersize": {
                "enabled": false
        },

        /*
        Adds Google Analytics asynchronous tracking code.

        for example:
        "gaq": [
                ["_setAccount", "UA-xxxxxx-x"],
                ["_setDomainName", ".your-domain.tld"],
                ["_trackPageview"],
                ["_trackPageLoadTime"]
        ]

        see: http://support.google.com/googleanalytics/bin/topic.py?hl=en&topic=27612
        */
        "google-analytics": {
                "enabled": false,
                "gaq": []
        },

        /*
        Localization, for example "en", "de" etc. - see "langs" below for
        possible values. Adjust it to your needs. If lang is not found in
        "langs" it defaults to "en".

        - lang: default language
        - useBroserLang: boolean, try to use browser language
        */
        "l10n": {
                "enabled": true,
                "lang": "ru",
                "useBrowserLang": true
        },

        /*
        Link the hover effects between crumb, main view and tree.
        */
        "link-hover-states": {
                "enabled": true
        },

        /*
        Shows the server mode in the bottom left corner.

        - display:
                0: only show mode
                1: mode and servername
                2: mode, servername and -version
        */
        "mode": {
                "enabled": false,
                "display": 2
        },

        /*
        Adds Piwik tracker javascript code.

        - baseURL: do not include the protocol, e.g. "mydomain.tld/piwik"
        - idSite: number
        */
        "piwik-analytics": {
                "enabled": false,
                "baseURL": "some/url",
                "idSite": 1
        },

        /*
        Show an image preview on click.

        - types: array of types
        */
        "preview-img": {
                "enabled": true,
                "types": ["bmp", "gif", "ico", "image", "jpg", "png"]
        },

        /*
        Show text file preview on click.
        "types" maps file types to SyntaxHighligher brushes.
        For available brushes see http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/

        Additional type are:
         - "markdown" to render Markdown text
         - "none" for floating text
         - "fixed" for fixed width text

        - types: maps types to brushes
        */
        "preview-txt": {
                "enabled": true,
                "types": {
                        "authors": "fixed",
                        "copying": "fixed",
                        "c": "c",
                        "txt": "fixed",
                        "nfo": "fixed",
                        "cpp": "cpp",
                        "css": "css",
                        "diff": "diff",
                        "h": "c",
                        "hpp": "cpp",
                        "install": "fixed",
                        "log": "fixed",
                        "java": "java",
                        "js": "js",
                        "json": "js",
                        "makefile": "xml",
                        "markdown": "markdown",
                        "php": "php",
                        "python": "python",
                        "readme": "fixed",
                        "rb": "ruby",
                        "rtf": "fixed",
                        "script": "shell",
                        "text": "fixed",
                        "xml": "xml"
                }
        },

        /*
        Show QRCodes on hovering files.

        - size: width and height in pixel
        */
        "qrcode": {
                "enabled": false,
                "size": 150
        },

        /* [EXPERIMENTAL]
        Allow to rename files.
        No GUI yet.
        */
        "rename": {
                "enabled": false
        },

        /*
        Make entries selectable (first mouse button + drag).
        At the moment only needed for packaged download and delete.

        - checkboxes: boolean, show a checkbox on mouse over item
        */
        "select": {
                "enabled": false,
                "checkboxes": true
        },

        /*
        Default sort order.
        "column" and "reverse" are locally stored.

        - column: int, 0 for "Name", 1 for "Date", 2 for "Size"
        - reverse: boolean, false for ascending, true for descending
        - ignorecase: boolean, compare ignorecase
        - natural: boolean, use natural sort order
        */
        "sort": {
                "enabled": true,
                "column": 0,
                "reverse": false,
                "ignorecase": true,
                "natural": false
        },

        /*
        Show additional info in a statusbar.
        */
        "statusbar": {
                "enabled": false
        },

        /*
        Show thumbnails for image files. Needs the "/_h5ai/cache" folder to be
        writable for the web Server.

        - img: array of types
        - mov: array of types
        - doc: array of types
        - delay: delay in milliseconds after "dom-ready" before thumb-requesting starts
        - size: number, size in pixel of the generated thumbnails
        - exif: boolean, use included EXIF thumbs if possible
        */
        "thumbnails": {
                "enabled": true,
                "img": ["bmp", "gif", "ico", "image", "jpg", "png"],
                "mov": ["video", "mp4", "avi", "mpg"],
                "doc": ["pdf", "ps"],
                "delay": 1,
                "size": 96,
                "exif": true
        },

        /*
        Replace window title with current breadcrumb.
        */
        "title": {
                "enabled": true
        },

        /*
        Show a folder tree.
        Note that this might affect performance significantly.

        - slide: boolean, slide tree bar into viewport if there is enough space
        - maxSubfolders: max number of subfolders to show in tree
        */
        "tree": {
                "enabled": false,
                "slide": true,
                "maxSubfolders": 50
        }
}