From f009d813215242689ddea4c9be6270f30568c93b Mon Sep 17 00:00:00 2001 From: mokaddem Date: Wed, 28 Aug 2019 15:49:40 +0200 Subject: [PATCH 01/10] fix: [diagnostic] Changed string formating to `format` --- diagnostic.py | 58 +++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/diagnostic.py b/diagnostic.py index edf10d6..2b0e9bd 100755 --- a/diagnostic.py +++ b/diagnostic.py @@ -18,7 +18,7 @@ try: from halo import Halo except ModuleNotFoundError as e: print('Dependency not met. Either not in a virtualenv or dependency not installed.') - print(f'- Error: {e}') + print('- Error: {}'.format(e)) sys.exit(1) ''' @@ -79,12 +79,12 @@ def add_spinner(_func=None, name='dots'): else: status = False flag_skip = True - spinner.fail(f'{human_func_name} - Function return unexpected result: {str(result)}') + spinner.fail('{} - Function return unexpected result: {}'.format(human_func_name, str(result))) if not flag_skip: text = human_func_result if output is not None and len(output) > 0: - text += f': {output}' + text += ': {}'.format(output) if isinstance(status, bool) and status: spinner.succeed(text) @@ -111,8 +111,8 @@ def check_virtual_environment_and_packages(spinner): return (False, 'This diagnostic tool should be started inside a virtual environment.') else: if redis.__version__.startswith('2'): - return (False, f'''Redis python client have version {redis.__version__}. Version 3.x required. -\t➥ [inside virtualenv] pip3 install -U redis''') + return (False, '''Redis python client have version {}. Version 3.x required. +\t➥ [inside virtualenv] pip3 install -U redis'''.format(redis.__version__)) else: return (True, '') @@ -139,7 +139,7 @@ def check_configuration(spinner): return_text = '''Configuration incomplete. \tUpdate your configuration file `config.cfg`.\n\t➥ Faulty fields:\n''' for field_name in faulties: - return_text += f'\t\t- {field_name}\n' + return_text += '\t\t- {}\n'.format(field_name) return (False, return_text) @@ -192,7 +192,7 @@ def check_zmq(spinner): flag_skip = True break else: - spinner.text = f'checking zmq of {misp_instance.get("name")} - elapsed time: {int(time.time() - start_time)}s' + spinner.text = 'checking zmq of {} - elapsed time: {}s'.format(misp_instance.get("name"), int(time.time() - start_time)) if not flag_skip: instances_status[misp_instance.get('name')] = False @@ -202,7 +202,7 @@ def check_zmq(spinner): elif any(results): return_text = 'Connection to ZMQ stream(s) failed.\n' for name, status in instances_status.items(): - return_text += f'\t➥ {name}: {"success" if status else "failed"}\n' + return_text += '\t➥ {}: {}\n'.format(name, "success" if status else "failed") return (True, return_text) else: return (False, '''Can\'t connect to the ZMQ stream(s). @@ -257,14 +257,14 @@ def check_subscriber_status(spinner): target = split[4] except IndexError: pass - if action == '"LPUSH"' and target == f'\"{configuration_file.get("RedisLIST", "listName")}\"': + if action == '"LPUSH"' and target == '\"{}\"'.format(configuration_file.get("RedisLIST", "listName")): signal.alarm(0) break else: - spinner.text = f'Checking subscriber status - elapsed time: {int(time.time() - start_time)}s' + spinner.text = 'Checking subscriber status - elapsed time: {}s'.format(int(time.time() - start_time)) except diagnostic_util.TimeoutException: - return_text = f'''zmq_subscriber seems not to be working. -\t➥ Consider restarting it: {pgrep_subscriber_output}''' + return_text = '''zmq_subscriber seems not to be working. +\t➥ Consider restarting it: {}'''.format(pgrep_subscriber_output) return (False, return_text) return (True, 'subscriber is running and populating the buffer') @@ -278,7 +278,7 @@ def check_buffer_queue(spinner): warning_threshold = 100 elements_in_list = redis_server.llen(configuration_file.get('RedisLIST', 'listName')) return_status = 'warning' if elements_in_list > warning_threshold else ('info' if elements_in_list > 0 else True) - return_text = f'Currently {elements_in_list} items in the buffer' + return_text = 'Currently {} items in the buffer'.format(elements_in_list) return (return_status, return_text) @@ -308,8 +308,8 @@ def check_buffer_change_rate(spinner): if next_refresh < time_slept: next_refresh = time_slept + refresh_frequency - change_rate_text = f'↑ {change_increase}/sec\t↓ {change_decrease}/sec' - spinner.text = f'Buffer: {elements_in_list}\t{change_rate_text}' + change_rate_text = '↑ {}/sec\t↓ {}/sec'.format(change_increase, change_decrease) + spinner.text = 'Buffer: {}\t{}'.format(elements_in_list, change_rate_text) if consecutive_no_rate_change == 3: time_slept = sleep_max @@ -322,7 +322,7 @@ def check_buffer_change_rate(spinner): if time_slept >= sleep_max: return_flag = elements_in_list == 0 or (elements_in_list < elements_in_inlist_init or elements_in_list < 2) - return_text = f'Buffer is consumed {"faster" if return_flag else "slower" } than being populated' + return_text = 'Buffer is consumed {} than being populated'.format("faster" if return_flag else "slower") break time.sleep(sleep_duration) @@ -354,18 +354,18 @@ def check_dispatcher_status(spinner): if reply is None: if time_slept >= sleep_max: return_flag = False - return_text = f'zmq_dispatcher did not respond in the given time ({int(sleep_max)}s)' + return_text = 'zmq_dispatcher did not respond in the given time ({}s)'.format(int(sleep_max)) if len(pgrep_dispatcher_output) > 0: - return_text += f'\n\t➥ Consider restarting it: {pgrep_dispatcher_output}' + return_text += '\n\t➥ Consider restarting it: {}'.format(pgrep_dispatcher_output) else: return_text += '\n\t➥ Consider starting it' break time.sleep(sleep_duration) - spinner.text = f'Dispatcher status: No response yet' + spinner.text = 'Dispatcher status: No response yet' time_slept += sleep_duration else: return_flag = True - return_text = f'Took {float(reply):.2f}s to complete' + return_text = 'Took {}s to complete'.format(float(reply):.2f) break return (return_flag, return_text) @@ -373,15 +373,15 @@ def check_dispatcher_status(spinner): @add_spinner def check_server_listening(spinner): - url = f'{HOST}:{PORT}/_get_log_head' - spinner.text = f'Trying to connect to {url}' + url = '{}:{}/_get_log_head'.format(HOST, PORT) + spinner.text = 'Trying to connect to {}'.format(url) try: r = requests.get(url) except requests.exceptions.ConnectionError: - return (False, f'Can\'t connect to {url}') + return (False, 'Can\'t connect to {}').format(url) return ( r.status_code == 200, - f'{url} {"not " if r.status_code != 200 else ""}reached. Status code [{r.status_code}]' + '{} {}reached. Status code [{}]'.format(url, "not " if r.status_code != 200 else "", r.status_code) ) @@ -389,14 +389,14 @@ def check_server_listening(spinner): def check_server_dynamic_enpoint(spinner): sleep_max = 15 start_time = time.time() - url = f'{HOST}:{PORT}/_logs' + url = '{}:{}/_logs'.format(HOST, PORT) p = subprocess.Popen( ['curl', '-sfN', '--header', 'Accept: text/event-stream', url], stdout=subprocess.PIPE, bufsize=1) signal.alarm(sleep_max) return_flag = False - return_text = f'Dynamic endpoint returned data but not in the correct format.' + return_text = 'Dynamic endpoint returned data but not in the correct format.' try: for line in iter(p.stdout.readline, b''): if line.startswith(b'data: '): @@ -404,15 +404,15 @@ def check_server_dynamic_enpoint(spinner): try: j = json.loads(data) return_flag = True - return_text = f'Dynamic endpoint returned data (took {time.time()-start_time:.2f}s)' + return_text = 'Dynamic endpoint returned data (took {}s)'.format(time.time()-start_time:.2f) signal.alarm(0) break except Exception as e: return_flag = False - return_text = f'Something went wrong. Output {line}' + return_text = 'Something went wrong. Output {}'.format(line) break except diagnostic_util.TimeoutException: - return_text = f'Dynamic endpoint did not returned data in the given time ({int(time.time()-start_time)}sec)' + return_text = 'Dynamic endpoint did not returned data in the given time ({}sec)'.format(int(time.time()-start_time)) return (return_flag, return_text) From f2fb36601a464cbbe2446159acccb4d45b317264 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Wed, 28 Aug 2019 15:54:37 +0200 Subject: [PATCH 02/10] fix: [helpers] Changed string formating to `format` and slight refact --- helpers/contributor_helper.py | 5 ++--- helpers/geo_helper.py | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/helpers/contributor_helper.py b/helpers/contributor_helper.py index 8044d89..34db60e 100644 --- a/helpers/contributor_helper.py +++ b/helpers/contributor_helper.py @@ -100,7 +100,7 @@ class Contributor_helper: self.DICO_PNTS_REWARD[categ] = self.default_pnts_per_contribution self.rankMultiplier = self.cfg_org_rank.getfloat('monthlyRanking' ,'rankMultiplier') - self.levelMax = self.cfg_org_rank.getint('monthlyRanking' ,'levelMax') + self.levelMax = self.cfg_org_rank.getint('monthlyRanking', 'levelMax') # REDIS KEYS self.keyDay = KEYDAY @@ -111,7 +111,6 @@ class Contributor_helper: self.keyTrophy = "CONTRIB_TROPHY" self.keyLastAward = "CONTRIB_LAST_AWARDS" - ''' HELPER ''' def getOrgLogoFromMISP(self, org): return "{}/img/orgs/{}.png".format(self.misp_web_url, org) @@ -123,7 +122,7 @@ class Contributor_helper: self.logger.debug('Added to redis: keyname={}, org={}, count={}'.format(keyname, org, count)) def publish_log(self, zmq_name, name, content, channel=""): - to_send = { 'name': name, 'log': json.dumps(content), 'zmqName': zmq_name } + to_send = {'name': name, 'log': json.dumps(content), 'zmqName': zmq_name } self.serv_log.publish(channel, json.dumps(to_send)) self.logger.debug('Published: {}'.format(json.dumps(to_send))) diff --git a/helpers/geo_helper.py b/helpers/geo_helper.py index 1133c62..6d29708 100644 --- a/helpers/geo_helper.py +++ b/helpers/geo_helper.py @@ -208,9 +208,10 @@ class Geo_helper: print("Please fix the above, and make sure you use a redis version that supports the GEOADD command.") print("To test for support: echo \"help GEOADD\"| redis-cli") self.logger.debug('Added to redis: keyname={}, lon={}, lat={}, content={}'.format(keyname, lon, lat, content)) + def push_to_redis_zset(self, keyCateg, toAdd, endSubkey="", count=1): if not isinstance(toAdd, str): - self.logger.warning(f'Can\'t add to redis, element is not of type String. {type(toAdd)}') + self.logger.warning('Can\'t add to redis, element is not of type String. {}'.format(type(toAdd))) return now = datetime.datetime.now() today_str = util.getDateStrFormat(now) From 26f9e317861266be5b6891c4ec80d82034b1e9ef Mon Sep 17 00:00:00 2001 From: mokaddem Date: Wed, 28 Aug 2019 15:57:13 +0200 Subject: [PATCH 03/10] fix: [update] Changed string formating to `format` --- updates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updates.py b/updates.py index d23681b..ef8a71d 100644 --- a/updates.py +++ b/updates.py @@ -65,9 +65,9 @@ def exec_updates(db_version): if result: serv_redis_db.set(cfg.get('RedisDB', 'dbVersion'), db_version) - update_logger.warning(f'dbVersion sets to {db_version}') + update_logger.warning('dbVersion sets to {}'.format(db_version)) else: - update_logger.error(f'Something went wrong. {result}') + update_logger.error('Something went wrong. {}'.format(result)) # Data format changed. Wipe the key. From fb1332be6a6471542d44daff3488403103ff7c64 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Wed, 28 Aug 2019 16:04:45 +0200 Subject: [PATCH 04/10] fix: [diagnostic] Corrected copy/paste typo Just me being a monkey --- diagnostic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diagnostic.py b/diagnostic.py index 2b0e9bd..386c048 100755 --- a/diagnostic.py +++ b/diagnostic.py @@ -365,7 +365,7 @@ def check_dispatcher_status(spinner): time_slept += sleep_duration else: return_flag = True - return_text = 'Took {}s to complete'.format(float(reply):.2f) + return_text = 'Took {:.2f}s to complete'.format(float(reply)) break return (return_flag, return_text) @@ -404,7 +404,7 @@ def check_server_dynamic_enpoint(spinner): try: j = json.loads(data) return_flag = True - return_text = 'Dynamic endpoint returned data (took {}s)'.format(time.time()-start_time:.2f) + return_text = 'Dynamic endpoint returned data (took {:.2f}s)'.format(time.time()-start_time) signal.alarm(0) break except Exception as e: From 0dbaa034fb23f740b6b377256bea525a32341b5c Mon Sep 17 00:00:00 2001 From: mokaddem Date: Thu, 29 Aug 2019 10:25:57 +0200 Subject: [PATCH 05/10] fix: [contrib] Hide broken organisation images - Fix #110 --- static/js/contrib.js | 19 ++++++++++++------- templates/contrib.html | 4 ++-- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/static/js/contrib.js b/static/js/contrib.js index 285ea3d..61c2bd1 100644 --- a/static/js/contrib.js +++ b/static/js/contrib.js @@ -152,6 +152,7 @@ function getMonthlyRankIcon(rank, size, header) { img.width = size; } } + img.setAttribute('onerror', "this.style.display='none'"); return img.outerHTML; } @@ -167,7 +168,8 @@ function getOrgRankIcon(rank, size) { obj.src = rankLogoPath; obj.type = "image/svg" obj.title = org_rank_obj[rank]; - obj.classList.add('orgRankClass') + obj.classList.add('orgRankClass'); + obj.setAttribute('onerror', "this.style.display='none'"); return obj.outerHTML; } @@ -177,8 +179,9 @@ function createImg(source, size) { obj.width = size; obj.style.margin = 'auto'; obj.src = source; - obj.type = "image/png" - obj.alt = "" + obj.type = "image/png"; + obj.alt = ""; + obj.setAttribute('onerror', "this.style.display='none'"); return obj.outerHTML; } @@ -187,10 +190,11 @@ function createTrophyImg(rank, size, categ) { obj.height = size; obj.width = size; obj.style.margin = 'auto'; - obj.src = url_baseTrophyLogo+rank+'.png';; + obj.src = url_baseTrophyLogo+rank+'.png'; obj.title = trophy_title[rank] + " in " + categ; - obj.type = "image/png" - obj.alt = "" + obj.type = "image/png"; + obj.alt = ""; + obj.setAttribute('onerror', "this.style.display='none'"); return obj.outerHTML; } @@ -208,6 +212,7 @@ function createHonorImg(array, size) { obj.style.margin = 'auto'; obj.title = org_honor_badge_title[badgeNum]; obj.src = url_baseHonorLogo+badgeNum+'.svg'; + obj.setAttribute('onerror', "this.style.display='none'"); div.appendChild(obj); } div.style.width = 32*array.length+'px'; @@ -563,7 +568,7 @@ function generate_table_ranking_on_category(categ) { var rank = arr[2]; var tr = $(''); tr.append($(''+i+'')); - tr.append($('')); + tr.append($('')); tr.append($(''+points+'')); tr.append($(''+org+'')); if (currOrg == org) { diff --git a/templates/contrib.html b/templates/contrib.html index 5c9a863..5a9677f 100644 --- a/templates/contrib.html +++ b/templates/contrib.html @@ -120,7 +120,7 @@ {% for item in org_rank_list %} - + {{ item[1] }} {{ item[2] }} {{ item[3] }} @@ -172,7 +172,7 @@
- +
{{ item[1] }} From 2f3fd08404aad7f04360b852eee870c90da4e427 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Fri, 30 Aug 2019 10:50:41 +0200 Subject: [PATCH 06/10] chg: [start] Added restart capability --- start_zmq.sh | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/start_zmq.sh b/start_zmq.sh index 9ce96fc..dec1b76 100755 --- a/start_zmq.sh +++ b/start_zmq.sh @@ -1,5 +1,4 @@ #!/usr/bin/env bash - #set -x GREEN="\\033[1;32m" @@ -9,6 +8,7 @@ RED="\\033[1;31m" # Getting CWD where bash script resides DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DASH_HOME="${DIR}" +SCREEN_NAME="Misp_Dashboard" cd ${DASH_HOME} @@ -20,11 +20,27 @@ else exit 1 fi + +PID_SCREEN=$(screen -ls | grep ${SCREEN_NAME} | cut -f2 | cut -d. -f1) +if [[ $PID_SCREEN ]]; then + echo -e $RED"* A screen '$SCREEN_NAME' is already launched"$DEFAULT + echo "Would you like to restart it (y/n)? " + read answer + if [ "$answer" != "${answer#[Yy]}" ] ;then + echo -e $GREEN"Killing $PID_SCREEN"$DEFAULT; + kill $PID_SCREEN + else + echo 'Exiting' + exit 0; + fi +else + echo 'No screen detected' +fi + +screen -dmS ${SCREEN_NAME} + ps auxw |grep zmq_subscriber.py |grep -v grep ; check_zmq_subscriber=$? ps auxw |grep zmq_dispatcher.py |grep -v grep ; check_zmq_dispatcher=$? - -screen -dmS "Misp_Dashboard" - sleep 0.1 if [ "${check_zmq_subscriber}" == "1" ]; then echo -e $GREEN"\t* Launching zmq subscribers"$DEFAULT @@ -39,4 +55,4 @@ if [ "${check_zmq_dispatcher}" == "1" ]; then screen -S "Misp_Dashboard" -X screen -t "zmq-dispacher" bash -c ${ENV_PY}' ./zmq_dispatcher.py; read x' else echo -e $RED"\t* NOT starting zmq dispatcher, made a rather unrealiable ps -auxw | grep for zmq_dispatcher.py, and something seems to be there… please double check if this is good!"$DEFAULT -fi +fi \ No newline at end of file From 19842f944558f2e3eb5a8d4d6bf35aefd400f97d Mon Sep 17 00:00:00 2001 From: mokaddem Date: Fri, 30 Aug 2019 11:05:43 +0200 Subject: [PATCH 07/10] fix: Catch if country does not have alpha_2 attribute - fix #119 --- helpers/geo_helper.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/helpers/geo_helper.py b/helpers/geo_helper.py index 6d29708..5fe678b 100644 --- a/helpers/geo_helper.py +++ b/helpers/geo_helper.py @@ -21,6 +21,7 @@ from phonenumbers import geocoder class InvalidCoordinate(Exception): pass + class Geo_helper: def __init__(self, serv_redis_db, cfg): self.serv_redis_db = serv_redis_db @@ -62,7 +63,12 @@ class Geo_helper: print(error) print("Please fix the above and try again.") sys.exit(126) - self.country_to_iso = { country.name: country.alpha_2 for country in pycountry.countries} + self.country_to_iso = {} + for country in pycountry.countries: + try: + self.country_to_iso[country.name] = country.alpha_2 + except AttributeError: + pass with open(self.PATH_TO_JSON) as f: self.country_code_to_coord = json.load(f) From 3e218cd14512bcb7ca30d970af62c2b8c5589600 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Fri, 30 Aug 2019 11:39:14 +0200 Subject: [PATCH 08/10] chg: [startup] Wait until redis is ready before starting the zmqs scripts --- start_all.sh | 25 +++++++++++++++++++++++++ start_zmq.sh | 12 ++---------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/start_all.sh b/start_all.sh index a9b7c89..5895794 100755 --- a/start_all.sh +++ b/start_all.sh @@ -6,6 +6,29 @@ GREEN="\\033[1;32m" DEFAULT="\\033[0;39m" RED="\\033[1;31m" +function wait_until_redis_is_ready { + redis_not_ready=true + while $redis_not_ready; do + if checking_redis; then + redis_not_ready=false; + else + sleep 1 + fi + done + echo -e $GREEN"* Redis 6250 is running"$DEFAULT +} + +function checking_redis { + flag_redis=0 + bash -c 'redis-cli -p 6250 PING | grep "PONG" &> /dev/null' + if [ ! $? == 0 ]; then + echo -e $RED"Redis 6250 not ready"$DEFAULT + flag_redis=1 + fi + sleep 0.1 + return $flag_redis; +} + # Getting CWD where bash script resides DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DASH_HOME="${DIR}" @@ -61,6 +84,8 @@ else fi sleep 0.1 +wait_until_redis_is_ready; + if [ "${check_dashboard_port}" == "1" ]; then echo -e $GREEN"\t* Launching flask server"$DEFAULT ${ENV_PY} ./server.py & diff --git a/start_zmq.sh b/start_zmq.sh index dec1b76..f64b539 100755 --- a/start_zmq.sh +++ b/start_zmq.sh @@ -20,19 +20,11 @@ else exit 1 fi - PID_SCREEN=$(screen -ls | grep ${SCREEN_NAME} | cut -f2 | cut -d. -f1) if [[ $PID_SCREEN ]]; then echo -e $RED"* A screen '$SCREEN_NAME' is already launched"$DEFAULT - echo "Would you like to restart it (y/n)? " - read answer - if [ "$answer" != "${answer#[Yy]}" ] ;then - echo -e $GREEN"Killing $PID_SCREEN"$DEFAULT; - kill $PID_SCREEN - else - echo 'Exiting' - exit 0; - fi + echo -e $GREEN"Killing $PID_SCREEN"$DEFAULT; + kill $PID_SCREEN else echo 'No screen detected' fi From fba754b2e5b49078a802bd756f467349a30b61d0 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Fri, 30 Aug 2019 11:59:50 +0200 Subject: [PATCH 09/10] chg: [livelog] Fix z-index and fullscreen log panel z-index --- templates/index.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/templates/index.html b/templates/index.html index 848c969..c90d5ea 100644 --- a/templates/index.html +++ b/templates/index.html @@ -188,11 +188,15 @@ div.dataTables_scrollHead table.dataTable { top: 66px !important; left: 15px !important; right: 10px !important; - z-index: 1001 !important; + z-index: 990 !important; bottom: -7px !important; height: unset !important; } +div.leaflet-bottom { + z-index: 900; +} + .rowTableIsObject { position: absolute; right: 15px; From 8fd474712b23a53e12f25675ce6dc35c1555fc3a Mon Sep 17 00:00:00 2001 From: mokaddem Date: Fri, 30 Aug 2019 12:15:43 +0200 Subject: [PATCH 10/10] chg: [livelog] Scrolling Logs when fullscreen is on - Fix #118 --- static/js/index/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/static/js/index/index.js b/static/js/index/index.js index d7c8df5..faf66e3 100644 --- a/static/js/index/index.js +++ b/static/js/index/index.js @@ -445,6 +445,13 @@ function createHead(callback) { } }, + changeOptions: function(options) { + var that = this; + Object.keys(options).forEach(function (optionName) { + that._options[optionName] = options[optionName]; + }); + }, + fetch_predata: function() { var that = this; if (this._options.preDataURL !== null) { @@ -808,10 +815,14 @@ $(document).ready(function() { $panel.detach().prependTo('#page-wrapper') $panel.addClass('liveLogFullScreen'); $this.data('isfullscreen', true); + $panel.find('#divLogTable').css({'overflow-y': 'auto'}); + livelog.changeOptions({tableMaxEntries: 300}); } else { $panel.detach().appendTo('#rightCol') $panel.removeClass('liveLogFullScreen'); $this.data('isfullscreen', false); + $panel.find('#divLogTable').css({'overflow': 'hidden'}); + livelog.changeOptions({tableMaxEntries: 50}); } });