├── README.md ├── changelog ├── charts.php ├── composer.json ├── config └── index.htm ├── css ├── font-awesome.min.css ├── ielogin.css ├── index.htm ├── login.css ├── plexwatch-tables.css ├── plexwatch.css ├── sysinfo │ ├── animate.css │ ├── index.htm │ ├── main.css │ └── plexDash.css └── xcharts.css ├── datafactory ├── app │ ├── base-plugin.html │ ├── key-value-list-plugin.html │ ├── line-chart-plugin.html │ ├── multi-line-chart-plugin.html │ ├── navbar.html │ ├── progress-bar-plugin.html │ ├── table-data-plugin.html │ └── ui-elements │ │ ├── last-update.html │ │ └── top-bar.html ├── get-info-modal.php ├── get-library-stats.php ├── get-user-info-modal.php ├── get-user-ip-stats.php ├── get-user-platform-stats.php ├── get-user-recently-watched.php ├── get-user-time-stats.php ├── index.go ├── index.htm ├── index.js ├── index.php ├── modules │ ├── config │ │ └── ping_hosts │ ├── cpu-load.html │ ├── cpu-utilization-chart.html │ ├── disk-space.html │ ├── download-transfer-rate.html │ ├── python_files │ │ └── speedtest_cli.py │ ├── ram-chart.html │ ├── shell_files │ │ ├── arp_cache.sh │ │ ├── bandwidth.sh │ │ ├── common_applications.sh │ │ ├── cpu_info.sh │ │ ├── cpu_intensive_processes.sh │ │ ├── cpu_utilization.sh │ │ ├── cron_history.sh │ │ ├── current_ram.sh │ │ ├── disk_partitions.sh │ │ ├── download_transfer_rate.sh │ │ ├── general_info.sh │ │ ├── internet_speed.sh │ │ ├── io_stats.sh │ │ ├── ip_addresses.sh │ │ ├── load_avg.sh │ │ ├── logged_in_users.sh │ │ ├── memcached.sh │ │ ├── memory_info.sh │ │ ├── network_connections.sh │ │ ├── number_of_cpu_cores.sh │ │ ├── ping.sh │ │ ├── ram_intensive_processes.sh │ │ ├── recent_account_logins.sh │ │ ├── redis.sh │ │ ├── scheduled_crons.sh │ │ ├── swap.sh │ │ ├── upload_transfer_rate.sh │ │ └── user_accounts.sh │ └── upload-transfer-rate.html ├── ping-speeds.html └── sections │ ├── accounts.html │ ├── applications.html │ ├── basic-info.html │ ├── network.html │ └── system-status.html ├── deleteStuff.php ├── edit.php ├── font ├── FontAwesome.otf ├── fontawesome-webfont.eot ├── fontawesome-webfont.svg ├── fontawesome-webfont.ttf ├── fontawesome-webfont.woff └── index.htm ├── history.php ├── images ├── background.png ├── chevron.png ├── favicon.ico ├── glyphicons-halflings-white.png ├── glyphicons-halflings.png ├── glyphicons.png ├── gravatar-default-80x80.png ├── gravatar-default.png ├── icon_ipad.png ├── icon_ipad@2x.png ├── icon_iphone.png ├── icon_iphone@2x.png ├── index.htm ├── login.jpg ├── logo-plexWatch-welcome.png ├── logo-plexwatch.png ├── logo-plexwatch@2x.png ├── platforms │ ├── android.png │ ├── atv.png │ ├── chrome.png │ ├── chromecast.png │ ├── default.png │ ├── firefox.png │ ├── gtv.png │ ├── ie.png │ ├── ios.png │ ├── opera.png │ ├── pht.png │ ├── platform-android.png │ ├── platform-appletv.png │ ├── platform-atv.png │ ├── platform-chrome.png │ ├── platform-default.png │ ├── platform-firefox.png │ ├── platform-ie.png │ ├── platform-ios.png │ ├── platform-plex-ht.png │ ├── platform-roku.png │ ├── platform-safari.png │ ├── platform-xbmc.png │ ├── pmh.png │ ├── pms.png │ ├── roku.png │ ├── safari.png │ ├── samsung.png │ ├── wiiu.png │ ├── win8.png │ ├── wp.png │ └── xbmc.png ├── poster.png ├── star-16.png ├── star-32.png ├── star-gray-16.png └── star-gray-32.png ├── includes ├── ConfigClass.php ├── current_activity.php ├── current_activity_header.php ├── functions.php ├── img.php ├── index.htm ├── myplex.php ├── process_settings.php ├── recently_added.php └── timeago.php ├── index.php ├── info.php ├── js ├── angular-route.js ├── angular.min.js ├── bootstrap.js ├── bootstrap.min.js ├── cacher.js ├── cpufunctions.js ├── d3.v3.js ├── d3.v3_ORIGINAL-- English.js ├── index.htm ├── jquery-2.0.3.js ├── jquery-2.0.3.min.js ├── jquery-sortable.js ├── jquery-ui.js ├── jquery.dataTables.js ├── jquery.dataTables.min.js ├── jquery.dataTables.plugin.bootstrap_pagination.js ├── jquery.dataTables.plugin.date_sorting.js ├── jquery.rateit.js ├── jquery.rateit.min.js ├── jquery.ui.sortable.js ├── modules.js ├── moment-with-locale.js ├── plexwatchDash.js ├── smoothie.min.js ├── spin.min.js └── xcharts.min.js ├── login.php ├── modules ├── bandwidth.php ├── df.php ├── dhcp-leases.php ├── hostname.php ├── index.htm ├── ip.php ├── issue.php ├── lastlog.php ├── loadavg.php ├── mem.php ├── netstat.php ├── numberofcores.php ├── online.php ├── phpinfo.php ├── ping.php ├── ps.php ├── sabnzbd.php ├── speed.php ├── swap.php ├── time.php ├── uptime.php ├── users.php └── where.php ├── package.json ├── python-server.py ├── serverdatapdo.php ├── settings.php ├── stats.php ├── sysinfo.php ├── user.php └── users.php /README.md: -------------------------------------------------------------------------------- 1 | # plexWatchWeb-2.1 2 | This is my development of the original plexWatchWeb from "https://github.com/ecleese/plexWatchWeb". 3 | 4 | A new web front-end for plexWatch. 5 | 6 | * plexWatch: https://github.com/ljunkie/plexWatch 7 | * plexWatch Plex forum thread: http://forums.plexapp.com/index.php/topic/72552-plexwatch-plex-notify-script-send-push-alerts-on-new-sessions-and-stopped/ 8 | * plexWatch (Windows branch) Plex forum thread: http://forums.plexapp.com/index.php/topic/79616-plexwatch-windows-branch/ 9 | 10 | 11 | ###Support 12 | ----------- 13 | * plexWatchWeb-2.0 Wiki: https://github.com/deepwather/plexWatchWeb-2.0/wiki 14 | 15 | ###NEW Features 16 | ----------- 17 | * A beautiful Login-Page is now included. The defauld passwort is: plexwatch (All php-Files are protectet!) 18 | * There is as well new a logout butten integradet in the main-menu 19 | * You can change the default PW by editing the "login.php" file 20 | 21 | * A very exciting new function, is the "System Info" tab. With it you have now the opportunity to monitor your server 22 | * You can monitor the server in the following ways: 23 | * General info like: os-type, uptime, server-time & hostname 24 | * Internet speed (Up/Down) & available bandwich 25 | * Load average CPU & numbers of prozessor cores and ram consumption 26 | * Network statistics, number of connections & IP-adresses 27 | * Disk usage (all partitions) size, used, avail. & the mountpoint 28 | * Displays all users on the system & their userhome path 29 | * Displays all running processes and details like: ->> "user, PID, CPU-load, used-mem, VSZ, RSS, TTY & STAT" 30 | * Aditionally you can activate ->> last login, who is online, swap usage & installed software (may not working) 31 | 32 | 33 | * A SQL-editor is as well new found in the top-Menu. With it you can easily delete incorrect DB informations. 34 | 35 | 36 | ###Regular Features 37 | ----------- 38 | 39 | * Responsive web design viewable on desktop, tablet and mobile web browsers 40 | 41 | * Themed to complement Plex/Web 42 | 43 | * Easy configuration setup via html form 44 | 45 | * Plex Media Server section counts / Total user count 46 | 47 | * Current Plex Media Server viewing activity including: 48 | * number of current users 49 | * title 50 | * progress 51 | * platform 52 | * user 53 | * state (playing, paused, buffering, etc) 54 | * stream type (direct, transcoded) 55 | * video type & resolution 56 | * audio type & channel count. 57 | 58 | * Recently added media and how long ago it was added 59 | 60 | * Global watching history charts (hourly, max hourly, daily, monthly) 61 | 62 | * Global watching history with search/filtering & dynamic column sorting 63 | * date 64 | * user 65 | * platform 66 | * ip address (if enabled in plexWatch) 67 | * title 68 | * stream information details 69 | * start time 70 | * paused duration length 71 | * stop time 72 | * duration length 73 | * percentage completed 74 | 75 | * full user list with general information and comparison stats 76 | 77 | * individual user information 78 | - username and gravatar (if available) 79 | - daily, weekly, monthly, all time stats for play count and duration length 80 | - individual platform stats for each user 81 | - public ip address history with last seen date and geo tag location 82 | - recently watched content 83 | - watching history 84 | * charts 85 | - top 10 all time viewed content 86 | - top 10 viewed movies 87 | - top 10 viewed tv shows 88 | - top 10 viewed tv episodes 89 | 90 | * content information pages 91 | - movies (includes watching history) 92 | - tv shows (includes top 10 watched episodes) 93 | - tv seasons 94 | - tv episodes (includes watching history) 95 | 96 | 97 | ###Requirements 98 | --------------- 99 | * Plex Media Server (v0.9.10+) and a PlexPass membership 100 | * plexWatch (v0.3.2+) 101 | * a web server that supports php (apache, nginx, XAMPP, WampServer, EasyPHP, lighttpd, etc) 102 | * php5 103 | * php5-sqlite 104 | * php5-curl 105 | * php5-json 106 | 107 | 108 | ### Install PlexWatch 2.0 on Ubuntu 109 | ----------- 110 | 111 | 1. Read Install requirements 112 | 2. Install the following packages: 113 | * apt-get install libwww-perl libxml-simple-perl libtime-duration-perl libtime-modules-perl libdbd-sqlite3-perl perl-doc libjson-perl 114 | * apt-get install php5 php5-sqlite php5-curl php5-json 115 | * apt-get install libfile-readbackwards-perl (For enable IP logging) 116 | 3. Download and unzip the plexWatchWeb 2.0 package. 117 | 4. Upload the contents to the desired location on your web server "/var/www/html/plexwatch" 118 | 5. Check the permission! On Ubuntu the Owner of the web-files must be "www-data". (chown www-data:www-data FOLDER) 119 | 120 | 121 | Check if you already installed PlexWatch.pl! Without it, it won't work! 122 | 123 | For Install execute the following!
124 | 1. wget -P /opt/plexWatch/ https://raw.github.com/ljunkie/plexWatch/master/plexWatch.pl
125 | 2. wget -P /opt/plexWatch/ https://raw.github.com/ljunkie/plexWatch/master/config.pl-dist
126 | 3. sudo chmod 777 /opt/plexWatch && sudo chmod 755 /opt/plexWatch/plexWatch.pl
127 | 4. cp /opt/plexWatch/config.pl-dist /opt/plexWatch/config.pl
128 | 129 | 130 | ###Use 131 | ------ 132 | 133 | Navigate to: http://ip-of-web-server/plexwatch 134 | -------------------------------------------------------------------------------- /changelog: -------------------------------------------------------------------------------- 1 | - General fixes & improvements (css etc..) 2 | - Redesigned the hole server informations plattform 3 | - Several script fixes.. 4 | - Logo Update 5 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "plexWatch", 3 | "description": "", 4 | "license": "MIT", 5 | "version": "2.3.0", 6 | "keywords": ["linux", "dashboard", "plexwatch", "server dashboard"], 7 | "authors": [ 8 | { 9 | "name": "Deepwather", 10 | "email": "" 11 | } 12 | ], 13 | "minimum-stability": "stable", 14 | "require": { 15 | "php": ">=5.4.0" 16 | }, 17 | "support": { 18 | "issues": "https://github.com/plexWatch/issues?state=open", 19 | "forum": "https://gitter.im/plexWatch", 20 | "source": "https://github.com/plexWatch" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /config/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
94 | 95 |

96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

100 | 101 |

102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

105 | 106 |

107 | Technical information:

108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

110 | *** root/ - 404, DateStamp 4e6b8559

111 | 112 |

113 | 114 | 115 |

116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /css/ielogin.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | margin: 0px; 4 | padding: 0px; 5 | } 6 | body { 7 | background: #2d2d2d url('../images/login.jpg') no-repeat center; 8 | } 9 | body, a { 10 | color: #fff; 11 | font-family: "Helvetica"; 12 | font-size: 13px; 13 | } 14 | form { 15 | background: #141414; 16 | filter:alpha(opacity=50); 17 | position: absolute; 18 | overflow: hidden; 19 | line-height: 2em; 20 | padding: 5px; 21 | width: 330px; 22 | bottom: 0px; 23 | right: 0px; 24 | } 25 | 26 | .menu { 27 | border:1px outset gray; margin:.5em; padding:.0em; background: #2d2d2d url('../images/bb.png') no-repeat center; 28 | } 29 | 30 | .logout { 31 | border:1px outset gray; 32 | margin:0.5em; 33 | padding:0em; 34 | background-color:#2d2d2d; 35 | width: 40px; 36 | position: absolute; 37 | left: 205px; 38 | top: 150px; 39 | } 40 | label { 41 | clear: both; 42 | float: right; 43 | } 44 | span { 45 | float: left; 46 | padding-right: 5px; 47 | text-align: right; 48 | width: 8em; 49 | } 50 | input { 51 | float: left; 52 | margin-top: 3px; 53 | } 54 | input.text { 55 | border: 1px solid #111; 56 | padding: 2px; 57 | width: 10em; 58 | } 59 | input.submit { 60 | clear: both; 61 | float: right; 62 | } 63 | h2 { 64 | font-size: 13px; 65 | font-weight: normal; 66 | margin: 0px; 67 | text-align: right; 68 | } 69 | p { 70 | display: none; 71 | } 72 | -------------------------------------------------------------------------------- /css/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
94 | 95 |

96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

100 | 101 |

102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

105 | 106 |

107 | Technical information:

108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

110 | *** root/ - 404, DateStamp 4e6b8559

111 | 112 |

113 | 114 | 115 |

116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /css/login.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | height: 100%; 3 | margin: 0px; 4 | padding: 0px; 5 | } 6 | body { 7 | background: #2d2d2d url('../images/login.jpg') no-repeat center center fixed; 8 | -webkit-background-size: cover; 9 | -moz-background-size: cover; 10 | -o-background-size: cover; 11 | background-size: cover; 12 | } 13 | body, a { 14 | color: #fff; 15 | font-family: "Helvetica"; 16 | font-size: 13px; 17 | } 18 | form { 19 | background: #141414; 20 | opacity:0.5; 21 | position: absolute; 22 | overflow: hidden; 23 | line-height: 2em; 24 | padding: 5px; 25 | width: 251px; 26 | bottom: 0px; 27 | right: 0px; 28 | } 29 | 30 | .menu { 31 | border:1px outset gray; margin:.5em; padding:.0em; background: #2d2d2d url('../images/bb.png') no-repeat center; 32 | } 33 | 34 | .logout { 35 | border:1px outset gray; 36 | margin:0.5em; 37 | padding:0em; 38 | background-color:#2d2d2d; 39 | width: 40px; 40 | position: absolute; 41 | left: 205px; 42 | top: 150px; 43 | } 44 | label { 45 | clear: both; 46 | float: right; 47 | } 48 | span { 49 | float: left; 50 | padding-right: 5px; 51 | text-align: right; 52 | width: 8em; 53 | } 54 | input { 55 | float: left; 56 | margin-top: 3px; 57 | } 58 | input.text { 59 | border: 1px solid #111; 60 | padding: 2px; 61 | width: 10em; 62 | } 63 | input.submit { 64 | clear: both; 65 | float: right; 66 | } 67 | h2 { 68 | font-size: 13px; 69 | font-weight: normal; 70 | margin: 0px; 71 | text-align: right; 72 | } 73 | p { 74 | display: none; 75 | } 76 | -------------------------------------------------------------------------------- /css/sysinfo/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
94 | 95 |

96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

100 | 101 |

102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

105 | 106 |

107 | Technical information:

108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

110 | *** root/ - 404, DateStamp 4e6b8559

111 | 112 |

113 | 114 | 115 |

116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /css/sysinfo/plexDash.css: -------------------------------------------------------------------------------- 1 | html { 2 | background: #282828 url(../../images/background.png); 3 | } 4 | html body { 5 | margin: 0; 6 | } 7 | html body * { 8 | /*font-family: "Open Sans";*/ 9 | letter-spacing: 0; 10 | } 11 | html body .hero { 12 | color: #ffffff; 13 | padding: 0; 14 | } 15 | html body .hero h4 { 16 | color: #ffffff; 17 | display: inline-block; 18 | font-size: 20px; 19 | font-weight: 600; 20 | height: 40px; 21 | line-height: 35px; 22 | margin: 0; 23 | vertical-align: middle; 24 | } 25 | html body .hero small { 26 | letter-spacing: 0.1rem; 27 | line-height: 40px; 28 | margin-left: 20px; 29 | opacity: 0.9; 30 | text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); 31 | } 32 | html body .hero #theme-switcher { 33 | right: -315px; 34 | } 35 | html body .hero #theme-switcher.open { 36 | right: 0; 37 | } 38 | html body .hero nav-bar { 39 | /*background: #ffffff;*/ 40 | border-bottom: 1px solid #d6d6d6; 41 | color: #333333; 42 | } 43 | html body .hero nav-bar br { 44 | display: none; 45 | } 46 | html body .hero nav-bar ul { 47 | display: inline-block; 48 | } 49 | html body .hero nav-bar ul li { 50 | display: inline-block; 51 | margin: 0; 52 | } 53 | html body .hero nav-bar ul li:not(:first-child) { 54 | border-left: 1px solid #e6e6e6; 55 | } 56 | html body .hero nav-bar ul li a { 57 | color: #B2AFAA; 58 | display: block; 59 | font-size: 12px; 60 | font-weight: bold; 61 | line-height: 30px; 62 | margin: 0; 63 | padding: 0 15px; 64 | text-transform: capitalize; 65 | } 66 | html body .hero nav-bar ul li:hover a { 67 | color: #888888; 68 | } 69 | html body #plugins { 70 | display: flex; 71 | flex-flow: row wrap; 72 | justify-content: flex-start; 73 | } 74 | html body .plugin { 75 | border: 1px solid #d5d5d5; 76 | border-radius: 0 0 5px 5px; 77 | box-shadow: none; 78 | margin: 10px; 79 | } 80 | html body .plugin .top-bar { 81 | background: transparent linear-gradient(to bottom, #f9f6f1 0%, #f2efea 100%) repeat scroll 0px 0px; 82 | border-bottom: 1px solid #d6d6d6; 83 | color: #525252; 84 | font-size: 14px; 85 | font-weight: bold; 86 | height: 40px; 87 | line-height: 40px; 88 | padding: 0 0 0 15px; 89 | position: relative; 90 | text-align: left; 91 | text-transform: none; 92 | } 93 | html body .plugin .top-bar last-update { 94 | float: right; 95 | margin: 0 10px; 96 | opacity: 0.8; 97 | } 98 | html body .plugin .top-bar refresh-btn { 99 | float: right; 100 | } 101 | html body .plugin .top-bar refresh-btn button { 102 | background: #ffffff; 103 | border: 1px solid rgba(0, 0, 0, 0.15); 104 | border-radius: 4px; 105 | box-shadow: 0px 1px 0px rgba(255, 255, 255, 0.1) inset, 0px 1px 2px rgba(0, 0, 0, 0.1); 106 | color: #555555; 107 | cursor: pointer; 108 | box-shadow: none; 109 | display: inline-block; 110 | float: none; 111 | font-size: 14px; 112 | height: auto; 113 | margin: 0 -5px 0 10px; 114 | padding: 0 4px; 115 | width: auto; 116 | } 117 | html body .plugin .top-bar refresh-btn button:hover { 118 | background: #e6e6e6; 119 | } 120 | html body .plugin .plugin-body { 121 | border: none; 122 | height: auto; 123 | line-height: normal; 124 | max-height: 300px; 125 | padding: 0; 126 | } 127 | html body .plugin .plugin-body table { 128 | border-collapse: separate; 129 | border-spacing: 0; 130 | font-size: 12px; 131 | min-width: 300px; 132 | } 133 | html body .plugin .plugin-body table tr:not(:first-child) th { 134 | border-top: 1px solid #dddddd; 135 | } 136 | html body .plugin .plugin-body table td, 137 | html body .plugin .plugin-body table th { 138 | border-bottom: none; 139 | padding: 4px 5px; 140 | } 141 | html body .plugin .plugin-body table td:not(:first-child), 142 | html body .plugin .plugin-body table th:not(:first-child) { 143 | border-left: 1px solid #dddddd; 144 | } 145 | html body .plugin .plugin-body table th:not(.filter-container) { 146 | background: transparent -moz-linear-gradient(center top, #fafafa 0%, #e9e9e9 100%) repeat scroll 0% 0%; 147 | text-transform: uppercase; 148 | } 149 | html body .plugin .plugin-body table th.filter-container .filter { 150 | border-bottom: none; 151 | font-size: 12px; 152 | height: auto; 153 | padding: 2px; 154 | } 155 | html body .plugin .plugin-body table th.filter-container .filter::before { 156 | content: 'Search >'; 157 | opacity: 0.5; 158 | position: absolute; 159 | left: 0; 160 | } 161 | html body .plugin .plugin-body table td { 162 | border-top: 1px solid #dddddd; 163 | } 164 | html body .plugin canvas { 165 | width: 100%; 166 | } -------------------------------------------------------------------------------- /css/xcharts.css: -------------------------------------------------------------------------------- 1 | .xchart .line { 2 | stroke-width: 3px; 3 | fill: none; 4 | } 5 | .xchart .fill { 6 | stroke-width: 0; 7 | } 8 | .xchart circle { 9 | stroke: #FFF; 10 | stroke-width: 2px; 11 | } 12 | .xchart .axis .domain { 13 | fill: none; 14 | } 15 | .xchart .axis .tick line { 16 | stroke: #444; 17 | stroke-width: 1px; 18 | } 19 | .xchart .axis text { 20 | font-family: Helvetica, Arial, Verdana, sans-serif; 21 | fill: #666; 22 | font-size: 12px; 23 | } 24 | .xchart .color0 .line { 25 | stroke: #F9AA03; 26 | } 27 | .xchart .color0 .line .fill { 28 | pointer-events: none; 29 | } 30 | .xchart .color0 rect, 31 | .xchart .color0 circle { 32 | fill: #F9AA03; 33 | } 34 | .xchart .color0 .fill { 35 | fill: rgba(170, 134, 56, 0.1); 36 | } 37 | .xchart .color0.comp .line { 38 | stroke: #89bbd8; 39 | } 40 | .xchart .color0.comp rect { 41 | fill: #89bbd8; 42 | } 43 | .xchart .color0.comp .fill { 44 | display: none; 45 | } 46 | .xchart .color0.comp circle, 47 | .xchart .color0.comp .pointer { 48 | fill: #89bbd8; 49 | } 50 | .xchart .color1 .line { 51 | stroke: #4da944; 52 | } 53 | .xchart .color1 .line .fill { 54 | pointer-events: none; 55 | } 56 | .xchart .color1 rect, 57 | .xchart .color1 circle { 58 | fill: #4da944; 59 | } 60 | .xchart .color1 .fill { 61 | fill: rgba(77, 169, 68, 0.1); 62 | } 63 | .xchart .color1.comp .line { 64 | stroke: #9dd597; 65 | } 66 | .xchart .color1.comp rect { 67 | fill: #9dd597; 68 | } 69 | .xchart .color1.comp .fill { 70 | display: none; 71 | } 72 | .xchart .color1.comp circle, 73 | .xchart .color1.comp .pointer { 74 | fill: #9dd597; 75 | } 76 | .xchart .color2 .line { 77 | stroke: #f26522; 78 | } 79 | .xchart .color2 .line .fill { 80 | pointer-events: none; 81 | } 82 | .xchart .color2 rect, 83 | .xchart .color2 circle { 84 | fill: #f26522; 85 | } 86 | .xchart .color2 .fill { 87 | fill: rgba(242, 101, 34, 0.1); 88 | } 89 | .xchart .color2.comp .line { 90 | stroke: #f9b99a; 91 | } 92 | .xchart .color2.comp rect { 93 | fill: #f9b99a; 94 | } 95 | .xchart .color2.comp .fill { 96 | display: none; 97 | } 98 | .xchart .color2.comp circle, 99 | .xchart .color2.comp .pointer { 100 | fill: #f9b99a; 101 | } 102 | .xchart .color3 .line { 103 | stroke: #c6080d; 104 | } 105 | .xchart .color3 .line .fill { 106 | pointer-events: none; 107 | } 108 | .xchart .color3 rect, 109 | .xchart .color3 circle { 110 | fill: #c6080d; 111 | } 112 | .xchart .color3 .fill { 113 | fill: rgba(198, 8, 13, 0.1); 114 | } 115 | .xchart .color3.comp .line { 116 | stroke: #f8555a; 117 | } 118 | .xchart .color3.comp rect { 119 | fill: #f8555a; 120 | } 121 | .xchart .color3.comp .fill { 122 | display: none; 123 | } 124 | .xchart .color3.comp circle, 125 | .xchart .color3.comp .pointer { 126 | fill: #f8555a; 127 | } 128 | .xchart .color4 .line { 129 | stroke: #672d8b; 130 | } 131 | .xchart .color4 .line .fill { 132 | pointer-events: none; 133 | } 134 | .xchart .color4 rect, 135 | .xchart .color4 circle { 136 | fill: #672d8b; 137 | } 138 | .xchart .color4 .fill { 139 | fill: rgba(103, 45, 139, 0.1); 140 | } 141 | .xchart .color4.comp .line { 142 | stroke: #a869ce; 143 | } 144 | .xchart .color4.comp rect { 145 | fill: #a869ce; 146 | } 147 | .xchart .color4.comp .fill { 148 | display: none; 149 | } 150 | .xchart .color4.comp circle, 151 | .xchart .color4.comp .pointer { 152 | fill: #a869ce; 153 | } 154 | .xchart .color5 .line { 155 | stroke: #ce1797; 156 | } 157 | .xchart .color5 .line .fill { 158 | pointer-events: none; 159 | } 160 | .xchart .color5 rect, 161 | .xchart .color5 circle { 162 | fill: #ce1797; 163 | } 164 | .xchart .color5 .fill { 165 | fill: rgba(206, 23, 151, 0.1); 166 | } 167 | .xchart .color5.comp .line { 168 | stroke: #f075cb; 169 | } 170 | .xchart .color5.comp rect { 171 | fill: #f075cb; 172 | } 173 | .xchart .color5.comp .fill { 174 | display: none; 175 | } 176 | .xchart .color5.comp circle, 177 | .xchart .color5.comp .pointer { 178 | fill: #f075cb; 179 | } 180 | .xchart .color6 .line { 181 | stroke: #d9ce00; 182 | } 183 | .xchart .color6 .line .fill { 184 | pointer-events: none; 185 | } 186 | .xchart .color6 rect, 187 | .xchart .color6 circle { 188 | fill: #d9ce00; 189 | } 190 | .xchart .color6 .fill { 191 | fill: rgba(217, 206, 0, 0.1); 192 | } 193 | .xchart .color6.comp .line { 194 | stroke: #fff75a; 195 | } 196 | .xchart .color6.comp rect { 197 | fill: #fff75a; 198 | } 199 | .xchart .color6.comp .fill { 200 | display: none; 201 | } 202 | .xchart .color6.comp circle, 203 | .xchart .color6.comp .pointer { 204 | fill: #fff75a; 205 | } 206 | .xchart .color7 .line { 207 | stroke: #754c24; 208 | } 209 | .xchart .color7 .line .fill { 210 | pointer-events: none; 211 | } 212 | .xchart .color7 rect, 213 | .xchart .color7 circle { 214 | fill: #754c24; 215 | } 216 | .xchart .color7 .fill { 217 | fill: rgba(117, 76, 36, 0.1); 218 | } 219 | .xchart .color7.comp .line { 220 | stroke: #c98c50; 221 | } 222 | .xchart .color7.comp rect { 223 | fill: #c98c50; 224 | } 225 | .xchart .color7.comp .fill { 226 | display: none; 227 | } 228 | .xchart .color7.comp circle, 229 | .xchart .color7.comp .pointer { 230 | fill: #c98c50; 231 | } 232 | .xchart .color8 .line { 233 | stroke: #2eb9b4; 234 | } 235 | .xchart .color8 .line .fill { 236 | pointer-events: none; 237 | } 238 | .xchart .color8 rect, 239 | .xchart .color8 circle { 240 | fill: #2eb9b4; 241 | } 242 | .xchart .color8 .fill { 243 | fill: rgba(46, 185, 180, 0.1); 244 | } 245 | .xchart .color8.comp .line { 246 | stroke: #86e1de; 247 | } 248 | .xchart .color8.comp rect { 249 | fill: #86e1de; 250 | } 251 | .xchart .color8.comp .fill { 252 | display: none; 253 | } 254 | .xchart .color8.comp circle, 255 | .xchart .color8.comp .pointer { 256 | fill: #86e1de; 257 | } 258 | .xchart .color9 .line { 259 | stroke: #0e2e42; 260 | } 261 | .xchart .color9 .line .fill { 262 | pointer-events: none; 263 | } 264 | .xchart .color9 rect, 265 | .xchart .color9 circle { 266 | fill: #0e2e42; 267 | } 268 | .xchart .color9 .fill { 269 | fill: rgba(14, 46, 66, 0.1); 270 | } 271 | .xchart .color9.comp .line { 272 | stroke: #2477ab; 273 | } 274 | .xchart .color9.comp rect { 275 | fill: #2477ab; 276 | } 277 | .xchart .color9.comp .fill { 278 | display: none; 279 | } 280 | .xchart .color9.comp circle, 281 | .xchart .color9.comp .pointer { 282 | fill: #2477ab; 283 | } 284 | -------------------------------------------------------------------------------- /datafactory/app/base-plugin.html: -------------------------------------------------------------------------------- 1 |
2 | 7 | 8 | 9 |
10 |
-------------------------------------------------------------------------------- /datafactory/app/key-value-list-plugin.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
{{ name }}{{ value }}
18 | 19 |
20 | 21 | 22 |
23 | -------------------------------------------------------------------------------- /datafactory/app/line-chart-plugin.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
{{ metric.name }}{{ metric.data }}
17 | 18 |
19 | 20 | -------------------------------------------------------------------------------- /datafactory/app/multi-line-chart-plugin.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | 21 |
12 |
15 |
16 |
{{ metric.name }}{{ metric.data }}
22 | 23 | 24 |
25 | 26 | -------------------------------------------------------------------------------- /datafactory/app/navbar.html: -------------------------------------------------------------------------------- 1 |
2 | 9 | -------------------------------------------------------------------------------- /datafactory/app/progress-bar-plugin.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
-------------------------------------------------------------------------------- /datafactory/app/table-data-plugin.html: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 |
15 | 16 |
20 | {{ header }} 21 | 22 | {{ (header === sortByColumn) ? '▲': ''; }} 23 | {{ ('-' + header === sortByColumn) ? '▼': ''; }} 24 | 25 |
31 | {{ row[header] }} 32 |
36 | 37 |
38 | 39 | 40 |
41 | -------------------------------------------------------------------------------- /datafactory/app/ui-elements/last-update.html: -------------------------------------------------------------------------------- 1 | Loading... 2 | 3 | {{ timestamp | date:'hh:mm:ss a' }} 4 | -------------------------------------------------------------------------------- /datafactory/app/ui-elements/top-bar.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | {{ heading }} 5 | 6 | {{ info }} 7 | 8 | 9 | 10 |
-------------------------------------------------------------------------------- /datafactory/get-info-modal.php: -------------------------------------------------------------------------------- 1 | 2 | escapeString($_POST['id']); 19 | } else { 20 | error_log('PlexWatchWeb :: POST parameter "id" not found.'); 21 | echo "id field is required."; 22 | exit; 23 | } 24 | 25 | $plexWatchDbTable = ""; 26 | 27 | if ($plexWatch['globalHistoryGrouping'] == "yes") { 28 | $plexWatchDbTable = "grouped"; 29 | } else if ($plexWatch['globalHistoryGrouping'] == "no") { 30 | $plexWatchDbTable = "processed"; 31 | } 32 | $results = $db->querySingle("SELECT xml FROM $plexWatchDbTable WHERE id = $id") or die ("Failed to access plexWatch database. Please check your settings."); 33 | $xmlfield = simplexml_load_string($results) ; 34 | 35 | if (array_key_exists('TranscodeSession',$xmlfield)) { ?> 36 |
37 |

Stream Details

38 |
    39 |
    Video
    40 |
  • Stream Type: TranscodeSession['videoDecision']; ?>
  • 41 |
  • Video Resolution: TranscodeSession['height']; ?>p
  • 42 |
  • Video Codec: TranscodeSession['videoCodec']; ?>
  • 43 |
  • Video Width: TranscodeSession['width']; ?>
  • 44 |
  • Video Height: TranscodeSession['height']; ?>
  • 45 |
46 |
    47 |
    Audio
    48 |
  • Stream Type: TranscodeSession['audioDecision']; ?>
  • 49 | TranscodeSession['audioCodec'] == "dca") { ?> 50 |
  • Audio Codec: dts
  • 51 | 52 |
  • Audio Codec: TranscodeSession['audioCodec']; ?>
  • 53 | 54 |
  • Audio Channels: TranscodeSession['audioChannels']; ?>
  • 55 |
56 |
57 |
58 |

Media Source Details

59 |
  • Container: Media['container']; ?>
  • 60 |
  • Resolution: Media['videoResolution']; ?>p
  • 61 |
  • Bitrate: Media['bitrate']; ?> kbps
  • 62 |
    63 |
    64 |

    Video Source Details

    65 |
      66 |
    • Width: Media['width']; ?>
    • 67 |
    • Height: Media['height']; ?>
    • 68 |
    • Aspect Ratio: Media['aspectRatio']; ?>
    • 69 |
    • Video Frame Rate: Media['videoFrameRate']; ?>
    • 70 |
    • Video Codec: Media['videoCodec']; ?>
    • 71 |
    72 |
    73 |

    Audio Source Details

    74 |
      75 | Media['audioCodec'] == "dca") { ?> 76 |
    • Audio Codec: dts
    • 77 | 78 |
    • Audio Codec: Media['audioCodec']; ?>
    • 79 | 80 |
    • Audio Channels: Media['audioChannels']; ?>
    • 81 |
    82 |
    83 | 84 | 85 | 86 |
    87 |

    Stream Details

    88 |
      89 |
      Video
      90 |
    • Stream Type: Direct Play
    • 91 |
    • Video Resolution: Media['videoResolution']; ?>p
    • 92 |
    • Video Codec: Media['videoCodec']; ?>
    • 93 |
    • Video Width: Media['width']; ?>
    • 94 |
    • Video Height: Media['height']; ?>
    • 95 |
    96 |
      97 |
      Audio
      98 |
    • Stream Type: Direct Play
    • 99 | Media['audioCodec'] == "dca") { ?> 100 |
    • Audio Codec: dts
    • 101 | 102 |
    • Audio Codec: Media['audioCodec']; ?>
    • 103 | 104 |
    • Audio Channels: Media['audioChannels']; ?>
    • 105 |
    106 |
    107 |
    108 |

    Media Source Details

    109 |
  • Container: Media['container']; ?>
  • 110 |
  • Resolution: Media['videoResolution']; ?>p
  • 111 |
  • Bitrate: Media['bitrate']; ?> kbps
  • 112 |
    113 |
    114 |

    Video Source Details

    115 |
      116 |
    • Width: Media['width']; ?>
    • 117 |
    • Height: Media['height']; ?>
    • 118 |
    • Aspect Ratio: Media['aspectRatio']; ?>
    • 119 |
    • Video Frame Rate: Media['videoFrameRate']; ?>
    • 120 |
    • Video Codec: Media['videoCodec']; ?>
    • 121 |
    122 |
    123 |

    Audio Source Details

    124 |
      125 | Media['audioCodec'] == "dca") { ?> 126 |
    • Audio Codec: dts
    • 127 | 128 |
    • Audio Codec: Media['audioCodec']; ?>
    • 129 | 130 |
    • Audio Channels: Media['audioChannels']; ?>
    • 131 |
    132 |
    133 | -------------------------------------------------------------------------------- /datafactory/get-library-stats.php: -------------------------------------------------------------------------------- 1 | 2 | Failed to access Plex Media Server. Please check your settings.
    "); 24 | } 25 | $sections = simplexml_load_file("".$plexWatchPmsUrl."/library/sections?X-Plex-Token=".$myPlexAuthToken."") or die ("
    Failed to access Plex Media Server. Please check your settings.
    "); 26 | }else{ 27 | $myPlexAuthToken = ''; 28 | if ($fileContents = file_get_contents("".$plexWatchPmsUrl."/status/sessions?X-Plex-Token=".$myPlexAuthToken."")) { 29 | $statusSessions = simplexml_load_string($fileContents) or die ("
    Failed to access Plex Media Server. Please check your settings.
    "); 30 | } 31 | $sections = simplexml_load_file("".$plexWatchPmsUrl."/library/sections") or die ("
    Failed to access Plex Media Server. Please check your settings.
    "); 32 | } 33 | 34 | echo ""; -------------------------------------------------------------------------------- /datafactory/get-user-info-modal.php: -------------------------------------------------------------------------------- 1 | 2 | escapeString($_POST['id']); 19 | } else { 20 | error_log('PlexWatchWeb :: POST parameter "id" not found.'); 21 | echo "id field is required."; 22 | exit; 23 | } 24 | 25 | $plexWatchDbTable = ""; 26 | 27 | if ($plexWatch['userHistoryGrouping'] == "yes") { 28 | $plexWatchDbTable = "grouped"; 29 | } else if ($plexWatch['userHistoryGrouping'] == "no") { 30 | $plexWatchDbTable = "processed"; 31 | } 32 | $results = $db->querySingle("SELECT xml FROM $plexWatchDbTable WHERE id = $id") or die ("Failed to access plexWatch database. Please check your settings."); 33 | $xmlfield = simplexml_load_string($results) ; 34 | 35 | if (array_key_exists('TranscodeSession',$xmlfield)) { ?> 36 |
    37 |

    Stream Details

    38 | 46 | 56 |
    57 |
    58 |

    Media Source Details

    59 |
  • Container: Media['container']; ?>
  • 60 |
  • Resolution: Media['videoResolution']; ?>p
  • 61 |
  • Bitrate: Media['bitrate']; ?> kbps
  • 62 |
    63 |
    64 |

    Video Source Details

    65 | 72 | 73 |

    Audio Source Details

    74 | 82 |
    83 | 84 | 85 | 86 |
    87 |

    Stream Details

    88 | 96 | 106 |
    107 |
    108 |

    Media Source Details

    109 |
  • Container: Media['container']; ?>
  • 110 |
  • Resolution: Media['videoResolution']; ?>p
  • 111 |
  • Bitrate: Media['bitrate']; ?> kbps
  • 112 |
    113 |
    114 |

    Video Source Details

    115 | 122 | 123 |

    Audio Source Details

    124 | 132 |
    133 | 134 | 135 | -------------------------------------------------------------------------------- /datafactory/get-user-ip-stats.php: -------------------------------------------------------------------------------- 1 | 2 | escapeString($_POST['user']); 32 | } else { 33 | error_log('PlexWatchWeb :: POST parameter "user" not found.'); 34 | echo "user field is required."; 35 | exit; 36 | } 37 | 38 | // Connects to your Database 39 | 40 | $userIpAddressesQuery = $db->query("SELECT time,ip_address,platform,xml, COUNT(ip_address) as play_count, strftime('%Y%m%d', datetime(time, 'unixepoch', 'localtime')) as date FROM processed WHERE user = '$user' GROUP BY ip_address ORDER BY time DESC"); 41 | $nrow = Array(); 42 | $i = 0; 43 | while ($userIpAddresses = $userIpAddressesQuery->fetchArray()) { 44 | 45 | if (!empty($userIpAddresses['ip_address'])) { 46 | 47 | if (strpos($userIpAddresses['ip_address'], "192.168" ) === 0) { 48 | 49 | }else if (strpos($userIpAddresses['ip_address'], "10." ) === 0) { 50 | 51 | }else if (strpos($userIpAddresses['ip_address'], "172.16" ) === 0) { //need a solution to check for 17-31 52 | 53 | }else{ 54 | 55 | $userIpAddressesUrl = "http://www.geoplugin.net/xml.gp?ip=".$userIpAddresses['ip_address'].""; 56 | $userIpAddressesData = simplexml_load_file($userIpAddressesUrl) or die ("
    Cannot access http://www.geoplugin.net.
    "); 57 | 58 | $nrow[$i][] = $userIpAddresses['time']; 59 | $nrow[$i][] = $userIpAddresses['ip_address']; 60 | $nrow[$i][] = $userIpAddresses['play_count']; 61 | $nrow[$i][] = $userIpAddresses['platform']; 62 | 63 | if (empty($userIpAddressesData->geoplugin_city)) { 64 | $nrow[$i][] = "n/a"; 65 | $nrow[$i][] = ""; 66 | } else { 67 | $nrow[$i][] = $userIpAddressesData->geoplugin_city.", ".$userIpAddressesData->geoplugin_region; 68 | $nrow[$i][] = "https://maps.google.com/maps?q=".urlencode($userIpAddressesData->geoplugin_city.", ".$userIpAddressesData->geoplugin_region); 69 | } 70 | $i++; 71 | } 72 | } 73 | 74 | } 75 | 76 | $graph_data = array('data'=>$nrow); 77 | 78 | echo json_encode($graph_data, JSON_NUMERIC_CHECK); 79 | 80 | ?> -------------------------------------------------------------------------------- /datafactory/get-user-platform-stats.php: -------------------------------------------------------------------------------- 1 | 2 | escapeString($_POST['user']); 30 | } else { 31 | error_log('PlexWatchWeb :: POST parameter "user" not found.'); 32 | echo "user field is required."; 33 | exit; 34 | } 35 | 36 | $platformResults = $db->query ("SELECT xml,platform, COUNT(platform) as platform_count FROM ".$plexWatchDbTable." WHERE user = '$user' GROUP BY platform ORDER BY platform ASC") or die ("Failed to access plexWatch database. Please check your settings."); 37 | 38 | 39 | $platformImage = 0; 40 | while ($platformResultsRow = $platformResults->fetchArray()) { 41 | 42 | $platformXml = $platformResultsRow['xml']; 43 | $platformXmlField = simplexml_load_string($platformXml); 44 | 45 | 46 | if(strstr($platformXmlField->Player['platform'], 'Roku')) { 47 | $platformImage = "images/platforms/roku.png"; 48 | }else if(strstr($platformXmlField->Player['platform'], 'Apple TV')) { 49 | $platformImage = "images/platforms/appletv.png"; 50 | }else if(strstr($platformXmlField->Player['platform'], 'Firefox')) { 51 | $platformImage = "images/platforms/firefox.png"; 52 | }else if(strstr($platformXmlField->Player['platform'], 'Chromecast')) { 53 | $platformImage = "images/platforms/chromecast.png"; 54 | }else if(strstr($platformXmlField->Player['platform'], 'Chrome')) { 55 | $platformImage = "images/platforms/chrome.png"; 56 | }else if(strstr($platformXmlField->Player['platform'], 'Android')) { 57 | $platformImage = "images/platforms/android.png"; 58 | }else if(strstr($platformXmlField->Player['platform'], 'Nexus')) { 59 | $platformImage = "images/platforms/android.png"; 60 | }else if(strstr($platformXmlField->Player['platform'], 'iPad')) { 61 | $platformImage = "images/platforms/ios.png"; 62 | }else if(strstr($platformXmlField->Player['platform'], 'iPhone')) { 63 | $platformImage = "images/platforms/ios.png"; 64 | }else if(strstr($platformXmlField->Player['platform'], 'iOS')) { 65 | $platformImage = "images/platforms/ios.png"; 66 | }else if(strstr($platformXmlField->Player['platform'], 'Plex Home Theater')) { 67 | $platformImage = "images/platforms/pht.png"; 68 | }else if(strstr($platformXmlField->Player['platform'], 'Linux/RPi-XBMC')) { 69 | $platformImage = "images/platforms/xbmc.png"; 70 | }else if(strstr($platformXmlField->Player['platform'], 'Safari')) { 71 | $platformImage = "images/platforms/safari.png"; 72 | }else if(strstr($platformXmlField->Player['platform'], 'Internet Explorer')) { 73 | $platformImage = "images/platforms/ie.png"; 74 | }else if(strstr($platformXmlField->Player['platform'], 'Unknown Browser')) { 75 | $platformImage = "images/platforms/default.png"; 76 | }else if(strstr($platformXmlField->Player['platform'], 'Windows-XBMC')) { 77 | $platformImage = "images/platforms/xbmc.png"; 78 | }else if(strstr($platformXmlField->Player['platform'], 'Xbox')) { 79 | $platformImage = "images/platforms/xbox.png"; 80 | }else if(strstr($platformXmlField->Player['platform'], 'Samsung')) { 81 | $platformImage = "images/platforms/samsung.png"; 82 | }else if(empty($platformXmlField->Player['platform'])) { 83 | if(strstr($platformXmlField->Player['title'], 'Apple')) { 84 | $platformImage = "images/platforms/atv.png"; 85 | //Code below matches Samsung naming standard: [Display Technology: 2 Letters][Size: 2 digits][Generation: 1 letter][Model: 4 digits] 86 | }else if(preg_match("/TV [a-z][a-z]\d\d[a-z]\d\d\d\d/i",$platformXmlField->Player['title'])) { 87 | $platformImage = "images/platforms/samsung.png"; 88 | }else{ 89 | $platformImage = "images/platforms/default.png"; 90 | } 91 | } 92 | 93 | echo ""; 109 | } -------------------------------------------------------------------------------- /datafactory/index.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "flag" 6 | "fmt" 7 | "net/http" 8 | "os" 9 | "os/exec" 10 | "path/filepath" 11 | ) 12 | 13 | var ( 14 | listenAddress = flag.String("listen", "0.0.0.0:80", "Where the server listens for connections. [interface]:port") 15 | staticPath = flag.String("static", "../", "Location of static files.") 16 | scriptPath = flag.String("scripts", "./modules/shell_files", "Location of shell scripts used to gather stats.") 17 | ) 18 | 19 | func init() { 20 | flag.Parse() 21 | } 22 | 23 | func main() { 24 | http.Handle("/", http.FileServer(http.Dir(*staticPath))) 25 | http.HandleFunc("/datafactory/", func(w http.ResponseWriter, r *http.Request) { 26 | module := r.URL.Query().Get("module") 27 | script := filepath.Join(*scriptPath, module+".sh") 28 | if module == "" { 29 | http.Error(w, "No module specified, or requested module doesn't exist.", 406) 30 | return 31 | } 32 | 33 | // Execute the command 34 | cmd := exec.Command(script) 35 | var output bytes.Buffer 36 | cmd.Stdout = &output 37 | err := cmd.Run() 38 | if err != nil { 39 | fmt.Printf("Error executing '%s': %s\n\tScript output: %s\n", script, err.Error(), output.String()) 40 | http.Error(w, "Unable to execute module.", http.StatusInternalServerError) 41 | return 42 | } 43 | 44 | w.Write(output.Bytes()) 45 | }) 46 | 47 | fmt.Println("Starting http server at:", *listenAddress) 48 | err := http.ListenAndServe(*listenAddress, nil) 49 | if err != nil { 50 | fmt.Println("Error starting http server:", err) 51 | os.Exit(1) 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /datafactory/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
    94 | 95 |

    96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

    97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

    100 | 101 |

    102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

    105 | 106 |

    107 | Technical information:

    108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

    110 | *** root/ - 404, DateStamp 4e6b8559

    111 | 112 |

    113 | 114 | 115 |

    116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /datafactory/index.js: -------------------------------------------------------------------------------- 1 | var express = require('express'); 2 | var app = require('express')(); 3 | var server = require('http').Server(app); 4 | var path = require('path'); 5 | var spawn = require('child_process').spawn; 6 | var fs = require('fs'); 7 | var ws = require('websocket').server; 8 | 9 | server.listen(80); 10 | console.log('Linux Dash Server Started!'); 11 | 12 | app.use(express.static(path.resolve(__dirname + '/../'))); 13 | 14 | app.get('/', function (req, res) { 15 | res.sendFile(path.resolve(__dirname + '/../index.html')); 16 | }); 17 | 18 | app.get('/websocket', function (req, res) { 19 | res.status(200).send(""); 20 | }); 21 | 22 | wsServer = new ws({ 23 | httpServer: server 24 | }); 25 | 26 | wsServer.on('request', function(request) { 27 | var connection = request.accept('linux-dash', request.origin); 28 | connection.on('message', function(message) { 29 | if (message.type === 'utf8') { 30 | var req = JSON.parse(message.utf8Data) 31 | 32 | var shellFile = __dirname + '/modules/shell_files/' + req.module + '.sh'; 33 | 34 | if (req.module.indexOf('.') > -1 35 | || !req.module 36 | || !fs.existsSync(shellFile)) 37 | { 38 | res.sendStatus(406); 39 | return; 40 | } 41 | 42 | var command = spawn(shellFile, [ req.color || '' ]); 43 | var output = []; 44 | 45 | command.stdout.on('data', function(chunk) { 46 | output.push(chunk); 47 | }); 48 | 49 | command.on('close', function(code) { 50 | if (code === 0) { 51 | req.output = output.toString(); 52 | connection.sendUTF(JSON.stringify(req)); 53 | } 54 | }); 55 | } 56 | }); 57 | }); 58 | 59 | app.get('/datafactory/', function (req, res) { 60 | 61 | var shellFile = __dirname + '/modules/shell_files/' + req.query.module + '.sh'; 62 | 63 | if (req.query.module.indexOf('.') > -1 64 | || !req.query.module 65 | || !fs.existsSync(shellFile)) 66 | { 67 | res.sendStatus(406); 68 | return; 69 | } 70 | 71 | var command = spawn(shellFile, [ req.query.color || '' ]); 72 | var output = []; 73 | 74 | command.stdout.on('data', function(chunk) { 75 | output.push(chunk); 76 | }); 77 | 78 | command.on('close', function(code) { 79 | if (code === 0) res.send(output.toString()); 80 | else res.sendStatus(500); 81 | }); 82 | 83 | }); 84 | -------------------------------------------------------------------------------- /datafactory/index.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /datafactory/modules/cpu-utilization-chart.html: -------------------------------------------------------------------------------- 1 | 2 | 14 | 15 | -------------------------------------------------------------------------------- /datafactory/modules/disk-space.html: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 28 | 31 | 34 | 35 | 36 | 37 |
    NameStats% FullMount Path
    {{partition['file_system']}} 22 | 26 | 27 | 29 | {{ partition['used'] }} / {{ partition['size'] }} 30 | 32 | {{ partition['used%'] }} 33 | {{ partition['mounted'] }}
    38 | 39 |
    40 | -------------------------------------------------------------------------------- /datafactory/modules/download-transfer-rate.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /datafactory/modules/ram-chart.html: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/arp_cache.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | arpCommand=$(command -v arp) 4 | 5 | result=$($arpCommand | awk 'BEGIN {print "["} NR>1 \ 6 | {print "{ \"address\": \"" $1 "\", " \ 7 | "\"hw_type\": \"" $2 "\", " \ 8 | "\"hw_address\": \"" $3 "\", " \ 9 | "\"flags\": \"" $4 "\", " \ 10 | "\"mask\": \"" $5 "\" }, " \ 11 | } \ 12 | END {print "]"}' \ 13 | | /bin/sed 'N;$s/},/}/;P;D') 14 | 15 | if [ -z "$result" ]; then echo {} 16 | else echo $result 17 | fi -------------------------------------------------------------------------------- /datafactory/modules/shell_files/bandwidth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /bin/cat /proc/net/dev \ 3 | | awk 'BEGIN {print "["} NR>2 {print "{ \"interface\": \"" $1 "\"," \ 4 | " \"tx\": " $2 "," \ 5 | " \"rx\": " $10 " }," } END {print "]"}' \ 6 | | /bin/sed 'N;$s/,\n/\n/;P;D' 7 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/common_applications.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(whereis php node mysql mongo vim python ruby java apache2 nginx openssl vsftpd make \ 3 | | awk -F: '{if(length($2)==0) { installed="false"; } else { installed="true"; } \ 4 | print \ 5 | "{ \ 6 | \"binary\": \""$1"\", \ 7 | \"location\": \""$2"\", \ 8 | \"installed\": "installed" \ 9 | },"}') 10 | 11 | echo "[" ${result%?} "]" -------------------------------------------------------------------------------- /datafactory/modules/shell_files/cpu_info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | result=$(/usr/bin/lscpu \ 4 | | /usr/bin/awk -F: '{print "\""$1"\": \""$2"\"," } '\ 5 | ) 6 | 7 | echo "{" ${result%?} "}" -------------------------------------------------------------------------------- /datafactory/modules/shell_files/cpu_intensive_processes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | result=$(/bin/ps axo pid,user,pcpu,rss,vsz,comm --sort -pcpu,-rss,-vsz \ 4 | | head -n 15 \ 5 | | /usr/bin/awk 'BEGIN{OFS=":"} NR>1 {print "{ \"pid\": " $1 \ 6 | ", \"user\": \"" $2 "\"" \ 7 | ", \"cpu_percent\": " $3 \ 8 | ", \"rss\": " $4 \ 9 | ", \"vsz\": " $5 \ 10 | ", \"command\": \"" $6 "\"" "},"\ 11 | }') 12 | 13 | echo "[" ${result%?} "]" -------------------------------------------------------------------------------- /datafactory/modules/shell_files/cpu_utilization.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # by Paul Colby (http://colby.id.au), no rights reserved ;) 3 | 4 | PREV_TOTAL=0 5 | PREV_IDLE=0 6 | iteration=0 7 | 8 | while [[ iteration -lt 2 ]]; do 9 | # Get the total CPU statistics, discarding the 'cpu ' prefix. 10 | CPU=(`sed -n 's/^cpu\s//p' /proc/stat`) 11 | IDLE=${CPU[3]} # Just the idle CPU time. 12 | 13 | # Calculate the total CPU time. 14 | TOTAL=0 15 | for VALUE in "${CPU[@]}"; do 16 | let "TOTAL=$TOTAL+$VALUE" 17 | done 18 | 19 | # Calculate the CPU usage since we last checked. 20 | let "DIFF_IDLE=$IDLE-$PREV_IDLE" 21 | let "DIFF_TOTAL=$TOTAL-$PREV_TOTAL" 22 | let "DIFF_USAGE=(1000*($DIFF_TOTAL-$DIFF_IDLE)/$DIFF_TOTAL+5)/10" 23 | #echo -en "\rCPU: $DIFF_USAGE% \b\b" 24 | 25 | # Remember the total and idle CPU times for the next check. 26 | PREV_TOTAL="$TOTAL" 27 | PREV_IDLE="$IDLE" 28 | 29 | # Wait before checking again. 30 | sleep 1 31 | iteration="$iteration+1" 32 | done 33 | echo -en "$DIFF_USAGE" 34 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/cron_history.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | grepCmd=$(which grep) 4 | cronLog='/var/log/syslog' 5 | numberOfLines='50' 6 | 7 | # Month, Day, Time, Hostname, tag, user, 8 | 9 | result=$($grepCmd -m$numberOfLines CRON $cronLog \ 10 | | awk '{ s = ""; for (i = 6; i <= NF; i++) s = s $i " "; \ 11 | print "{\"time\" : \"" $1" "$2" "$3 "\"," \ 12 | "\"user\" : \"" $6 "\"," \ 13 | "\"message\" : \"" $5" "s "\"" \ 14 | "}," 15 | }' 16 | ) 17 | 18 | echo [${result%?}] -------------------------------------------------------------------------------- /datafactory/modules/shell_files/current_ram.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | freeCmd=`which free` 4 | awkCmd=`which awk` 5 | 6 | procps=$($freeCmd -V | /bin/grep procps-ng) 7 | 8 | if [ -z "$procps" ]; then 9 | $freeCmd -tmo | $awkCmd 'NR==2 {print "{ \"total\": " $2 ", \"used\": " $3-$6-$7 ", \"free\": " $4+$6+$7 " }"}' 10 | else 11 | $freeCmd -tm | $awkCmd 'NR==2 {print "{ \"total\": " $2 ", \"used\": " $3-$6-$7 ", \"free\": " $4+$6+$7 " }"}' 12 | fi 13 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/disk_partitions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(/bin/df -Ph | awk 'NR>1 {print "{\"file_system\": \"" $1 "\", \"size\": \"" $2 "\", \"used\": \"" $3 "\", \"avail\": \"" $4 "\", \"used%\": \"" $5 "\", \"mounted\": \"" $6 "\"},"}') 3 | 4 | echo [ ${result%?} ] -------------------------------------------------------------------------------- /datafactory/modules/shell_files/download_transfer_rate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=(/sys/class/net/*) 4 | pos=$(( ${#files[*]} - 1 )) 5 | last=${files[$pos]} 6 | 7 | json_output="{" 8 | 9 | for interface in "${files[@]}" 10 | do 11 | basename=$(basename "$interface") 12 | 13 | # find the number of bytes transfered for this interface 14 | in1=$(cat /sys/class/net/"$basename"/statistics/rx_bytes) 15 | 16 | # wait a second 17 | sleep 1 18 | 19 | # check same interface again 20 | in2=$(cat /sys/class/net/"$basename"/statistics/rx_bytes) 21 | 22 | # get the difference (transfer rate) 23 | in_bytes=$((in2 - in1)) 24 | 25 | # convert transfer rate to KB 26 | in_kbytes=$((in_bytes / 1024)) 27 | 28 | # convert transfer rate to KB 29 | json_output="$json_output \"$basename\": $in_kbytes" 30 | 31 | # if it is not the last line 32 | if [[ ! $interface == $last ]] 33 | then 34 | # add a comma to the line (JSON formatting) 35 | json_output="$json_output," 36 | fi 37 | done 38 | 39 | # close the JSON object & print to screen 40 | echo "$json_output}" 41 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/general_info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function displaytime { 4 | local T=$1 5 | local D=$((T/60/60/24)) 6 | local H=$((T/60/60%24)) 7 | local M=$((T/60%60)) 8 | local S=$((T%60)) 9 | [[ $D > 0 ]] && printf '%d days ' $D 10 | [[ $H > 0 ]] && printf '%d hours ' $H 11 | [[ $M > 0 ]] && printf '%d minutes ' $M 12 | [[ $D > 0 || $H > 0 || $M > 0 ]] && printf 'and ' 13 | printf '%d seconds\n' $S 14 | } 15 | 16 | os=$(/usr/bin/lsb_release -ds;/bin/uname -r | sed -e 's/^"//' -e 's/"$//') 17 | hostname=$(/bin/hostname) 18 | uptime_seconds=$(/bin/cat /proc/uptime | awk '{print $1}') 19 | server_time=$(date) 20 | 21 | echo { \ 22 | \"OS\": \"$os\", \ 23 | \"Hostname\": \"$hostname\", \ 24 | \"Uptime\": \" $(displaytime ${uptime_seconds%.*}) \", \ 25 | \"Server Time\": \"$server_time\" \ 26 | } -------------------------------------------------------------------------------- /datafactory/modules/shell_files/internet_speed.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SCRIPTPATH=`dirname $(readlink -f $0)` 4 | SPEED_TEST_SCRIPT=$SCRIPTPATH"/../python_files/speedtest_cli.py" 5 | 6 | $SPEED_TEST_SCRIPT \ 7 | | grep 'Upload\|Download' \ 8 | | awk 'BEGIN {print "{"} {print "\"" $1 "\": \"" $2 " " $3 "\"," } END {print "}"}' \ 9 | | /bin/sed 'N;$s/",/"/;P;D' -------------------------------------------------------------------------------- /datafactory/modules/shell_files/io_stats.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(/bin/cat /proc/diskstats | /usr/bin/awk \ 3 | '{ if($4==0 && $8==0 && $12==0 && $13==0) next } \ 4 | {print "{ \"device\": \"" $3 "\", \"reads\": \""$4"\", \"writes\": \"" $8 "\", \"in_progress\": \"" $12 "\", \"time_in_io\": \"" $13 "\"},"}' 5 | ) 6 | 7 | echo [ ${result%?} ] -------------------------------------------------------------------------------- /datafactory/modules/shell_files/ip_addresses.sh: -------------------------------------------------------------------------------- 1 | awkCmd=`which awk` 2 | grepCmd=`which grep` 3 | sedCmd=`which sed` 4 | ifconfigCmd=`which ifconfig` 5 | trCmd=`which tr` 6 | digCmd=`which dig` 7 | 8 | externalIp=`$digCmd +short myip.opendns.com @resolver1.opendns.com` 9 | 10 | $ifconfigCmd \ 11 | | $grepCmd -B1 "inet addr" \ 12 | | $awkCmd '{ if ( $1 == "inet" ) { print $2 } else if ( $2 == "Link" ) { printf "%s:" ,$1 } }' \ 13 | | $awkCmd -v exIp="$externalIp" -F: 'BEGIN {print "["} { print "{ \"interface\": \"" $1 "\", \"ip\": \"" $3 "\" },"} END {print "{ \"interface\": \"external\", \"ip\": \""exIp"\" } ]"}' \ 14 | | $trCmd -d '\r\n' 15 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/load_avg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | numberOfCores=$(/bin/grep -c 'model name' /proc/cpuinfo) 3 | 4 | if [ $numberOfCores -eq 0 ]; then 5 | numberOfCores=1 6 | fi 7 | 8 | result=$(/bin/cat /proc/loadavg | /usr/bin/awk '{print "{ \"1_min_avg\": " ($1*100)/'$numberOfCores' ", \"5_min_avg\": " ($2*100)/'$numberOfCores' ", \"15_min_avg\": " ($3*100)/'$numberOfCores' "}," }') 9 | 10 | echo ${result%?} -------------------------------------------------------------------------------- /datafactory/modules/shell_files/logged_in_users.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(COLUMNS=300 /usr/bin/w -h | /usr/bin/awk '{print "{\"user\": \"" $1 "\", \"from\": \"" $3 "\", \"when\": \"" $4 "\"},"}') 3 | 4 | echo [ ${result%?} ] -------------------------------------------------------------------------------- /datafactory/modules/shell_files/memcached.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "stats" \ 3 | | /bin/nc -w 1 127.0.0.1 11211 \ 4 | | /bin/grep 'bytes' \ 5 | | /usr/bin/awk 'BEGIN {print "{"} {print "\"" $2 "\": " $3 } END {print "}"}' \ 6 | | /usr/bin/tr '\r' ',' \ 7 | | /bin/sed 'N;$s/,\n/\n/;P;D' -------------------------------------------------------------------------------- /datafactory/modules/shell_files/memory_info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | /bin/cat /proc/meminfo \ 3 | | /usr/bin/awk -F: 'BEGIN {print "{"} {print "\"" $1 "\": \"" $2 "\"," } END {print "}"}' \ 4 | | /bin/sed 'N;$s/,\n/\n/;P;D' 5 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/network_connections.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | netstatCmd=`which netstat` 3 | awkCmd=`which awk` 4 | sortCmd=`which sort` 5 | uniqCmd=`which uniq` 6 | sedCmd=`which sed` 7 | 8 | $netstatCmd -ntu \ 9 | | $awkCmd 'NR>2 {print $5}' \ 10 | | $sortCmd \ 11 | | $uniqCmd -c \ 12 | | $awkCmd 'BEGIN {print "["} {print "{ \"connections\": " $1 ", \"address\": \"" $2 "\" }," } END {print "]"}' \ 13 | | $sedCmd 'N;$s/},/}/;P;D' 14 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/number_of_cpu_cores.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | numberOfCores=$(/bin/grep -c 'model name' /proc/cpuinfo) 4 | 5 | if [length($numberOfCores)]; then 6 | echo "cannnot be found"; 7 | fi -------------------------------------------------------------------------------- /datafactory/modules/shell_files/ping.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # http://askubuntu.com/questions/413367/ping-multiple-ips-using-bash 3 | 4 | # get absolute path to config file 5 | SCRIPTPATH=`dirname $(readlink -f $0)` 6 | CONFIG_PATH=$SCRIPTPATH"/../config/ping_hosts" 7 | 8 | catCmd=`which cat` 9 | pingCmd=`which ping` 10 | awkCmd=`which awk` 11 | sedCmd=`which sed` 12 | numOfLinesInConfig=`$sedCmd -n '$=' $CONFIG_PATH` 13 | result='[' 14 | 15 | { $catCmd $CONFIG_PATH; echo; } \ 16 | | while read output 17 | do 18 | singlePing=$($pingCmd -qc 2 $output \ 19 | | $awkCmd -F/ 'BEGIN { endLine="}," } /^rtt/ { if ('$numOfLinesInConfig'==1){endLine="}"} print "{" "\"host\": \"'$output'\", \"ping\": " $5 " " endLine }' \ 20 | ) 21 | numOfLinesInConfig=$(($numOfLinesInConfig-1)) 22 | result=$result$singlePing 23 | if [ $numOfLinesInConfig -eq 1 ] 24 | then 25 | echo $result"]" 26 | fi 27 | done \ 28 | | $sedCmd 's/\},]/}]/g' 29 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/ram_intensive_processes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(/bin/ps axo pid,user,pmem,rss,vsz,comm --sort -pmem,-rss,-vsz \ 3 | | head -n 15 \ 4 | | /usr/bin/awk 'NR>1 {print "{ \"pid\": " $1 \ 5 | ", \"user\": \"" $2 \ 6 | "\", \"mem_per\": " $3 \ 7 | ", \"rss\": " $4 \ 8 | ", \"vsz\": " $5 \ 9 | ", \"command\": \"" $6 \ 10 | "\"},"}') 11 | 12 | echo [ ${result%?} ] -------------------------------------------------------------------------------- /datafactory/modules/shell_files/recent_account_logins.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(/usr/bin/lastlog -t 365 \ 3 | | /usr/bin/awk 'NR>1 {\ 4 | print "{ \ 5 | \"user\": \"" $1 "\", \ 6 | \"ip\": \"" $3 "\","" \ 7 | \"date\": \"" $5" "$6" "$7" "$8" "$9 "\"}," 8 | }' 9 | ) 10 | echo [ ${result%?} ] -------------------------------------------------------------------------------- /datafactory/modules/shell_files/redis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ########### Enter Your Redis Password HERE ######### 4 | redisPassword='' 5 | ########### Enter Your Redis Password HERE ######### 6 | 7 | redisCommand=$(which redis-cli); 8 | 9 | if [ -n "$redisPassword" ]; then 10 | redisCommand="$redisCommand -a $redisPassword" 11 | fi 12 | 13 | result=$($redisCommand INFO \ 14 | | grep 'redis_version\|connected_clients\|connected_slaves\|used_memory_human\|total_connections_received\|total_commands_processed' \ 15 | | awk -F: '{print "\"" $1 "\":" "\"" $2 }' \ 16 | | tr '\r' '"' | tr '\n' ',' 17 | ) 18 | echo { ${result%?} } -------------------------------------------------------------------------------- /datafactory/modules/shell_files/scheduled_crons.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ###### 3 | # Credit: http://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users#answer-137173 4 | ###### 5 | 6 | catCmd=`which cat` 7 | awkCmd=`which awk` 8 | sedCmd=`which sed` 9 | egrepCmd=`which egrep` 10 | echoCmd=`which echo` 11 | crontabCmd=`which crontab` 12 | 13 | # System-wide crontab file and cron job directory. Change these for your system. 14 | CRONTAB='/etc/crontab' 15 | CRONDIR='/etc/cron.d' 16 | 17 | # Single tab character. Annoyingly necessary. 18 | tab=$(echo -en "\t") 19 | 20 | # Given a stream of crontab lines, exclude non-cron job lines, replace 21 | # whitespace characters with a single space, and remove any spaces from the 22 | # beginning of each line. 23 | function clean_cron_lines() { 24 | while read line ; do 25 | $echoCmd "${line}" | 26 | $egrepCmd --invert-match '^($|\s*#|\s*[[:alnum:]_]+=)' | 27 | $sedCmd --regexp-extended "s/\s+/ /g" | 28 | $sedCmd --regexp-extended "s/^ //" 29 | done; 30 | } 31 | 32 | # Given a stream of cleaned crontab lines, $echoCmd any that don't include the 33 | # run-parts command, and for those that do, show each job file in the run-parts 34 | # directory as if it were scheduled explicitly. 35 | function lookup_run_parts() { 36 | while read line ; do 37 | match=$($echoCmd "${line}" | $egrepCmd -o 'run-parts (-{1,2}\S+ )*\S+') 38 | 39 | if [[ -z "${match}" ]] ; then 40 | $echoCmd "${line}" 41 | else 42 | cron_fields=$($echoCmd "${line}" | cut -f1-6 -d' ') 43 | cron_job_dir=$($echoCmd "${match}" | awk '{print $NF}') 44 | 45 | if [[ -d "${cron_job_dir}" ]] ; then 46 | for cron_job_file in "${cron_job_dir}"/* ; do # */ 47 | [[ -f "${cron_job_file}" ]] && $echoCmd "${cron_fields} ${cron_job_file}" 48 | done 49 | fi 50 | fi 51 | done; 52 | } 53 | 54 | # Temporary file for crontab lines. 55 | temp=$(mktemp) || exit 1 56 | 57 | # Add all of the jobs from the system-wide crontab file. 58 | $catCmd "${CRONTAB}" | clean_cron_lines | lookup_run_parts >"${temp}" 59 | 60 | # Add all of the jobs from the system-wide cron directory. 61 | $catCmd "${CRONDIR}"/* | clean_cron_lines >>"${temp}" # */ 62 | 63 | # Add each user's crontab (if it exists). Insert the user's name between the 64 | # five time fields and the command. 65 | while read user ; do 66 | $crontabCmd -l -u "${user}" 2>/dev/null | 67 | clean_cron_lines | 68 | $sedCmd --regexp-extended "s/^((\S+ +){5})(.+)$/\1${user} \3/" >>"${temp}" 69 | done < <(cut --fields=1 --delimiter=: /etc/passwd) 70 | 71 | # Output the collected crontab lines. 72 | 73 | ## Changes: Parses output into JSON 74 | 75 | $catCmd "${temp}" \ 76 | | awk 'BEGIN {print "["} \ 77 | {print "{ \"min(s)\": \"" $1 \ 78 | "\", \"hours(s)\": \"" $2 "\", " \ 79 | " \"day(s)\": \"" $3 "\", " \ 80 | " \"month\": \"" $4 "\", " \ 81 | " \"weekday\": \"" $5 "\", " \ 82 | " \"user\": \"" $6 "\", " \ 83 | " \"command\": \"" $7$8$9$10 "\" " \ 84 | "}," } \ 85 | END {print "]"}' \ 86 | | $sedCmd 'N;$s/,\n/\n/;P;D' 87 | 88 | rm --force "${temp}" -------------------------------------------------------------------------------- /datafactory/modules/shell_files/swap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(/bin/cat /proc/swaps \ 3 | | /usr/bin/awk 'NR>1 {print "{ \"filename\": \"" $1"\", \"type\": \""$2"\", \"size\": \""$3"\", \"used\": \""$4"\", \"priority\": \""$5"\"}," }' 4 | ) 5 | echo [ ${result%?} ] -------------------------------------------------------------------------------- /datafactory/modules/shell_files/upload_transfer_rate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=(/sys/class/net/*) 4 | pos=$(( ${#files[*]} - 1 )) 5 | last=${files[$pos]} 6 | 7 | json_output="{" 8 | 9 | for interface in "${files[@]}" 10 | do 11 | basename=$(basename "$interface") 12 | 13 | # find the number of bytes transfered for this interface 14 | out1=$(cat /sys/class/net/"$basename"/statistics/tx_bytes) 15 | 16 | # wait a second 17 | sleep 1 18 | 19 | # check same interface again 20 | out2=$(cat /sys/class/net/"$basename"/statistics/tx_bytes) 21 | 22 | # get the difference (transfer rate) 23 | out_bytes=$((out2 - out1)) 24 | 25 | # convert transfer rate to KB 26 | out_kbytes=$((out_bytes / 1024)) 27 | 28 | # convert transfer rate to KB 29 | json_output="$json_output \"$basename\": $out_kbytes" 30 | 31 | # if it is not the last line 32 | if [[ ! $interface == $last ]] 33 | then 34 | # add a comma to the line (JSON formatting) 35 | json_output="$json_output," 36 | fi 37 | done 38 | 39 | # close the JSON object & print to screen 40 | echo "$json_output}" 41 | -------------------------------------------------------------------------------- /datafactory/modules/shell_files/user_accounts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | result=$(/usr/bin/awk -F: '{ \ 3 | if ($3<=499){userType="system";} \ 4 | else {userType="user";} \ 5 | print "{ \"type\": \"" userType "\"" ", \"user\": \"" $1 "\", \"home\": \"" $6 "\" }," }' < /etc/passwd 6 | ) 7 | 8 | length=$(echo ${#result}) 9 | 10 | if [ $length -eq 0 ]; then 11 | result=$(getent passwd | /usr/bin/awk -F: '{ if ($3<=499){userType="system";} else {userType="user";} print "{ \"type\": \"" userType "\"" ", \"user\": \"" $1 "\", \"home\": \"" $6 "\" }," }') 12 | fi 13 | 14 | echo [ ${result%?} ] -------------------------------------------------------------------------------- /datafactory/modules/upload-transfer-rate.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /datafactory/ping-speeds.html: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /datafactory/sections/accounts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /datafactory/sections/applications.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /datafactory/sections/basic-info.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /datafactory/sections/network.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /datafactory/sections/system-status.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /deleteStuff.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 ) { 33 | $db->query("DELETE FROM processed WHERE id=".$_POST['id']); 34 | } 35 | 36 | ?> 37 | -------------------------------------------------------------------------------- /font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/font/FontAwesome.otf -------------------------------------------------------------------------------- /font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /font/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
    94 | 95 |

    96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

    97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

    100 | 101 |

    102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

    105 | 106 |

    107 | Technical information:

    108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

    110 | *** root/ - 404, DateStamp 4e6b8559

    111 | 112 |

    113 | 114 | 115 |

    116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/background.png -------------------------------------------------------------------------------- /images/chevron.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/chevron.png -------------------------------------------------------------------------------- /images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/favicon.ico -------------------------------------------------------------------------------- /images/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /images/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/glyphicons-halflings.png -------------------------------------------------------------------------------- /images/glyphicons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/glyphicons.png -------------------------------------------------------------------------------- /images/gravatar-default-80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/gravatar-default-80x80.png -------------------------------------------------------------------------------- /images/gravatar-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/gravatar-default.png -------------------------------------------------------------------------------- /images/icon_ipad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/icon_ipad.png -------------------------------------------------------------------------------- /images/icon_ipad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/icon_ipad@2x.png -------------------------------------------------------------------------------- /images/icon_iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/icon_iphone.png -------------------------------------------------------------------------------- /images/icon_iphone@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/icon_iphone@2x.png -------------------------------------------------------------------------------- /images/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
    94 | 95 |

    96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

    97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

    100 | 101 |

    102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

    105 | 106 |

    107 | Technical information:

    108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

    110 | *** root/ - 404, DateStamp 4e6b8559

    111 | 112 |

    113 | 114 | 115 |

    116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /images/login.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/login.jpg -------------------------------------------------------------------------------- /images/logo-plexWatch-welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/logo-plexWatch-welcome.png -------------------------------------------------------------------------------- /images/logo-plexwatch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/logo-plexwatch.png -------------------------------------------------------------------------------- /images/logo-plexwatch@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/logo-plexwatch@2x.png -------------------------------------------------------------------------------- /images/platforms/android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/android.png -------------------------------------------------------------------------------- /images/platforms/atv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/atv.png -------------------------------------------------------------------------------- /images/platforms/chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/chrome.png -------------------------------------------------------------------------------- /images/platforms/chromecast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/chromecast.png -------------------------------------------------------------------------------- /images/platforms/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/default.png -------------------------------------------------------------------------------- /images/platforms/firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/firefox.png -------------------------------------------------------------------------------- /images/platforms/gtv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/gtv.png -------------------------------------------------------------------------------- /images/platforms/ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/ie.png -------------------------------------------------------------------------------- /images/platforms/ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/ios.png -------------------------------------------------------------------------------- /images/platforms/opera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/opera.png -------------------------------------------------------------------------------- /images/platforms/pht.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/pht.png -------------------------------------------------------------------------------- /images/platforms/platform-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-android.png -------------------------------------------------------------------------------- /images/platforms/platform-appletv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-appletv.png -------------------------------------------------------------------------------- /images/platforms/platform-atv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-atv.png -------------------------------------------------------------------------------- /images/platforms/platform-chrome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-chrome.png -------------------------------------------------------------------------------- /images/platforms/platform-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-default.png -------------------------------------------------------------------------------- /images/platforms/platform-firefox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-firefox.png -------------------------------------------------------------------------------- /images/platforms/platform-ie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-ie.png -------------------------------------------------------------------------------- /images/platforms/platform-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-ios.png -------------------------------------------------------------------------------- /images/platforms/platform-plex-ht.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-plex-ht.png -------------------------------------------------------------------------------- /images/platforms/platform-roku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-roku.png -------------------------------------------------------------------------------- /images/platforms/platform-safari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-safari.png -------------------------------------------------------------------------------- /images/platforms/platform-xbmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/platform-xbmc.png -------------------------------------------------------------------------------- /images/platforms/pmh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/pmh.png -------------------------------------------------------------------------------- /images/platforms/pms.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/pms.png -------------------------------------------------------------------------------- /images/platforms/roku.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/roku.png -------------------------------------------------------------------------------- /images/platforms/safari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/safari.png -------------------------------------------------------------------------------- /images/platforms/samsung.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/samsung.png -------------------------------------------------------------------------------- /images/platforms/wiiu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/wiiu.png -------------------------------------------------------------------------------- /images/platforms/win8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/win8.png -------------------------------------------------------------------------------- /images/platforms/wp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/wp.png -------------------------------------------------------------------------------- /images/platforms/xbmc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/platforms/xbmc.png -------------------------------------------------------------------------------- /images/poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/poster.png -------------------------------------------------------------------------------- /images/star-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/star-16.png -------------------------------------------------------------------------------- /images/star-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/star-32.png -------------------------------------------------------------------------------- /images/star-gray-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/star-gray-16.png -------------------------------------------------------------------------------- /images/star-gray-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tuxmi/plexWatchWeb-2.0/84700be62caf14e13bf720445018a731b4dcb5a1/images/star-gray-32.png -------------------------------------------------------------------------------- /includes/ConfigClass.php: -------------------------------------------------------------------------------- 1 | 2 | 2 | Failed to access Plex Media Server. Please check your settings.
    '); 14 | } 15 | }else{ 16 | $myPlexAuthToken = ''; 17 | if ($fileContents = file_get_contents("".$plexWatchPmsUrl."/status/sessions")) { 18 | $statusSessions = simplexml_load_string($fileContents) or die ('
    Failed to access Plex Media Server. Please check your settings.
    '); 19 | } 20 | } 21 | 22 | 23 | 24 | if ($statusSessions['size'] == '0') { 25 | echo "

    Current Activity

    "; 26 | }else{ 27 | echo "

    Current Activity ".$statusSessions['size']." user(s)

    "; 28 | } 29 | 30 | ?> -------------------------------------------------------------------------------- /includes/functions.php: -------------------------------------------------------------------------------- 1 | 2 | querySingle("SELECT json_pretty from config")) { 19 | if ($json = json_decode($result)) { 20 | $_SESSION['pwc'] = keysToLower($json); 21 | } 22 | } 23 | } 24 | if (isset($_SESSION['pwc'])) { 25 | return $_SESSION['pwc']; 26 | } 27 | } 28 | 29 | /* return friends name based on user/platform */ 30 | function FriendlyName($user,$platform = NULL) { 31 | $user = strtolower($user); 32 | $platform = strtolower($platform); 33 | 34 | $config = loadPwConfig(); 35 | if (is_object($config)) { 36 | $fn = $config->{'user_display'}; 37 | if (is_object($fn)) { 38 | if (isset($fn->{$user.'+'.$platform})) { 39 | //print "user+platform match"; 40 | return $fn->{$user.'+'.$platform}; 41 | } else if (isset($fn->{$user})) { 42 | //print "user match"; 43 | return $fn->{$user}; 44 | } 45 | } 46 | } 47 | return $user; 48 | } 49 | 50 | /* db connector */ 51 | function dbconnect() { 52 | global $plexWatch; 53 | 54 | if(!class_exists('SQLite3')) 55 | die("
    php5-sqlite is not installed. Please install this requirement and restart your webserver before continuing.
    "); 56 | 57 | $db = new SQLite3($plexWatch['plexWatchDb']); 58 | $db->busyTimeout(10*1000); 59 | return $db; 60 | 61 | } 62 | 63 | 64 | 65 | /* dbtable -- processed or grouped */ 66 | function dbTable() { 67 | global $plexWatch; 68 | if ($plexWatch['globalHistoryGrouping'] == "yes") { 69 | return "grouped"; 70 | } 71 | return "processed"; 72 | } 73 | 74 | 75 | 76 | /* function to lowercase all object keys. easier for matching */ 77 | function &keysToLower(&$obj){ 78 | $type = (int) is_object($obj) - (int) is_array($obj); 79 | if ($type === 0) return $obj; 80 | foreach ($obj as $key => &$val) { 81 | $element = keysToLower($val); 82 | switch ($type) { 83 | case 1: 84 | if (!is_int($key) && $key !== ($keyLowercase = strtolower($key))) { 85 | unset($obj->{$key}); 86 | $key = $keyLowercase; 87 | } 88 | $obj->{$key} = $element; 89 | break; 90 | case -1: 91 | if (!is_int($key) && $key !== ($keyLowercase = strtolower($key))) { 92 | unset($obj[$key]); 93 | $key = $keyLowercase; 94 | } 95 | $obj[$key] = $element; 96 | break; 97 | } 98 | } 99 | return $obj; 100 | } 101 | 102 | 103 | ?> -------------------------------------------------------------------------------- /includes/img.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /includes/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
    94 | 95 |

    96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

    97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

    100 | 101 |

    102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

    105 | 106 |

    107 | Technical information:

    108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

    110 | *** root/ - 404, DateStamp 4e6b8559

    111 | 112 |

    113 | 114 | 115 |

    116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /includes/myplex.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /includes/process_settings.php: -------------------------------------------------------------------------------- 1 | 2 | ") or die("Cannot write to file $file."); 60 | fclose($fp); 61 | 62 | sleep(1); 63 | 64 | //grab myPlex authentication token 65 | require_once(dirname(__FILE__) . '/myplex.php'); 66 | $myPlexToken = "\$plexWatch['myPlexAuthToken'] = '".$myPlexAuthToken."';"; 67 | 68 | //include authentication code in saved data 69 | $data = "$dateFormat\r$timeFormat\r$pmsIp\r$pmsHttpPort\r$plexWatchDb\r$myPlexUser\r$myPlexPass\r$myPlexToken\r$globalHistoryGrping\r$userHistoryGrping\r$chartsGrping"; 70 | 71 | //rewrite data to config.php 72 | $fp = fopen($file, "w+") or die("Cannot open file $file."); 73 | fwrite($fp, "") or die("Cannot write to file $file."); 77 | fclose($fp); 78 | 79 | // check if an error was found - if there was, send the user back to the form 80 | if (!empty($errorCode)) { 81 | header('Location: ../settings.php?e='.urlencode($errorCode)); exit; 82 | } 83 | 84 | // send the user back to the form 85 | header("Location: ../settings.php?s=".urlencode("Settings saved.")); exit; 86 | 87 | ?> -------------------------------------------------------------------------------- /includes/recently_added.php: -------------------------------------------------------------------------------- 1 | 2 | 0) { 11 | $containerSize = $tmp; 12 | if (!isset($singlerow)) { $containerSize = $containerSize*1; } 13 | } 14 | $containerSize = floor($containerSize); 15 | } 16 | 17 | /* needs some indentation fixing */ 18 | 19 | 20 | $plexWatchPmsUrl = "http://".$plexWatch['pmsIp'].":".$plexWatch['pmsHttpPort'].""; 21 | 22 | date_default_timezone_set(@date_default_timezone_get()); 23 | 24 | if (!empty($plexWatch['myPlexAuthToken'])) { 25 | $myPlexAuthToken = $plexWatch['myPlexAuthToken']; 26 | if ($fileContents = file_get_contents("".$plexWatchPmsUrl."/library/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=".$containerSize."&X-Plex-Token=".$myPlexAuthToken."")) { 27 | $recentRequest = simplexml_load_string($fileContents) or die ("
    Failed to access Plex Media Server. Please check your settings.
    "); 28 | } 29 | }else{ 30 | $myPlexAuthToken = ''; 31 | if ($fileContents = file_get_contents("".$plexWatchPmsUrl."/library/recentlyAdded?X-Plex-Container-Start=0&X-Plex-Container-Size=".$containerSize)) { 32 | $recentRequest = simplexml_load_string($fileContents) or die ("
    Failed to access Plex Media Server. Please check your settings.
    "); 33 | } 34 | 35 | } 36 | 37 | 38 | echo "
    "; 39 | echo ""; 111 | echo "
    "; 112 | echo ""; 113 | 114 | 115 | ?> 116 | -------------------------------------------------------------------------------- /includes/timeago.php: -------------------------------------------------------------------------------- 1 | 2 | = 60 && $difference<60*60) 28 | { 29 | $interval = "n"; 30 | } 31 | 32 | // If difference is between 1 hour and 24 hours 33 | // hours is a good interval 34 | elseif($difference >= 60*60 && $difference<60*60*24) 35 | { 36 | $interval = "h"; 37 | } 38 | 39 | // If difference is between 1 day and 7 days 40 | // days is a good interval 41 | elseif($difference >= 60*60*24 && $difference<60*60*24*7) 42 | { 43 | $interval = "d"; 44 | } 45 | 46 | // If difference is between 1 week and 30 days 47 | // weeks is a good interval 48 | elseif($difference >= 60*60*24*7 && $difference < 49 | 60*60*24*30) 50 | { 51 | $interval = "ww"; 52 | } 53 | 54 | // If difference is between 30 days and 365 days 55 | // months is a good interval, again, the same thing 56 | // applies, if the 29th February happens to exist 57 | // between your 2 dates, the function will return 58 | // the 'incorrect' value for a day 59 | elseif($difference >= 60*60*24*30 && $difference < 60 | 60*60*24*365) 61 | { 62 | $interval = "m"; 63 | } 64 | 65 | // If difference is greater than or equal to 365 66 | // days, return year. This will be incorrect if 67 | // for example, you call the function on the 28th April 68 | // 2008 passing in 29th April 2007. It will return 69 | // 1 year ago when in actual fact (yawn!) not quite 70 | // a year has gone by 71 | elseif($difference >= 60*60*24*365) 72 | { 73 | $interval = "y"; 74 | } 75 | 76 | // Based on the interval, determine the 77 | // number of units between the two dates 78 | // From this point on, you would be hard 79 | // pushed telling the difference between 80 | // this function and DateDiff. If the $datediff 81 | // returned is 1, be sure to return the singular 82 | // of the unit, e.g. 'day' rather 'days' 83 | 84 | switch($interval) 85 | { 86 | case "m": 87 | $months_difference = floor($difference / 60 / 60 / 24 / 88 | 29); 89 | while (mktime(date("H", $datefrom), date("i", $datefrom), 90 | date("s", $datefrom), date("n", $datefrom)+($months_difference), 91 | date("j", $dateto), date("Y", $datefrom)) < $dateto) 92 | { 93 | $months_difference++; 94 | } 95 | $datediff = $months_difference; 96 | 97 | // We need this in here because it is possible 98 | // to have an 'm' interval and a months 99 | // difference of 12 because we are using 29 days 100 | // in a month 101 | 102 | if($datediff==12) 103 | { 104 | $datediff--; 105 | } 106 | 107 | $res = ($datediff==1) ? "$datediff month ago" : "$datediff 108 | months ago"; 109 | break; 110 | 111 | case "y": 112 | $datediff = floor($difference / 60 / 60 / 24 / 365); 113 | $res = ($datediff==1) ? "$datediff year ago" : "$datediff 114 | years ago"; 115 | break; 116 | 117 | case "d": 118 | $datediff = floor($difference / 60 / 60 / 24); 119 | $res = ($datediff==1) ? "$datediff day ago" : "$datediff 120 | days ago"; 121 | break; 122 | 123 | case "ww": 124 | $datediff = floor($difference / 60 / 60 / 24 / 7); 125 | $res = ($datediff==1) ? "$datediff week ago" : "$datediff 126 | weeks ago"; 127 | break; 128 | 129 | case "h": 130 | $datediff = floor($difference / 60 / 60); 131 | $res = ($datediff==1) ? "$datediff hour ago" : "$datediff 132 | hours ago"; 133 | break; 134 | 135 | case "n": 136 | $datediff = floor($difference / 60); 137 | $res = ($datediff==1) ? "$datediff minute ago" : 138 | "$datediff minutes ago"; 139 | break; 140 | 141 | case "s": 142 | $datediff = $difference; 143 | $res = ($datediff==1) ? "$datediff second ago" : 144 | "$datediff seconds ago"; 145 | break; 146 | } 147 | return $res; 148 | } 149 | ?> 150 | -------------------------------------------------------------------------------- /js/cacher.js: -------------------------------------------------------------------------------- 1 | // check if browser supports session storage, if not log error in console. 2 | if(sessionStorage === null) console.log("Session storage not supported by this browser."); 3 | 4 | // get cache object 5 | var temp = sessionStorage.getItem('cacheObj'); 6 | var cacheObj = $.parseJSON(temp); 7 | 8 | // create cache object if it doesn't exist 9 | if (cacheObj === null) { 10 | var cacheObj = new Object(); 11 | } 12 | 13 | // setCache function 14 | // usage: setCache(unique_identifier, data_to_be_cached, minutes_to_remain_cached [optional, default = 60] ) 15 | function setCache(postId, postData, validityTime) { 16 | 17 | validityTime = typeof validityTime !== 'undefined' ? validityTime : 60; 18 | 19 | // get the current time 20 | var milliseconds = new Date().getTime(); 21 | 22 | if (cacheObj.length > 0) { 23 | 24 | var objectExists = false; 25 | 26 | //check if we already have this data stored and is current 27 | for (var i = 0; i < cacheObj.length; i++) { 28 | if (cacheObj[i].postId === postId) { 29 | objectExists = true; 30 | } 31 | } 32 | // add the data to the object if it's not there already 33 | if (!objectExists) { 34 | cacheObj.push( { postId: postId, data: postData, expire: (milliseconds + (validityTime * 60 * 1000)) } ); 35 | sessionStorage.setItem('cacheObj', JSON.stringify(cacheObj)); 36 | } 37 | } else { 38 | cacheObj = [ { postId: postId, data: postData, expire: (milliseconds + (validityTime * 60 * 1000)) } ]; 39 | sessionStorage.setItem('cacheObj', JSON.stringify(cacheObj)); 40 | } 41 | 42 | }; 43 | 44 | // getCache function 45 | // usage: getCache(unique_identifier) 46 | function getCache(postId) { 47 | 48 | // get the current time 49 | var milliseconds = new Date().getTime(); 50 | 51 | if (cacheObj.length > 0) { 52 | for (var i = 0; i < cacheObj.length; i++) { 53 | if (cacheObj[i].postId === postId) { 54 | // check if item has expired 55 | if (milliseconds < cacheObj[i].expire) { 56 | return cacheObj[i].data; 57 | } else { 58 | // if item expired then remove from cache object 59 | console.log('Object expired, destroying.'); 60 | cacheObj.splice(i, 1); 61 | } 62 | } 63 | } 64 | } 65 | return false; 66 | }; -------------------------------------------------------------------------------- /js/cpufunctions.js: -------------------------------------------------------------------------------- 1 | //php-cpu-monitor was developed by Steve Stone - zyk0tik@gmail.com 2 | //If you find this useful then please share it about to people who you think may also find use for it. 3 | //This program comes with absolutely no warranty and under no license. 4 | //If you think you can contribute to the codebase then please contact me! 5 | 6 | //Enables Tooltips using JQueryUI. 7 | $(function() { 8 | $( document ).tooltip({ 9 | track: true, 10 | show: false, 11 | hide: false 12 | }); 13 | }); 14 | //Enables Tabs using JQueryUI. 15 | $(function() { 16 | $( "#tabs" ).tabs(); 17 | }); 18 | 19 | var cpuUsage = new Array, ramUsage = new Array, cpuWidth = new Array, ramWidth = new Array, cpuCall = "0.5"; 20 | 21 | //Function to change how often the monitor is refreshed 22 | function changeSeconds(){ 23 | if ($("#radio1").attr("checked")) { 24 | cpuCall = "1"; 25 | $("#timeBox").html("1 Second"); 26 | }else if ($("#radio5").attr("checked")){ 27 | cpuCall = "5"; 28 | $("#timeBox").html("5 Seconds"); 29 | }else if ($("#radio01").attr("checked")){ 30 | cpuCall = "0.1"; 31 | $("#timeBox").html("0.1 Seconds"); 32 | }else if ($("#radio10").attr("checked")){ 33 | cpuCall = "10"; 34 | $("#timeBox").html("10 Seconds"); 35 | }else{ 36 | cpuCall = "0.5"; 37 | $("#timeBox").html("0.5 Seconds"); 38 | } 39 | } 40 | 41 | //Function to process data and draw the graph in the browser 42 | $(function replay(){ 43 | //Loads div with current CPU usage and does not continue with the function until it is complete. 44 | $("#cpu").load("cpu.php?cpu=" + cpuCall , function() { 45 | //Loads div with current RAM usage and does not continue with the function until it is complete. 46 | $("#ram").load("cpu.php", function(){ 47 | for (i=0; i<39; i++){ 48 | //Sets all values in an array with previous CPU and RAM information. This is done on a sliding scale so previous value for array[10] becomes the new value for array[9] and so on. 49 | cpuUsage[i] = cpuUsage[i + 1]; 50 | cpuWidth[i] = cpuWidth[i + 1]; 51 | ramUsage[i] = ramUsage[i + 1]; 52 | ramWidth[i] = ramWidth[i + 1]; 53 | } 54 | //Sets the values of the highest number in the array to the current value. Also sets the titles of things to current value and also tells it what height the bars in the graph should be. 55 | cpuUsage[39] = $("#cpu").html(); 56 | $("#cpuO").html(cpuUsage[39]); 57 | cpuWidth[39] = cpuUsage[39] * 2.3 + 5, 10; 58 | ramUsage[39] = $("#ram").html(); 59 | $("#ramO").html(ramUsage[39]); 60 | ramWidth[39] = ramUsage[39] * 2.3 + 5, 10; 61 | for(i=0; i<40; i++){ 62 | //Does all the changes of bar heights in the graph. the ,0 at the end means do it in 0 miliseconds. This can be changed if you want to see the bars slide up and down. 63 | $("#cpu" + i).animate({ 64 | height: cpuWidth[i] * 2.2, 65 | },0); 66 | $("#ram" + i).animate({ 67 | height: ramWidth[i] * 2.2, 68 | },0); 69 | $("#cpuO" + i).animate({ 70 | height: cpuWidth[i], 71 | },0); 72 | $("#ramO" + i).animate({ 73 | height: ramWidth[i], 74 | },0); 75 | //Sets all of the tooltips for the bars so when you highlight them it shows you what percentage was in use at that time. 76 | $("#cpu" + i).attr('title', cpuUsage[i] + '%'); 77 | $("#ram" + i).attr('title', ramUsage[i] + '%'); 78 | $("#cpuO" + i).attr('title', cpuUsage[i] + '%'); 79 | $("#ramO" + i).attr('title', ramUsage[i] + '%'); 80 | } 81 | //Once the function has completed it calls itself again. 82 | replay(); 83 | }); 84 | }); 85 | }); 86 | 87 | 88 | -------------------------------------------------------------------------------- /js/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 404 Not Found 5 | 6 | 7 | 8 | 16 | 89 | 90 | 91 | 92 | 93 | 404 Not Found
    94 | 95 |

    96 | Oh no a God damn 404 error has been detected and the PlexWatch v2.0 script has been shut down to prevent damage

    97 | 98 | This may be due to a simple server issue which we have little if any control but either way try to F5 or refresh your page. Failing that follow the link below back to the home page :) 99 |

    100 | 101 |

    102 | If problems continue, send us an email to notify us, save any open work you may have and restart your computer, then try again later. 103 | 104 |

    105 | 106 |

    107 | Technical information:

    108 | 109 | *** STOP: 0x00000050 (0xFD3094C2, 0x00000001, 0xFBFE7617, 0x00000000)

    110 | *** root/ - 404, DateStamp 4e6b8559

    111 | 112 |

    113 | 114 | 115 |

    116 | 117 | 118 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /js/jquery.dataTables.plugin.bootstrap_pagination.js: -------------------------------------------------------------------------------- 1 | /* API method to get paging information */ 2 | $.fn.dataTableExt.oApi.fnPagingInfo = function ( oSettings ) 3 | { 4 | return { 5 | "iStart": oSettings._iDisplayStart, 6 | "iEnd": oSettings.fnDisplayEnd(), 7 | "iLength": oSettings._iDisplayLength, 8 | "iTotal": oSettings.fnRecordsTotal(), 9 | "iFilteredTotal": oSettings.fnRecordsDisplay(), 10 | "iPage": oSettings._iDisplayLength === -1 ? 11 | 0 : Math.ceil( oSettings._iDisplayStart / oSettings._iDisplayLength ), 12 | "iTotalPages": oSettings._iDisplayLength === -1 ? 13 | 0 : Math.ceil( oSettings.fnRecordsDisplay() / oSettings._iDisplayLength ) 14 | }; 15 | } 16 | 17 | /* Bootstrap style pagination control */ 18 | $.extend( $.fn.dataTableExt.oPagination, { 19 | "bootstrap": { 20 | "fnInit": function( oSettings, nPaging, fnDraw ) { 21 | var oLang = oSettings.oLanguage.oPaginate; 22 | var fnClickHandler = function ( e ) { 23 | e.preventDefault(); 24 | if ( oSettings.oApi._fnPageChange(oSettings, e.data.action) ) { 25 | fnDraw( oSettings ); 26 | } 27 | }; 28 | 29 | $(nPaging).addClass('pagination').append( 30 | '' 34 | ); 35 | var els = $('a', nPaging); 36 | $(els[0]).bind( 'click.DT', { action: "previous" }, fnClickHandler ); 37 | $(els[1]).bind( 'click.DT', { action: "next" }, fnClickHandler ); 38 | }, 39 | 40 | "fnUpdate": function ( oSettings, fnDraw ) { 41 | var iListLength = 5; 42 | var oPaging = oSettings.oInstance.fnPagingInfo(); 43 | var an = oSettings.aanFeatures.p; 44 | var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2); 45 | 46 | if ( oPaging.iTotalPages < iListLength) { 47 | iStart = 1; 48 | iEnd = oPaging.iTotalPages; 49 | } 50 | else if ( oPaging.iPage <= iHalf ) { 51 | iStart = 1; 52 | iEnd = iListLength; 53 | } else if ( oPaging.iPage >= (oPaging.iTotalPages-iHalf) ) { 54 | iStart = oPaging.iTotalPages - iListLength + 1; 55 | iEnd = oPaging.iTotalPages; 56 | } else { 57 | iStart = oPaging.iPage - iHalf + 1; 58 | iEnd = iStart + iListLength - 1; 59 | } 60 | 61 | for ( i=0, iLen=an.length ; i'+j+'') 69 | .insertBefore( $('li:last', an[i])[0] ) 70 | .bind('click', function (e) { 71 | e.preventDefault(); 72 | oSettings._iDisplayStart = (parseInt($('a', this).text(),10)-1) * oPaging.iLength; 73 | fnDraw( oSettings ); 74 | } ); 75 | } 76 | 77 | // Add / remove disabled classes from the static elements 78 | if ( oPaging.iPage === 0 ) { 79 | $('li:first', an[i]).addClass('disabled'); 80 | } else { 81 | $('li:first', an[i]).removeClass('disabled'); 82 | } 83 | 84 | if ( oPaging.iPage === oPaging.iTotalPages-1 || oPaging.iTotalPages === 0 ) { 85 | $('li:last', an[i]).addClass('disabled'); 86 | } else { 87 | $('li:last', an[i]).removeClass('disabled'); 88 | } 89 | } 90 | } 91 | } 92 | } ); -------------------------------------------------------------------------------- /js/jquery.dataTables.plugin.date_sorting.js: -------------------------------------------------------------------------------- 1 | $.fn.dataTableExt.afnSortData['dom-data-order'] = function ( oSettings, iColumn ) 2 | { 3 | return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) { 4 | return $('td:eq('+iColumn+')', tr).attr('data-order'); 5 | } ); 6 | } -------------------------------------------------------------------------------- /js/jquery.rateit.min.js: -------------------------------------------------------------------------------- 1 | (function(n){function t(n){var u=n.originalEvent.changedTouches,t=u[0],i="",r;switch(n.type){case"touchmove":i="mousemove";break;case"touchend":i="mouseup";break;default:return}r=document.createEvent("MouseEvent"),r.initMouseEvent(i,!0,!0,window,1,t.screenX,t.screenY,t.clientX,t.clientY,!1,!1,!1,!1,0,null),t.target.dispatchEvent(r),n.preventDefault()}n.rateit={aria:{resetLabel:"reset rating",ratingLabel:"rating"}},n.fn.rateit=function(i,r){var e=1,u={},o="init",s=function(n){return n.charAt(0).toUpperCase()+n.substr(1)},f;if(this.length==0)return this;if(f=n.type(i),f=="object"||i===undefined||i==null)u=n.extend({},n.fn.rateit.defaults,i);else{if(f=="string"&&r===undefined)return this.data("rateit"+s(i));f=="string"&&(o="setvalue")}return this.each(function(){var c=n(this),f=function(n,t){if(t!=null){var i="aria-value"+(n=="value"?"now":n),r=c.find(".rateit-range");r.attr(i)!=undefined&&r.attr(i,t)}return arguments[0]="rateit"+s(n),c.data.apply(c,arguments)},v,h,b,k,l,y,p,a;if(c.hasClass("rateit")||c.addClass("rateit"),v=c.css("direction")!="rtl",o=="setvalue"){if(!f("init"))throw"Can't set value before init";i!="readonly"||r!=!0||f("readonly")||(c.find(".rateit-range").unbind(),f("wired",!1)),i=="value"&&(r=r==null?f("min"):Math.max(f("min"),Math.min(f("max"),r))),f("backingfld")&&(h=n(f("backingfld")),i=="value"&&h.val(r),i=="min"&&h[0].min&&(h[0].min=r),i=="max"&&h[0].max&&(h[0].max=r),i=="step"&&h[0].step&&(h[0].step=r)),f(i,r)}f("init")||(f("min",f("min")||u.min),f("max",f("max")||u.max),f("step",f("step")||u.step),f("readonly",f("readonly")!==undefined?f("readonly"):u.readonly),f("resetable",f("resetable")!==undefined?f("resetable"):u.resetable),f("backingfld",f("backingfld")||u.backingfld),f("starwidth",f("starwidth")||u.starwidth),f("starheight",f("starheight")||u.starheight),f("value",Math.max(f("min"),Math.min(f("max"),f("value")||u.value||u.min))),f("ispreset",f("ispreset")!==undefined?f("ispreset"):u.ispreset),f("backingfld")&&(h=n(f("backingfld")),f("value",h.hide().val()),(h.attr("disabled")||h.attr("readonly"))&&f("readonly",!0),h[0].nodeName=="INPUT"&&(h[0].type=="range"||h[0].type=="text")&&(f("min",parseInt(h.attr("min"))||f("min")),f("max",parseInt(h.attr("max"))||f("max")),f("step",parseInt(h.attr("step"))||f("step"))),h[0].nodeName=="SELECT"&&h[0].options.length>1&&(f("min",Number(h[0].options[0].value)),f("max",Number(h[0].options[h[0].length-1].value)),f("step",Number(h[0].options[1].value)-Number(h[0].options[0].value)))),b=c[0].nodeName=="DIV"?"div":"span",e++,k='