From 36de864694f5c89d1bf0fb58925a7643a1ee8653 Mon Sep 17 00:00:00 2001 From: epacke Date: Thu, 18 Jul 2019 19:46:38 +0200 Subject: [PATCH 1/2] Moved the partition filter --- js/lib/addPartitionFilter.js | 54 ++++++++++++++++++++++++++++++++++++ js/main.js | 54 ------------------------------------ manifest.json | 2 ++ 3 files changed, 56 insertions(+), 54 deletions(-) create mode 100644 js/lib/addPartitionFilter.js diff --git a/js/lib/addPartitionFilter.js b/js/lib/addPartitionFilter.js new file mode 100644 index 0000000..1dfabbd --- /dev/null +++ b/js/lib/addPartitionFilter.js @@ -0,0 +1,54 @@ + +function addPartitionFilter(){ + + initiateBaloon(); + + var partitionDiv = $(parent.top.document).find("div#partition"); + + // Add the filter input and the label + partitionDiv.prepend(" ") + partitionDiv.prepend(""); + + var partitionDropDown = partitionDiv.find("select#partition_control"); + var partitonOptions = partitionDropDown.find("option"); + var partitionFilterInput = partitionDiv.find("input#partitionFilter"); + + partitionFilterInput.on("keyup", function(e){ + + if(e.keyCode === 13){ + triggerEvent("change", parent.top.document.querySelector("div#partition select#partition_control")) + return; + } + + var searchValue = this.value; + + // Set the local storage in order to re-populate the filter upon page reload + localStorage.setItem("tamperMonkey-PartitionFilter", searchValue); + + var re = new RegExp(searchValue, "i"); + + partitonOptions.each(function(){ + if($(this).val().match(re) || $(this).val() === "[All]"){ + $(this).attr("ismatch", "true") + $(this).show(); + } else { + $(this).attr("ismatch", "false") + $(this).hide(); + } + }); + + var selectedOption = partitionDropDown.find("option:selected"); + var selectedOptionValue = selectedOption.val() || "" + var matchedCount = partitionDropDown.find("option[ismatch='true']").length; + + if(!selectedOptionValue.match(re) && matchedCount > 0){ + selectedOption.removeAttr("selected"); + partitionDropDown.find("option[ismatch='true']:eq(0)").attr("selected", "selected"); + } + + }) + + partitionFilterInput.val(localStorage.getItem("tamperMonkey-PartitionFilter") || "").trigger("keyup"); + + } + \ No newline at end of file diff --git a/js/main.js b/js/main.js index 588650f..033c809 100644 --- a/js/main.js +++ b/js/main.js @@ -434,60 +434,6 @@ String.prototype.hashCode = function(){ -function addPartitionFilter(){ - - initiateBaloon(); - - var partitionDiv = $(parent.top.document).find("div#partition"); - - // Add the filter input and the label - partitionDiv.prepend(" ") - partitionDiv.prepend(""); - - var partitionDropDown = partitionDiv.find("select#partition_control"); - var partitonOptions = partitionDropDown.find("option"); - var partitionFilterInput = partitionDiv.find("input#partitionFilter"); - - partitionFilterInput.on("keyup", function(e){ - - if(e.keyCode === 13){ - triggerEvent("change", parent.top.document.querySelector("div#partition select#partition_control")) - return; - } - - var searchValue = this.value; - - // Set the local storage in order to re-populate the filter upon page reload - localStorage.setItem("tamperMonkey-PartitionFilter", searchValue); - - var re = new RegExp(searchValue, "i"); - - partitonOptions.each(function(){ - if($(this).val().match(re) || $(this).val() === "[All]"){ - $(this).attr("ismatch", "true") - $(this).show(); - } else { - $(this).attr("ismatch", "false") - $(this).hide(); - } - }); - - var selectedOption = partitionDropDown.find("option:selected"); - var selectedOptionValue = selectedOption.val() || "" - var matchedCount = partitionDropDown.find("option[ismatch='true']").length; - - if(!selectedOptionValue.match(re) && matchedCount > 0){ - selectedOption.removeAttr("selected"); - partitionDropDown.find("option[ismatch='true']:eq(0)").attr("selected", "selected"); - } - - }) - - partitionFilterInput.val(localStorage.getItem("tamperMonkey-PartitionFilter") || "").trigger("keyup"); - -} - - /************************************************************************** * * iRule improvements diff --git a/manifest.json b/manifest.json index 09df6d5..eb20067 100644 --- a/manifest.json +++ b/manifest.json @@ -9,9 +9,11 @@ "matches": ["https://*/tmui/Control/*"], "css": ["css/todo.css"], "js": [ + "settings/settings.js", "js/lib/jquery-3.3.1.min.js", "js/lib/balloon.js", "js/lib/waitForStorageKey.js", + "js/lib/addPartitionFilter.js", "js/lib/christmas.js", "js/lib/ltmLogParser.js", "js/lib/getStorage.js", From da6a77f3b8c0f03a30b36b535755c3dcefc63042 Mon Sep 17 00:00:00 2001 From: epacke Date: Thu, 18 Jul 2019 20:11:11 +0200 Subject: [PATCH 2/2] Divided main.js --- css/poolimprovements.css | 335 ++++++++ css/todo.css | 6 - js/lib/dataGroupListImprovements.js | 189 +++++ js/lib/genericFunctions.js | 133 +++ js/lib/iRuleImprovements.js | 237 ++++++ js/lib/ltmLogParser.js | 53 +- js/lib/poolImprovements.js | 400 +++++++++ js/lib/sslProfileImprovements.js | 121 +++ js/lib/virtualServerImprovements.js | 38 + js/main.js | 1187 +-------------------------- manifest.json | 9 +- 11 files changed, 1521 insertions(+), 1187 deletions(-) create mode 100644 css/poolimprovements.css delete mode 100644 css/todo.css create mode 100644 js/lib/dataGroupListImprovements.js create mode 100644 js/lib/genericFunctions.js create mode 100644 js/lib/iRuleImprovements.js create mode 100644 js/lib/poolImprovements.js create mode 100644 js/lib/sslProfileImprovements.js create mode 100644 js/lib/virtualServerImprovements.js diff --git a/css/poolimprovements.css b/css/poolimprovements.css new file mode 100644 index 0000000..f031e04 --- /dev/null +++ b/css/poolimprovements.css @@ -0,0 +1,335 @@ +div.tamperpoolstatus{ + position:relative; +} +div.tamperpoolstatus table.list{ + position:relative; + width:100%; + border:1px solid #999 +} +div.tamperpoolstatus table.list tbody tr.color0{ + background:#deddd9 +} +div.tamperpoolstatus table.list tbody tr.color0 td{ + border-bottom:1px solid #c4c2be +} +div.tamperpoolstatus table.list tbody tr.inner td,div.tamperpoolstatus table.list tbody tr.innerbold td{ + padding:3px 5px; + border-bottom:none; + white-space:nowrap +} +div.tamperpoolstatus table.list tbody tr.color1{ + background:#fff +} +div.tamperpoolstatus table.list tbody tr.color2{ + background:#f7f6f5 +} +div.tamperpoolstatus table.list tbody tr.innerbold td{ + font-weight:700 +} +div.tamperpoolstatus table.list tbody td{ + vertical-align:top; + padding:6px 5px 4px; + border-bottom:1px solid #ddd; + white-space:nowrap +} +div.tamperpoolstatus table.list tbody td input{ + margin-top:0 +} +div.tamperpoolstatus table.list tbody td img{ + padding-top:1px +} +div.tamperpoolstatus table.list div.customtooltip div,div.tamperpoolstatus table.list div.filter div{ + padding:3px 5px +} +div.tamperpoolstatus table.list tbody td.first{ + border-left:1px solid #999 +} +div.tamperpoolstatus table.list tbody td.last{ + border-right:1px solid #999 +} +div.tamperpoolstatus table.list tbody td.column1,div.tamperpoolstatus table.list tbody td.column2{ + border-left:1px solid #ddd +} +div.tamperpoolstatus table.list div.customtooltip,div.tamperpoolstatus table.list div.filter{ + position:absolute; + z-index:1; + margin-top:2px; + border:1px solid #666; + background:#deddd9 +} +div.tamperpoolstatus table.list div.customtooltip div a.close{ + color:red; + font-weight:700 +} +div.tamperpoolstatus table.list div.filter div.current{ + margin:1px; + padding:3px; + border:1px solid #999; + background:#eee +} +div.tamperpoolstatus table.list tbody tr.expanded td,div.tamperpoolstatus table.list tbody tr.notlast td{ + border-bottom:none!important +} +div.tamperpoolstatus table.list .expired{ + padding-left:17px; + background:url(../images/status_certificate_expired.gif) left center no-repeat +} +div.tamperpoolstatus table.list .warning{ + padding-left:17px; + background:url(../images/status_certificate_warning.gif) left center no-repeat +} +div.tamperpoolstatus table.list tbody tr.collapsible-parent td a{ + vertical-align:top +} +div.tamperpoolstatus table.list thead tr td div.collapsible-toggle.expanded{ + background:url(/xui/common/images/icon_toggle_all_minus.gif) no-repeat; + width:15px; + height:15px; + display:inline-block; + cursor:pointer; + zoom:1 +} +div.tamperpoolstatus table.list tbody tr.expanded td div.collapsible-toggle{ + background:url(/xui/common/images/icon_toggle_minus.gif) no-repeat; + width:12px; + height:12px; + margin:0 auto; + zoom:1 +} +div.tamperpoolstatus table.list thead tr td div.collapsible-toggle.collapsed{ + background:url(/xui/common/images/icon_toggle_all_plus.gif) no-repeat; + width:15px; + height:15px; + display:inline-block; + cursor:pointer; + zoom:1 +} +div.tamperpoolstatus table.list tbody tr.collapsed td div.collapsible-toggle{ + background:url(/xui/common/images/icon_toggle_plus.gif) no-repeat; + width:12px; + height:12px; + margin:0 auto; + zoom:1 +} +div.tamperpoolstatus table.list tbody tr.set-whitespace-normal td{ + white-space:normal +} +div.tamperpoolstatus table.list tbody.group_move_placeholder{ + display:table-row +} +div.tamperpoolstatus table.list tbody tr.handle td.first{ + width:15px; + background:url(/tmui/tmui/skins/Default/images/icon_gripper.png) 50% no-repeat!important; + cursor:url(/xui/common/images/openhand.cur),default +} +div.tamperpoolstatus thead tr.columnhead td div.reorder{ + width:16px; + height:16px; + background:url(/xui/common/images/cursor-openhand.png) center no-repeat +} +div.tamperpoolstatus table.list .highlight{ + background:#dbefff!important; + cursor:url(/xui/common/images/openhand.cur),default +} +div.tamperpoolstatus table.list .highlight a{ + cursor:url(/xui/common/images/openhand.cur),default +} +div.tamperpoolstatus div.section{ + margin:10px 0 +} +div.tamperpoolstatus thead tr.tablehead td{ + border-bottom:1px solid #999; + vertical-align:bottom +} +div.tamperpoolstatus thead tr.tablehead div{ + padding-bottom:3px; + white-space:nowrap +} +div.tamperpoolstatus thead tr.tablehead div.title{ + float:left; + margin-top:.5em; + color:#000; + font-weight:700 +} +div.tamperpoolstatus thead tr.tablehead div.advancedtoggle{ + float:left; + margin:0 0 0 5px; + color:#000 +} +div.tamperpoolstatus thead tr.tablehead div.search{ + float:left +} +div.tamperpoolstatus thead tr.tablehead div.searchnofloat{ + clear:both; + float:left +} +div.tamperpoolstatus thead tr.tablehead div.search input.search,div.tamperpoolstatus thead tr.tablehead div.searchnofloat input.search{ + width:240px +} +div.tamperpoolstatus thead tr.tablehead div.buttons{ + float:right +} +div.buttons input[type=button],div.tamperpoolstatus thead tr.tablehead div.buttons input[type=button],div.tamperpoolstatus thead tr.tablehead div.buttons input[type=submit]{ + padding:0 5px +} +div.tamperpoolstatus thead tr.tablehead div.buttons input.checkall{ + margin-right:9px +} +div.tamperpoolstatus thead tr.tablehead div.grouptitle{ + margin:0 3px 0 2px; + padding:1px 10px; + border:1px solid #999; + border-bottom:none; + background:#deddd9; + text-align:center; + font-weight:700 +} +div.tamperpoolstatus thead tr.columnhead td{ + padding:5px; + border-bottom:1px solid #999; + border-top:1px solid #999; + border-left:1px solid #999; + background:url(../images/background_list_head.gif) #deddd9; + white-space:nowrap +} +div.tamperpoolstatus thead tr.columnhead td.last{ + border-right:1px solid #999 +} +div.tamperpoolstatus thead tr.columnhead td a{ + display:block; + width:expression("1%"); + padding-top:1px; + margin-top:-1px; + color:#000 +} +div.tamperpoolstatus thead tr.columnhead td a.filteroff{ + margin-top:0; + padding-left:20px; + background:url(../images/button_filter_off.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td a.filteron{ + margin-top:0; + padding-left:20px; + background:url(../images/button_filter_on.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td a.selectall{ + margin-top:0; + width:15px; + background:url(../images/button_select_all.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td a.selectall:hover{ + text-decoration:none +} +div.tamperpoolstatus thead tr.columnhead td a.sortoff{ + margin-top:0; + padding-left:12px; + background:url(../images/button_sort_off.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td a.sorton{ + margin-top:0; + padding-left:12px; + background:url(../images/button_sort_on.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td a.sortup{ + margin-top:0; + padding-left:12px; + background:url(../images/button_sort_up.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td a.sortdown{ + margin-top:0; + padding-left:12px; + background:url(../images/button_sort_down.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .greenflag,div.tamperpoolstatus thead tr.columnhead td .redflag,div.tamperpoolstatus thead tr.columnhead td .yellowflag{ + display:block; + width:expression("1%"); + padding-top:1px; + padding-left:20px +} +div.tamperpoolstatus thead tr.columnhead td .greenflag{ + background:url(../images/status_flag_green.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .yellowflag{ + background:url(../images/status_flag_yellow.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .redflag{ + background:url(../images/status_flag_red.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .activedevice,div.tamperpoolstatus thead tr.columnhead td .failsafefaultdevice,div.tamperpoolstatus thead tr.columnhead td .impaireddevice,div.tamperpoolstatus thead tr.columnhead td .maintenancedevice,div.tamperpoolstatus thead tr.columnhead td .offlinedevice,div.tamperpoolstatus thead tr.columnhead td .replacementdevice,div.tamperpoolstatus thead tr.columnhead td .standbydevice,div.tamperpoolstatus thead tr.columnhead td .unknowndevice,div.tamperpoolstatus thead tr.columnhead td .unreachabledevice{ + display:block; + width:expression("1%"); + padding:2px 0 2px 27px +} +div.tamperpoolstatus thead tr.columnhead td .activedevice{ + background:url(../images/status_filter_device_active.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .standbydevice{ + background:url(../images/status_filter_device_standby.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .failsafefaultdevice{ + background:url(../images/status_filter_device_failsafe_fault.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .offlinedevice{ + background:url(../images/status_filter_device_offline.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .forcedofflinedevice{ + display:block; + width:expression("1%"); + padding:2px 0 2px 27px; + background:url(../images/status_filter_device_forcedoffline.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .unknowndevice{ + background:url(../images/status_filter_device_present_unknown.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .impaireddevice{ + background:url(../images/status_filter_device_impaired.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .maintenancedevice{ + background:url(../images/status_filter_device_maint.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .replacementdevice{ + background:url(../images/status_filter_device_replacement.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .unreachabledevice{ + background:url(../images/status_filter_device_unreachable.gif) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .available,div.tamperpoolstatus thead tr.columnhead td .offline,div.tamperpoolstatus thead tr.columnhead td .unavailable,div.tamperpoolstatus thead tr.columnhead td .unknown{ + display:block; + width:expression("1%"); + padding-top:1px; + padding-left:20px +} +div.tamperpoolstatus thead tr.columnhead td .available{ + background:url(../images/status_circle_green.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .unavailable{ + background:url(../images/status_triangle_yellow.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .offline{ + background:url(../images/status_diamond_red.png) left center no-repeat +} +div.tamperpoolstatus thead tr.columnhead td .unknown{ + background:url(../images/status_square_blue.png) left center no-repeat +} +div.tamperpoolstatus table.head td.wizardtext{ + padding-top:10px +} +div.tamperpoolstatus table.tablefoot{ + width:100% +} +div.tamperpoolstatus table.tablefoot td{ + vertical-align:top +} +div.tamperpoolstatus table.tablefoot div{ + padding:3px 0 20px +} +div.tamperpoolstatus table.tablefoot div.buttons{ + float:left +} +div.tamperpoolstatus table.tablefoot div.buttons input[type=button],div.tamperpoolstatus table.tablefoot div.buttons input[type=submit]{ + padding:0 5px +} +div.tamperpoolstatus table.tablefoot div.pagecontrols{ + float:right +} + \ No newline at end of file diff --git a/css/todo.css b/css/todo.css deleted file mode 100644 index 212eba5..0000000 --- a/css/todo.css +++ /dev/null @@ -1,6 +0,0 @@ -div.indeni-todo-div { - margin: 30 50 0 0; -} -span.responsible { - font-weight: bold; -} \ No newline at end of file diff --git a/js/lib/dataGroupListImprovements.js b/js/lib/dataGroupListImprovements.js new file mode 100644 index 0000000..a12cf87 --- /dev/null +++ b/js/lib/dataGroupListImprovements.js @@ -0,0 +1,189 @@ + + +/************************************************************************** +* +* Data group list improvements +* +**************************************************************************/ + +function improveDataGroupListEditing(){ + //Increase the size of the lists + $("select").not("#datagroup_type_select").attr("size", DatagroupListCount); + + //Add extra cell and buttons for bulk import + $("table#records thead tr.tablehead td").after(` +
Bulk import text
+ + `); + $("table#records tbody tr td.settings").after(` +