lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
December 2018
----- 2024 -----
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
15 participants
342 discussions
Start a n
N
ew thread
Moved service discovery logic to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: 16417afedd34b90349e622574a28a5d8a252de2e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=16417afedd34b9…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:38 2018 +0100 Moved service discovery logic to dedicated module Change-Id: I418e2ada412b71618706f64213b0d4f88c84db26 --- cmk/gui/wato/pages/services.py | 6 +- web/htdocs/js/index.js | 2 + web/htdocs/js/modules/service_discovery.js | 210 +++++++++++++++++++++++++++++ web/htdocs/js/wato.js | 201 --------------------------- 4 files changed, 215 insertions(+), 204 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=16417afedd…
5 years, 6 months
1
0
0
0
Moved hover logic to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: 39fb0ab915b6bd28512d760e52312777db436bbd URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=39fb0ab915b6bd…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:37 2018 +0100 Moved hover logic to dedicated module Change-Id: I870035139f3e82db8125e18fc706671b9edab730 --- cmk/gui/plugins/views/icons/builtin.py | 2 +- web/htdocs/js/checkmk.js | 140 ++------------------------------ web/htdocs/js/index.js | 2 + web/htdocs/js/modules/hover.js | 143 +++++++++++++++++++++++++++++++++ 4 files changed, 151 insertions(+), 136 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=39fb0ab915…
5 years, 6 months
1
0
0
0
Moved backup logic to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: b48cc5f2fb47b8bae23808a682a96cc0082c6fa3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b48cc5f2fb47b8…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:37 2018 +0100 Moved backup logic to dedicated module Change-Id: If3c379f17e338f2609e7b24627c881dd2fd92121 --- cmk/gui/backup.py | 4 +- web/htdocs/js/checkmk.js | 89 ---------------------------------- web/htdocs/js/index.js | 2 + web/htdocs/js/modules/backup.js | 103 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 91 deletions(-) diff --git a/cmk/gui/backup.py b/cmk/gui/backup.py index e89facb..5a80059 100644 --- a/cmk/gui/backup.py +++ b/cmk/gui/backup.py @@ -821,8 +821,8 @@ class PageAbstractBackupJobState(object): html.open_div(id_="job_details") self.show_job_details() html.close_div() - html.javascript("refresh_job_details('%s', '%s', %s)" % (self._update_url(), self._ident, - "true" if is_site() else "false")) + html.javascript("cmk.backup.refresh_job_details('%s', '%s', %s)" % + (self._update_url(), self._ident, "true" if is_site() else "false")) def _update_url(self): return "ajax_backup_job_state.py?job=%s" % self._ident diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js index 6e6b487..8ed7c5e 100644 --- a/web/htdocs/js/checkmk.js +++ b/web/htdocs/js/checkmk.js @@ -2379,92 +2379,3 @@ function hover_menu_in_screen(hoverMenu, hoverSpacer) return true; } - -//#. -//# .-Backup-------------------------------------------------------------. -//# | ____ _ | -//# | | __ ) __ _ ___| | ___ _ _ __ | -//# | | _ \ / _` |/ __| |/ / | | | '_ \ | -//# | | |_) | (_| | (__| <| |_| | |_) | | -//# | |____/ \__,_|\___|_|\_\\__,_| .__/ | -//# | |_| | -//# +--------------------------------------------------------------------+ -//# | | -//# '--------------------------------------------------------------------' - -function refresh_job_details(url, ident, is_site) -{ - setTimeout(function() { - do_job_detail_refresh(url, ident, is_site); - }, 1000); -} - -function do_job_detail_refresh(url, ident, is_site) -{ - call_ajax(url, { - method : "GET", - post_data : "job=" + encodeURIComponent(ident), - response_handler : handle_job_detail_response, - error_handler : handle_job_detail_error, - handler_data : { - "url" : url, - "ident" : ident, - "is_site" : is_site, - } - }); -} - -function handle_job_detail_response(handler_data, response_body) -{ - // when a message was shown and now not anymore, assume the job has finished - var had_message = document.getElementById("job_detail_msg") ? true : false; - - var container = document.getElementById("job_details"); - container.innerHTML = response_body; - - if (!had_message) { - refresh_job_details(handler_data["url"], handler_data["ident"], handler_data["is_site"]); - } - else { - cmk.utils.reload_sidebar(); - window.location.reload(); - } -} - -function handle_job_detail_error(handler_data, status_code, error_msg) -{ - hide_job_detail_msg(); - - if (status_code == 0) - return; // ajax request aborted. Stop refresh. - - var container = document.getElementById("job_details"); - - var msg = document.createElement("div"); - container.insertBefore(msg, container.children[0]); - msg.setAttribute("id", "job_detail_msg"); - msg.className = "message"; - - var txt = "Could not update the job details."; - if (handler_data.is_site) - txt += " The site will be started again after the restore."; - else - txt += " Maybe the device is currently being rebooted."; - - txt += "<br>Will continue trying to refresh the job details."; - - txt += "<br><br>HTTP status code: "+status_code; - if (error_msg) - txt += ", Error: "+error_msg; - - msg.innerHTML = txt; - - refresh_job_details(handler_data["url"], handler_data["ident"], handler_data["is_site"]); -} - -function hide_job_detail_msg() -{ - var msg = document.getElementById("job_detail_msg"); - if (msg) - msg.parentNode.removeChild(msg); -} diff --git a/web/htdocs/js/index.js b/web/htdocs/js/index.js index 8fe5d44..83a4402 100644 --- a/web/htdocs/js/index.js +++ b/web/htdocs/js/index.js @@ -38,6 +38,7 @@ import * as availability from "availability"; import * as sla from "sla"; import * as bi from "bi"; import * as crash_reporting from "crash_reporting"; +import * as backup from "backup"; import * as dashboard from "dashboard"; require("script-loader!./checkmk.js"); @@ -72,6 +73,7 @@ export default { sla: sla, bi: bi, crash_reporting: crash_reporting, + backup: backup, dashboard: dashboard }, // TODO: Compatibility for not yet modularized JS code diff --git a/web/htdocs/js/modules/backup.js b/web/htdocs/js/modules/backup.js new file mode 100644 index 0000000..7f730f2 --- /dev/null +++ b/web/htdocs/js/modules/backup.js @@ -0,0 +1,103 @@ +// +------------------------------------------------------------------+ +// | ____ _ _ __ __ _ __ | +// | / ___| |__ ___ ___| | __ | \/ | |/ / | +// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +// | | |___| | | | __/ (__| < | | | | . \ | +// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +// | | +// | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de | +// +------------------------------------------------------------------+ +// +// This file is part of Check_MK. +// The official homepage is at
http://mathias-kettner.de/check_mk
. +// +// check_mk is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation in version 2. check_mk is distributed +// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +// PARTICULAR PURPOSE. See the GNU General Public License for more de- +// ails. You should have received a copy of the GNU General Public +// License along with GNU Make; see the file COPYING. If not, write +// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +// Boston, MA 02110-1301 USA. + +import * as utils from "utils"; +import * as ajax from "ajax"; + +export function refresh_job_details(url, ident, is_site) +{ + setTimeout(function() { + do_job_detail_refresh(url, ident, is_site); + }, 1000); +} + +function do_job_detail_refresh(url, ident, is_site) +{ + ajax.call_ajax(url, { + method : "GET", + post_data : "job=" + encodeURIComponent(ident), + response_handler : handle_job_detail_response, + error_handler : handle_job_detail_error, + handler_data : { + "url" : url, + "ident" : ident, + "is_site" : is_site, + } + }); +} + +function handle_job_detail_response(handler_data, response_body) +{ + // when a message was shown and now not anymore, assume the job has finished + var had_message = document.getElementById("job_detail_msg") ? true : false; + + var container = document.getElementById("job_details"); + container.innerHTML = response_body; + + if (!had_message) { + refresh_job_details(handler_data["url"], handler_data["ident"], handler_data["is_site"]); + } + else { + utils.reload_sidebar(); + window.location.reload(); + } +} + +function handle_job_detail_error(handler_data, status_code, error_msg) +{ + hide_job_detail_msg(); + + if (status_code == 0) + return; // ajax request aborted. Stop refresh. + + var container = document.getElementById("job_details"); + + var msg = document.createElement("div"); + container.insertBefore(msg, container.children[0]); + msg.setAttribute("id", "job_detail_msg"); + msg.className = "message"; + + var txt = "Could not update the job details."; + if (handler_data.is_site) + txt += " The site will be started again after the restore."; + else + txt += " Maybe the device is currently being rebooted."; + + txt += "<br>Will continue trying to refresh the job details."; + + txt += "<br><br>HTTP status code: "+status_code; + if (error_msg) + txt += ", Error: "+error_msg; + + msg.innerHTML = txt; + + refresh_job_details(handler_data["url"], handler_data["ident"], handler_data["is_site"]); +} + +function hide_job_detail_msg() +{ + var msg = document.getElementById("job_detail_msg"); + if (msg) + msg.parentNode.removeChild(msg); +}
5 years, 6 months
1
0
0
0
Moved host diagnose logic to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: 73706f40bf73039214aecb7570b85338ec25d2f3 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=73706f40bf7303…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:38 2018 +0100 Moved host diagnose logic to dedicated module Change-Id: I8533931e04fe3702dba86329245448999adf9c9d --- cmk/gui/wato/pages/host_diagnose.py | 6 +- web/htdocs/js/index.js | 2 + web/htdocs/js/modules/host_diagnose.js | 111 +++++++++++++++++++++++++++++++++ web/htdocs/js/wato.js | 93 --------------------------- 4 files changed, 116 insertions(+), 96 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=73706f40bf…
5 years, 6 months
1
0
0
0
Moved profile replication to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: 2ae9f34f59416bcb138346045d2692d53855f0ef URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2ae9f34f59416b…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:38 2018 +0100 Moved profile replication to dedicated module Change-Id: I1f3aaef3c7d38144b1bb931a0c207b9ca8c18b04 --- cmk/gui/wato/user_profile.py | 4 +- web/htdocs/js/index.js | 2 + web/htdocs/js/modules/profile_replication.js | 103 +++++++++++++++++++++++++++ web/htdocs/js/wato.js | 84 ---------------------- 4 files changed, 107 insertions(+), 86 deletions(-) diff --git a/cmk/gui/wato/user_profile.py b/cmk/gui/wato/user_profile.py index 2059b6e..0f1ca79 100644 --- a/cmk/gui/wato/user_profile.py +++ b/cmk/gui/wato/user_profile.py @@ -89,7 +89,7 @@ def user_profile_async_replication_dialog(sites): estimated_duration = changes_manager.get_activation_time( site_id, watolib.ACTIVATION_TIME_PROFILE_SYNC, 2.0) html.javascript( - 'wato_do_profile_replication(\'%s\', %d, \'%s\');' % + 'cmk.profile_replication.start(\'%s\', %d, \'%s\');' % (site_id, int(estimated_duration * 1000.0), _('Replication in progress'))) num_replsites += 1 else: @@ -98,7 +98,7 @@ def user_profile_async_replication_dialog(sites): html.close_div() - html.javascript('var g_num_replsites = %d;\n' % num_replsites) + html.javascript('cmk.profile_replication.prepare(%d);\n' % num_replsites) html.close_div() diff --git a/web/htdocs/js/index.js b/web/htdocs/js/index.js index 78683fa..fc593f3 100644 --- a/web/htdocs/js/index.js +++ b/web/htdocs/js/index.js @@ -42,6 +42,7 @@ import * as backup from "backup"; import * as hover from "hover"; import * as service_discovery from "service_discovery"; import * as host_diagnose from "host_diagnose"; +import * as profile_replication from "profile_replication"; import * as dashboard from "dashboard"; require("script-loader!./checkmk.js"); @@ -80,6 +81,7 @@ export default { hover: hover, service_discovery: service_discovery, host_diagnose: host_diagnose, + profile_replication: profile_replication, dashboard: dashboard }, // TODO: Compatibility for not yet modularized JS code diff --git a/web/htdocs/js/modules/profile_replication.js b/web/htdocs/js/modules/profile_replication.js new file mode 100644 index 0000000..ba72e0f --- /dev/null +++ b/web/htdocs/js/modules/profile_replication.js @@ -0,0 +1,103 @@ +// +------------------------------------------------------------------+ +// | ____ _ _ __ __ _ __ | +// | / ___| |__ ___ ___| | __ | \/ | |/ / | +// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +// | | |___| | | | __/ (__| < | | | | . \ | +// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +// | | +// | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de | +// +------------------------------------------------------------------+ +// +// This file is part of Check_MK. +// The official homepage is at
http://mathias-kettner.de/check_mk
. +// +// check_mk is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation in version 2. check_mk is distributed +// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +// PARTICULAR PURPOSE. See the GNU General Public License for more de- +// ails. You should have received a copy of the GNU General Public +// License along with GNU Make; see the file COPYING. If not, write +// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +// Boston, MA 02110-1301 USA. + +import * as utils from "utils"; +import * as ajax from "ajax"; + +var g_num_replsites = 0; +var profile_replication_progress = {}; + +export function prepare(num) { + g_num_replsites = num; +} + +export function start(siteid, est, progress_text) { + ajax.call_ajax("wato_ajax_profile_repl.py", { + response_handler : function (handler_data, response_json) { + var response = JSON.parse(response_json); + var success = response.result_code === 0; + var msg = response.result; + + set_result(handler_data["site_id"], success, msg); + }, + error_handler : function (handler_data, status_code, error_msg) { + set_result(handler_data["site_id"], false, + "Failed to perform profile replication [" + status_code + "]: " + error_msg); + }, + method : "POST", + post_data : "request=" + encodeURIComponent(JSON.stringify({ + "site": siteid + })), + handler_data : { + "site_id": siteid + }, + add_ajax_id : false + }); + + profile_replication_progress[siteid] = 20; // 10 of 10 10ths + setTimeout("cmk.profile_replication.step('"+siteid+"', "+est+", '"+progress_text+"');", est/20); +} + +function set_status(siteid, image, text) { + var oImg = document.getElementById("site-" + siteid).childNodes[0]; + oImg.title = text; + oImg.src = "images/icon_"+image+".png"; +} + +export function step(siteid, est, progress_text) { + if (profile_replication_progress[siteid] > 0) { + profile_replication_progress[siteid]--; + var perc = (20.0 - profile_replication_progress[siteid]) * 100 / 20; + var img; + if (perc >= 75) + img = "repl_75"; + else if (perc >= 50) + img = "repl_50"; + else if (perc >= 25) + img = "repl_25"; + else + img = "repl_pending"; + set_status(siteid, img, progress_text); + setTimeout("cmk.profile_replication.step('"+siteid+"',"+est+", '"+progress_text+"');", est/20); + } +} + +function set_result(site_id, success, msg) { + profile_replication_progress[site_id] = 0; + + var icon_name = success ? "repl_success" : "repl_failed"; + + set_status(site_id, icon_name, msg); + + g_num_replsites--; + if (g_num_replsites == 0) { + setTimeout(finish, 1000); + } +} + +function finish() { + // check if we have a sidebar-main frame setup + if (this.parent && parent && parent.frames[1] == this) + utils.reload_sidebar(); +} diff --git a/web/htdocs/js/wato.js b/web/htdocs/js/wato.js index f1babd1..3b72ab6 100644 --- a/web/htdocs/js/wato.js +++ b/web/htdocs/js/wato.js @@ -261,90 +261,6 @@ function update_bulk_moveto(val) { fields[i].options[a].selected = true; } -// .-Profile Repl----------------------------------------------------------. -// | ____ __ _ _ ____ _ | -// | | _ \ _ __ ___ / _(_) | ___ | _ \ ___ _ __ | | | -// | | |_) | '__/ _ \| |_| | |/ _ \ | |_) / _ \ '_ \| | | -// | | __/| | | (_) | _| | | __/ | _ < __/ |_) | | | -// | |_| |_| \___/|_| |_|_|\___| |_| \_\___| .__/|_| | -// | |_| | -// +-----------------------------------------------------------------------+ - -var profile_replication_progress = new Array(); - -function wato_do_profile_replication(siteid, est, progress_text) { - call_ajax("wato_ajax_profile_repl.py", { - response_handler : function (handler_data, response_json) { - var response = JSON.parse(response_json); - var success = response.result_code === 0; - var msg = response.result; - - set_profile_replication_result(handler_data["site_id"], success, msg); - }, - error_handler : function (handler_data, status_code, error_msg) { - set_profile_replication_result(handler_data["site_id"], false, - "Failed to perform profile replication [" + status_code + "]: " + error_msg); - }, - method : "POST", - post_data : "request=" + encodeURIComponent(JSON.stringify({ - "site": siteid - })), - handler_data : { - "site_id": siteid - }, - add_ajax_id : false - }); - - profile_replication_progress[siteid] = 20; // 10 of 10 10ths - setTimeout("profile_replication_step('"+siteid+"', "+est+", '"+progress_text+"');", est/20); -} - -function profile_replication_set_status(siteid, image, text) { - var oImg = document.getElementById("site-" + siteid).childNodes[0]; - oImg.title = text; - oImg.src = "images/icon_"+image+".png"; -} - -function profile_replication_step(siteid, est, progress_text) { - if (profile_replication_progress[siteid] > 0) { - profile_replication_progress[siteid]--; - var perc = (20.0 - profile_replication_progress[siteid]) * 100 / 20; - var img; - if (perc >= 75) - img = "repl_75"; - else if (perc >= 50) - img = "repl_50"; - else if (perc >= 25) - img = "repl_25"; - else - img = "repl_pending"; - profile_replication_set_status(siteid, img, progress_text); - setTimeout("profile_replication_step('"+siteid+"',"+est+", '"+progress_text+"');", est/20); - } -} - -function set_profile_replication_result(site_id, success, msg) { - profile_replication_progress[site_id] = 0; - - var icon_name = success ? "repl_success" : "repl_failed"; - - profile_replication_set_status(site_id, icon_name, msg); - - // g_num_replsites is set by the page code in wato.py to the number async jobs started - // in total - g_num_replsites--; - - if (0 == g_num_replsites) { - setTimeout(wato_profile_replication_finish, 1000); - } -} - -function wato_profile_replication_finish() { - // check if we have a sidebar-main frame setup - if (this.parent && parent && parent.frames[1] == this) - cmk.utils.reload_sidebar(); -} - // ---------------------------------------------------------------------------- // Folderlist // ----------------------------------------------------------------------------
5 years, 6 months
1
0
0
0
agent_aws, aws.include, aws_ec2: Minor cleanup
by Simon Betz
Module: check_mk Branch: master Commit: 5853c36bac312a065c51b4b9e195e7d816501ba1 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5853c36bac312a…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Fri Dec 21 13:02:37 2018 +0100 agent_aws, aws.include, aws_ec2: Minor cleanup Change-Id: I810781f8ef85f89152252121b9c3c14cb29f51ce --- agents/special/agent_aws | 24 ++++++++++-------------- checks/aws.include | 19 +++++++++++++------ checks/aws_ec2 | 35 ++++++++++++++++++----------------- 3 files changed, 41 insertions(+), 37 deletions(-) diff --git a/agents/special/agent_aws b/agents/special/agent_aws index f9fd920..0ba90ec 100755 --- a/agents/special/agent_aws +++ b/agents/special/agent_aws @@ -216,7 +216,7 @@ class EC2Summary(AWSSection): reservations = raw_result['Reservations'] except KeyError, e: logging.info("%s: KeyError %s; Available are %s", self.name, e, raw_result.keys()) - return [] + return {} return { "Reservations": reservations, "mapping": self._map_instance_id_to_name(reservations), @@ -255,7 +255,7 @@ class EC2(AWSSection): start_time = end_time - self.period metrics = self._get_metrics() if not metrics: - return {} + return [] # A single GetMetricData call can include up to 100 MetricDataQuery structures # There's no pagination for this operation: @@ -278,11 +278,11 @@ class EC2(AWSSection): return raw_result def _get_metrics(self): - instance_ids = self._received_results.get('ec2_summary', {})\ - .get('mapping', {}).values() metrics = [] idx = 0 - for instance_id in instance_ids: + for instance_id, instance_name in\ + self._received_results.get('ec2_summary', {})\ + .get('mapping', {}).iteritems(): for metric_name, unit in [ ("CPUCreditUsage", "Count"), ("CPUCreditBalance", "Count"), @@ -298,7 +298,7 @@ class EC2(AWSSection): ]: metrics.append({ 'Id': "%s_%s" % (metric_name.lower(), idx), - 'Label': instance_id, + 'Label': instance_name, 'MetricStat': { 'Metric': { 'Namespace': 'AWS/EC2', @@ -473,7 +473,7 @@ class ELB(AWSSection): start_time = end_time - self.period metrics = self._get_metrics() if not metrics: - return {} + return [] # A single GetMetricData call can include up to 100 MetricDataQuery structures # There's no pagination for this operation: @@ -539,11 +539,7 @@ class ELB(AWSSection): return metrics def _extract_content_from(self, raw_result): - try: - return raw_result['MetricDataResults'] - except KeyError, e: - logging.info("%s: KeyError %s; Available are %s", self.name, e, raw_result.keys()) - return [] + return raw_result def _format_content(self, content): content_by_piggyback_hosts = {} @@ -633,7 +629,7 @@ class EBS(AWSSection): start_time = end_time - self.period metrics = self._get_metrics() if not metrics: - return {} + return [] # A single GetMetricData call can include up to 100 MetricDataQuery structures # There's no pagination for this operation: @@ -822,8 +818,8 @@ class AWSSections(object): #---sections-------------------------------------------------------- s3 = S3(s3_client) - ec2 = EC2(cloudwatch_client) elb_health = ELBHealth(elb_client) + ec2 = EC2(cloudwatch_client) elb = ELB(cloudwatch_client) ebs = EBS(cloudwatch_client) diff --git a/checks/aws.include b/checks/aws.include index 980d411..1e495ff 100644 --- a/checks/aws.include +++ b/checks/aws.include @@ -52,11 +52,18 @@ def _extract_aws_metrics(expected_metric_names, parsed): def _extract_aws_metrics_by_labels(expected_metric_names, parsed): values_by_labels = {} for row in parsed: + row_id = row['Id'] + row_label = row['Label'] + row_values = row['Values'] for expected_metric_name in expected_metric_names: - if row['Id'].startswith(expected_metric_name.lower()): - try: - values_by_labels.setdefault(row['Label'], {})\ - .setdefault(expected_metric_name, row['Values'][0]) - except IndexError: - pass + if not row_id.startswith(expected_metric_name.lower()): + continue + + try: + value = row_values[0] + except IndexError: + continue + else: + values_by_labels.setdefault(row_label, {})\ + .setdefault(expected_metric_name, value) return values_by_labels diff --git a/checks/aws_ec2 b/checks/aws_ec2 index 79d66df..14105c5 100644 --- a/checks/aws_ec2 +++ b/checks/aws_ec2 @@ -24,26 +24,27 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. +EC2DefaultItemName = "DEFAULT" -def parse_aws_ec2(info): - return { - EC2DefaultItemName: _extract_aws_metrics([ - 'StatusCheckFailed_Instance', - 'StatusCheckFailed_System', - 'CPUCreditUsage', - 'CPUCreditBalance', - 'CPUUtilization', - 'DiskReadOps', - 'DiskWriteOps', - 'DiskReadBytes', - 'DiskWriteBytes', - 'NetworkIn', - 'NetworkOut', - ], parse_aws(info)), - } +def parse_aws_ec2(info): + metrics = _extract_aws_metrics([ + 'StatusCheckFailed_Instance', + 'StatusCheckFailed_System', + 'CPUCreditUsage', + 'CPUCreditBalance', + 'CPUUtilization', + 'DiskReadOps', + 'DiskWriteOps', + 'DiskReadBytes', + 'DiskWriteBytes', + 'NetworkIn', + 'NetworkOut', + ], parse_aws(info)) + if metrics: + return {EC2DefaultItemName: metrics} + return -EC2DefaultItemName = "DEFAULT" # .--status check--------------------------------------------------------. # | _ _ _ _ |
5 years, 6 months
1
0
0
0
Fixed html unit tests
by Lars Michelsen
Module: check_mk Branch: master Commit: d4b7e05c9180a4f611cc6ea106c752308f0af6f5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d4b7e05c9180a4…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 12:53:45 2018 +0100 Fixed html unit tests Change-Id: I16b3ae1f6790a476866ffaf6d66c9f9de4dd4f17 --- tests/unit/cmk/gui/old/unittest_files/header.unittest | 4 ++-- tests/unit/cmk/gui/old/unittest_files/top_heading.unittest | 2 +- tests/unit/cmk/gui/old/unittest_files/top_heading_right.unittest | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/cmk/gui/old/unittest_files/header.unittest b/tests/unit/cmk/gui/old/unittest_files/header.unittest index 042cb15..0f8c693 100644 --- a/tests/unit/cmk/gui/old/unittest_files/header.unittest +++ b/tests/unit/cmk/gui/old/unittest_files/header.unittest @@ -19,7 +19,7 @@ 'title': 'Test'}, 'attributes': {'_header_sent': False}}, 'output': {'attributes': {'_header_sent': True}, - 'html_code': '<!DOCTYPE HTML>\n<html><head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<meta http-equiv="X-UA-Compatible" content="IE=edge" />\n<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">\n<title>Test</title>\n<link type="text/css" href="file/name/css_main_min" rel="stylesheet" />\n<link rel="stylesheet" type="text/css" href="file/name/css_check_mk" />\n<link rel="stylesheet" type="text/css" href="file/name/css_graphs" />\n<link rel="stylesheet" type="text/css" href="file/name/css_pages" />\n<link rel="stylesheet" type="text/css" href="file/name/css_teststylesheet" />\n<!--[if IE]>\n<link rel="stylesheet" type="text/css" href="file/name/css_ie" />\n<![endif]-->\n<script type="text/javascript" src="js/file/name/js_main.js">\n</script>\n<script type="text/javascript" src="js/file/name/js_hallo_welt.js">\n</script>\n</head>\n<body class="main"><table class="header"><tr><td width="*" class="heading"><a href="#" onfocus="if (this.blur) this.blur();" onclick="this.innerHTML=\'Reloading...\'; document.location.reload();">Test</a></td><a id=\'helpbutton\' onclick="toggle_help()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}, + 'html_code': '<!DOCTYPE HTML>\n<html><head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<meta http-equiv="X-UA-Compatible" content="IE=edge" />\n<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">\n<title>Test</title>\n<link type="text/css" href="file/name/css_main_min" rel="stylesheet" />\n<link rel="stylesheet" type="text/css" href="file/name/css_check_mk" />\n<link rel="stylesheet" type="text/css" href="file/name/css_graphs" />\n<link rel="stylesheet" type="text/css" href="file/name/css_pages" />\n<link rel="stylesheet" type="text/css" href="file/name/css_teststylesheet" />\n<!--[if IE]>\n<link rel="stylesheet" type="text/css" href="file/name/css_ie" />\n<![endif]-->\n<script type="text/javascript" src="js/file/name/js_main.js">\n</script>\n<script type="text/javascript" src="js/file/name/js_hallo_welt.js">\n</script>\n</head>\n<body class="main"><table class="header"><tr><td width="*" class="heading"><a href="#" onfocus="if (this.blur) this.blur();" onclick="this.innerHTML=\'Reloading...\'; document.location.reload();">Test</a></td><a id=\'helpbutton\' onclick="cmk.help.toggle()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}, {'function_name': 'header', 'input': {'arguments': {'force': False, 'javascripts': ['hallo_welt'], @@ -27,4 +27,4 @@ 'title': 'Test'}, 'attributes': {'_header_sent': False}}, 'output': {'attributes': {'_header_sent': True}, - 'html_code': '<!DOCTYPE HTML>\n<html><head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<meta http-equiv="X-UA-Compatible" content="IE=edge" />\n<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">\n<title>Test</title>\n<link type="text/css" href="file/name/css_main_min" rel="stylesheet" />\n<link rel="stylesheet" type="text/css" href="file/name/css_check_mk" />\n<link rel="stylesheet" type="text/css" href="file/name/css_graphs" />\n<link rel="stylesheet" type="text/css" href="file/name/css_pages" />\n<link rel="stylesheet" type="text/css" href="file/name/css_teststylesheet" />\n<!--[if IE]>\n<link rel="stylesheet" type="text/css" href="file/name/css_ie" />\n<![endif]-->\n<script type="text/javascript" src="js/file/name/js_main.js">\n</script>\n<script type="text/javascript" src="js/file/name/js_hallo_welt.js">\n</script>\n</head>\n<body class="main"><table class="header"><tr><td width="*" class="heading"><a href="#" onfocus="if (this.blur) this.blur();" onclick="this.innerHTML=\'Reloading...\'; document.location.reload();">Test</a></td><a id=\'helpbutton\' onclick="toggle_help()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}] + 'html_code': '<!DOCTYPE HTML>\n<html><head>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\n<meta http-equiv="X-UA-Compatible" content="IE=edge" />\n<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">\n<title>Test</title>\n<link type="text/css" href="file/name/css_main_min" rel="stylesheet" />\n<link rel="stylesheet" type="text/css" href="file/name/css_check_mk" />\n<link rel="stylesheet" type="text/css" href="file/name/css_graphs" />\n<link rel="stylesheet" type="text/css" href="file/name/css_pages" />\n<link rel="stylesheet" type="text/css" href="file/name/css_teststylesheet" />\n<!--[if IE]>\n<link rel="stylesheet" type="text/css" href="file/name/css_ie" />\n<![endif]-->\n<script type="text/javascript" src="js/file/name/js_main.js">\n</script>\n<script type="text/javascript" src="js/file/name/js_hallo_welt.js">\n</script>\n</head>\n<body class="main"><table class="header"><tr><td width="*" class="heading"><a href="#" onfocus="if (this.blur) this.blur();" onclick="this.innerHTML=\'Reloading...\'; document.location.reload();">Test</a></td><a id=\'helpbutton\' onclick="cmk.help.toggle()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}] diff --git a/tests/unit/cmk/gui/old/unittest_files/top_heading.unittest b/tests/unit/cmk/gui/old/unittest_files/top_heading.unittest index eb6ae06..a136b85 100644 --- a/tests/unit/cmk/gui/old/unittest_files/top_heading.unittest +++ b/tests/unit/cmk/gui/old/unittest_files/top_heading.unittest @@ -1,3 +1,3 @@ [{'function_name': 'top_heading', 'input': {'arguments': {'title': 'TEST'}}, - 'output': {'html_code': '<table class="header"><tr><td width="*" class="heading"><a href="#" onfocus="if (this.blur) this.blur();" onclick="this.innerHTML=\'Reloading...\'; document.location.reload();">TEST</a></td><a id=\'helpbutton\' onclick="toggle_help()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}] + 'output': {'html_code': '<table class="header"><tr><td width="*" class="heading"><a href="#" onfocus="if (this.blur) this.blur();" onclick="this.innerHTML=\'Reloading...\'; document.location.reload();">TEST</a></td><a id=\'helpbutton\' onclick="cmk.help.toggle()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}] diff --git a/tests/unit/cmk/gui/old/unittest_files/top_heading_right.unittest b/tests/unit/cmk/gui/old/unittest_files/top_heading_right.unittest index 1dda91a..a79ca74 100644 --- a/tests/unit/cmk/gui/old/unittest_files/top_heading_right.unittest +++ b/tests/unit/cmk/gui/old/unittest_files/top_heading_right.unittest @@ -1,3 +1,3 @@ [{'function_name': 'top_heading_right', 'input': {'arguments': {}}, - 'output': {'html_code': '<a id=\'helpbutton\' onclick="toggle_help()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}] + 'output': {'html_code': '<a id=\'helpbutton\' onclick="cmk.help.toggle()" style="display:none" class="passive" onfocus="if (this.blur) this.blur();" href="javascript:void(0)" title="Toggle context help texts"><img src="images/icons/help.png" class="icon iconbutton" align=absmiddle /></a><a class=head_logo href="
https://mathias-kettner.com
"><img src="images/logo_cmk_small.png"/></a></td></tr></table><hr class="header">\n'}}]
5 years, 6 months
1
0
0
0
Moved BI logic to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: 24fe90faab3c1b076e7f6c056959cac7937cc381 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=24fe90faab3c1b…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:36 2018 +0100 Moved BI logic to dedicated module Change-Id: Ibb1a128024d28657533734270588b0db2164be72 --- cmk/gui/bi.py | 8 +- web/htdocs/js/checkmk.js | 140 +------------------------ web/htdocs/js/index.js | 2 + web/htdocs/js/modules/bi.js | 152 ++++++++++++++++++++++++++++ web/htdocs/js/modules/foldable_container.js | 12 +-- web/htdocs/js/modules/utils.js | 8 ++ 6 files changed, 169 insertions(+), 153 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=24fe90faab…
5 years, 6 months
1
0
0
0
Moved element dragging to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: d723c5f277c7a52073a15860080394543a6ad052 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d723c5f277c7a5…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:34 2018 +0100 Moved element dragging to dedicated module Change-Id: Ib58b0a1960970119a518d89c31af17c6ae25a236 --- Makefile | 4 +- cmk/gui/htmllib.py | 6 +- web/htdocs/js/checkmk.js | 198 +----------------------------- web/htdocs/js/index.js | 5 + web/htdocs/js/modules/element_dragging.js | 183 +++++++++++++++++++++++++++ web/htdocs/js/modules/utils.js | 8 ++ 6 files changed, 202 insertions(+), 202 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=d723c5f277…
5 years, 6 months
1
0
0
0
Moved SLA logic to dedicated module
by Lars Michelsen
Module: check_mk Branch: master Commit: 0f84114df3b3f0f96b43c24a2bbe9e8cf9166fd2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0f84114df3b3f0…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 21 10:08:35 2018 +0100 Moved SLA logic to dedicated module Change-Id: I3cdb2d4026b03053f07b9a46fdfd8ee4b93ba4fd --- web/htdocs/js/checkmk.js | 68 ------------------------------------- web/htdocs/js/index.js | 2 ++ web/htdocs/js/modules/sla.js | 80 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 68 deletions(-) diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js index f3edf52..0e0fd61 100644 --- a/web/htdocs/js/checkmk.js +++ b/web/htdocs/js/checkmk.js @@ -2024,74 +2024,6 @@ function host_tag_update_value(prefix, grp) { } //#. -//# .--SLA-----------------------------------------------------------------. -//# | ____ _ _ | -//# | / ___|| | / \ | -//# | \___ \| | / _ \ | -//# | ___) | |___ / ___ \ | -//# | |____/|_____/_/ \_\ | -//# | | -//# +----------------------------------------------------------------------+ -//# | | -//# '----------------------------------------------------------------------' - - -function sla_details_period_hover(td, sla_period, onoff) -{ - if (has_class(td, "lock_hilite")) { - return; - } - - var sla_period_elements = document.getElementsByClassName(sla_period) - for(var i = 0; i < sla_period_elements.length; i++) - { - if (onoff) { - add_class(sla_period_elements[i], 'sla_hilite'); - } - else { - remove_class(sla_period_elements[i], 'sla_hilite'); - } - } -} - - -function sla_details_period_click(td, sla_period) -{ - var sla_period_elements = document.getElementsByClassName(sla_period); - var onoff = has_class(td, "lock_hilite") - for(var i = 0; i < sla_period_elements.length; i++) - { - if (onoff) { - remove_class(sla_period_elements[i], 'sla_hilite'); - remove_class(sla_period_elements[i], 'lock_hilite'); - } - else { - add_class(sla_period_elements[i], 'sla_hilite'); - add_class(sla_period_elements[i], 'lock_hilite'); - } - } -} - - -function sla_details_table_hover(tr, row_id, onoff) { - var sla_period_elements = tr.closest("table").closest("tbody").getElementsByClassName(row_id); - for(var i = 0; i < sla_period_elements.length; i++) - { - - if (onoff) { - add_class(sla_period_elements[i], 'sla_hilite'); - add_class(sla_period_elements[i], 'sla_error_hilite'); - } - else { - remove_class(sla_period_elements[i], 'sla_error_hilite'); - if (!has_class(sla_period_elements[i], "lock_hilite")) { - remove_class(sla_period_elements[i], 'sla_hilite'); - } - } - } -} - -//#. //# .-Popup Menu---------------------------------------------------------. //# | ____ __ __ | //# | | _ \ ___ _ __ _ _ _ __ | \/ | ___ _ __ _ _ | diff --git a/web/htdocs/js/index.js b/web/htdocs/js/index.js index cbf47be..d74246f 100644 --- a/web/htdocs/js/index.js +++ b/web/htdocs/js/index.js @@ -35,6 +35,7 @@ import * as selection from "selection"; import * as element_dragging from "element_dragging"; import * as help from "help"; import * as availability from "availability"; +import * as sla from "sla"; import * as dashboard from "dashboard"; require("script-loader!./checkmk.js"); @@ -66,6 +67,7 @@ export default { element_dragging: element_dragging, help: help, availability: availability, + sla: sla, dashboard: dashboard }, // TODO: Compatibility for not yet modularized JS code diff --git a/web/htdocs/js/modules/sla.js b/web/htdocs/js/modules/sla.js new file mode 100644 index 0000000..49928f8 --- /dev/null +++ b/web/htdocs/js/modules/sla.js @@ -0,0 +1,80 @@ +// +------------------------------------------------------------------+ +// | ____ _ _ __ __ _ __ | +// | / ___| |__ ___ ___| | __ | \/ | |/ / | +// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | +// | | |___| | | | __/ (__| < | | | | . \ | +// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | +// | | +// | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de | +// +------------------------------------------------------------------+ +// +// This file is part of Check_MK. +// The official homepage is at
http://mathias-kettner.de/check_mk
. +// +// check_mk is free software; you can redistribute it and/or modify it +// under the terms of the GNU General Public License as published by +// the Free Software Foundation in version 2. check_mk is distributed +// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- +// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A +// PARTICULAR PURPOSE. See the GNU General Public License for more de- +// ails. You should have received a copy of the GNU General Public +// License along with GNU Make; see the file COPYING. If not, write +// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, +// Boston, MA 02110-1301 USA. + +import * as utils from "utils"; + +export function details_period_hover(td, sla_period, onoff) +{ + if (utils.has_class(td, "lock_hilite")) { + return; + } + + var sla_period_elements = document.getElementsByClassName(sla_period); + for(var i = 0; i < sla_period_elements.length; i++) + { + if (onoff) { + utils.add_class(sla_period_elements[i], "sla_hilite"); + } + else { + utils.remove_class(sla_period_elements[i], "sla_hilite"); + } + } +} + + +export function details_period_click(td, sla_period) +{ + var sla_period_elements = document.getElementsByClassName(sla_period); + var onoff = utils.has_class(td, "lock_hilite"); + for(var i = 0; i < sla_period_elements.length; i++) + { + if (onoff) { + utils.remove_class(sla_period_elements[i], "sla_hilite"); + utils.remove_class(sla_period_elements[i], "lock_hilite"); + } + else { + utils.add_class(sla_period_elements[i], "sla_hilite"); + utils.add_class(sla_period_elements[i], "lock_hilite"); + } + } +} + + +export function details_table_hover(tr, row_id, onoff) { + var sla_period_elements = tr.closest("table").closest("tbody").getElementsByClassName(row_id); + for(var i = 0; i < sla_period_elements.length; i++) + { + + if (onoff) { + utils.add_class(sla_period_elements[i], "sla_hilite"); + utils.add_class(sla_period_elements[i], "sla_error_hilite"); + } + else { + utils.remove_class(sla_period_elements[i], "sla_error_hilite"); + if (!utils.has_class(sla_period_elements[i], "lock_hilite")) { + utils.remove_class(sla_period_elements[i], "sla_hilite"); + } + } + } +}
5 years, 6 months
1
0
0
0
← Newer
1
2
3
4
5
...
35
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Results per page:
10
25
50
100
200