diff --git a/main/views.py b/main/views.py index eb32022..0d8150f 100755 --- a/main/views.py +++ b/main/views.py @@ -1,35 +1,35 @@ -#The MIT License (MIT) +# The MIT License (MIT) # -#Copyright (c) 2014 Florian Neagu - michaelneagu@gmail.com - https://github.com/k3oni/ +# Copyright (c) 2014 Florian Neagu - michaelneagu@gmail.com - https://github.com/k3oni/ # -#Permission is hereby granted, free of charge, to any person obtaining a copy -#of this software and associated documentation files (the "Software"), to deal -#in the Software without restriction, including without limitation the rights -#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -#copies of the Software, and to permit persons to whom the Software is -#furnished to do so, subject to the following conditions: +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -#The above copyright notice and this permission notice shall be included in all -#copies or substantial portions of the Software. +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. # -#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -#SOFTWARE. - -import platform, os, multiprocessing, json - +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import platform +import os +import multiprocessing from datetime import timedelta from django.contrib.auth.decorators import login_required -from django.core import serializers from django.shortcuts import render_to_response -from django.http import HttpResponseRedirect, HttpResponse +from django.http import HttpResponseRedirect from django.template import RequestContext -from django.utils.translation import ugettext_lazy as _ + from pydash.settings import TIME_JS_REFRESH, TIME_JS_REFRESH_LONG, TIME_JS_REFRESH_NET, VERSION time_refresh = TIME_JS_REFRESH @@ -37,6 +37,7 @@ time_refresh_long = TIME_JS_REFRESH_LONG time_refresh_net = TIME_JS_REFRESH_NET version = VERSION + @login_required(login_url='/login/') def index(request): """ @@ -48,20 +49,21 @@ def index(request): def chunks(get, n): - return [get[i:i+n] for i in range(0, len(get), n)] + return [get[i:i + n] for i in range(0, len(get), n)] + def get_uptime(): """ Get uptime """ - try: - with open('/proc/uptime', 'r') as f: - uptime_seconds = float(f.readline().split()[0]) - uptime_time = str(timedelta(seconds = uptime_seconds)) - data = uptime_time.split('.', 1)[0] - - except Exception,err: - data = str(err) + try: + with open('/proc/uptime', 'r') as f: + uptime_seconds = float(f.readline().split()[0]) + uptime_time = str(timedelta(seconds=uptime_seconds)) + data = uptime_time.split('.', 1)[0] + + except Exception, err: + data = str(err) return data @@ -73,7 +75,7 @@ def get_ipaddress(): data = [] try: eth = os.popen("ip addr | grep LOWER_UP | awk '{print $2}'") - iface = eth.read().strip().replace(':','').split('\n') + iface = eth.read().strip().replace(':', '').split('\n') eth.close() del iface[0] @@ -82,7 +84,7 @@ def get_ipaddress(): data1 = pipe.read().strip().split('\n') pipe.close() if len(data1) == 2: - data1.append('unavailable', 'unavailable') + data1.append('unavailable') if len(data1) == 3: data1.append('unavailable') data1[0] = i @@ -92,199 +94,207 @@ def get_ipaddress(): data = ips - except Exception,err: - data = str(err) + except Exception, err: + data = str(err) return data + def get_cpus(): """ Get the number of CPUs and model/type """ try: - pipe = os.popen("cat /proc/cpuinfo |" + "grep 'model name'") - data = pipe.read().strip().split(':')[-1] - pipe.close() - - if not data: - pipe = os.popen("cat /proc/cpuinfo |" + "grep 'Processor'") - data = pipe.read().strip().split(':')[-1] - pipe.close() - - cpus = multiprocessing.cpu_count() - - data = {'cpus': cpus, 'type': data} - + pipe = os.popen("cat /proc/cpuinfo |" + "grep 'model name'") + data = pipe.read().strip().split(':')[-1] + pipe.close() + + if not data: + pipe = os.popen("cat /proc/cpuinfo |" + "grep 'Processor'") + data = pipe.read().strip().split(':')[-1] + pipe.close() + + cpus = multiprocessing.cpu_count() + + data = {'cpus': cpus, 'type': data} + except Exception, err: - data = str(err) - + data = str(err) + return data - + + def get_users(): """ Get the current logged in users """ try: - pipe = os.popen("who |" + "awk '{print $1, $2, $6}'") - data = pipe.read().strip().split('\n') - pipe.close() - - if data == [""]: - data = None - else: - data = [i.split(None, 3) for i in data] - + pipe = os.popen("who |" + "awk '{print $1, $2, $6}'") + data = pipe.read().strip().split('\n') + pipe.close() + + if data == [""]: + data = None + else: + data = [i.split(None, 3) for i in data] + except Exception, err: - data = str(err) - + data = str(err) + return data - + + def get_traffic(request): """ Get the traffic for the specified interface """ try: - pipe = os.popen("cat /proc/net/dev |" + "grep " + request + "| awk '{print $1, $9}'") - data = pipe.read().strip().split(':',1)[-1] - pipe.close() - - if not data[0].isdigit(): - pipe = os.popen("cat /proc/net/dev |" + "grep " + request + "| awk '{print $2, $10}'") - data = pipe.read().strip().split(':',1)[-1] - pipe.close() - - data = data.split() - - traffic_in = int(data[0]) - traffic_out = int(data[1]) - - all_traffic = {'traffic_in': traffic_in, 'traffic_out': traffic_out} - - data = all_traffic - - except Exception,err: - data = str(err) - + pipe = os.popen("cat /proc/net/dev |" + "grep " + request + "| awk '{print $1, $9}'") + data = pipe.read().strip().split(':', 1)[-1] + pipe.close() + + if not data[0].isdigit(): + pipe = os.popen("cat /proc/net/dev |" + "grep " + request + "| awk '{print $2, $10}'") + data = pipe.read().strip().split(':', 1)[-1] + pipe.close() + + data = data.split() + + traffic_in = int(data[0]) + traffic_out = int(data[1]) + + all_traffic = {'traffic_in': traffic_in, 'traffic_out': traffic_out} + + data = all_traffic + + except Exception, err: + data = str(err) + return data + def get_platform(): """ Get the OS name, hostname and kernel """ try: - osname = " ".join(platform.linux_distribution()) - uname = platform.uname() - - if osname == ' ': - osname = uname[0] - - data = {'osname': osname, 'hostname': uname[1], 'kernel': uname[2] } - - except Exception,err: - data = str(err) + osname = " ".join(platform.linux_distribution()) + uname = platform.uname() + + if osname == ' ': + osname = uname[0] + + data = {'osname': osname, 'hostname': uname[1], 'kernel': uname[2]} + + except Exception, err: + data = str(err) return data - + + def get_disk(): """ Get disk usage """ try: - pipe = os.popen("df -Ph | " + "grep -v Filesystem | " + "awk '{print $1, $2, $3, $4, $5, $6}'") - data = pipe.read().strip().split('\n') - pipe.close() - - data = [i.split(None, 6) for i in data] - - except Exception,err: - data = str(err) - + pipe = os.popen("df -Ph | " + "grep -v Filesystem | " + "awk '{print $1, $2, $3, $4, $5, $6}'") + data = pipe.read().strip().split('\n') + pipe.close() + + data = [i.split(None, 6) for i in data] + + except Exception, err: + data = str(err) + return data + def get_disk_rw(): """ Get the disk reads and writes """ try: - pipe = os.popen("cat /proc/partitions | grep -v 'major' | awk '{print $4}'") - data = pipe.read().strip().split('\n') - pipe.close() - - rws = [] - for i in data: - if i.isalpha(): - pipe = os.popen("cat /proc/diskstats | grep -w '" + i + "'|awk '{print $4, $8}'") - rw = pipe.read().strip().split() - pipe.close() - - rws.append([i, rw[0], rw[1]]) - - if not rws: - pipe = os.popen("cat /proc/diskstats | grep -w '" + data[0] + "'|awk '{print $4, $8}'") - rw = pipe.read().strip().split() - pipe.close() - - rws.append([data[0], rw[0], rw[1]]) - - data = rws - - except Exception,err: - data = str(err) - + pipe = os.popen("cat /proc/partitions | grep -v 'major' | awk '{print $4}'") + data = pipe.read().strip().split('\n') + pipe.close() + + rws = [] + for i in data: + if i.isalpha(): + pipe = os.popen("cat /proc/diskstats | grep -w '" + i + "'|awk '{print $4, $8}'") + rw = pipe.read().strip().split() + pipe.close() + + rws.append([i, rw[0], rw[1]]) + + if not rws: + pipe = os.popen("cat /proc/diskstats | grep -w '" + data[0] + "'|awk '{print $4, $8}'") + rw = pipe.read().strip().split() + pipe.close() + + rws.append([data[0], rw[0], rw[1]]) + + data = rws + + except Exception, err: + data = str(err) + return data + def get_mem(): """ Get memory usage """ try: - pipe = os.popen("free -tmo | " + "grep 'Mem' | " + "awk '{print $2,$4}'") - data = pipe.read().strip().split() - pipe.close() - - allmem = int(data[0]) - freemem = int(data[1]) - - percent = (100 - ((freemem * 100) / allmem)) - usage = (allmem - freemem) - - mem_usage = {'usage': usage, 'free': freemem, 'percent': percent} - - data = mem_usage - - except Exception,err: - data = str(err) - + pipe = os.popen("free -tmo | " + "grep 'Mem' | " + "awk '{print $2,$4}'") + data = pipe.read().strip().split() + pipe.close() + + allmem = int(data[0]) + freemem = int(data[1]) + + percent = (100 - ((freemem * 100) / allmem)) + usage = (allmem - freemem) + + mem_usage = {'usage': usage, 'free': freemem, 'percent': percent} + + data = mem_usage + + except Exception, err: + data = str(err) + return data - + + def get_cpu_usage(): """ Get the CPU usage and running processes """ - try: - pipe = os.popen("ps aux --sort -%cpu,-rss") - data = pipe.read().strip().split('\n') - pipe.close() - - usage = [i.split(None, 10) for i in data] - del usage[0] - - total_usage = [] - - for element in usage: - usage_cpu = element[2] - total_usage.append(usage_cpu) - - total_usage = sum(float(i) for i in total_usage) - - total_free = ((100 * int(get_cpus()['cpus'])) - float(total_usage)) - - cpu_used = {'free': total_free, 'used': float(total_usage), 'all': usage} - - data = cpu_used - - except Exception,err: - data = str(err) + try: + pipe = os.popen("ps aux --sort -%cpu,-rss") + data = pipe.read().strip().split('\n') + pipe.close() + + usage = [i.split(None, 10) for i in data] + del usage[0] + + total_usage = [] + + for element in usage: + usage_cpu = element[2] + total_usage.append(usage_cpu) + + total_usage = sum(float(i) for i in total_usage) + + total_free = ((100 * int(get_cpus()['cpus'])) - float(total_usage)) + + cpu_used = {'free': total_free, 'used': float(total_usage), 'all': usage} + + data = cpu_used + + except Exception, err: + data = str(err) return data @@ -300,28 +310,29 @@ def get_load(): return data + def get_netstat(): """ Get ports and applications """ try: - pipe = os.popen("ss -tnp | grep ESTAB | awk '{print $4, $5}'| sed 's/::ffff://g' | awk -F: '{print $1, $2}' | awk 'NF > 0' | sort -n | uniq -c") + pipe = os.popen( + "ss -tnp | grep ESTAB | awk '{print $4, $5}'| sed 's/::ffff://g' | awk -F: '{print $1, $2}' " + "| awk 'NF > 0' | sort -n | uniq -c") data = pipe.read().strip().split('\n') pipe.close() - + data = [i.split(None, 4) for i in data] - + except Exception, err: data = str(err) - + return data @login_required(login_url='/login/') def getall(request): - return render_to_response('main.html', {'time_refresh': time_refresh, - 'time_refresh_long': time_refresh_long, - 'time_refresh_net': time_refresh_net, - 'version': version - }, context_instance=RequestContext(request)) + 'time_refresh_long': time_refresh_long, + 'time_refresh_net': time_refresh_net, + 'version': version}, context_instance=RequestContext(request)) diff --git a/pydash/settings.py b/pydash/settings.py index b8942ff..ea5095a 100644 --- a/pydash/settings.py +++ b/pydash/settings.py @@ -10,9 +10,10 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os + BASE_DIR = os.path.dirname(os.path.dirname(__file__)) -#SITE_ID = 1 +# SITE_ID = 1 # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ @@ -93,7 +94,7 @@ TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.Loader', - ) +) TEMPLATE_DIRS = (os.path.join(BASE_DIR, 'templates'),) @@ -118,19 +119,19 @@ LOGGING = { 'filters': { 'require_debug_false': { '()': 'django.utils.log.RequireDebugFalse' - } + } }, 'handlers': { 'mail_admins': { 'level': 'ERROR', - 'filters': ['require_debug_false'], + 'filters': ['require_debug_false'], 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { - 'django.request': { + 'django.request': { 'handlers': ['mail_admins'], - 'level': 'ERROR', + 'level': 'ERROR', 'propagate': True, }, } diff --git a/pydash/urls.py b/pydash/urls.py index 9841377..7597e6d 100644 --- a/pydash/urls.py +++ b/pydash/urls.py @@ -1,34 +1,35 @@ from django.conf.urls import patterns, url from django.conf import settings -#from django.contrib import admin -#admin.autodiscover() +# from django.contrib import admin +# admin.autodiscover() urlpatterns = patterns('', - # Examples: - # url(r'^$', 'pydash.views.home', name='home'), - # url(r'^blog/', include('blog.urls')), + # Examples: + # url(r'^$', 'pydash.views.home', name='home'), + # url(r'^blog/', include('blog.urls')), - #url(r'^admin/', include(admin.site.urls)), - url(r'^$', 'main.views.index', name='index'), - url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name='login'), - url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, name='logout'), - url(r'^main/$', 'main.views.getall', name='main'), - url(r'^info/uptime/$', 'usage.views.uptime', name='uptime'), - url(r'^info/memory/$', 'usage.views.memusage', name='memusage'), - url(r'^info/cpuusage/$', 'usage.views.cpuusage', name='cpuusage'), - url(r'^info/getdisk/$', 'usage.views.getdisk', name='getdisk'), - url(r'^info/getusers/$', 'usage.views.getusers', name='getusers'), - url(r'^info/getips/$', 'usage.views.getips', name='getips'), - url(r'^info/gettraffic/$', 'usage.views.gettraffic', name='gettraffic'), - url(r'^info/proc/$', 'usage.views.getproc', name='getproc'), - url(r'^info/getdiskio/$', 'usage.views.getdiskio', name='getdiskio'), - url(r'^info/loadaverage/$', 'usage.views.loadaverage', name='loadaverage'), - url(r'^info/platform/([\w\-\.]+)/$', 'usage.views.platform', name='platform'), - url(r'^info/getcpus/([\w\-\.]+)/$', 'usage.views.getcpus', name='getcpus'), - url(r'^info/getnetstat/$', 'usage.views.getnetstat', name='getnetstat') -) + # url(r'^admin/', include(admin.site.urls)), + url(r'^$', 'main.views.index', name='index'), + url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, + name='login'), + url(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': 'logout.html'}, + name='logout'), + url(r'^main/$', 'main.views.getall', name='main'), + url(r'^info/uptime/$', 'usage.views.uptime', name='uptime'), + url(r'^info/memory/$', 'usage.views.memusage', name='memusage'), + url(r'^info/cpuusage/$', 'usage.views.cpuusage', name='cpuusage'), + url(r'^info/getdisk/$', 'usage.views.getdisk', name='getdisk'), + url(r'^info/getusers/$', 'usage.views.getusers', name='getusers'), + url(r'^info/getips/$', 'usage.views.getips', name='getips'), + url(r'^info/gettraffic/$', 'usage.views.gettraffic', name='gettraffic'), + url(r'^info/proc/$', 'usage.views.getproc', name='getproc'), + url(r'^info/getdiskio/$', 'usage.views.getdiskio', name='getdiskio'), + url(r'^info/loadaverage/$', 'usage.views.loadaverage', name='loadaverage'), + url(r'^info/platform/([\w\-\.]+)/$', 'usage.views.platform', name='platform'), + url(r'^info/getcpus/([\w\-\.]+)/$', 'usage.views.getcpus', name='getcpus'), + url(r'^info/getnetstat/$', 'usage.views.getnetstat', name='getnetstat')) urlpatterns += patterns('', - (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}), -) + (r'^static/(?P.*)$', 'django.views.static.serve', + {'document_root': settings.STATIC_ROOT})) diff --git a/static/css/dashboard.css b/static/css/dashboard.css index 5ade332..11dfca5 100644 --- a/static/css/dashboard.css +++ b/static/css/dashboard.css @@ -116,9 +116,8 @@ Bootstrap Admin Template by EGrappler.com .news-items li { display: table; - padding: 0 2em 0 1.5em; - padding-bottom: 1em; - margin-bottom: 1em; + padding: 0 2em 1em 1.5em; + margin-bottom: 1em; border-bottom: 1px dotted #CCC; } @@ -190,7 +189,7 @@ Bootstrap Admin Template by EGrappler.com } .action-table .td-actions .btn:last-child { - margin-rigth: 0; + margin-right: 0; } @@ -221,10 +220,9 @@ Bootstrap Admin Template by EGrappler.com #big_stats .stat i { color:#19bc9c; } h6.bigstats { - margin: 20px; - border-bottom: 1px solid #eee; + border-bottom: 1px solid #eee; padding-bottom: 20px; - margin-bottom: 26px; + margin: 20px 20px 26px; } #big_stats .stat:first-child { @@ -318,9 +316,9 @@ h6.bigstats { } } -.widget-content { padding:0px; } +.widget-content { padding:0; } .dataTables_length { display:none; } -.dataTable { margin-bottom:0px; } +.dataTable { margin-bottom:0; } .pulse { background:#19bc9c; @@ -351,71 +349,55 @@ h6.bigstats { } .dataTables_paginate{ width:100%; text-align:center; margin-top:10px; margin-left:-30px;} .dataTables_paginate a{ margin-left:8px;} -.dataTables_paginate a:hover{ pointer:pointer;} -.navbar-fixed-top{ margin-left:0px;} +.dataTables_paginate a:hover{ cursor:pointer;} +.navbar-fixed-top{ margin-left:0;} .widget-search{display: inline-block; vertical-align: middle; margin: 0 6px; width: 200px;} .netin { - border-color: rgb(105,210,231); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(105, 210, 231); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } .netout { - border-color: rgb(227,48,81); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(227, 48, 81); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } .cpuu { - border-color: rgb(247,70,74); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(247, 70, 74); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } .cpuf { - border-color: rgb(10,209,27); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(10, 209, 27); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } .diskr { - border-color: rgb(245,134,15); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(245, 134, 15); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } .diskw { - border-color: rgb(15,103,245); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(15, 103, 245); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } .memf { - border-color: rgb(43,214,66); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(43, 214, 66); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } .memu { - border-color: rgb(249,134,33); margin: 0.5em; - border-style: solid; - border-width: 0 0 0 1em; + border: 0 solid rgb(249, 134, 33); + border-left-width: 1em; padding: 0 0.3em; - border-style: solid; } diff --git a/static/css/font-awesome.css b/static/css/font-awesome.css index da28a95..eb4127b 100644 --- a/static/css/font-awesome.css +++ b/static/css/font-awesome.css @@ -1,145 +1,69 @@ /*! - * Font Awesome 3.2.1 - * the iconic font designed for Bootstrap - * ------------------------------------------------------------------------------ - * The full suite of pictographic icons, examples, and documentation can be - * found at http://fontawesome.io. Stay up to date on Twitter at - * http://twitter.com/fontawesome. - * - * License - * ------------------------------------------------------------------------------ - * - The Font Awesome font is licensed under SIL OFL 1.1 - - * http://scripts.sil.org/OFL - * - Font Awesome CSS, LESS, and SASS files are licensed under MIT License - - * http://opensource.org/licenses/mit-license.html - * - Font Awesome documentation licensed under CC BY 3.0 - - * http://creativecommons.org/licenses/by/3.0/ - * - Attribution is no longer required in Font Awesome 3.0, but much appreciated: - * "Font Awesome by Dave Gandy - http://fontawesome.io" - * - * Author - Dave Gandy - * ------------------------------------------------------------------------------ - * Email: dave@fontawesome.io - * Twitter: http://twitter.com/davegandy - * Work: Lead Product Designer @ Kyruus - http://kyruus.com + * Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) */ /* FONT PATH * -------------------------- */ @font-face { font-family: 'FontAwesome'; - src: url('../fonts/fontawesome-webfont.eot'); - src: url('../fonts/fontawesome-webfont.eot') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff') format('woff'), url('../fonts/fontawesome-webfont.ttf') format('truetype'), url('../fonts/fontawesome-webfont.svg') format('svg'); + src: url('../fonts/fontawesome-webfont.eot?v=4.1.0'); + src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg'); font-weight: normal; font-style: normal; } -/* FONT AWESOME CORE - * -------------------------- */ -[class^="icon-"], -[class*=" icon-"] { +.fa { + display: inline-block; font-family: FontAwesome; - font-weight: normal; font-style: normal; - text-decoration: inherit; + font-weight: normal; + line-height: 1; -webkit-font-smoothing: antialiased; - *margin-right: .3em; -} -[class^="icon-"]:before, -[class*=" icon-"]:before { - text-decoration: inherit; - display: inline-block; - speak: none; + -moz-osx-font-smoothing: grayscale; } /* makes the font 33% larger relative to the icon container */ -.icon-large:before { - vertical-align: -10%; - font-size: 1.3333333333333333em; -} -/* makes sure icons active on rollover in links */ -a [class^="icon-"], -a [class*=" icon-"] { - display: inline; -} -/* increased font size for icon-large */ -[class^="icon-"].icon-fixed-width, -[class*=" icon-"].icon-fixed-width { - display: inline-block; - width: 1.1428571428571428em; - text-align: right; - padding-right: 0.2857142857142857em; +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; } -[class^="icon-"].icon-fixed-width.icon-large, -[class*=" icon-"].icon-fixed-width.icon-large { - width: 1.4285714285714286em; +.fa-2x { + font-size: 2em; } -.icons-ul { - margin-left: 2.142857142857143em; - list-style-type: none; +.fa-3x { + font-size: 3em; } -.icons-ul > li { - position: relative; +.fa-4x { + font-size: 4em; } -.icons-ul .icon-li { - position: absolute; - left: -2.142857142857143em; - width: 2.142857142857143em; +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; text-align: center; - line-height: inherit; } -[class^="icon-"].hide, -[class*=" icon-"].hide { - display: none; +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; } -.icon-muted { - color: #eeeeee; +.fa-ul > li { + position: relative; } -.icon-light { - color: #ffffff; +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; } -.icon-dark { - color: #333333; +.fa-li.fa-lg { + left: -1.85714286em; } -.icon-border { - border: solid 1px #eeeeee; +.fa-border { padding: .2em .25em .15em; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} -.icon-2x { - font-size: 2em; -} -.icon-2x.icon-border { - border-width: 2px; - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; -} -.icon-3x { - font-size: 3em; -} -.icon-3x.icon-border { - border-width: 3px; - -webkit-border-radius: 5px; - -moz-border-radius: 5px; - border-radius: 5px; -} -.icon-4x { - font-size: 4em; -} -.icon-4x.icon-border { - border-width: 4px; - -webkit-border-radius: 6px; - -moz-border-radius: 6px; - border-radius: 6px; -} -.icon-5x { - font-size: 5em; -} -.icon-5x.icon-border { - border-width: 5px; - -webkit-border-radius: 7px; - -moz-border-radius: 7px; - border-radius: 7px; + border: solid 0.08em #eeeeee; + border-radius: .1em; } .pull-right { float: right; @@ -147,147 +71,18 @@ a [class*=" icon-"] { .pull-left { float: left; } -[class^="icon-"].pull-left, -[class*=" icon-"].pull-left { +.fa.pull-left { margin-right: .3em; } -[class^="icon-"].pull-right, -[class*=" icon-"].pull-right { +.fa.pull-right { margin-left: .3em; } -/* BOOTSTRAP SPECIFIC CLASSES - * -------------------------- */ -/* Bootstrap 2.0 sprites.less reset */ -[class^="icon-"], -[class*=" icon-"] { - display: inline; - width: auto; - height: auto; - line-height: normal; - vertical-align: baseline; - background-image: none; - background-position: 0% 0%; - background-repeat: repeat; - margin-top: 0; -} -/* more sprites.less reset */ -.icon-white, -.nav-pills > .active > a > [class^="icon-"], -.nav-pills > .active > a > [class*=" icon-"], -.nav-list > .active > a > [class^="icon-"], -.nav-list > .active > a > [class*=" icon-"], -.navbar-inverse .nav > .active > a > [class^="icon-"], -.navbar-inverse .nav > .active > a > [class*=" icon-"], -.dropdown-menu > li > a:hover > [class^="icon-"], -.dropdown-menu > li > a:hover > [class*=" icon-"], -.dropdown-menu > .active > a > [class^="icon-"], -.dropdown-menu > .active > a > [class*=" icon-"], -.dropdown-submenu:hover > a > [class^="icon-"], -.dropdown-submenu:hover > a > [class*=" icon-"] { - background-image: none; -} -/* keeps Bootstrap styles with and without icons the same */ -.btn [class^="icon-"].icon-large, -.nav [class^="icon-"].icon-large, -.btn [class*=" icon-"].icon-large, -.nav [class*=" icon-"].icon-large { - line-height: .9em; -} -.btn [class^="icon-"].icon-spin, -.nav [class^="icon-"].icon-spin, -.btn [class*=" icon-"].icon-spin, -.nav [class*=" icon-"].icon-spin { - display: inline-block; -} -.nav-tabs [class^="icon-"], -.nav-pills [class^="icon-"], -.nav-tabs [class*=" icon-"], -.nav-pills [class*=" icon-"], -.nav-tabs [class^="icon-"].icon-large, -.nav-pills [class^="icon-"].icon-large, -.nav-tabs [class*=" icon-"].icon-large, -.nav-pills [class*=" icon-"].icon-large { - line-height: .9em; -} -.btn [class^="icon-"].pull-left.icon-2x, -.btn [class*=" icon-"].pull-left.icon-2x, -.btn [class^="icon-"].pull-right.icon-2x, -.btn [class*=" icon-"].pull-right.icon-2x { - margin-top: .18em; -} -.btn [class^="icon-"].icon-spin.icon-large, -.btn [class*=" icon-"].icon-spin.icon-large { - line-height: .8em; -} -.btn.btn-small [class^="icon-"].pull-left.icon-2x, -.btn.btn-small [class*=" icon-"].pull-left.icon-2x, -.btn.btn-small [class^="icon-"].pull-right.icon-2x, -.btn.btn-small [class*=" icon-"].pull-right.icon-2x { - margin-top: .25em; -} -.btn.btn-large [class^="icon-"], -.btn.btn-large [class*=" icon-"] { - margin-top: 0; -} -.btn.btn-large [class^="icon-"].pull-left.icon-2x, -.btn.btn-large [class*=" icon-"].pull-left.icon-2x, -.btn.btn-large [class^="icon-"].pull-right.icon-2x, -.btn.btn-large [class*=" icon-"].pull-right.icon-2x { - margin-top: .05em; -} -.btn.btn-large [class^="icon-"].pull-left.icon-2x, -.btn.btn-large [class*=" icon-"].pull-left.icon-2x { - margin-right: .2em; -} -.btn.btn-large [class^="icon-"].pull-right.icon-2x, -.btn.btn-large [class*=" icon-"].pull-right.icon-2x { - margin-left: .2em; -} -/* Fixes alignment in nav lists */ -.nav-list [class^="icon-"], -.nav-list [class*=" icon-"] { - line-height: inherit; -} -/* EXTRAS - * -------------------------- */ -/* Stacked and layered icon */ -.icon-stack { - position: relative; - display: inline-block; - width: 2em; - height: 2em; - line-height: 2em; - vertical-align: -35%; -} -.icon-stack [class^="icon-"], -.icon-stack [class*=" icon-"] { - display: block; - text-align: center; - position: absolute; - width: 100%; - height: 100%; - font-size: 1em; - line-height: inherit; - *line-height: 2em; -} -.icon-stack .icon-stack-base { - font-size: 2em; - *line-height: 1em; -} -/* Animated rotating icon */ -.icon-spin { - display: inline-block; +.fa-spin { + -webkit-animation: spin 2s infinite linear; -moz-animation: spin 2s infinite linear; -o-animation: spin 2s infinite linear; - -webkit-animation: spin 2s infinite linear; animation: spin 2s infinite linear; } -/* Prevent stack and spinners from being taken inline when inside a link */ -a .icon-stack, -a .icon-spin { - display: inline-block; - text-decoration: none; -} @-moz-keyframes spin { 0% { -moz-transform: rotate(0deg); @@ -312,1168 +107,1460 @@ a .icon-spin { -o-transform: rotate(359deg); } } -@-ms-keyframes spin { - 0% { - -ms-transform: rotate(0deg); - } - 100% { - -ms-transform: rotate(359deg); - } -} @keyframes spin { 0% { + -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { + -webkit-transform: rotate(359deg); transform: rotate(359deg); } } -/* Icon rotations and mirroring */ -.icon-rotate-90:before { +.fa-rotate-90 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -ms-transform: rotate(90deg); -o-transform: rotate(90deg); transform: rotate(90deg); - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); } -.icon-rotate-180:before { +.fa-rotate-180 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); } -.icon-rotate-270:before { +.fa-rotate-270 { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -webkit-transform: rotate(270deg); -moz-transform: rotate(270deg); -ms-transform: rotate(270deg); -o-transform: rotate(270deg); transform: rotate(270deg); - filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); } -.icon-flip-horizontal:before { +.fa-flip-horizontal { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); -webkit-transform: scale(-1, 1); -moz-transform: scale(-1, 1); -ms-transform: scale(-1, 1); -o-transform: scale(-1, 1); transform: scale(-1, 1); } -.icon-flip-vertical:before { +.fa-flip-vertical { + filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); -webkit-transform: scale(1, -1); -moz-transform: scale(1, -1); -ms-transform: scale(1, -1); -o-transform: scale(1, -1); transform: scale(1, -1); } -/* ensure rotation occurs inside anchor tags */ -a .icon-rotate-90:before, -a .icon-rotate-180:before, -a .icon-rotate-270:before, -a .icon-flip-horizontal:before, -a .icon-flip-vertical:before { +.fa-stack { + position: relative; display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; } /* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen readers do not read off random characters that represent icons */ -.icon-glass:before { +.fa-glass:before { content: "\f000"; } -.icon-music:before { +.fa-music:before { content: "\f001"; } -.icon-search:before { +.fa-search:before { content: "\f002"; } -.icon-envelope-alt:before { +.fa-envelope-o:before { content: "\f003"; } -.icon-heart:before { +.fa-heart:before { content: "\f004"; } -.icon-star:before { +.fa-star:before { content: "\f005"; } -.icon-star-empty:before { +.fa-star-o:before { content: "\f006"; } -.icon-user:before { +.fa-user:before { content: "\f007"; } -.icon-film:before { +.fa-film:before { content: "\f008"; } -.icon-th-large:before { +.fa-th-large:before { content: "\f009"; } -.icon-th:before { +.fa-th:before { content: "\f00a"; } -.icon-th-list:before { +.fa-th-list:before { content: "\f00b"; } -.icon-ok:before { +.fa-check:before { content: "\f00c"; } -.icon-remove:before { +.fa-times:before { content: "\f00d"; } -.icon-zoom-in:before { +.fa-search-plus:before { content: "\f00e"; } -.icon-zoom-out:before { +.fa-search-minus:before { content: "\f010"; } -.icon-power-off:before, -.icon-off:before { +.fa-power-off:before { content: "\f011"; } -.icon-signal:before { +.fa-signal:before { content: "\f012"; } -.icon-gear:before, -.icon-cog:before { +.fa-gear:before, +.fa-cog:before { content: "\f013"; } -.icon-trash:before { +.fa-trash-o:before { content: "\f014"; } -.icon-home:before { +.fa-home:before { content: "\f015"; } -.icon-file-alt:before { +.fa-file-o:before { content: "\f016"; } -.icon-time:before { +.fa-clock-o:before { content: "\f017"; } -.icon-road:before { +.fa-road:before { content: "\f018"; } -.icon-download-alt:before { +.fa-download:before { content: "\f019"; } -.icon-download:before { +.fa-arrow-circle-o-down:before { content: "\f01a"; } -.icon-upload:before { +.fa-arrow-circle-o-up:before { content: "\f01b"; } -.icon-inbox:before { +.fa-inbox:before { content: "\f01c"; } -.icon-play-circle:before { +.fa-play-circle-o:before { content: "\f01d"; } -.icon-rotate-right:before, -.icon-repeat:before { +.fa-rotate-right:before, +.fa-repeat:before { content: "\f01e"; } -.icon-refresh:before { +.fa-refresh:before { content: "\f021"; } -.icon-list-alt:before { +.fa-list-alt:before { content: "\f022"; } -.icon-lock:before { +.fa-lock:before { content: "\f023"; } -.icon-flag:before { +.fa-flag:before { content: "\f024"; } -.icon-headphones:before { +.fa-headphones:before { content: "\f025"; } -.icon-volume-off:before { +.fa-volume-off:before { content: "\f026"; } -.icon-volume-down:before { +.fa-volume-down:before { content: "\f027"; } -.icon-volume-up:before { +.fa-volume-up:before { content: "\f028"; } -.icon-qrcode:before { +.fa-qrcode:before { content: "\f029"; } -.icon-barcode:before { +.fa-barcode:before { content: "\f02a"; } -.icon-tag:before { +.fa-tag:before { content: "\f02b"; } -.icon-tags:before { +.fa-tags:before { content: "\f02c"; } -.icon-book:before { +.fa-book:before { content: "\f02d"; } -.icon-bookmark:before { +.fa-bookmark:before { content: "\f02e"; } -.icon-print:before { +.fa-print:before { content: "\f02f"; } -.icon-camera:before { +.fa-camera:before { content: "\f030"; } -.icon-font:before { +.fa-font:before { content: "\f031"; } -.icon-bold:before { +.fa-bold:before { content: "\f032"; } -.icon-italic:before { +.fa-italic:before { content: "\f033"; } -.icon-text-height:before { +.fa-text-height:before { content: "\f034"; } -.icon-text-width:before { +.fa-text-width:before { content: "\f035"; } -.icon-align-left:before { +.fa-align-left:before { content: "\f036"; } -.icon-align-center:before { +.fa-align-center:before { content: "\f037"; } -.icon-align-right:before { +.fa-align-right:before { content: "\f038"; } -.icon-align-justify:before { +.fa-align-justify:before { content: "\f039"; } -.icon-list:before { +.fa-list:before { content: "\f03a"; } -.icon-indent-left:before { +.fa-dedent:before, +.fa-outdent:before { content: "\f03b"; } -.icon-indent-right:before { +.fa-indent:before { content: "\f03c"; } -.icon-facetime-video:before { +.fa-video-camera:before { content: "\f03d"; } -.icon-picture:before { +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { content: "\f03e"; } -.icon-pencil:before { +.fa-pencil:before { content: "\f040"; } -.icon-map-marker:before { +.fa-map-marker:before { content: "\f041"; } -.icon-adjust:before { +.fa-adjust:before { content: "\f042"; } -.icon-tint:before { +.fa-tint:before { content: "\f043"; } -.icon-edit:before { +.fa-edit:before, +.fa-pencil-square-o:before { content: "\f044"; } -.icon-share:before { +.fa-share-square-o:before { content: "\f045"; } -.icon-check:before { +.fa-check-square-o:before { content: "\f046"; } -.icon-move:before { +.fa-arrows:before { content: "\f047"; } -.icon-step-backward:before { +.fa-step-backward:before { content: "\f048"; } -.icon-fast-backward:before { +.fa-fast-backward:before { content: "\f049"; } -.icon-backward:before { +.fa-backward:before { content: "\f04a"; } -.icon-play:before { +.fa-play:before { content: "\f04b"; } -.icon-pause:before { +.fa-pause:before { content: "\f04c"; } -.icon-stop:before { +.fa-stop:before { content: "\f04d"; } -.icon-forward:before { +.fa-forward:before { content: "\f04e"; } -.icon-fast-forward:before { +.fa-fast-forward:before { content: "\f050"; } -.icon-step-forward:before { +.fa-step-forward:before { content: "\f051"; } -.icon-eject:before { +.fa-eject:before { content: "\f052"; } -.icon-chevron-left:before { +.fa-chevron-left:before { content: "\f053"; } -.icon-chevron-right:before { +.fa-chevron-right:before { content: "\f054"; } -.icon-plus-sign:before { +.fa-plus-circle:before { content: "\f055"; } -.icon-minus-sign:before { +.fa-minus-circle:before { content: "\f056"; } -.icon-remove-sign:before { +.fa-times-circle:before { content: "\f057"; } -.icon-ok-sign:before { +.fa-check-circle:before { content: "\f058"; } -.icon-question-sign:before { +.fa-question-circle:before { content: "\f059"; } -.icon-info-sign:before { +.fa-info-circle:before { content: "\f05a"; } -.icon-screenshot:before { +.fa-crosshairs:before { content: "\f05b"; } -.icon-remove-circle:before { +.fa-times-circle-o:before { content: "\f05c"; } -.icon-ok-circle:before { +.fa-check-circle-o:before { content: "\f05d"; } -.icon-ban-circle:before { +.fa-ban:before { content: "\f05e"; } -.icon-arrow-left:before { +.fa-arrow-left:before { content: "\f060"; } -.icon-arrow-right:before { +.fa-arrow-right:before { content: "\f061"; } -.icon-arrow-up:before { +.fa-arrow-up:before { content: "\f062"; } -.icon-arrow-down:before { +.fa-arrow-down:before { content: "\f063"; } -.icon-mail-forward:before, -.icon-share-alt:before { +.fa-mail-forward:before, +.fa-share:before { content: "\f064"; } -.icon-resize-full:before { +.fa-expand:before { content: "\f065"; } -.icon-resize-small:before { +.fa-compress:before { content: "\f066"; } -.icon-plus:before { +.fa-plus:before { content: "\f067"; } -.icon-minus:before { +.fa-minus:before { content: "\f068"; } -.icon-asterisk:before { +.fa-asterisk:before { content: "\f069"; } -.icon-exclamation-sign:before { +.fa-exclamation-circle:before { content: "\f06a"; } -.icon-gift:before { +.fa-gift:before { content: "\f06b"; } -.icon-leaf:before { +.fa-leaf:before { content: "\f06c"; } -.icon-fire:before { +.fa-fire:before { content: "\f06d"; } -.icon-eye-open:before { +.fa-eye:before { content: "\f06e"; } -.icon-eye-close:before { +.fa-eye-slash:before { content: "\f070"; } -.icon-warning-sign:before { +.fa-warning:before, +.fa-exclamation-triangle:before { content: "\f071"; } -.icon-plane:before { +.fa-plane:before { content: "\f072"; } -.icon-calendar:before { +.fa-calendar:before { content: "\f073"; } -.icon-random:before { +.fa-random:before { content: "\f074"; } -.icon-comment:before { +.fa-comment:before { content: "\f075"; } -.icon-magnet:before { +.fa-magnet:before { content: "\f076"; } -.icon-chevron-up:before { +.fa-chevron-up:before { content: "\f077"; } -.icon-chevron-down:before { +.fa-chevron-down:before { content: "\f078"; } -.icon-retweet:before { +.fa-retweet:before { content: "\f079"; } -.icon-shopping-cart:before { +.fa-shopping-cart:before { content: "\f07a"; } -.icon-folder-close:before { +.fa-folder:before { content: "\f07b"; } -.icon-folder-open:before { +.fa-folder-open:before { content: "\f07c"; } -.icon-resize-vertical:before { +.fa-arrows-v:before { content: "\f07d"; } -.icon-resize-horizontal:before { +.fa-arrows-h:before { content: "\f07e"; } -.icon-bar-chart:before { +.fa-bar-chart-o:before { content: "\f080"; } -.icon-twitter-sign:before { +.fa-twitter-square:before { content: "\f081"; } -.icon-facebook-sign:before { +.fa-facebook-square:before { content: "\f082"; } -.icon-camera-retro:before { +.fa-camera-retro:before { content: "\f083"; } -.icon-key:before { +.fa-key:before { content: "\f084"; } -.icon-gears:before, -.icon-cogs:before { +.fa-gears:before, +.fa-cogs:before { content: "\f085"; } -.icon-comments:before { +.fa-comments:before { content: "\f086"; } -.icon-thumbs-up-alt:before { +.fa-thumbs-o-up:before { content: "\f087"; } -.icon-thumbs-down-alt:before { +.fa-thumbs-o-down:before { content: "\f088"; } -.icon-star-half:before { +.fa-star-half:before { content: "\f089"; } -.icon-heart-empty:before { +.fa-heart-o:before { content: "\f08a"; } -.icon-signout:before { +.fa-sign-out:before { content: "\f08b"; } -.icon-linkedin-sign:before { +.fa-linkedin-square:before { content: "\f08c"; } -.icon-pushpin:before { +.fa-thumb-tack:before { content: "\f08d"; } -.icon-external-link:before { +.fa-external-link:before { content: "\f08e"; } -.icon-signin:before { +.fa-sign-in:before { content: "\f090"; } -.icon-trophy:before { +.fa-trophy:before { content: "\f091"; } -.icon-github-sign:before { +.fa-github-square:before { content: "\f092"; } -.icon-upload-alt:before { +.fa-upload:before { content: "\f093"; } -.icon-lemon:before { +.fa-lemon-o:before { content: "\f094"; } -.icon-phone:before { +.fa-phone:before { content: "\f095"; } -.icon-unchecked:before, -.icon-check-empty:before { +.fa-square-o:before { content: "\f096"; } -.icon-bookmark-empty:before { +.fa-bookmark-o:before { content: "\f097"; } -.icon-phone-sign:before { +.fa-phone-square:before { content: "\f098"; } -.icon-twitter:before { +.fa-twitter:before { content: "\f099"; } -.icon-facebook:before { +.fa-facebook:before { content: "\f09a"; } -.icon-github:before { +.fa-github:before { content: "\f09b"; } -.icon-unlock:before { +.fa-unlock:before { content: "\f09c"; } -.icon-credit-card:before { +.fa-credit-card:before { content: "\f09d"; } -.icon-rss:before { +.fa-rss:before { content: "\f09e"; } -.icon-hdd:before { +.fa-hdd-o:before { content: "\f0a0"; } -.icon-bullhorn:before { +.fa-bullhorn:before { content: "\f0a1"; } -.icon-bell:before { - content: "\f0a2"; +.fa-bell:before { + content: "\f0f3"; } -.icon-certificate:before { +.fa-certificate:before { content: "\f0a3"; } -.icon-hand-right:before { +.fa-hand-o-right:before { content: "\f0a4"; } -.icon-hand-left:before { +.fa-hand-o-left:before { content: "\f0a5"; } -.icon-hand-up:before { +.fa-hand-o-up:before { content: "\f0a6"; } -.icon-hand-down:before { +.fa-hand-o-down:before { content: "\f0a7"; } -.icon-circle-arrow-left:before { +.fa-arrow-circle-left:before { content: "\f0a8"; } -.icon-circle-arrow-right:before { +.fa-arrow-circle-right:before { content: "\f0a9"; } -.icon-circle-arrow-up:before { +.fa-arrow-circle-up:before { content: "\f0aa"; } -.icon-circle-arrow-down:before { +.fa-arrow-circle-down:before { content: "\f0ab"; } -.icon-globe:before { +.fa-globe:before { content: "\f0ac"; } -.icon-wrench:before { +.fa-wrench:before { content: "\f0ad"; } -.icon-tasks:before { +.fa-tasks:before { content: "\f0ae"; } -.icon-filter:before { +.fa-filter:before { content: "\f0b0"; } -.icon-briefcase:before { +.fa-briefcase:before { content: "\f0b1"; } -.icon-fullscreen:before { +.fa-arrows-alt:before { content: "\f0b2"; } -.icon-group:before { +.fa-group:before, +.fa-users:before { content: "\f0c0"; } -.icon-link:before { +.fa-chain:before, +.fa-link:before { content: "\f0c1"; } -.icon-cloud:before { +.fa-cloud:before { content: "\f0c2"; } -.icon-beaker:before { +.fa-flask:before { content: "\f0c3"; } -.icon-cut:before { +.fa-cut:before, +.fa-scissors:before { content: "\f0c4"; } -.icon-copy:before { +.fa-copy:before, +.fa-files-o:before { content: "\f0c5"; } -.icon-paperclip:before, -.icon-paper-clip:before { +.fa-paperclip:before { content: "\f0c6"; } -.icon-save:before { +.fa-save:before, +.fa-floppy-o:before { content: "\f0c7"; } -.icon-sign-blank:before { +.fa-square:before { content: "\f0c8"; } -.icon-reorder:before { +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { content: "\f0c9"; } -.icon-list-ul:before { +.fa-list-ul:before { content: "\f0ca"; } -.icon-list-ol:before { +.fa-list-ol:before { content: "\f0cb"; } -.icon-strikethrough:before { +.fa-strikethrough:before { content: "\f0cc"; } -.icon-underline:before { +.fa-underline:before { content: "\f0cd"; } -.icon-table:before { +.fa-table:before { content: "\f0ce"; } -.icon-magic:before { +.fa-magic:before { content: "\f0d0"; } -.icon-truck:before { +.fa-truck:before { content: "\f0d1"; } -.icon-pinterest:before { +.fa-pinterest:before { content: "\f0d2"; } -.icon-pinterest-sign:before { +.fa-pinterest-square:before { content: "\f0d3"; } -.icon-google-plus-sign:before { +.fa-google-plus-square:before { content: "\f0d4"; } -.icon-google-plus:before { +.fa-google-plus:before { content: "\f0d5"; } -.icon-money:before { +.fa-money:before { content: "\f0d6"; } -.icon-caret-down:before { +.fa-caret-down:before { content: "\f0d7"; } -.icon-caret-up:before { +.fa-caret-up:before { content: "\f0d8"; } -.icon-caret-left:before { +.fa-caret-left:before { content: "\f0d9"; } -.icon-caret-right:before { +.fa-caret-right:before { content: "\f0da"; } -.icon-columns:before { +.fa-columns:before { content: "\f0db"; } -.icon-sort:before { +.fa-unsorted:before, +.fa-sort:before { content: "\f0dc"; } -.icon-sort-down:before { +.fa-sort-down:before, +.fa-sort-desc:before { content: "\f0dd"; } -.icon-sort-up:before { +.fa-sort-up:before, +.fa-sort-asc:before { content: "\f0de"; } -.icon-envelope:before { +.fa-envelope:before { content: "\f0e0"; } -.icon-linkedin:before { +.fa-linkedin:before { content: "\f0e1"; } -.icon-rotate-left:before, -.icon-undo:before { +.fa-rotate-left:before, +.fa-undo:before { content: "\f0e2"; } -.icon-legal:before { +.fa-legal:before, +.fa-gavel:before { content: "\f0e3"; } -.icon-dashboard:before { +.fa-dashboard:before, +.fa-tachometer:before { content: "\f0e4"; } -.icon-comment-alt:before { +.fa-comment-o:before { content: "\f0e5"; } -.icon-comments-alt:before { +.fa-comments-o:before { content: "\f0e6"; } -.icon-bolt:before { +.fa-flash:before, +.fa-bolt:before { content: "\f0e7"; } -.icon-sitemap:before { +.fa-sitemap:before { content: "\f0e8"; } -.icon-umbrella:before { +.fa-umbrella:before { content: "\f0e9"; } -.icon-paste:before { +.fa-paste:before, +.fa-clipboard:before { content: "\f0ea"; } -.icon-lightbulb:before { +.fa-lightbulb-o:before { content: "\f0eb"; } -.icon-exchange:before { +.fa-exchange:before { content: "\f0ec"; } -.icon-cloud-download:before { +.fa-cloud-download:before { content: "\f0ed"; } -.icon-cloud-upload:before { +.fa-cloud-upload:before { content: "\f0ee"; } -.icon-user-md:before { +.fa-user-md:before { content: "\f0f0"; } -.icon-stethoscope:before { +.fa-stethoscope:before { content: "\f0f1"; } -.icon-suitcase:before { +.fa-suitcase:before { content: "\f0f2"; } -.icon-bell-alt:before { - content: "\f0f3"; +.fa-bell-o:before { + content: "\f0a2"; } -.icon-coffee:before { +.fa-coffee:before { content: "\f0f4"; } -.icon-food:before { +.fa-cutlery:before { content: "\f0f5"; } -.icon-file-text-alt:before { +.fa-file-text-o:before { content: "\f0f6"; } -.icon-building:before { +.fa-building-o:before { content: "\f0f7"; } -.icon-hospital:before { +.fa-hospital-o:before { content: "\f0f8"; } -.icon-ambulance:before { +.fa-ambulance:before { content: "\f0f9"; } -.icon-medkit:before { +.fa-medkit:before { content: "\f0fa"; } -.icon-fighter-jet:before { +.fa-fighter-jet:before { content: "\f0fb"; } -.icon-beer:before { +.fa-beer:before { content: "\f0fc"; } -.icon-h-sign:before { +.fa-h-square:before { content: "\f0fd"; } -.icon-plus-sign-alt:before { +.fa-plus-square:before { content: "\f0fe"; } -.icon-double-angle-left:before { +.fa-angle-double-left:before { content: "\f100"; } -.icon-double-angle-right:before { +.fa-angle-double-right:before { content: "\f101"; } -.icon-double-angle-up:before { +.fa-angle-double-up:before { content: "\f102"; } -.icon-double-angle-down:before { +.fa-angle-double-down:before { content: "\f103"; } -.icon-angle-left:before { +.fa-angle-left:before { content: "\f104"; } -.icon-angle-right:before { +.fa-angle-right:before { content: "\f105"; } -.icon-angle-up:before { +.fa-angle-up:before { content: "\f106"; } -.icon-angle-down:before { +.fa-angle-down:before { content: "\f107"; } -.icon-desktop:before { +.fa-desktop:before { content: "\f108"; } -.icon-laptop:before { +.fa-laptop:before { content: "\f109"; } -.icon-tablet:before { +.fa-tablet:before { content: "\f10a"; } -.icon-mobile-phone:before { +.fa-mobile-phone:before, +.fa-mobile:before { content: "\f10b"; } -.icon-circle-blank:before { +.fa-circle-o:before { content: "\f10c"; } -.icon-quote-left:before { +.fa-quote-left:before { content: "\f10d"; } -.icon-quote-right:before { +.fa-quote-right:before { content: "\f10e"; } -.icon-spinner:before { +.fa-spinner:before { content: "\f110"; } -.icon-circle:before { +.fa-circle:before { content: "\f111"; } -.icon-mail-reply:before, -.icon-reply:before { +.fa-mail-reply:before, +.fa-reply:before { content: "\f112"; } -.icon-github-alt:before { +.fa-github-alt:before { content: "\f113"; } -.icon-folder-close-alt:before { +.fa-folder-o:before { content: "\f114"; } -.icon-folder-open-alt:before { +.fa-folder-open-o:before { content: "\f115"; } -.icon-expand-alt:before { - content: "\f116"; -} -.icon-collapse-alt:before { - content: "\f117"; -} -.icon-smile:before { +.fa-smile-o:before { content: "\f118"; } -.icon-frown:before { +.fa-frown-o:before { content: "\f119"; } -.icon-meh:before { +.fa-meh-o:before { content: "\f11a"; } -.icon-gamepad:before { +.fa-gamepad:before { content: "\f11b"; } -.icon-keyboard:before { +.fa-keyboard-o:before { content: "\f11c"; } -.icon-flag-alt:before { +.fa-flag-o:before { content: "\f11d"; } -.icon-flag-checkered:before { +.fa-flag-checkered:before { content: "\f11e"; } -.icon-terminal:before { +.fa-terminal:before { content: "\f120"; } -.icon-code:before { +.fa-code:before { content: "\f121"; } -.icon-reply-all:before { +.fa-mail-reply-all:before, +.fa-reply-all:before { content: "\f122"; } -.icon-mail-reply-all:before { - content: "\f122"; -} -.icon-star-half-full:before, -.icon-star-half-empty:before { +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { content: "\f123"; } -.icon-location-arrow:before { +.fa-location-arrow:before { content: "\f124"; } -.icon-crop:before { +.fa-crop:before { content: "\f125"; } -.icon-code-fork:before { +.fa-code-fork:before { content: "\f126"; } -.icon-unlink:before { +.fa-unlink:before, +.fa-chain-broken:before { content: "\f127"; } -.icon-question:before { +.fa-question:before { content: "\f128"; } -.icon-info:before { +.fa-info:before { content: "\f129"; } -.icon-exclamation:before { +.fa-exclamation:before { content: "\f12a"; } -.icon-superscript:before { +.fa-superscript:before { content: "\f12b"; } -.icon-subscript:before { +.fa-subscript:before { content: "\f12c"; } -.icon-eraser:before { +.fa-eraser:before { content: "\f12d"; } -.icon-puzzle-piece:before { +.fa-puzzle-piece:before { content: "\f12e"; } -.icon-microphone:before { +.fa-microphone:before { content: "\f130"; } -.icon-microphone-off:before { +.fa-microphone-slash:before { content: "\f131"; } -.icon-shield:before { +.fa-shield:before { content: "\f132"; } -.icon-calendar-empty:before { +.fa-calendar-o:before { content: "\f133"; } -.icon-fire-extinguisher:before { +.fa-fire-extinguisher:before { content: "\f134"; } -.icon-rocket:before { +.fa-rocket:before { content: "\f135"; } -.icon-maxcdn:before { +.fa-maxcdn:before { content: "\f136"; } -.icon-chevron-sign-left:before { +.fa-chevron-circle-left:before { content: "\f137"; } -.icon-chevron-sign-right:before { +.fa-chevron-circle-right:before { content: "\f138"; } -.icon-chevron-sign-up:before { +.fa-chevron-circle-up:before { content: "\f139"; } -.icon-chevron-sign-down:before { +.fa-chevron-circle-down:before { content: "\f13a"; } -.icon-html5:before { +.fa-html5:before { content: "\f13b"; } -.icon-css3:before { +.fa-css3:before { content: "\f13c"; } -.icon-anchor:before { +.fa-anchor:before { content: "\f13d"; } -.icon-unlock-alt:before { +.fa-unlock-alt:before { content: "\f13e"; } -.icon-bullseye:before { +.fa-bullseye:before { content: "\f140"; } -.icon-ellipsis-horizontal:before { +.fa-ellipsis-h:before { content: "\f141"; } -.icon-ellipsis-vertical:before { +.fa-ellipsis-v:before { content: "\f142"; } -.icon-rss-sign:before { +.fa-rss-square:before { content: "\f143"; } -.icon-play-sign:before { +.fa-play-circle:before { content: "\f144"; } -.icon-ticket:before { +.fa-ticket:before { content: "\f145"; } -.icon-minus-sign-alt:before { +.fa-minus-square:before { content: "\f146"; } -.icon-check-minus:before { +.fa-minus-square-o:before { content: "\f147"; } -.icon-level-up:before { +.fa-level-up:before { content: "\f148"; } -.icon-level-down:before { +.fa-level-down:before { content: "\f149"; } -.icon-check-sign:before { +.fa-check-square:before { content: "\f14a"; } -.icon-edit-sign:before { +.fa-pencil-square:before { content: "\f14b"; } -.icon-external-link-sign:before { +.fa-external-link-square:before { content: "\f14c"; } -.icon-share-sign:before { +.fa-share-square:before { content: "\f14d"; } -.icon-compass:before { +.fa-compass:before { content: "\f14e"; } -.icon-collapse:before { +.fa-toggle-down:before, +.fa-caret-square-o-down:before { content: "\f150"; } -.icon-collapse-top:before { +.fa-toggle-up:before, +.fa-caret-square-o-up:before { content: "\f151"; } -.icon-expand:before { +.fa-toggle-right:before, +.fa-caret-square-o-right:before { content: "\f152"; } -.icon-euro:before, -.icon-eur:before { +.fa-euro:before, +.fa-eur:before { content: "\f153"; } -.icon-gbp:before { +.fa-gbp:before { content: "\f154"; } -.icon-dollar:before, -.icon-usd:before { +.fa-dollar:before, +.fa-usd:before { content: "\f155"; } -.icon-rupee:before, -.icon-inr:before { +.fa-rupee:before, +.fa-inr:before { content: "\f156"; } -.icon-yen:before, -.icon-jpy:before { +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { content: "\f157"; } -.icon-renminbi:before, -.icon-cny:before { +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { content: "\f158"; } -.icon-won:before, -.icon-krw:before { +.fa-won:before, +.fa-krw:before { content: "\f159"; } -.icon-bitcoin:before, -.icon-btc:before { +.fa-bitcoin:before, +.fa-btc:before { content: "\f15a"; } -.icon-file:before { +.fa-file:before { content: "\f15b"; } -.icon-file-text:before { +.fa-file-text:before { content: "\f15c"; } -.icon-sort-by-alphabet:before { +.fa-sort-alpha-asc:before { content: "\f15d"; } -.icon-sort-by-alphabet-alt:before { +.fa-sort-alpha-desc:before { content: "\f15e"; } -.icon-sort-by-attributes:before { +.fa-sort-amount-asc:before { content: "\f160"; } -.icon-sort-by-attributes-alt:before { +.fa-sort-amount-desc:before { content: "\f161"; } -.icon-sort-by-order:before { +.fa-sort-numeric-asc:before { content: "\f162"; } -.icon-sort-by-order-alt:before { +.fa-sort-numeric-desc:before { content: "\f163"; } -.icon-thumbs-up:before { +.fa-thumbs-up:before { content: "\f164"; } -.icon-thumbs-down:before { +.fa-thumbs-down:before { content: "\f165"; } -.icon-youtube-sign:before { +.fa-youtube-square:before { content: "\f166"; } -.icon-youtube:before { +.fa-youtube:before { content: "\f167"; } -.icon-xing:before { +.fa-xing:before { content: "\f168"; } -.icon-xing-sign:before { +.fa-xing-square:before { content: "\f169"; } -.icon-youtube-play:before { +.fa-youtube-play:before { content: "\f16a"; } -.icon-dropbox:before { +.fa-dropbox:before { content: "\f16b"; } -.icon-stackexchange:before { +.fa-stack-overflow:before { content: "\f16c"; } -.icon-instagram:before { +.fa-instagram:before { content: "\f16d"; } -.icon-flickr:before { +.fa-flickr:before { content: "\f16e"; } -.icon-adn:before { +.fa-adn:before { content: "\f170"; } -.icon-bitbucket:before { +.fa-bitbucket:before { content: "\f171"; } -.icon-bitbucket-sign:before { +.fa-bitbucket-square:before { content: "\f172"; } -.icon-tumblr:before { +.fa-tumblr:before { content: "\f173"; } -.icon-tumblr-sign:before { +.fa-tumblr-square:before { content: "\f174"; } -.icon-long-arrow-down:before { +.fa-long-arrow-down:before { content: "\f175"; } -.icon-long-arrow-up:before { +.fa-long-arrow-up:before { content: "\f176"; } -.icon-long-arrow-left:before { +.fa-long-arrow-left:before { content: "\f177"; } -.icon-long-arrow-right:before { +.fa-long-arrow-right:before { content: "\f178"; } -.icon-apple:before { +.fa-apple:before { content: "\f179"; } -.icon-windows:before { +.fa-windows:before { content: "\f17a"; } -.icon-android:before { +.fa-android:before { content: "\f17b"; } -.icon-linux:before { +.fa-linux:before { content: "\f17c"; } -.icon-dribbble:before { +.fa-dribbble:before { content: "\f17d"; } -.icon-skype:before { +.fa-skype:before { content: "\f17e"; } -.icon-foursquare:before { +.fa-foursquare:before { content: "\f180"; } -.icon-trello:before { +.fa-trello:before { content: "\f181"; } -.icon-female:before { +.fa-female:before { content: "\f182"; } -.icon-male:before { +.fa-male:before { content: "\f183"; } -.icon-gittip:before { +.fa-gittip:before { content: "\f184"; } -.icon-sun:before { +.fa-sun-o:before { content: "\f185"; } -.icon-moon:before { +.fa-moon-o:before { content: "\f186"; } -.icon-archive:before { +.fa-archive:before { content: "\f187"; } -.icon-bug:before { +.fa-bug:before { content: "\f188"; } -.icon-vk:before { +.fa-vk:before { content: "\f189"; } -.icon-weibo:before { +.fa-weibo:before { content: "\f18a"; } -.icon-renren:before { +.fa-renren:before { content: "\f18b"; -} \ No newline at end of file +} +.fa-pagelines:before { + content: "\f18c"; +} +.fa-stack-exchange:before { + content: "\f18d"; +} +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} +.fa-arrow-circle-o-left:before { + content: "\f190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} +.fa-dot-circle-o:before { + content: "\f192"; +} +.fa-wheelchair:before { + content: "\f193"; +} +.fa-vimeo-square:before { + content: "\f194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} +.fa-plus-square-o:before { + content: "\f196"; +} +.fa-space-shuttle:before { + content: "\f197"; +} +.fa-slack:before { + content: "\f198"; +} +.fa-envelope-square:before { + content: "\f199"; +} +.fa-wordpress:before { + content: "\f19a"; +} +.fa-openid:before { + content: "\f19b"; +} +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\f19c"; +} +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\f19d"; +} +.fa-yahoo:before { + content: "\f19e"; +} +.fa-google:before { + content: "\f1a0"; +} +.fa-reddit:before { + content: "\f1a1"; +} +.fa-reddit-square:before { + content: "\f1a2"; +} +.fa-stumbleupon-circle:before { + content: "\f1a3"; +} +.fa-stumbleupon:before { + content: "\f1a4"; +} +.fa-delicious:before { + content: "\f1a5"; +} +.fa-digg:before { + content: "\f1a6"; +} +.fa-pied-piper-square:before, +.fa-pied-piper:before { + content: "\f1a7"; +} +.fa-pied-piper-alt:before { + content: "\f1a8"; +} +.fa-drupal:before { + content: "\f1a9"; +} +.fa-joomla:before { + content: "\f1aa"; +} +.fa-language:before { + content: "\f1ab"; +} +.fa-fax:before { + content: "\f1ac"; +} +.fa-building:before { + content: "\f1ad"; +} +.fa-child:before { + content: "\f1ae"; +} +.fa-paw:before { + content: "\f1b0"; +} +.fa-spoon:before { + content: "\f1b1"; +} +.fa-cube:before { + content: "\f1b2"; +} +.fa-cubes:before { + content: "\f1b3"; +} +.fa-behance:before { + content: "\f1b4"; +} +.fa-behance-square:before { + content: "\f1b5"; +} +.fa-steam:before { + content: "\f1b6"; +} +.fa-steam-square:before { + content: "\f1b7"; +} +.fa-recycle:before { + content: "\f1b8"; +} +.fa-automobile:before, +.fa-car:before { + content: "\f1b9"; +} +.fa-cab:before, +.fa-taxi:before { + content: "\f1ba"; +} +.fa-tree:before { + content: "\f1bb"; +} +.fa-spotify:before { + content: "\f1bc"; +} +.fa-deviantart:before { + content: "\f1bd"; +} +.fa-soundcloud:before { + content: "\f1be"; +} +.fa-database:before { + content: "\f1c0"; +} +.fa-file-pdf-o:before { + content: "\f1c1"; +} +.fa-file-word-o:before { + content: "\f1c2"; +} +.fa-file-excel-o:before { + content: "\f1c3"; +} +.fa-file-powerpoint-o:before { + content: "\f1c4"; +} +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\f1c5"; +} +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\f1c6"; +} +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\f1c7"; +} +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\f1c8"; +} +.fa-file-code-o:before { + content: "\f1c9"; +} +.fa-vine:before { + content: "\f1ca"; +} +.fa-codepen:before { + content: "\f1cb"; +} +.fa-jsfiddle:before { + content: "\f1cc"; +} +.fa-life-bouy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\f1cd"; +} +.fa-circle-o-notch:before { + content: "\f1ce"; +} +.fa-ra:before, +.fa-rebel:before { + content: "\f1d0"; +} +.fa-ge:before, +.fa-empire:before { + content: "\f1d1"; +} +.fa-git-square:before { + content: "\f1d2"; +} +.fa-git:before { + content: "\f1d3"; +} +.fa-hacker-news:before { + content: "\f1d4"; +} +.fa-tencent-weibo:before { + content: "\f1d5"; +} +.fa-qq:before { + content: "\f1d6"; +} +.fa-wechat:before, +.fa-weixin:before { + content: "\f1d7"; +} +.fa-send:before, +.fa-paper-plane:before { + content: "\f1d8"; +} +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\f1d9"; +} +.fa-history:before { + content: "\f1da"; +} +.fa-circle-thin:before { + content: "\f1db"; +} +.fa-header:before { + content: "\f1dc"; +} +.fa-paragraph:before { + content: "\f1dd"; +} +.fa-sliders:before { + content: "\f1de"; +} +.fa-share-alt:before { + content: "\f1e0"; +} +.fa-share-alt-square:before { + content: "\f1e1"; +} +.fa-bomb:before { + content: "\f1e2"; +} diff --git a/static/css/style.css b/static/css/style.css index ce10fee..32ba473 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -25,7 +25,7 @@ input, button, select, textarea { - font-family: 'Open Sans'; + font-family: 'Open Sans',sans-serif; } .dropdown .dropdown-menu { @@ -214,11 +214,10 @@ textarea { .subnavbar .dropdown-menu::before { content: ''; display: inline-block; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-bottom: 7px solid #CCC; - border-bottom-color: rgba(0, 0, 0, 0.2); - position: absolute; + border-right: 7px solid transparent; + border-bottom: 7px solid rgba(0, 0, 0, 0.2); + border-left: 7px solid transparent; + position: absolute; top: -7px; left: 9px; } @@ -492,9 +491,8 @@ textarea { } -.widget-box .widget-content { - background: #E3E3E3; - background: #FFF; +.widget-box .widget-content { + background: #E3E3E3; } @@ -585,23 +583,20 @@ ul.messages_layout li .message_wrap { -moz-border-radius: 3px; border-radius: 3px; position: relative; - border: 1px solid #e9e9e9; padding: 10px; border: 1px solid #cbcbcb; margin-bottom: 20px; float: left; background: #fefefe; - -webkit-box-shadow: rgba(0,0,0,0.1) 0 1px 0px; - -moz-box-shadow: rgba(0,0,0,0.1) 0 1px 0px; - box-shadow: rgba(0,0,0,0.1) 0 1px 0px + -webkit-box-shadow: rgba(0,0,0,0.1) 0 1px 0; + -moz-box-shadow: rgba(0,0,0,0.1) 0 1px 0; + box-shadow: rgba(0,0,0,0.1) 0 1px 0 } ul.messages_layout li .message_wrap .arrow { background-position: 0 -228px; height: 15px; width: 12px; - height: 15px; - width: 12px; - position: absolute; + position: absolute; left: -12px; top: 13px } @@ -849,9 +844,8 @@ html .fc, .fc table { display: none } .fc-event { - border-style: solid; - border-width: 0; - font-size: .85em; + border: 0 solid; + font-size: .85em; cursor: default } a.fc-event, .fc-event-draggable { @@ -872,9 +866,8 @@ a.fc-event { position: relative; width: 100%; height: 100%; - border-style: solid; - border-width: 0; - overflow: hidden + border: 0 solid; + overflow: hidden } .fc-event-time, .fc-event-title { padding: 0 1px @@ -954,7 +947,7 @@ table.fc-border-separate { border-right-width: 1px } .fc-border-separate tr.fc-last th, .fc-border-separate tr.fc-last td { - border-bottom-width: 0px + border-bottom-width: 0 } .fc-first { border-left-width: 0 !important @@ -1083,12 +1076,14 @@ table.fc-border-separate { .fc-agenda .ui-resizable-resizing { _overflow: hidden } -.fc-header-left .fc-button-prev .fc-button-inner {background: url('../img/icons-sa7c41345d9.png') no-repeat; background-position: 0 -351px; -height: 16px; +.fc-header-left .fc-button-prev .fc-button-inner { + background: url('../img/icons-sa7c41345d9.png') no-repeat 0 -351px; + height: 16px; width: 11px;} -.fc-header-left .fc-button-next .fc-button-inner {background: url('../img/icons-sa7c41345d9.png') no-repeat; background-position: 0 -367px; -height: 16px; +.fc-header-left .fc-button-next .fc-button-inner { + background: url('../img/icons-sa7c41345d9.png') no-repeat 0 -367px; + height: 16px; width: 11px;} /*------------------------------------------------------------------ diff --git a/static/fonts/fontawesome-webfont.eot b/static/fonts/fontawesome-webfont.eot old mode 100644 new mode 100755 index 0662cb9..6cfd566 Binary files a/static/fonts/fontawesome-webfont.eot and b/static/fonts/fontawesome-webfont.eot differ diff --git a/static/fonts/fontawesome-webfont.svg b/static/fonts/fontawesome-webfont.svg old mode 100644 new mode 100755 index 2edb4ec..a9f8469 --- a/static/fonts/fontawesome-webfont.svg +++ b/static/fonts/fontawesome-webfont.svg @@ -14,10 +14,11 @@ + - + - + @@ -30,370 +31,474 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/static/fonts/fontawesome-webfont.ttf b/static/fonts/fontawesome-webfont.ttf old mode 100644 new mode 100755 index d365924..5cd6cff Binary files a/static/fonts/fontawesome-webfont.ttf and b/static/fonts/fontawesome-webfont.ttf differ diff --git a/static/fonts/fontawesome-webfont.woff b/static/fonts/fontawesome-webfont.woff old mode 100644 new mode 100755 index b9bd17e..9eaecb3 Binary files a/static/fonts/fontawesome-webfont.woff and b/static/fonts/fontawesome-webfont.woff differ diff --git a/static/js/dashboard.js b/static/js/dashboard.js index ad0d12c..e7548f2 100644 --- a/static/js/dashboard.js +++ b/static/js/dashboard.js @@ -2,18 +2,18 @@ //Sort file size data. jQuery.extend(jQuery.fn.dataTableExt.oSort, { "file-size-units": { - K : 1024, - M : Math.pow(1024, 2), - G : Math.pow(1024, 3), - T : Math.pow(1024, 4), - P : Math.pow(1024, 5), - E : Math.pow(1024, 6) + K: 1024, + M: Math.pow(1024, 2), + G: Math.pow(1024, 3), + T: Math.pow(1024, 4), + P: Math.pow(1024, 5), + E: Math.pow(1024, 6) }, - "file-size-pre": function(a) { + "file-size-pre": function (a) { var x = a.substring(0, a.length - 1); var x_unit = a.substring(a.length - 1, a.length); - if(jQuery.fn.dataTableExt.oSort['file-size-units'][x_unit]) { + if (jQuery.fn.dataTableExt.oSort['file-size-units'][x_unit]) { return parseInt(x * jQuery.fn.dataTableExt.oSort['file-size-units'][x_unit], 10); } else { @@ -21,11 +21,11 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, { } }, - "file-size-asc": function(a, b) { + "file-size-asc": function (a, b) { return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }, - "file-size-desc": function(a, b) { + "file-size-desc": function (a, b) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } }); @@ -33,16 +33,16 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, { //DataTables //Sort numeric data which has a percent sign with it. jQuery.extend(jQuery.fn.dataTableExt.oSort, { - "percent-pre": function(a) { + "percent-pre": function (a) { var x = (a === "-") ? 0 : a.replace(/%/, ""); return parseFloat(x); }, - "percent-asc": function(a, b) { + "percent-asc": function (a, b) { return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }, - "percent-desc": function(a, b) { + "percent-desc": function (a, b) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } }); @@ -50,7 +50,7 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, { //DataTables //Sort IP addresses jQuery.extend(jQuery.fn.dataTableExt.oSort, { - "ip-address-pre": function(a) { + "ip-address-pre": function (a) { // split the address into octets // var x = a.split('.'); @@ -59,24 +59,24 @@ jQuery.extend(jQuery.fn.dataTableExt.oSort, { // function zeroPad(num, places) { var zero = places - num.toString().length + 1; - return Array(+(zero > 0 && zero)).join("0") + num; + return new Array(+(zero > 0 && zero)).join("0") + num; } // build the resulting IP var r = ''; - for(var i=0; i b) ? 1 : 0)); }, - "ip-address-desc": function(a, b) { + "ip-address-desc": function (a, b) { return ((a < b) ? 1 : ((a > b) ? -1 : 0)); } }); @@ -88,174 +88,186 @@ function destroy_dataTable(table_id) { if ($.fn.DataTable.fnIsDataTable(ex)) { table.hide().dataTable().fnClearTable(); table.dataTable().fnDestroy(); - } + } } function get_os_data(url, element) { - $.get(url, function(data) { - $(element).text(data); - }, "json"); + $.get(url, function (data) { + $(element).text(data); + }, "json"); } var dashboard = {}; +dashboard.getUptime = function () { + get_os_data('/info/uptime/', "#get-uptime"); +}; -dashboard.getUptime = function() { - get_os_data('/info/uptime/', "#get-uptime"); - } -dashboard.getOSname = function() { - get_os_data('/info/platform/osname/', "#get-osname"); - } -dashboard.getHostname = function() { - get_os_data('/info/platform/hostname/', "#get-hostname"); - } -dashboard.getKernel = function() { - get_os_data('/info/platform/kernel/', "#get-kernel"); - } -dashboard.getCPUcount = function() { - get_os_data('/info/getcpus/count/', "#get-cpucount"); - } -dashboard.getCPUtype = function() { - get_os_data('/info/getcpus/type/', "#get-cputype"); - } -dashboard.getDisk = function() { - $.getJSON('/info/getdisk/', function(data) { - destroy_dataTable("get_disk"); - $("#filter-ps").val("").off("keyup"); - var psTable = $("#get_disk").dataTable({ - aaData: data, - aoColumns: [ - { sTitle: "FILESYSTEM" }, - { sTitle: "SIZE" }, - { sTitle: "USED" }, - { sTitle: "AVAIL" }, - { sTitle: "USE %" }, - { sTitle: "MOUNTED" } - ], - bPaginate: false, - bFilter: true, - sDom: "lrtip", - bAutoWidth: false, - bInfo: false - }).fadeIn(); - $("#filter-ps").on("keyup", function() { - psTable.fnFilter(this.value); - }); +dashboard.getOSname = function () { + get_os_data('/info/platform/osname/', "#get-osname"); +}; + +dashboard.getHostname = function () { + get_os_data('/info/platform/hostname/', "#get-hostname"); +}; + +dashboard.getKernel = function () { + get_os_data('/info/platform/kernel/', "#get-kernel"); +}; + +dashboard.getCPUcount = function () { + get_os_data('/info/getcpus/count/', "#get-cpucount"); +}; + +dashboard.getCPUtype = function () { + get_os_data('/info/getcpus/type/', "#get-cputype"); +}; + +dashboard.getDisk = function () { + $.getJSON('/info/getdisk/', function (data) { + destroy_dataTable("get_disk"); + var $filterPs = $("#filter-ps"); + $filterPs.val("").off("keyup"); + var psTable = $("#get_disk").dataTable({ + aaData: data, + aoColumns: [ + { sTitle: "FILESYSTEM" }, + { sTitle: "SIZE" }, + { sTitle: "USED" }, + { sTitle: "AVAIL" }, + { sTitle: "USE %" }, + { sTitle: "MOUNTED" } + ], + bPaginate: false, + bFilter: true, + sDom: "lrtip", + bAutoWidth: false, + bInfo: false + }).fadeIn(); + $filterPs.on("keyup", function () { + psTable.fnFilter(this.value); }); -} -dashboard.getUsers = function() { - $.getJSON('/info/getusers/', function(data) { - destroy_dataTable("get_users"); - $("#filter-ps").val("").off("keyup"); - var psTable = $("#get_users").dataTable({ - aaData: data, - aoColumns: [ - { sTitle: "USER" }, - { sTitle: "TTY" }, - { sTitle: "LOOGED IN FROM", - sDefaultContent: "unavailable" } - ], - aaSorting: [ - [0, "desc"] - ], - bPaginate: true, - sPaginationType: "two_button", - bFilter: false, - bAutoWidth: false, - bInfo: false - }).fadeIn(); - $("#filter-ps").on("keyup", function() { - psTable.fnFilter(this.value); - }); + }); +}; + +dashboard.getUsers = function () { + $.getJSON('/info/getusers/', function (data) { + destroy_dataTable("get_users"); + var $filterPs = $("#filter-ps"); + $filterPs.val("").off("keyup"); + var psTable = $("#get_users").dataTable({ + aaData: data, + aoColumns: [ + { sTitle: "USER" }, + { sTitle: "TTY" }, + { sTitle: "LOOGED IN FROM", + sDefaultContent: "unavailable" } + ], + aaSorting: [ + [0, "desc"] + ], + bPaginate: true, + sPaginationType: "two_button", + bFilter: false, + bAutoWidth: false, + bInfo: false + }).fadeIn(); + $filterPs.on("keyup", function () { + psTable.fnFilter(this.value); }); -} -dashboard.getNetstat = function() { - $.getJSON('/info/getnetstat/', function(data) { - destroy_dataTable("get_netstat"); - $("#filter-ps").val("").off("keyup"); - var psTable = $("#get_netstat").dataTable({ - aaData: data, - aoColumns: [ - { sTitle: "COUNT" }, - { sTitle: "LOCAL IP" }, - { sTitle: "LOCAL PORT" }, - { sTitle: "FOREIGN" } - ], - bPaginate: true, - sPaginationType: "two_button", - bFilter: true, - sDom: "lrtip", - bAutoWidth: false, - bInfo: false - }).fadeIn(); - $("#filter-ps").on("keyup", function() { - psTable.fnFilter(this.value); - }); + }); +}; + +dashboard.getNetstat = function () { + $.getJSON('/info/getnetstat/', function (data) { + destroy_dataTable("get_netstat"); + var $filterPs = $("#filter-ps"); + $filterPs.val("").off("keyup"); + var psTable = $("#get_netstat").dataTable({ + aaData: data, + aoColumns: [ + { sTitle: "COUNT" }, + { sTitle: "LOCAL IP" }, + { sTitle: "LOCAL PORT" }, + { sTitle: "FOREIGN" } + ], + bPaginate: true, + sPaginationType: "two_button", + bFilter: true, + sDom: "lrtip", + bAutoWidth: false, + bInfo: false + }).fadeIn(); + $filterPs.on("keyup", function () { + psTable.fnFilter(this.value); }); -} -dashboard.getProc = function() { - $.getJSON('/info/proc/', function(data) { - destroy_dataTable("get_proc"); - $("#filter-ps").val("").off("keyup"); - var psTable = $("#get_proc").dataTable({ - aaData: data, - aoColumns: [ - { sTitle: "USER" }, - { sTitle: "PID" }, - { sTitle: "%CPU" }, - { sTitle: "%MEM" }, - { sTitle: "VSZ" }, - { sTitle: "RSS" }, - { sTitle: "TTY" }, - { sTitle: "STAT" }, - { sTitle: "START" }, - { sTitle: "TIME" }, - { sTitle: "COMMAND" } - ], - bPaginate: true, - sPaginationType: "full_numbers", - bFilter: true, - sDom: "lrtip", - bAutoWidth: false, - bInfo: false - }).fadeIn(); - $("#filter-ps").on("keyup", function() { - psTable.fnFilter(this.value); - }); + }); +}; + +dashboard.getProc = function () { + $.getJSON('/info/proc/', function (data) { + destroy_dataTable("get_proc"); + var $filterPs = $("#filter-ps"); + $filterPs.val("").off("keyup"); + var psTable = $("#get_proc").dataTable({ + aaData: data, + aoColumns: [ + { sTitle: "USER" }, + { sTitle: "PID" }, + { sTitle: "%CPU" }, + { sTitle: "%MEM" }, + { sTitle: "VSZ" }, + { sTitle: "RSS" }, + { sTitle: "TTY" }, + { sTitle: "STAT" }, + { sTitle: "START" }, + { sTitle: "TIME" }, + { sTitle: "COMMAND" } + ], + bPaginate: true, + sPaginationType: "full_numbers", + bFilter: true, + sDom: "lrtip", + bAutoWidth: false, + bInfo: false + }).fadeIn(); + $filterPs.on("keyup", function () { + psTable.fnFilter(this.value); }); -} + }); +}; -dashboard.getIps = function() { - $.getJSON('/info/getips/', function(data) { - destroy_dataTable("get_ips"); - $("#filter-ps").val("").off("keyup"); - var psTable = $("#get_ips").dataTable({ - aaData: data, - aoColumns: [ - { sTitle: "INTERFACE" }, - { sTitle: "MAC ADDRESS" }, - { sTitle: "IP ADDRESS" }, - { sTitle: "IP ADDRESS", - sDefaultContent: "unavailable" } - ], - bPaginate: false, - bFilter: true, - sDom: "lrtip", - bAutoWidth: false, - bInfo: false - }).fadeIn(); - $("#filter-ps").on("keyup", function() { - psTable.fnFilter(this.value); - }); +dashboard.getIps = function () { + $.getJSON('/info/getips/', function (data) { + destroy_dataTable("get_ips"); + var $filterPs = $("#filter-ps"); + $filterPs.val("").off("keyup"); + var psTable = $("#get_ips").dataTable({ + aaData: data, + aoColumns: [ + { sTitle: "INTERFACE" }, + { sTitle: "MAC ADDRESS" }, + { sTitle: "IP ADDRESS" }, + { sTitle: "IP ADDRESS", + sDefaultContent: "unavailable" } + ], + bPaginate: false, + bFilter: true, + sDom: "lrtip", + bAutoWidth: false, + bInfo: false + }).fadeIn(); + $filterPs.on("keyup", function () { + psTable.fnFilter(this.value); }); -} + }); +}; -//Expand-Contract div/table -$(document).ready(function() { - $(".widget-content").show(); - $(".widget-header").click(function() - { - $(this).next(".widget-content").slideToggle(500); - $("i",this).toggleClass("icon-minus icon-plus"); +// Expand-Contract div/table +$(document).ready(function () { + $(".widget-content").show(); + $(".widget-header").click(function () { + $(this).next(".widget-content").slideToggle(500); + $("i", this).toggleClass("icon-minus icon-plus"); }); }); diff --git a/usage/views.py b/usage/views.py index 3a58ac4..77e1554 100755 --- a/usage/views.py +++ b/usage/views.py @@ -1,34 +1,33 @@ -#The MIT License (MIT) +# The MIT License (MIT) # -#Copyright (c) 2014 Florian Neagu - michaelneagu@gmail.com - https://github.com/k3oni/ +# Copyright (c) 2014 Florian Neagu - michaelneagu@gmail.com - https://github.com/k3oni/ # -#Permission is hereby granted, free of charge, to any person obtaining a copy -#of this software and associated documentation files (the "Software"), to deal -#in the Software without restriction, including without limitation the rights -#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -#copies of the Software, and to permit persons to whom the Software is -#furnished to do so, subject to the following conditions: +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -#The above copyright notice and this permission notice shall be included in all -#copies or substantial portions of the Software. +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. # -#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -#SOFTWARE. +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. import json -from django.shortcuts import render_to_response -from django.http import HttpResponse, HttpResponseRedirect -from django.template import RequestContext -from django.contrib.auth.decorators import login_required + +from django.http import HttpResponse from main.views import * from pydash.settings import TIME_JS_REFRESH, TIME_JS_REFRESH_LONG, TIME_JS_REFRESH_NET + time_refresh = TIME_JS_REFRESH time_refresh_long = TIME_JS_REFRESH_LONG time_refresh_net = TIME_JS_REFRESH_NET @@ -40,16 +39,17 @@ def getnetstat(request): Return netstat output """ try: - net_stat = get_netstat() + net_stat = get_netstat() except Exception: - net_stat = None - + net_stat = None + data = json.dumps(net_stat) response = HttpResponse() response['Content-Type'] = "text/javascript" response.write(data) return response - + + @login_required(login_url='/login/') def platform(request, name): """ @@ -59,52 +59,56 @@ def platform(request, name): hostname = getplatform['hostname'] osname = getplatform['osname'] kernel = getplatform['kernel'] - + + data = {} + if name == 'hostname': - try: - data = hostname - except Exception: - data = None + try: + data = hostname + except Exception: + data = None if name == 'osname': - try: - data = osname - except Exception: - data = None - + try: + data = osname + except Exception: + data = None + if name == 'kernel': - try: - data = kernel - except Exception: - data = None + try: + data = kernel + except Exception: + data = None - data = json.dumps(data) + data = json.dumps(data) response = HttpResponse() response['Content-Type'] = "text/javascript" response.write(data) return response - + + @login_required(login_url='/login/') def getcpus(request, name): """ Return the CPU number and type/model """ - getcpus = get_cpus() - cputype = getcpus['type'] - cpucount = getcpus['cpus'] - + cpus = get_cpus() + cputype = cpus['type'] + cpucount = cpus['cpus'] + data = {} + if name == 'type': - try: - data = cputype - except Exception: - data = None - + try: + data = cputype + except Exception: + data = None + if name == 'count': - try: - data = cpucount - except Exception: - data = None - + try: + data = cpucount + except Exception: + data = None + data = json.dumps(data) response = HttpResponse() response['Content-Type'] = "text/javascript" @@ -118,10 +122,10 @@ def uptime(request): Return uptime """ try: - up_time = get_uptime() + up_time = get_uptime() except Exception: - up_time = None - + up_time = None + data = json.dumps(up_time) response = HttpResponse() response['Content-Type'] = "text/javascript" @@ -135,26 +139,27 @@ def getdisk(request): Return the disk usage """ try: - getdisk = get_disk() + diskusage = get_disk() except Exception: - getdisk = None - - data = json.dumps(getdisk) + diskusage = None + + data = json.dumps(diskusage) response = HttpResponse() response['Content-Type'] = "text/javascript" response.write(data) return response + @login_required(login_url='/login/') def getips(request): """ Return the IPs and interfaces """ try: - get_ips = get_ipaddress() + get_ips = get_ipaddress() except Exception: - get_ips = None - + get_ips = None + data = json.dumps(get_ips['itfip']) response = HttpResponse() response['Content-Type'] = "text/javascript" @@ -168,10 +173,10 @@ def getusers(request): Return online users """ try: - online_users = get_users() + online_users = get_users() except Exception: - online_users = None - + online_users = None + data = json.dumps(online_users) response = HttpResponse() response['Content-Type'] = "text/javascript" @@ -179,23 +184,24 @@ def getusers(request): return response -@login_required(login_url='/login/') +@login_required(login_url='/login/') def getproc(request): """ Return the running processes """ try: - processes = get_cpu_usage() - processes = processes['all'] + processes = get_cpu_usage() + processes = processes['all'] except Exception: - processes = None - + processes = None + data = json.dumps(processes) response = HttpResponse() response['Content-Type'] = "text/javascript" response.write(data) return response + @login_required(login_url='/login/') def cpuusage(request): """ @@ -203,20 +209,20 @@ def cpuusage(request): """ try: cpu_usage = get_cpu_usage() - + except Exception: cpu_usage = 0 - + cpu = [ - { - "value": cpu_usage['free'], - "color": "#0AD11B" - }, - { - "value": cpu_usage['used'], - "color": "#F7464A" - } - ] + { + "value": cpu_usage['free'], + "color": "#0AD11B" + }, + { + "value": cpu_usage['used'], + "color": "#F7464A" + } + ] data = json.dumps(cpu) response = HttpResponse() @@ -224,6 +230,7 @@ def cpuusage(request): response.write(data) return response + @login_required(login_url='/login/') def memusage(request): """ @@ -231,7 +238,6 @@ def memusage(request): """ datasets_free = [] datasets_used = [] - cookie_memory = {} try: mem_usage = get_mem() @@ -250,7 +256,7 @@ def memusage(request): datasets = json.loads(cookies) datasets_free = datasets[0] datasets_used = datasets[1] - + if len(datasets_free) > 10: while datasets_free: del datasets_free[0] @@ -298,7 +304,7 @@ def memusage(request): } ] } - + cookie_memory = [datasets_free, datasets_used] data = json.dumps(memory) response = HttpResponse() @@ -307,7 +313,8 @@ def memusage(request): response.write(data) return response -@login_required(login_url='/login/') + +@login_required(login_url='/login/') def loadaverage(request): """ Return Load Average numeric @@ -350,15 +357,15 @@ def loadaverage(request): 'labels': [""] * 10, 'datasets': [ { - "fillColor" : "rgba(151,187,205,0.5)", - "strokeColor" : "rgba(151,187,205,1)", - "pointColor" : "rgba(151,187,205,1)", + "fillColor": "rgba(151,187,205,0.5)", + "strokeColor": "rgba(151,187,205,1)", + "pointColor": "rgba(151,187,205,1)", "pointStrokeColor": "#fff", "data": datasets } ] } - + data = json.dumps(load) response = HttpResponse() response['Content-Type'] = "text/javascript" @@ -376,14 +383,12 @@ def gettraffic(request): datasets_in_i = [] datasets_out = [] datasets_out_o = [] - json_traffic = [] - cookie_traffic = {} label = "KBps" try: - intf = get_ipaddress() - intf = intf['interface'][0] - + intf = get_ipaddress() + intf = intf['interface'][0] + traffic = get_traffic(intf) except Exception: traffic = 0 @@ -402,8 +407,8 @@ def gettraffic(request): datasets = json.loads(cookies) datasets_in = datasets[0] datasets_out = datasets[1] - datasets_in_i = datasets[2] - datasets_out_o = datasets[3] + datasets_in_i = datasets[2] + datasets_out_o = datasets[3] if len(datasets_in) > 10: while datasets_in: @@ -437,14 +442,14 @@ def gettraffic(request): datasets_out_o.append(float(traffic['traffic_out'])) del datasets_out_o[0] - dataset_in = (float(((datasets_in_i[1] - datasets_in_i[0]) / 1024 ) / ( time_refresh_net / 1000 ))) - dataset_out = (float(((datasets_out_o[1] - datasets_out_o[0]) / 1024 ) / ( time_refresh_net / 1000 ))) - + dataset_in = (float(((datasets_in_i[1] - datasets_in_i[0]) / 1024) / (time_refresh_net / 1000))) + dataset_out = (float(((datasets_out_o[1] - datasets_out_o[0]) / 1024) / (time_refresh_net / 1000))) + if dataset_in > 1024 or dataset_out > 1024: - dataset_in = (float(dataset_in / 1024 )) - dataset_out = (float(dataset_out / 1024 )) - label = "MBps" - + dataset_in = (float(dataset_in / 1024)) + dataset_out = (float(dataset_out / 1024)) + label = "MBps" + if len(datasets_in) <= 9: datasets_in.append(dataset_in) if len(datasets_in) == 10: @@ -501,13 +506,10 @@ def getdiskio(request): datasets_in_i = [] datasets_out = [] datasets_out_o = [] - json_diskrw = [] - cookie_diskrw = {} try: - diskrw = get_disk_rw() - diskrw = diskrw[0] - + diskrw = get_disk_rw() + diskrw = diskrw[0] except Exception: diskrw = 0 @@ -525,8 +527,8 @@ def getdiskio(request): datasets = json.loads(cookies) datasets_in = datasets[0] datasets_out = datasets[1] - datasets_in_i = datasets[2] - datasets_out_o = datasets[3] + datasets_in_i = datasets[2] + datasets_out_o = datasets[3] if len(datasets_in) > 10: while datasets_in: @@ -560,9 +562,9 @@ def getdiskio(request): datasets_out_o.append(int(diskrw[2])) del datasets_out_o[0] - dataset_in = (int((datasets_in_i[1] - datasets_in_i[0]) / ( time_refresh_net / 1000 ))) - dataset_out = (int((datasets_out_o[1] - datasets_out_o[0]) / ( time_refresh_net / 1000 ))) - + dataset_in = (int((datasets_in_i[1] - datasets_in_i[0]) / (time_refresh_net / 1000))) + dataset_out = (int((datasets_out_o[1] - datasets_out_o[0]) / (time_refresh_net / 1000))) + if len(datasets_in) <= 9: datasets_in.append(dataset_in) if len(datasets_in) == 10: