├── LICENSE ├── NOTICE ├── README.md ├── _site ├── background.js ├── css │ ├── CssGrid_2 │ │ ├── 1140.css │ │ ├── License.txt │ │ ├── ie.css │ │ └── styles.css │ ├── bigdesk.css │ ├── normalize.css │ └── reset.css ├── images │ ├── 1license.txt │ ├── award_star_gold.png │ └── favicon.png ├── index.html ├── js │ ├── bigdeskApp.js │ ├── charts │ │ ├── bigdesk_charts.js │ │ ├── common.css │ │ ├── not-available │ │ │ ├── not-available-chart.css │ │ │ ├── not-available-chart.js │ │ │ └── test-not-available-chart.html │ │ ├── pack │ │ │ └── pack.css │ │ ├── time-area │ │ │ ├── test-time-area-chart.html │ │ │ ├── time-area-chart.css │ │ │ └── time-area-chart.js │ │ └── time-series │ │ │ ├── test-time-series-chart.html │ │ │ ├── time-series-chart.css │ │ │ └── time-series-chart.js │ ├── lib │ │ ├── D3-v2.8.1 │ │ │ ├── LICENSE │ │ │ └── d3.v2.min.js │ │ ├── backbone │ │ │ ├── LICENSE │ │ │ └── backbone-min.js │ │ ├── css3-mediaqueries │ │ │ ├── License.txt │ │ │ └── css3-mediaqueries.js │ │ ├── jquery │ │ │ └── jquery-1.7.1.min.js │ │ ├── mustache │ │ │ ├── LICENSE │ │ │ └── mustache.js │ │ ├── tinysort │ │ │ ├── License.txt │ │ │ └── jquery.tinysort.min.js │ │ └── underscore │ │ │ ├── LICENSE │ │ │ └── underscore-min.js │ ├── models │ │ ├── Hello.js │ │ └── cluster │ │ │ ├── ClusterHealth.js │ │ │ ├── ClusterState.js │ │ │ ├── IndicesStatus.js │ │ │ ├── NodeInfo.js │ │ │ ├── NodesState.js │ │ │ └── NodesStats.js │ ├── store │ │ └── BigdeskStore.js │ ├── util │ │ └── bigdesk_extension.js │ └── views │ │ ├── ClusterHealthView.js │ │ ├── ClusterNodesListView.js │ │ ├── ClusterStateView.js │ │ ├── SelectedClusterNodeView.js │ │ └── templates.js └── manifest.json ├── bigdesk_es2.png ├── crx └── es-bigdesk.crx └── plugin-descriptor.properties /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | ========================================================================= 2 | == Bigdesk - Live charts and statistics for elasticsearch cluster. == 3 | ========================================================================= 4 | 5 | Copyright 2011-2014 Lukas Vlcek 6 | 7 | This product includes: 8 | 9 | Meyer CSS reset 10 | http://meyerweb.com/eric/tools/css/reset/ 11 | License: none (public domain) 12 | 13 | normalize.css 14 | http://github.com/necolas/normalize.css 15 | Copyright (c) Nicolas Gallagher and Jonathan Neal 16 | License: https://github.com/necolas/normalize.css/blob/master/LICENSE.md 17 | 18 | CssGrid 19 | http://cssgrid.net 20 | Copyright (c) Andy Taylor 21 | License: http://creativecommons.org/licenses/by/3.0/au/ 22 | 23 | D3.js 24 | http://d3js.org 25 | Copyright (c) 2012, Michael Bostock 26 | License: http://opensource.org/licenses/BSD-3-Clause 27 | 28 | Backbone.js 29 | http://backbonejs.org 30 | Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud 31 | License: MIT License, https://github.com/documentcloud/backbone/blob/master/LICENSE 32 | 33 | CSS3-mediaqueries.js 34 | http://code.google.com/p/css3-mediaqueries-js/ 35 | License: MIT License, http://www.opensource.org/licenses/mit-license.php 36 | 37 | jQuery 38 | Copyright 2012 jQuery Foundation and other contributors 39 | http://jquery.com 40 | License: MIT License, http://jquery.org/license/ 41 | 42 | Mustache.js 43 | Copyright (c) 2009 Chris Wanstrath (Ruby) 44 | Copyright (c) 2010 Jan Lehnardt (JavaScript) 45 | http://mustache.github.com 46 | License: MIT License 47 | 48 | Tinysort.js 49 | http://code.google.com/p/tinysort/ 50 | http://tinysort.sjeiti.com/ 51 | License: MIT License 52 | 53 | Underscore.js 54 | http://underscorejs.org 55 | Copyright (c) 2009-2012 Jeremy Ashkenas, DocumentCloud 56 | License: MIT License, https://github.com/documentcloud/underscore/blob/master/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bigdesk 2 | 3 | Live charts and statistics for Elasticsearch 2.x/5.x/7.x/8.x+ cluster. 4 | 5 | ## 2022-03-21 6 | - Test on Elasticsearch 8.0.0 7 | 8 | ## 2020-03-25 9 | - Test on Elasticsearch 7.6.1 10 | 11 | - Running as a Chrome extension 12 | 13 | download crx/es-bigdesk.crx , check extentions develop mode on , drag to webbrowser 14 | 15 | if cannot installed , enable installing local CRX files , or unzip es-bigdesk.crx then install from local folder 16 | 17 | Click the extension icon in the toolbar of your web browser. 18 | 19 | Note that you don¡¯t need to enable CORS with this method. 20 | 21 | Test on Chrome 75.x and Opera 67 22 | 23 | - Run bigdesk standalone 24 | 25 | site plugins are not supported. Run bigdesk standalone ,see below 26 | 27 | ## 2016-10-30 28 | - How to use for ES5.x 29 | 30 | site plugins are not supported. Run bigdesk standalone 31 | 32 | modify elasticsearch.yml,enable CORS 33 | 34 | http.cors.enabled: true 35 | 36 | http.cors.allow-origin: "*" 37 | 38 | Check Elasticsearch documentation on this parameter: `https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html#modules-http` 39 | 40 | then open index.html in browser 41 | 42 | or run on another web server 43 | 44 | ## 2016-03-23 45 | - Modify and relayout some metrics and charts 46 | 47 | ## 2016-03-21 48 | - Support for Elasticsearch 2.x 49 | 50 | ## Installation Instructions 51 | 52 | navigate to `` and execute the following command on command line 53 | 54 | Online Install Elasticsearch master 55 | 56 | $ ./bin/plugin install hlstudio/bigdesk 57 | 58 | Online Install a special/previous version eg: v2.2.a 59 | 60 | $ ./bin/plugin install hlstudio/bigdesk/v2.2.a 61 | 62 | Offline Install, download release zip file or master zip file, copy to a directory eg:/tmp 63 | 64 | $ ./bin/plugin install file:/tmp/bigdesk-master.zip 65 | 66 | ## How to use Bigdesk 67 | 68 | Open your web browser to access `http://127.0.0.1:9200/_plugin/bigdesk` by default. 69 | 70 | Now you should see cluster name and list of its nodes. You can switch between nodes in the cluster, new nodes are added 71 | and old nodes are removed automatically on the fly. 72 | 73 | You can change the Bigdesk **refresh interval** and **amount of data** that is displayed by charts. 74 | 75 | 76 | ## Screenshots 77 | 78 | ![Bigdesk ES2.x](https://github.com/hlstudio/bigdesk/raw/master/bigdesk_es2.png) 79 | 80 | 81 | ## Supported Web Browsers 82 | 83 | Bigdesk should work in all modern web browsers as long as they support SVG. It has been tested in Safari, Firefox and Chrome. 84 | 85 | ## Credits 86 | 87 | Lukas Vlcek and [contributors](https://github.com/lukas-vlcek/bigdesk/contributors). 88 | 89 | Modified by hlstudio. 90 | -------------------------------------------------------------------------------- /_site/background.js: -------------------------------------------------------------------------------- 1 | chrome.browserAction.onClicked.addListener(function (tab) { 2 | chrome.tabs.create({'url': chrome.extension.getURL('index.html')}, function (tab) { 3 | }); 4 | }); 5 | -------------------------------------------------------------------------------- /_site/css/CssGrid_2/1140.css: -------------------------------------------------------------------------------- 1 | /* CSS Resets */ 2 | 3 | html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,address,cite,code,del,dfn,em,img,ins,q,small,strong,sub,sup,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{border:0;margin:0;padding:0}article,aside,figure,figure img,figcaption,hgroup,footer,header,nav,section,video,object{display:block}a img{border:0}figure{position:relative}figure img{width:100%} 4 | 5 | 6 | /* ==================================================================================================================== */ 7 | /* ! The 1140px Grid V2 by Andy Taylor \ http://cssgrid.net \ http://www.twitter.com/andytlr \ http://www.andytlr.com */ 8 | /* ==================================================================================================================== */ 9 | 10 | .container { 11 | padding-left: 20px; 12 | padding-right: 20px; 13 | } 14 | 15 | .row { 16 | width: 100%; 17 | max-width: 1140px; 18 | min-width: 755px; 19 | margin: 0 auto; 20 | overflow: hidden; 21 | } 22 | 23 | .onecol, .twocol, .threecol, .fourcol, .fivecol, .sixcol, .sevencol, .eightcol, .ninecol, .tencol, .elevencol { 24 | margin-right: 3.8%; 25 | float: left; 26 | min-height: 1px; 27 | } 28 | 29 | .row .onecol { 30 | width: 4.85%; 31 | } 32 | 33 | .row .twocol { 34 | width: 13.45%; 35 | } 36 | 37 | .row .threecol { 38 | width: 22.05%; 39 | } 40 | 41 | .row .fourcol { 42 | width: 30.75%; 43 | } 44 | 45 | .row .fivecol { 46 | width: 39.45%; 47 | } 48 | 49 | .row .sixcol { 50 | width: 48%; 51 | } 52 | 53 | .row .sevencol { 54 | width: 56.75%; 55 | } 56 | 57 | .row .eightcol { 58 | width: 65.4%; 59 | } 60 | 61 | .row .ninecol { 62 | width: 74.05%; 63 | } 64 | 65 | .row .tencol { 66 | width: 82.7%; 67 | } 68 | 69 | .row .elevencol { 70 | width: 91.35%; 71 | } 72 | 73 | .row .twelvecol { 74 | width: 100%; 75 | float: left; 76 | } 77 | 78 | .last { 79 | margin-right: 0px; 80 | } 81 | 82 | img, object, embed { 83 | max-width: 100%; 84 | } 85 | 86 | img { 87 | height: auto; 88 | } 89 | 90 | 91 | /* Smaller screens */ 92 | 93 | @media only screen and (max-width: 1023px) { 94 | 95 | body { 96 | font-size: 0.8em; 97 | line-height: 1.5em; 98 | } 99 | 100 | } 101 | 102 | 103 | /* Mobile */ 104 | 105 | @media handheld, only screen and (max-width: 767px) { 106 | 107 | body { 108 | font-size: 16px; 109 | -webkit-text-size-adjust: none; 110 | } 111 | 112 | .row, body, .container { 113 | width: 100%; 114 | min-width: 0; 115 | margin-left: 0px; 116 | margin-right: 0px; 117 | padding-left: 0px; 118 | padding-right: 0px; 119 | } 120 | 121 | .row .onecol, .row .twocol, .row .threecol, .row .fourcol, .row .fivecol, .row .sixcol, .row .sevencol, .row .eightcol, .row .ninecol, .row .tencol, .row .elevencol, .row .twelvecol { 122 | width: auto; 123 | float: none; 124 | margin-left: 0px; 125 | margin-right: 0px; 126 | padding-left: 20px; 127 | padding-right: 20px; 128 | } 129 | 130 | } -------------------------------------------------------------------------------- /_site/css/CssGrid_2/License.txt: -------------------------------------------------------------------------------- 1 | http://cssgrid.net/ 2 | 3 | License: 4 | http://creativecommons.org/licenses/by/3.0/au/ -------------------------------------------------------------------------------- /_site/css/CssGrid_2/ie.css: -------------------------------------------------------------------------------- 1 | .onecol { 2 | width: 4.7%; 3 | } 4 | 5 | .twocol { 6 | width: 13.2%; 7 | } 8 | 9 | .threecol { 10 | width: 22.05%; 11 | } 12 | 13 | .fourcol { 14 | width: 30.6%; 15 | } 16 | 17 | .fivecol { 18 | width: 39%; 19 | } 20 | 21 | .sixcol { 22 | width: 48%; 23 | } 24 | 25 | .sevencol { 26 | width: 56.75%; 27 | } 28 | 29 | .eightcol { 30 | width: 61.6%; 31 | } 32 | 33 | .ninecol { 34 | width: 74.05%; 35 | } 36 | 37 | .tencol { 38 | width: 82%; 39 | } 40 | 41 | .elevencol { 42 | width: 91.35%; 43 | } -------------------------------------------------------------------------------- /_site/css/CssGrid_2/styles.css: -------------------------------------------------------------------------------- 1 | /* ============================== */ 2 | /* ! Layout for desktop version */ 3 | /* ============================== */ 4 | 5 | body {} 6 | .container p { 7 | font-size: 14px; 8 | } 9 | 10 | .masterNode { 11 | background: url("../../images/award_star_gold.png") no-repeat 1px 3px; 12 | } 13 | 14 | @media only screen and (max-width: 1023px) { 15 | 16 | body {} 17 | .container p { 18 | font-size: 12px; 19 | } 20 | .masterNode { 21 | background: url("../../images/award_star_gold.png") no-repeat 1px 1px; 22 | } 23 | } 24 | 25 | /* ============================= */ 26 | /* ! Layout for mobile version */ 27 | /* ============================= */ 28 | 29 | @media handheld, only screen and (max-width: 767px) { 30 | 31 | body {} 32 | .container p { 33 | font-size: 12px; 34 | } 35 | .masterNode { 36 | background: url("../../images/award_star_gold.png") no-repeat 1px 1px; 37 | } 38 | } 39 | 40 | 41 | /* ========================================== */ 42 | /* ! Provide higher res assets for iPhone 4 */ 43 | /* ========================================== */ 44 | 45 | @media only screen and (-webkit-min-device-pixel-ratio: 2) { 46 | 47 | /* .logo { 48 | background: url(logo2x.jpg) no-repeat; 49 | background-size: 212px 303px; 50 | }*/ 51 | 52 | } -------------------------------------------------------------------------------- /_site/css/bigdesk.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2012 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | html { 18 | overflow: -moz-scrollbars-vertical; 19 | overflow-y: scroll; 20 | } 21 | 22 | body { 23 | /*font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;*/ 24 | line-height: 1.3; 25 | } 26 | 27 | .row.newSection { 28 | border-top: 1px solid #9bf; 29 | } 30 | 31 | .container p { 32 | color: #777; 33 | /*line-height: 100px;*/ 34 | /*background: #000;*/ 35 | /*text-align: center;*/ 36 | margin: 15px 0 10px 0; 37 | font-family: sans-serif; 38 | /*font-size: 14px;*/ 39 | } 40 | 41 | h2 { 42 | color: #0055ff; 43 | margin-bottom: 10px; 44 | font-family: serif; 45 | font-size: 16px; 46 | font-weight: bold; 47 | } 48 | 49 | h3 { 50 | color: #555; 51 | font-size: 85%; 52 | margin-top: 9px; 53 | margin-bottom: 5px; 54 | font-weight: bold; 55 | } 56 | 57 | .invisible p { 58 | display: none; 59 | } 60 | 61 | .connectionPanel { 62 | padding: 3px 0 3px 0; 63 | color: #555; 64 | background-color: #eee; 65 | border-bottom: 1px solid #aaa; 66 | white-space: nowrap; 67 | } 68 | 69 | .connectionPanel.settings { 70 | background-color: #d6d6d6; 71 | } 72 | 73 | .connectionPanelSection { 74 | border-right: 1px solid lightgray; 75 | padding: 0 5px 0 7px; 76 | } 77 | 78 | .connectionPanelSectionWithoutDecoration { 79 | padding: 0 2px 0 7px; 80 | } 81 | 82 | #clusterHealth { 83 | /*border: 1px solid black;*/ 84 | } 85 | 86 | #clusterNodes { 87 | /*border: 1px solid blue;*/ 88 | } 89 | 90 | #selectedClusterNode p { 91 | /*border: 1px solid blue;*/ 92 | } 93 | 94 | .clusterNode { 95 | border: 1px solid black; 96 | margin: 0 4px 4px 0px; 97 | padding: 2px 5px 2px 5px; 98 | cursor: pointer; 99 | float: left; 100 | } 101 | 102 | .clusterNode:hover { 103 | background-color: #d1d1d1; 104 | } 105 | 106 | .clusterNode.selectedNode { 107 | background-color: lightgray; 108 | color: white; 109 | } 110 | 111 | .masterNode { 112 | padding-left: 20px; 113 | /*background: url("../images/award_star_gold.png") no-repeat 1px 3px;*/ 114 | } 115 | 116 | .clusterStatus { 117 | padding: 1px 2px; 118 | } 119 | .clusterStatus.red { 120 | background-color: red; 121 | color: white; 122 | } 123 | .clusterStatus.yellow { 124 | background-color: yellow; 125 | } 126 | .clusterStatus.green { 127 | background-color: green; 128 | color: white; 129 | } 130 | 131 | /* TODO css for chart, move it into different file */ 132 | .line { 133 | fill: none; 134 | stroke: #000; 135 | stroke-width: 1px; 136 | } 137 | 138 | .area { 139 | fill: #969696; 140 | } 141 | 142 | /* Courtesy of Jeff Starr, http://perishablepress.com/wrapping-content/ */ 143 | span.pre { 144 | white-space: pre; /* CSS 2.0 */ 145 | white-space: pre-wrap; /* CSS 2.1 */ 146 | white-space: pre-line; /* CSS 3.0 */ 147 | white-space: -pre-wrap; /* Opera 4-6 */ 148 | white-space: -o-pre-wrap; /* Opera 7 */ 149 | white-space: -moz-pre-wrap; /* Mozilla */ 150 | white-space: -hp-pre-wrap; /* HP Printers */ 151 | word-wrap: break-word; /* IE 5+ */ 152 | } 153 | 154 | label { 155 | cursor: pointer; 156 | } 157 | 158 | .center { 159 | text-align: center; 160 | } 161 | -------------------------------------------------------------------------------- /_site/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */ 2 | 3 | /* ============================================================================= 4 | HTML5 display definitions 5 | ========================================================================== */ 6 | 7 | /* 8 | * Corrects block display not defined in IE6/7/8/9 & FF3 9 | */ 10 | 11 | article, 12 | aside, 13 | details, 14 | figcaption, 15 | figure, 16 | footer, 17 | header, 18 | hgroup, 19 | nav, 20 | section, 21 | summary { 22 | display: block; 23 | } 24 | 25 | /* 26 | * Corrects inline-block display not defined in IE6/7/8/9 & FF3 27 | */ 28 | 29 | audio, 30 | canvas, 31 | video { 32 | display: inline-block; 33 | *display: inline; 34 | *zoom: 1; 35 | } 36 | 37 | /* 38 | * Prevents modern browsers from displaying 'audio' without controls 39 | * Remove excess height in iOS5 devices 40 | */ 41 | 42 | audio:not([controls]) { 43 | display: none; 44 | height: 0; 45 | } 46 | 47 | /* 48 | * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4 49 | * Known issue: no IE6 support 50 | */ 51 | 52 | [hidden] { 53 | display: none; 54 | } 55 | 56 | 57 | /* ============================================================================= 58 | Base 59 | ========================================================================== */ 60 | 61 | /* 62 | * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units 63 | * http://clagnut.com/blog/348/#c790 64 | * 2. Prevents iOS text size adjust after orientation change, without disabling user zoom 65 | * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/ 66 | */ 67 | 68 | html { 69 | font-size: 100%; /* 1 */ 70 | -webkit-text-size-adjust: 100%; /* 2 */ 71 | -ms-text-size-adjust: 100%; /* 2 */ 72 | } 73 | 74 | /* 75 | * Addresses font-family inconsistency between 'textarea' and other form elements. 76 | */ 77 | 78 | html, 79 | button, 80 | input, 81 | select, 82 | textarea { 83 | font-family: sans-serif; 84 | } 85 | 86 | /* 87 | * Addresses margins handled incorrectly in IE6/7 88 | */ 89 | 90 | body { 91 | margin: 0; 92 | } 93 | 94 | 95 | /* ============================================================================= 96 | Links 97 | ========================================================================== */ 98 | 99 | /* 100 | * Addresses outline displayed oddly in Chrome 101 | */ 102 | 103 | a:focus { 104 | outline: thin dotted; 105 | } 106 | 107 | /* 108 | * Improves readability when focused and also mouse hovered in all browsers 109 | * people.opera.com/patrickl/experiments/keyboard/test 110 | */ 111 | 112 | a:hover, 113 | a:active { 114 | outline: 0; 115 | } 116 | 117 | 118 | /* ============================================================================= 119 | Typography 120 | ========================================================================== */ 121 | 122 | /* 123 | * Addresses font sizes and margins set differently in IE6/7 124 | * Addresses font sizes within 'section' and 'article' in FF4+, Chrome, S5 125 | */ 126 | 127 | h1 { 128 | font-size: 2em; 129 | margin: 0.67em 0; 130 | } 131 | 132 | h2 { 133 | font-size: 1.5em; 134 | margin: 0.83em 0; 135 | } 136 | 137 | h3 { 138 | font-size: 1.17em; 139 | margin: 1em 0; 140 | } 141 | 142 | h4 { 143 | font-size: 1em; 144 | margin: 1.33em 0; 145 | } 146 | 147 | h5 { 148 | font-size: 0.83em; 149 | margin: 1.67em 0; 150 | } 151 | 152 | h6 { 153 | font-size: 0.75em; 154 | margin: 2.33em 0; 155 | } 156 | 157 | /* 158 | * Addresses styling not present in IE7/8/9, S5, Chrome 159 | */ 160 | 161 | abbr[title] { 162 | border-bottom: 1px dotted; 163 | } 164 | 165 | /* 166 | * Addresses style set to 'bolder' in FF3+, S4/5, Chrome 167 | */ 168 | 169 | b, 170 | strong { 171 | font-weight: bold; 172 | } 173 | 174 | blockquote { 175 | margin: 1em 40px; 176 | } 177 | 178 | /* 179 | * Addresses styling not present in S5, Chrome 180 | */ 181 | 182 | dfn { 183 | font-style: italic; 184 | } 185 | 186 | /* 187 | * Addresses styling not present in IE6/7/8/9 188 | */ 189 | 190 | mark { 191 | background: #ff0; 192 | color: #000; 193 | } 194 | 195 | /* 196 | * Addresses margins set differently in IE6/7 197 | */ 198 | 199 | p, 200 | pre { 201 | margin: 1em 0; 202 | } 203 | 204 | /* 205 | * Corrects font family set oddly in IE6, S4/5, Chrome 206 | * en.wikipedia.org/wiki/User:Davidgothberg/Test59 207 | */ 208 | 209 | pre, 210 | code, 211 | kbd, 212 | samp { 213 | font-family: monospace, serif; 214 | _font-family: 'courier new', monospace; 215 | font-size: 1em; 216 | } 217 | 218 | /* 219 | * Improves readability of pre-formatted text in all browsers 220 | */ 221 | 222 | pre { 223 | white-space: pre; 224 | white-space: pre-wrap; 225 | word-wrap: break-word; 226 | } 227 | 228 | /* 229 | * 1. Addresses CSS quotes not supported in IE6/7 230 | * 2. Addresses quote property not supported in S4 231 | */ 232 | 233 | /* 1 */ 234 | 235 | q { 236 | quotes: none; 237 | } 238 | 239 | /* 2 */ 240 | 241 | q:before, 242 | q:after { 243 | content: ''; 244 | content: none; 245 | } 246 | 247 | small { 248 | font-size: 75%; 249 | } 250 | 251 | /* 252 | * Prevents sub and sup affecting line-height in all browsers 253 | * gist.github.com/413930 254 | */ 255 | 256 | sub, 257 | sup { 258 | font-size: 75%; 259 | line-height: 0; 260 | position: relative; 261 | vertical-align: baseline; 262 | } 263 | 264 | sup { 265 | top: -0.5em; 266 | } 267 | 268 | sub { 269 | bottom: -0.25em; 270 | } 271 | 272 | 273 | /* ============================================================================= 274 | Lists 275 | ========================================================================== */ 276 | 277 | /* 278 | * Addresses margins set differently in IE6/7 279 | */ 280 | 281 | dl, 282 | menu, 283 | ol, 284 | ul { 285 | margin: 1em 0; 286 | } 287 | 288 | dd { 289 | margin: 0 0 0 40px; 290 | } 291 | 292 | /* 293 | * Addresses paddings set differently in IE6/7 294 | */ 295 | 296 | menu, 297 | ol, 298 | ul { 299 | padding: 0 0 0 40px; 300 | } 301 | 302 | /* 303 | * Corrects list images handled incorrectly in IE7 304 | */ 305 | 306 | nav ul, 307 | nav ol { 308 | list-style: none; 309 | list-style-image: none; 310 | } 311 | 312 | 313 | /* ============================================================================= 314 | Embedded content 315 | ========================================================================== */ 316 | 317 | /* 318 | * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3 319 | * 2. Improves image quality when scaled in IE7 320 | * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/ 321 | */ 322 | 323 | img { 324 | border: 0; /* 1 */ 325 | -ms-interpolation-mode: bicubic; /* 2 */ 326 | } 327 | 328 | /* 329 | * Corrects overflow displayed oddly in IE9 330 | */ 331 | 332 | svg:not(:root) { 333 | overflow: hidden; 334 | } 335 | 336 | 337 | /* ============================================================================= 338 | Figures 339 | ========================================================================== */ 340 | 341 | /* 342 | * Addresses margin not present in IE6/7/8/9, S5, O11 343 | */ 344 | 345 | figure { 346 | margin: 0; 347 | } 348 | 349 | 350 | /* ============================================================================= 351 | Forms 352 | ========================================================================== */ 353 | 354 | /* 355 | * Corrects margin displayed oddly in IE6/7 356 | */ 357 | 358 | form { 359 | margin: 0; 360 | } 361 | 362 | /* 363 | * Define consistent border, margin, and padding 364 | */ 365 | 366 | fieldset { 367 | border: 1px solid #c0c0c0; 368 | margin: 0 2px; 369 | padding: 0.35em 0.625em 0.75em; 370 | } 371 | 372 | /* 373 | * 1. Corrects color not being inherited in IE6/7/8/9 374 | * 2. Corrects text not wrapping in FF3 375 | * 3. Corrects alignment displayed oddly in IE6/7 376 | */ 377 | 378 | legend { 379 | border: 0; /* 1 */ 380 | padding: 0; 381 | white-space: normal; /* 2 */ 382 | *margin-left: -7px; /* 3 */ 383 | } 384 | 385 | /* 386 | * 1. Corrects font size not being inherited in all browsers 387 | * 2. Addresses margins set differently in IE6/7, FF3+, S5, Chrome 388 | * 3. Improves appearance and consistency in all browsers 389 | */ 390 | 391 | button, 392 | input, 393 | select, 394 | textarea { 395 | font-size: 100%; /* 1 */ 396 | margin: 0; /* 2 */ 397 | vertical-align: baseline; /* 3 */ 398 | *vertical-align: middle; /* 3 */ 399 | } 400 | 401 | /* 402 | * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet 403 | */ 404 | 405 | button, 406 | input { 407 | line-height: normal; /* 1 */ 408 | } 409 | 410 | /* 411 | * 1. Improves usability and consistency of cursor style between image-type 'input' and others 412 | * 2. Corrects inability to style clickable 'input' types in iOS 413 | * 3. Removes inner spacing in IE7 without affecting normal text inputs 414 | * Known issue: inner spacing remains in IE6 415 | */ 416 | 417 | button, 418 | input[type="button"], 419 | input[type="reset"], 420 | input[type="submit"] { 421 | cursor: pointer; /* 1 */ 422 | -webkit-appearance: button; /* 2 */ 423 | *overflow: visible; /* 3 */ 424 | } 425 | 426 | /* 427 | * Re-set default cursor for disabled elements 428 | */ 429 | 430 | button[disabled], 431 | input[disabled] { 432 | cursor: default; 433 | } 434 | 435 | /* 436 | * 1. Addresses box sizing set to content-box in IE8/9 437 | * 2. Removes excess padding in IE8/9 438 | * 3. Removes excess padding in IE7 439 | Known issue: excess padding remains in IE6 440 | */ 441 | 442 | input[type="checkbox"], 443 | input[type="radio"] { 444 | box-sizing: border-box; /* 1 */ 445 | padding: 0; /* 2 */ 446 | *height: 13px; /* 3 */ 447 | *width: 13px; /* 3 */ 448 | } 449 | 450 | /* 451 | * 1. Addresses appearance set to searchfield in S5, Chrome 452 | * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof) 453 | */ 454 | 455 | input[type="search"] { 456 | -webkit-appearance: textfield; /* 1 */ 457 | -moz-box-sizing: content-box; 458 | -webkit-box-sizing: content-box; /* 2 */ 459 | box-sizing: content-box; 460 | } 461 | 462 | /* 463 | * Removes inner padding and search cancel button in S5, Chrome on OS X 464 | */ 465 | 466 | input[type="search"]::-webkit-search-decoration, 467 | input[type="search"]::-webkit-search-cancel-button { 468 | -webkit-appearance: none; 469 | } 470 | 471 | /* 472 | * Removes inner padding and border in FF3+ 473 | * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/ 474 | */ 475 | 476 | button::-moz-focus-inner, 477 | input::-moz-focus-inner { 478 | border: 0; 479 | padding: 0; 480 | } 481 | 482 | /* 483 | * 1. Removes default vertical scrollbar in IE6/7/8/9 484 | * 2. Improves readability and alignment in all browsers 485 | */ 486 | 487 | textarea { 488 | overflow: auto; /* 1 */ 489 | vertical-align: top; /* 2 */ 490 | } 491 | 492 | 493 | /* ============================================================================= 494 | Tables 495 | ========================================================================== */ 496 | 497 | /* 498 | * Remove most spacing between table cells 499 | */ 500 | 501 | table { 502 | border-collapse: collapse; 503 | border-spacing: 0; 504 | } -------------------------------------------------------------------------------- /_site/css/reset.css: -------------------------------------------------------------------------------- 1 | /* http://meyerweb.com/eric/tools/css/reset/ 2 | v2.0 | 20110126 3 | License: none (public domain) 4 | */ 5 | 6 | html, body, div, span, applet, object, iframe, 7 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 8 | a, abbr, acronym, address, big, cite, code, 9 | del, dfn, em, img, ins, kbd, q, s, samp, 10 | small, strike, strong, sub, sup, tt, var, 11 | b, u, i, center, 12 | dl, dt, dd, ol, ul, li, 13 | fieldset, form, label, legend, 14 | table, caption, tbody, tfoot, thead, tr, th, td, 15 | article, aside, canvas, details, embed, 16 | figure, figcaption, footer, header, hgroup, 17 | menu, nav, output, ruby, section, summary, 18 | time, mark, audio, video { 19 | margin: 0; 20 | padding: 0; 21 | border: 0; 22 | font-size: 100%; 23 | font: inherit; 24 | vertical-align: baseline; 25 | } 26 | /* HTML5 display-role reset for older browsers */ 27 | article, aside, details, figcaption, figure, 28 | footer, header, hgroup, menu, nav, section { 29 | display: block; 30 | } 31 | body { 32 | line-height: 1; 33 | } 34 | ol, ul { 35 | list-style: none; 36 | } 37 | blockquote, q { 38 | quotes: none; 39 | } 40 | blockquote:before, blockquote:after, 41 | q:before, q:after { 42 | content: ''; 43 | content: none; 44 | } 45 | table { 46 | border-collapse: collapse; 47 | border-spacing: 0; 48 | } -------------------------------------------------------------------------------- /_site/images/1license.txt: -------------------------------------------------------------------------------- 1 | The icons are free for personal use and also free for commercial use, but we require linking to our web site. 2 | 3 | http://creativecommons.org/licenses/by-sa/3.0/ 4 | 5 | You are free: 6 | * to Share � to copy, distribute and transmit the work 7 | 8 | Under the following conditions: 9 | Attribution � You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). 10 | 11 | Attribute this work: 12 | What does "Attribute this work" mean? 13 | The page you came from contained embedded licensing metadata, including how the creator wishes to be attributed for re-use. You can use the HTML here to cite the work. Doing so will also include metadata on your page so that others can find the original work as well. 14 | Share Alike � If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. 15 | 16 | led24.de 17 | 31/05/2009 -------------------------------------------------------------------------------- /_site/images/award_star_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hlstudio/bigdesk/f89486dd4ebc42dff82b6c3622d8204a8f61d03e/_site/images/award_star_gold.png -------------------------------------------------------------------------------- /_site/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hlstudio/bigdesk/f89486dd4ebc42dff82b6c3622d8204a8f61d03e/_site/images/favicon.png -------------------------------------------------------------------------------- /_site/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bigdesk 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 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 |
78 |
79 |
80 |
81 | 82 | ES node REST endpoint 83 | 84 | 85 |
86 |
87 | 88 | Refresh every 89 | 97 | 98 | 99 | Keep 100 | 111 | history 112 | 113 | 114 | 115 | 116 |     117 |
118 |
119 |
120 |
121 |
122 | 123 | 124 | -------------------------------------------------------------------------------- /_site/js/bigdeskApp.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2014 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // bigdesk store keeps track of state of clusters 18 | var bigdeskStore = new BigdeskStore(); 19 | 20 | // declare views 21 | var nodesView = { 22 | 23 | clusterHealthView: undefined, 24 | clusterNodesListView: undefined, 25 | 26 | render: function(cluster) { 27 | 28 | var nodesViewTemplate = Mustache.render(templates.nodesViewTemplate, {}); 29 | $("#selectedViewDetail").empty().append(nodesViewTemplate); 30 | 31 | this.clusterHealthView = new ClusterHealthView({el: $("#clusterHealth"), model: cluster}); 32 | this.clusterHealthView.render(); 33 | 34 | this.clusterNodesListView = new ClusterNodesListView({el: $("#clusterNodes"), model: cluster}); 35 | this.clusterNodesListView.render(); 36 | }, 37 | 38 | showNodeDetail: function(cluster, nodeId) { 39 | if (this.clusterNodesListView == undefined) { 40 | this.clusterNodesListView = new ClusterNodesListView({el: $("#clusterNodes"), model: cluster}); 41 | this.clusterNodesListView.render(); 42 | } 43 | this.clusterNodesListView.showNodeDetail(nodeId); 44 | }, 45 | 46 | clear: function() { 47 | if (this.clusterHealthView != undefined) { 48 | this.clusterHealthView.clear(); 49 | } 50 | if (this.clusterNodesListView != undefined) { 51 | this.clusterNodesListView.clear(); 52 | this.clusterNodesListView.undelegateEvents(); 53 | } 54 | } 55 | }; 56 | 57 | var clusterView = { 58 | 59 | clusterHealthView: undefined, 60 | clusterStateView: undefined, 61 | 62 | render: function(cluster) { 63 | 64 | var clusterViewTemplate = Mustache.render(templates.clusterViewTemplate, {}); 65 | $("#selectedViewDetail").empty().append(clusterViewTemplate); 66 | 67 | this.clusterHealthView = new ClusterHealthView({el: $("#clusterHealth"), model: cluster}); 68 | this.clusterHealthView.render(); 69 | 70 | this.clusterStateView = new ClusterStateView({el: $("#clusterChart"), model: cluster}); 71 | // this.clusterStateView.render(); 72 | }, 73 | 74 | clear: function() { 75 | if (this.clusterHealthView != undefined) { 76 | this.clusterHealthView.clear(); 77 | } 78 | if (this.clusterStateView != undefined) { 79 | this.clusterStateView.clear(); 80 | } 81 | } 82 | }; 83 | 84 | var selectedView = undefined; 85 | 86 | var selectedClusterName = undefined; 87 | 88 | var connectTo = function(url, refreshInterval, storeSize, dispatcher, selectedView, callback) { 89 | //fix 20200324 90 | if( url.endsWith('/')){url=url.substring(0,url.length-1);} 91 | var connectionConfig = { baseUrl: url }; 92 | var clusterHealth = new ClusterHealth({},connectionConfig); 93 | 94 | clusterHealth.fetch({ 95 | 96 | success: function(model, response) { 97 | 98 | var clusterName = model.get("cluster_name"); 99 | var cluster = bigdeskStore.getCluster(clusterName); 100 | 101 | selectedClusterName = clusterName; 102 | 103 | if (cluster == undefined) { 104 | 105 | console.log("Found a new cluster [" + clusterName + "]"); 106 | 107 | bigdeskStore.addCluster( 108 | 109 | // Keep in mind 'new Cluster()' is a heavy operation 110 | // because it performs several AJAX calls. 111 | new Cluster({ 112 | id: clusterName, 113 | baseUrl: connectionConfig.baseUrl, 114 | storeSize: storeSize, 115 | refreshInterval: refreshInterval, 116 | dispatcher: dispatcher 117 | }) 118 | ); 119 | 120 | // get cluster reference so that it can be used in view later... 121 | cluster = bigdeskStore.getCluster(clusterName); 122 | selectedView.render(cluster); 123 | 124 | } else { 125 | 126 | console.log("Cluster [" + clusterName + "] found in store"); 127 | 128 | cluster.setStoreSize(storeSize); 129 | 130 | // init view first, then fetch the update! 131 | selectedView.render(cluster); 132 | cluster.startFetch(refreshInterval, connectionConfig.baseUrl); 133 | } 134 | if (callback) { 135 | callback(); 136 | } 137 | }, 138 | 139 | error: function(model, response) { /* can not handle in JSONP */ } 140 | 141 | }); 142 | }; 143 | 144 | var disconnectFrom = function(url, callback) { 145 | 146 | var disconnectFromCluster = function(cluster) { 147 | cluster.clearIntervals(); 148 | cluster.clearTimeouts(); 149 | selectedView.clear(); 150 | }; 151 | 152 | // Iterate through all clusters having baseUrl == url and disconnect from them. 153 | var disconnectFromURL = function(url) { 154 | _.each(bigdeskStore.get("cluster") 155 | .filter(function(cluster){ 156 | return cluster.get("health").get("baseUrl") == url; 157 | }), 158 | function(cluster){ 159 | console.log("Disconnecting from ["+cluster.id+"]"); 160 | disconnectFromCluster(cluster); 161 | }); 162 | if (callback) { 163 | callback(); 164 | } 165 | }; 166 | 167 | disconnectFromURL(url); 168 | }; 169 | 170 | var changeRefreshInterval = function(url, newRefreshInterval) { 171 | 172 | var connectionConfig = { baseUrl: url }; 173 | var clusterHealth = new ClusterHealth({},connectionConfig); 174 | 175 | // we need to do the health.fetch to get cluster name. 176 | clusterHealth.fetch({ 177 | 178 | success: function(model, response) { 179 | var clusterName = model.get("cluster_name"); 180 | var cluster = bigdeskStore.getCluster(clusterName); 181 | if (cluster) { 182 | // we do not want to change URL just refresh interval 183 | cluster.startFetch(newRefreshInterval/*, connectionConfig.baseUrl*/); 184 | } 185 | }, 186 | 187 | error: function(model, response) { /* can not handle in JSONP */ } 188 | 189 | }); 190 | }; 191 | 192 | var changeStoreSize = function(url, newStoreSize) { 193 | 194 | var connectionConfig = { baseUrl: url }; 195 | var clusterHealth = new ClusterHealth({},connectionConfig); 196 | 197 | // we need to do the health.fetch to get cluster name. 198 | clusterHealth.fetch({ 199 | 200 | success: function(model, response) { 201 | var clusterName = model.get("cluster_name"); 202 | var cluster = bigdeskStore.getCluster(clusterName); 203 | if (cluster) { 204 | cluster.setStoreSize(newStoreSize); 205 | } 206 | }, 207 | 208 | error: function(model, response) { /* can not handle in JSONP */ } 209 | 210 | }); 211 | }; 212 | 213 | $(document).ready( 214 | function($) { 215 | 216 | var restEndPoint = $("#restEndPoint"), 217 | refreshInterval = $("#refreshInterval"), 218 | storeSize = $("#storeSize"), 219 | button = $("#connectButton"), 220 | ajaxIndicator = $("#ajaxIndicator"); 221 | var isConnected = function() { 222 | return (button.val() !== "Connect"); 223 | }; 224 | 225 | var getRefreshInterval = function() { 226 | return refreshInterval.find(":selected").val(); 227 | }; 228 | 229 | var getStoreSize = function() { 230 | return storeSize.find(":selected").val(); 231 | }; 232 | 233 | var switchButtonText = function() { 234 | if (isConnected()) { 235 | button.val("Connect"); 236 | restEndPoint.removeAttr('disabled'); 237 | } else { 238 | button.val("Disconnect"); 239 | restEndPoint.attr('disabled','disabled'); 240 | } 241 | }; 242 | 243 | refreshInterval.change(function(){ 244 | if (isConnected()) { 245 | changeRefreshInterval(restEndPoint.val(), getRefreshInterval()); 246 | } 247 | }); 248 | 249 | storeSize.change(function(){ 250 | if (isConnected()) { 251 | changeStoreSize(restEndPoint.val(), getStoreSize()); 252 | } 253 | }); 254 | 255 | var ajaxResponseCallback = function(clusterName, restApiName, response) { 256 | // console.log("["+clusterName+"] ["+restApiName+"]", response); 257 | // var iterator = function(nodeStats) {return nodeStats.id; }; 258 | // if (restApiName == "cluster > NodesStats") { 259 | // console.log(response); 260 | // var nodesCollection = this.get("nodesStats"); 261 | // console.log("collection length",nodesCollection.length); 262 | // console.log("collection max",nodesCollection.max(iterator).id); 263 | // console.log("collection min",nodesCollection.min(iterator).id); 264 | // } 265 | ajaxIndicator.show().css("background-color", "lightgreen").fadeOut("slow"); 266 | }; 267 | 268 | var newDataCallback = function(description, data) { 269 | // console.log(description, data); 270 | }; 271 | 272 | var bigdeskEventDispatcher = _.clone(Backbone.Events); 273 | bigdeskEventDispatcher.on("onAjaxResponse", ajaxResponseCallback); 274 | bigdeskEventDispatcher.on("onNewData", newDataCallback); 275 | 276 | button.click(function(){ 277 | if (isConnected()) { 278 | disconnectFrom(restEndPoint.val(), switchButtonText); 279 | } else { 280 | connectTo(restEndPoint.val(), getRefreshInterval(), getStoreSize(), bigdeskEventDispatcher, selectedView, switchButtonText); 281 | window.localStorage.setItem("endpoint",restEndPoint.val()); 282 | } 283 | }); 284 | 285 | restEndPoint.bind("keypress",function(event){ 286 | if (typeof event == 'undefined' && window.event) { event = window.event; } 287 | if(event.keyCode == 13){ 288 | if (event.cancelable && event.preventDefault) { 289 | event.preventDefault(); 290 | button.click(); 291 | } else { 292 | button.click(); 293 | } 294 | return false; 295 | } 296 | return true; 297 | }); 298 | 299 | var getSearchUrlVar = function(key) { 300 | var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search); 301 | return decodeURIComponent(result && result[1] || ""); 302 | }; 303 | var getLocalUrlVar = function(key) { 304 | return window.localStorage.getItem(key); 305 | }; 306 | 307 | var parseUrlParams = function() { 308 | return { 309 | endpoint: getSearchUrlVar("endpoint") || getLocalUrlVar("endpoint") || "http://localhost:9200", 310 | refresh: getSearchUrlVar("refresh") || 3000, 311 | history: getSearchUrlVar("history") || 300000, 312 | connect: getSearchUrlVar("connect") || false 313 | } 314 | }; 315 | 316 | // If any URL params are found (i.e. they are provided by the user) 317 | // then they are applied/set into appropriate form fields. 318 | var applyUrlParams = function() { 319 | 320 | var params = parseUrlParams(); 321 | 322 | // assume this is a plugin running in ES node 323 | if (window.location.href.indexOf("/_plugin/") != -1) { 324 | // if "endpoint" or "connect" values provided as an URL parameter, do not change them 325 | if (!getSearchUrlVar("endpoint")) { 326 | params.endpoint = window.location.protocol + "//" + window.location.host; 327 | var index = window.location.pathname.indexOf("/_plugin"); 328 | if (index > 0){ 329 | params.endpoint += window.location.pathname.substr(0, index); 330 | } 331 | } 332 | if (!getSearchUrlVar("connect")) { 333 | params.connect = true; 334 | } 335 | } 336 | 337 | restEndPoint.val(params.endpoint); 338 | refreshInterval.val(params.refresh); 339 | storeSize.val(params.history); 340 | return params; 341 | }; 342 | 343 | var applyUrlParamsCalled = false; 344 | 345 | var BigdeskRouter = Backbone.Router.extend({ 346 | 347 | routes: { 348 | "nodes" : "nodes", 349 | "nodes/master" : "nodes_master", 350 | "nodes/:nodeId" : "nodes", 351 | "cluster" : "cluster", 352 | "*other" : "defaultRoute" 353 | }, 354 | 355 | cluster: function() { 356 | // console.log("change route: cluster"); 357 | if (selectedView && _.isFunction(selectedView.clear)) { 358 | selectedView.clear(); 359 | } 360 | selectedView = clusterView; 361 | if (!isConnected() && !applyUrlParamsCalled) { 362 | var params = applyUrlParams(); 363 | applyUrlParamsCalled = true; 364 | if (params.connect == true || params.connect == "true") { 365 | button.click(); 366 | } 367 | } else { 368 | selectedView.render( 369 | bigdeskStore.getCluster(selectedClusterName) 370 | ) 371 | } 372 | }, 373 | 374 | nodes_master: function() { 375 | // console.log("try to connect to the master node"); 376 | var masterNodeId = ""; 377 | if (!isConnected() && !applyUrlParamsCalled) { 378 | // we are not connected and master node id is not known yet 379 | } else { 380 | masterNodeId = "/" + bigdeskStore.getCluster(selectedClusterName).getMasterNodeId(); 381 | } 382 | 383 | this.navigate("nodes" + masterNodeId, {trigger: true, replace: true}); 384 | }, 385 | 386 | nodes: function(nodeId) { 387 | // console.log("change route: nodes("+(nodeId||"")+")"); 388 | if (selectedView && _.isFunction(selectedView.clear)) { 389 | selectedView.clear(); 390 | } 391 | selectedView = nodesView; 392 | if (!isConnected() && !applyUrlParamsCalled) { 393 | if (nodeId) { 394 | // If not connected yet but nodeId is provided, then redirect to "nodes" route 395 | // i.e. remove the nodeId form the URL fragment. 396 | this.navigate("nodes", {trigger: true, replace: true}); 397 | return; 398 | } 399 | var params = applyUrlParams(); 400 | applyUrlParamsCalled = true; 401 | if (params.connect == true || params.connect == "true") { 402 | button.click(); 403 | } 404 | } else { 405 | selectedView.render( 406 | bigdeskStore.getCluster(selectedClusterName) 407 | ); 408 | if (nodeId) { 409 | selectedView.showNodeDetail(bigdeskStore.getCluster(selectedClusterName), nodeId); 410 | } 411 | } 412 | }, 413 | 414 | defaultRoute: function(other) { 415 | this.navigate("nodes", {trigger: true, replace: true}); 416 | } 417 | 418 | }); 419 | 420 | new BigdeskRouter(); 421 | 422 | Backbone.history.start(); 423 | 424 | } 425 | ); 426 | -------------------------------------------------------------------------------- /_site/js/charts/common.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2012 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | .chart_box { 18 | fill: none; 19 | /*stroke: #999;*/ 20 | stroke: none; 21 | } 22 | 23 | .plot_box { 24 | fill: none; 25 | stroke-width: 0.1; 26 | /*stroke: #444;*/ 27 | stroke: none; 28 | } 29 | 30 | .area { 31 | fill: #969696; 32 | } 33 | 34 | .tick { 35 | stroke: #000; 36 | stroke-width: 0.6; 37 | } 38 | 39 | .domain { 40 | fill: none; 41 | stroke: #000; 42 | stroke-width: 0.6; 43 | /*shape-rendering: crispEdges;*/ /* does not look good on FF and Chrome */ 44 | } 45 | 46 | .axis { 47 | font-size: 70%; 48 | font-family: Verdana; 49 | } 50 | 51 | .circle_line1 { 52 | stroke: #44c; 53 | stroke-width: 0.7; 54 | fill: white; 55 | } 56 | 57 | .circle_line2 { 58 | stroke: #c77; 59 | stroke-width: 0.7; 60 | fill: white; 61 | } 62 | 63 | .circle_line3 { 64 | stroke: #7c9; 65 | stroke-width: 0.7; 66 | fill: white; 67 | } 68 | 69 | .legend_background { 70 | stroke: #ccc; 71 | stroke-width: 0.7; 72 | fill: white; 73 | opacity: 0.7; 74 | } 75 | 76 | .legend_text { 77 | fill: #555; 78 | } 79 | 80 | .legend_caption { 81 | fill: black; 82 | font-size: 14px; 83 | font-weight: bolder; 84 | font-family: serif; 85 | } 86 | 87 | .legend_circle_line1 { 88 | stroke: #44c; 89 | stroke-width: 1.5; 90 | fill: white; 91 | } 92 | 93 | .legend_circle_line2 { 94 | stroke: #c77; 95 | stroke-width: 1.5; 96 | fill: white; 97 | } 98 | 99 | .legend_circle_line3 { 100 | stroke: #7c9; 101 | stroke-width: 1.5; 102 | fill: white; 103 | } 104 | -------------------------------------------------------------------------------- /_site/js/charts/not-available/not-available-chart.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2012 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | .na_chart_box { 18 | fill: #ddd; 19 | /*stroke: #aaa;*/ 20 | stroke: none; 21 | } 22 | 23 | .na_chart_text { 24 | fill: #888; 25 | } 26 | -------------------------------------------------------------------------------- /_site/js/charts/not-available/not-available-chart.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2014 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | function chartNotAvailable() { 18 | 19 | var svg = undefined, 20 | width = undefined, 21 | height = undefined; 22 | 23 | function chart() {}; 24 | 25 | chart.show = function() { 26 | 27 | if (!svg || svg.length == 0) throw "svg element must be set"; 28 | 29 | var clip_id = svg.attr("clip_id"); 30 | if (!clip_id || clip_id.length == 0) { 31 | throw "svg element must have 'clip_id' attribute"; 32 | } 33 | 34 | svg.append("rect") 35 | .attr("width", width) 36 | .attr("height",height) 37 | .attr("class","na_chart_box"); 38 | 39 | svg.append("text") 40 | .text("Chart not available") 41 | .attr("transform","translate("+((width/2)-70)+","+(height/2)+")") 42 | .attr("class","na_chart_text"); 43 | 44 | return chart; 45 | }; 46 | 47 | chart.width = function(_) { 48 | if (!arguments.length) return width; 49 | width = _; 50 | return chart; 51 | }; 52 | 53 | chart.height = function(_) { 54 | if (!arguments.length) return height; 55 | height = _; 56 | return chart; 57 | }; 58 | 59 | chart.svg = function(_) { 60 | if (!arguments.length) return svg; 61 | svg = _; 62 | return chart; 63 | }; 64 | 65 | return chart; 66 | } 67 | -------------------------------------------------------------------------------- /_site/js/charts/not-available/test-not-available-chart.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Test of not-available-chart 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 |
24 | Chart not available. 25 | 26 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /_site/js/charts/pack/pack.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2012 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | circle { 18 | /*fill: rgb(31, 119, 180);*/ 19 | /*fill-opacity: .25;*/ 20 | stroke: rgb(31, 119, 180); 21 | stroke-width: 1px; 22 | } 23 | 24 | circle:hover { 25 | stroke-width: 3px; 26 | cursor: pointer; 27 | } 28 | 29 | .leaf circle { 30 | fill: #ff7f0e; 31 | fill-opacity: 0.5; 32 | } 33 | 34 | .leaf.primary circle { 35 | fill: #ff7f0e; 36 | fill-opacity: 1; 37 | } 38 | 39 | .node { 40 | fill: rgb(31, 119, 180); 41 | fill-opacity: .25; 42 | } 43 | 44 | .master.node { 45 | fill-opacity: .45; 46 | } 47 | 48 | text { 49 | font: 10px sans-serif; 50 | fill: rgb(10, 10, 10); 51 | fill-opacity: 1; 52 | } 53 | 54 | /*text:hover {*/ 55 | /*font: 10px sans-serif;*/ 56 | /*cursor: pointer;*/ 57 | /*}*/ 58 | -------------------------------------------------------------------------------- /_site/js/charts/time-area/test-time-area-chart.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Test of time-area-chart 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 |
24 | Click at least 3 times: 25 | animated 26 |
27 | Chart holds series up to 20 data points. 28 | 29 |
30 | Click at least 3 times: 31 | animated 32 |
33 | Chart holds series up to 20 data points. 34 | 35 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /_site/js/charts/time-area/time-area-chart.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2012 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | .area1 { 18 | fill: #88d; 19 | } 20 | 21 | .area2 { 22 | fill: #daa; 23 | } 24 | 25 | .area3 { 26 | fill: #deb; 27 | } 28 | 29 | .line1 { 30 | fill: none; 31 | stroke: #44c; 32 | stroke-width: 1; 33 | } 34 | 35 | .line2 { 36 | fill: none; 37 | stroke: #c77; 38 | stroke-width: 1; 39 | } 40 | 41 | .line3 { 42 | fill: none; 43 | /*stroke: #c77;*/ 44 | /*stroke-width: 1;*/ 45 | } 46 | -------------------------------------------------------------------------------- /_site/js/charts/time-area/time-area-chart.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2014 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | function timeAreaChart() { 18 | 19 | var width = 330, 20 | height = 150, 21 | margin = { top: 17, right: 40, bottom :30, left: 7, axes: 0 }, 22 | legend = { caption: "Time area", series1: "series1", series2: "series2", width: 110 }, 23 | svg = undefined, 24 | initialized = false, 25 | animate = true, 26 | 27 | time_scale = undefined, 28 | time_scale_axis = undefined, 29 | value_scale = undefined, 30 | 31 | xAxis = undefined, 32 | yAxis = undefined, 33 | 34 | line = undefined, 35 | path1 = undefined, 36 | path2 = undefined, 37 | path3 = undefined, 38 | 39 | area = undefined, 40 | area1 = undefined, 41 | area2 = undefined, 42 | area3 = undefined; 43 | 44 | function chart() {}; 45 | 46 | function init() { 47 | 48 | if (!svg || svg.length == 0) throw "svg element must be set"; 49 | 50 | var clip_id = svg.attr("clip_id"); 51 | if (!clip_id || clip_id.length == 0) { 52 | throw "svg element must have 'clip_id' attribute"; 53 | } 54 | 55 | time_scale = d3.time.scale() 56 | .range([0 + margin.left, width - margin.right]); 57 | 58 | time_scale_axis = d3.time.scale() 59 | .range([0 + margin.left, width - margin.right]); 60 | 61 | value_scale = d3.scale.linear() 62 | .range([height - margin.bottom, 0 + margin.top]); 63 | 64 | xAxis = d3.svg.axis().scale(time_scale_axis).orient("bottom").ticks(4).tickSize(6,3,0).tickSubdivide(true); 65 | yAxis = d3.svg.axis().scale(value_scale).orient("right").ticks(4).tickFormat(d3.format("s")); 66 | 67 | line = d3.svg.line() 68 | // .interpolate("monotone") 69 | .x(function(d){return time_scale( new Date(d.timestamp));}) 70 | .y(function(d){return value_scale(d.value);}); 71 | 72 | area = d3.svg.area() 73 | // .interpolate("monotone") 74 | .x(function(d) { return time_scale( new Date(d.timestamp)); }) 75 | .y0(height) 76 | .y1(function(d) { return value_scale(d.value); }); 77 | 78 | // chart box 79 | svg.append("rect") 80 | .attr("width", width) 81 | .attr("height",height) 82 | .attr("class","chart_box"); 83 | 84 | // plot box 85 | svg.append("rect") 86 | .attr("x", margin.left) 87 | .attr("y", margin.top) 88 | .attr("width", width - margin.left - margin.right) 89 | .attr("height",height - margin.top - margin.bottom) 90 | .attr("class","plot_box"); 91 | 92 | svg.append("defs").append("clipPath") 93 | .attr("id", clip_id) 94 | .append("rect") 95 | .attr("x", margin.left) 96 | .attr("y", margin.top) 97 | .attr("width", width - margin.left - margin.right) 98 | .attr("height",height - margin.top - margin.bottom); 99 | 100 | // areas and paths 101 | area3 = svg.append("g") 102 | .attr("clip-path", "url(#"+clip_id+")") 103 | .append("path"); 104 | 105 | path3 = svg.append("g") 106 | .attr("clip-path", "url(#"+clip_id+")") 107 | .append("path"); 108 | 109 | area2 = svg.append("g") 110 | .attr("clip-path", "url(#"+clip_id+")") 111 | .append("path"); 112 | 113 | path2 = svg.append("g") 114 | .attr("clip-path", "url(#"+clip_id+")") 115 | .append("path"); 116 | 117 | area1 = svg.append("g") 118 | .attr("clip-path", "url(#"+clip_id+")") 119 | .append("path"); 120 | 121 | path1 = svg.append("g") 122 | .attr("clip-path", "url(#"+clip_id+")") 123 | .append("path"); 124 | 125 | // axes 126 | svg.append("svg:g") 127 | .attr("class", "axis x") 128 | .attr("transform","translate(0,"+ (height - margin.bottom + margin.axes) +")") 129 | .call(xAxis); 130 | 131 | svg.append("svg:g") 132 | .attr("class", "axis y") 133 | .attr("transform","translate("+ (width - margin.right + margin.axes) +",0)") 134 | .call(yAxis); 135 | 136 | // legend 137 | var legendSize = { width: legend.width, height: 31 }; 138 | 139 | var legendSvg = svg.append("svg:g"); 140 | 141 | legendSvg.append("rect") 142 | .attr("width", legendSize.width) 143 | .attr("height", legendSize.height) 144 | .attr("rx", 2) 145 | .attr("ry", 2) 146 | .attr("class","legend_background"); 147 | 148 | legendSvg.attr("transform","translate("+(margin.left + legend.margin_left)+","+(height -margin.bottom - legendSize.height - legend.margin_bottom)+")"); 149 | 150 | var legend1 = legendSvg.append("text").text(legend.series1).attr("class","legend_text"); 151 | var legend2 = legendSvg.append("text").text(legend.series2).attr("class","legend_text"); 152 | 153 | legend1.attr("font-size", 10) 154 | .attr("font-family", "Verdana") 155 | .attr("transform","translate("+20+","+(legendSize.height - 5)+")"); 156 | 157 | legend2.attr("font-size", 10) 158 | .attr("font-family", "Verdana") 159 | .attr("transform","translate("+20+","+(legendSize.height - 5 - 14)+")"); 160 | 161 | legendSvg.append("circle") 162 | .attr("r", 3) 163 | .attr("class", "legend_circle_line1") 164 | .attr("transform","translate("+10+","+(legendSize.height - 8)+")"); 165 | 166 | legendSvg.append("circle") 167 | .attr("r", 3) 168 | .attr("class", "legend_circle_line2") 169 | .attr("transform","translate("+10+","+(legendSize.height - 8 - 14)+")"); 170 | 171 | // caption 172 | if (legend.caption && legend.caption.length > 0) { 173 | 174 | var captionSvg = svg.append("g"); 175 | captionSvg.append("text").text(legend.caption).attr("class","legend_caption"); 176 | captionSvg.attr("transform", "translate("+margin.left+",11)"); 177 | 178 | } 179 | 180 | initialized = true; 181 | 182 | }; 183 | 184 | // data1 and data2 are mandatory 185 | // data3 is optional 186 | chart.update = function(data1, data2, data3) { 187 | 188 | if (!initialized) init(); 189 | 190 | if (data3 && data3.length > 0) { 191 | // we assume data3 (if present) is always max 192 | value_scale.domain([0,d3.max(data3, function(d){return d.value})]).nice(); 193 | } else { 194 | value_scale.domain([0, 195 | d3.max([ 196 | d3.max(data1, function(d){return d.value}), 197 | d3.max(data2, function(d){return d.value}) 198 | ]) 199 | ]).nice(); 200 | } 201 | 202 | if (data1.length > 2) 203 | time_scale_axis.domain([ 204 | data1[1].timestamp, 205 | data1[data1.length-1].timestamp 206 | ]); 207 | 208 | if (!animate) { 209 | if (data1.length > 2) 210 | time_scale.domain([ 211 | data1[1].timestamp, 212 | data1[data1.length-1].timestamp 213 | ]); 214 | } 215 | 216 | area1.data(data1) 217 | .attr("class", "area1") 218 | .attr("d", area(data1)); 219 | 220 | path1.data(data1) 221 | .attr("class", "line1") 222 | .attr("d", line(data1)); 223 | 224 | area2.data(data2) 225 | .attr("class", "area2") 226 | .attr("d", area(data2)); 227 | 228 | path2.data(data2) 229 | .attr("class", "line2") 230 | .attr("d", line(data2)); 231 | 232 | if (data3 && data3.length > 0) { 233 | area3.data(data3) 234 | .attr("class", "area3") 235 | .attr("d", area(data3)); 236 | 237 | path3.data(data3) 238 | .attr("class", "line3") 239 | .attr("d", line(data3)); 240 | } 241 | 242 | if (animate) { 243 | if (data1.length > 2) 244 | time_scale.domain([ 245 | data1[1].timestamp, 246 | data1[data1.length-1].timestamp 247 | ]); 248 | } 249 | 250 | if (animate) { 251 | var t = svg.transition() 252 | .duration(250) 253 | .ease("linear"); 254 | 255 | t.select(".x.axis").call(xAxis); 256 | t.select(".y.axis").call(yAxis); 257 | 258 | t.select(".area1").attr("d", area(data1)); 259 | t.select(".area2").attr("d", area(data2)); 260 | if (data3 && data3.length > 0) { 261 | t.select(".area3").attr("d", area(data3)); 262 | } 263 | } else { 264 | svg.select(".x.axis").call(xAxis); 265 | svg.select(".y.axis").call(yAxis); 266 | } 267 | 268 | if (animate) { 269 | path1 270 | .transition().duration(250).ease("linear") 271 | .attr("d", line(data1)); 272 | 273 | } else { 274 | path1 275 | .attr("d", line(data1)); 276 | } 277 | 278 | if (animate) { 279 | path2 280 | .transition().duration(250).ease("linear") 281 | .attr("d", line(data2)); 282 | } else { 283 | path2 284 | .attr("d", line(data2)); 285 | } 286 | 287 | if (data3 && data3.length > 0) { 288 | if (animate) { 289 | path3 290 | .transition().duration(250).ease("linear") 291 | .attr("d", line(data3)); 292 | } else { 293 | path3 294 | .attr("d", line(data3)); 295 | } 296 | } 297 | 298 | }; 299 | 300 | chart.width = function(_) { 301 | if (!arguments.length) return width; 302 | width = _; 303 | return chart; 304 | }; 305 | 306 | chart.height = function(_) { 307 | if (!arguments.length) return height; 308 | height = _; 309 | return chart; 310 | }; 311 | 312 | chart.svg = function(_) { 313 | if (!arguments.length) return svg; 314 | svg = _; 315 | return chart; 316 | }; 317 | 318 | chart.legend = function(_) { 319 | if (!arguments.length) return legend; 320 | legend = _; 321 | return chart; 322 | }; 323 | 324 | chart.animate = function(_) { 325 | if (!arguments.length) return animate; 326 | animate = _; 327 | return chart; 328 | } 329 | 330 | return chart; 331 | } 332 | 333 | 334 | -------------------------------------------------------------------------------- /_site/js/charts/time-series/test-time-series-chart.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Test of time-series-chart 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 20 | 21 | 22 | 23 |
24 | Click at least 3 times: 25 | animated 26 |
27 | Chart holds series up to 20 data points. 28 | 29 |
30 | Click at least 3 times: 31 | animated 32 |
33 | Chart holds series up to 20 data points. 34 | 35 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /_site/js/charts/time-series/time-series-chart.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2012 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | .line1 { 18 | fill: none; 19 | stroke: #44c; 20 | stroke-width: 1; 21 | } 22 | 23 | .line2 { 24 | fill: none; 25 | stroke: #c77; 26 | stroke-width: 1; 27 | } 28 | 29 | .line3 { 30 | fill: none; 31 | stroke: #7c9; 32 | stroke-width: 1; 33 | } 34 | -------------------------------------------------------------------------------- /_site/js/charts/time-series/time-series-chart.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2011-2014 Lukas Vlcek 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | function timeSeriesChart() { 18 | 19 | var width = 330, 20 | height = 150, 21 | margin = { top: 17, right: 40, bottom :30, left: 7, axes: 0 }, 22 | legend = { caption: "Time series", series1: "series1", series2: "series2", width: 110 }, 23 | svg = undefined, 24 | initialized = false, 25 | animate = true, 26 | 27 | line = undefined, 28 | path1 = undefined, 29 | path2 = undefined, 30 | path3 = undefined, 31 | 32 | circlesContainer = undefined, 33 | 34 | time_scale = undefined, 35 | time_scale_axis = undefined, 36 | value_scale = undefined, 37 | 38 | xAxis = undefined, 39 | yAxis = undefined; 40 | 41 | function chart() {}; 42 | 43 | function init(data1, data2, data3) { 44 | 45 | if (!svg || svg.length == 0) throw "svg element must be set"; 46 | 47 | var clip_id = svg.attr("clip_id"); 48 | if (!clip_id || clip_id.length == 0) { 49 | throw "svg element must have 'clip_id' attribute"; 50 | } 51 | 52 | time_scale = d3.time.scale() 53 | .range([0 + margin.left, width - margin.right]); 54 | 55 | time_scale_axis = d3.time.scale() 56 | .range([0 + margin.left, width - margin.right]); 57 | 58 | value_scale = d3.scale.linear() 59 | .range([height - margin.bottom, 0 + margin.top]); 60 | 61 | xAxis = d3.svg.axis().scale(time_scale_axis).orient("bottom").ticks(4).tickSize(6,3,0).tickSubdivide(true); 62 | yAxis = d3.svg.axis().scale(value_scale).orient("right").ticks(4).tickFormat(d3.format("s")); 63 | 64 | line = d3.svg.line() 65 | // .interpolate("monotone") 66 | .x(function(d){return time_scale( new Date(d.timestamp));}) 67 | .y(function(d){return value_scale(d.value);}); 68 | 69 | // chart box 70 | svg.append("rect") 71 | .attr("width", width) 72 | .attr("height",height) 73 | .attr("class","chart_box"); 74 | 75 | // plot box 76 | svg.append("rect") 77 | .attr("x", margin.left) 78 | .attr("y", margin.top) 79 | .attr("width", width - margin.left - margin.right) 80 | .attr("height",height - margin.top - margin.bottom) 81 | .attr("class","plot_box"); 82 | 83 | svg.append("defs").append("clipPath") 84 | .attr("id", clip_id) 85 | .append("rect") 86 | .attr("x", margin.left) 87 | .attr("y", margin.top) 88 | .attr("width", width - margin.left - margin.right) 89 | .attr("height",height - margin.top - margin.bottom); 90 | 91 | // paths 92 | path1 = svg.append("g") 93 | .attr("clip-path", "url(#"+clip_id+")") 94 | .append("path"); 95 | 96 | path2 = svg.append("g") 97 | .attr("clip-path", "url(#"+clip_id+")") 98 | .append("path"); 99 | 100 | if (data3) { 101 | path3 = svg.append("g") 102 | .attr("clip-path", "url(#"+clip_id+")") 103 | .append("path"); 104 | } 105 | 106 | circlesContainer = svg.append("g") 107 | .attr("clip-path", "url(#"+clip_id+")") 108 | .attr("id","circlesContainer"); 109 | 110 | // axes 111 | svg.append("svg:g") 112 | .attr("class", "axis x") 113 | .attr("transform","translate(0,"+ (height - margin.bottom + margin.axes) +")") 114 | .call(xAxis); 115 | 116 | svg.append("svg:g") 117 | .attr("class", "axis y") 118 | .attr("transform","translate("+ (width - margin.right + margin.axes) +",0)") 119 | .call(yAxis); 120 | 121 | // legend 122 | var legendSize = { width: legend.width, height: (data3 ? 47 : 31)}; 123 | 124 | var legendSvg = svg.append("svg:g"); 125 | 126 | legendSvg.append("rect") 127 | .attr("width", legendSize.width) 128 | .attr("height", legendSize.height) 129 | .attr("rx", 2) 130 | .attr("ry", 2) 131 | .attr("class","legend_background"); 132 | 133 | legendSvg.attr("transform","translate("+(margin.left + legend.margin_left)+","+(height -margin.bottom - legendSize.height - legend.margin_bottom)+")"); 134 | 135 | var legend1 = legendSvg.append("text").text(legend.series1).attr("class","legend_text"); 136 | var legend2 = legendSvg.append("text").text(legend.series2).attr("class","legend_text"); 137 | var legend3 = legendSvg.append("text").text(legend.series3).attr("class","legend_text"); 138 | 139 | legend1.attr("font-size", 10) 140 | .attr("font-family", "Verdana") 141 | .attr("transform","translate("+20+","+(legendSize.height - 5)+")"); 142 | 143 | legend2.attr("font-size", 10) 144 | .attr("font-family", "Verdana") 145 | .attr("transform","translate("+20+","+(legendSize.height - 5 - 14)+")"); 146 | 147 | legendSvg.append("circle") 148 | .attr("r", 3) 149 | .attr("class", "legend_circle_line1") 150 | .attr("transform","translate("+10+","+(legendSize.height - 8)+")"); 151 | 152 | legendSvg.append("circle") 153 | .attr("r", 3) 154 | .attr("class", "legend_circle_line2") 155 | .attr("transform","translate("+10+","+(legendSize.height - 8 - 14)+")"); 156 | 157 | if (data3) { 158 | 159 | legend3.attr("font-size", 10) 160 | .attr("font-family", "Verdana") 161 | .attr("transform","translate("+20+","+(legendSize.height - 5 - 14 - 14)+")"); 162 | 163 | legendSvg.append("circle") 164 | .attr("r", 3) 165 | .attr("class", "legend_circle_line3") 166 | .attr("transform","translate("+10+","+(legendSize.height - 8 - 14 - 14)+")"); 167 | 168 | } 169 | 170 | // caption 171 | if (legend.caption && legend.caption.length > 0) { 172 | 173 | var captionSvg = svg.append("g"); 174 | captionSvg.append("text").text(legend.caption).attr("class","legend_caption"); 175 | captionSvg.attr("transform", "translate("+margin.left+",11)"); 176 | 177 | } 178 | 179 | initialized = true; 180 | 181 | }; 182 | 183 | // data1 and data2 are mandatory 184 | // data3 is optional 185 | chart.update = function(data1, data2, data3) { 186 | 187 | if (!initialized) init(data1, data2, data3); 188 | 189 | var circles1 = circlesContainer.selectAll("circle.circle_line1") 190 | .data(data1, function(d){return d.timestamp}); 191 | 192 | var circles2 = circlesContainer.selectAll("circle.circle_line2") 193 | .data(data2, function(d){return d.timestamp}); 194 | 195 | circles1.enter() 196 | .append("circle") 197 | .attr("class","circle_line1") 198 | .attr("r", 1.5); 199 | 200 | circles2.enter() 201 | .append("circle") 202 | .attr("class","circle_line2") 203 | .attr("r", 1.5); 204 | 205 | var circles3 = undefined; 206 | 207 | if (data3) { 208 | 209 | circles3 = circlesContainer.selectAll("circle.circle_line3") 210 | .data(data3, function(d){return d.timestamp}); 211 | 212 | circles3.enter() 213 | .append("circle") 214 | .attr("class","circle_line3") 215 | .attr("r", 1.5); 216 | 217 | } 218 | 219 | value_scale.domain([0, 220 | d3.max([ 221 | d3.max(data1, function(d){return d.value}), 222 | d3.max(data2, function(d){return d.value}), 223 | d3.max(data3 ? data3 : [], function(d){return d.value}) 224 | ]) 225 | ]).nice(); 226 | 227 | if (data1.length > 2) 228 | time_scale_axis.domain([ 229 | data1[1].timestamp, 230 | data1[data1.length-1].timestamp 231 | ]); 232 | 233 | if (!animate) { 234 | if (data1.length > 2) 235 | time_scale.domain([ 236 | data1[1].timestamp, 237 | data1[data1.length-1].timestamp 238 | ]); 239 | } 240 | 241 | circles1.attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 242 | .attr("cy", function(d){return value_scale(d.value)}); 243 | 244 | circles2.attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 245 | .attr("cy", function(d){return value_scale(d.value)}); 246 | 247 | if (animate) { 248 | circles1 249 | .transition().duration(250).ease("linear") 250 | .attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 251 | .attr("cy", function(d){return value_scale(d.value)}); 252 | } else { 253 | circles1 254 | .attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 255 | .attr("cy", function(d){return value_scale(d.value)}); 256 | } 257 | 258 | if (animate) { 259 | circles2 260 | .transition().duration(250).ease("linear") 261 | .attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 262 | .attr("cy", function(d){return value_scale(d.value)}); 263 | } else { 264 | circles2 265 | .attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 266 | .attr("cy", function(d){return value_scale(d.value)}); 267 | } 268 | 269 | path1.data(data1) 270 | .attr("class", "line1") 271 | .attr("d", line(data1)); 272 | 273 | path2.data(data2) 274 | .attr("class", "line2") 275 | .attr("d", line(data2)); 276 | 277 | if (data3) { 278 | 279 | circles3.attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 280 | .attr("cy", function(d){return value_scale(d.value)}); 281 | 282 | if (animate) { 283 | circles3 284 | .transition().duration(250).ease("linear") 285 | .attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 286 | .attr("cy", function(d){return value_scale(d.value)}); 287 | } else { 288 | circles3 289 | .attr("cx", function(d){return time_scale(new Date(d.timestamp))}) 290 | .attr("cy", function(d){return value_scale(d.value)}); 291 | } 292 | 293 | path3.data(data3) 294 | .attr("class", "line3") 295 | .attr("d", line(data3)); 296 | 297 | } 298 | 299 | if (animate) { 300 | if (data1.length > 2) 301 | time_scale.domain([ 302 | data1[1].timestamp, 303 | data1[data1.length-1].timestamp 304 | // new Date(d3.min(data1, function(d){return d.timestamp})), 305 | // new Date(d3.max(data1, function(d){return d.timestamp})) 306 | ]); 307 | } 308 | 309 | if (animate) { 310 | var t = svg.transition() 311 | .duration(250) 312 | .ease("linear"); 313 | 314 | t.select(".x.axis").call(xAxis); 315 | t.select(".y.axis").call(yAxis); 316 | } else { 317 | svg.select(".x.axis").call(xAxis); 318 | svg.select(".y.axis").call(yAxis); 319 | } 320 | 321 | if (animate) { 322 | path1 323 | .transition().duration(250).ease("linear") 324 | .attr("d", line(data1)); 325 | } else { 326 | path1 327 | .attr("d", line(data1)); 328 | } 329 | 330 | if (animate) { 331 | path2 332 | .transition().duration(250).ease("linear") 333 | .attr("d", line(data2)); 334 | } else { 335 | path2 336 | .attr("d", line(data2)); 337 | } 338 | 339 | circles1.exit().remove(); 340 | circles2.exit().remove(); 341 | 342 | if (data3) { 343 | 344 | if (animate) { 345 | path3 346 | .transition().duration(250).ease("linear") 347 | .attr("d", line(data3)); 348 | } else { 349 | path3 350 | .attr("d", line(data3)); 351 | } 352 | 353 | circles3.exit().remove(); 354 | } 355 | 356 | }; 357 | 358 | chart.width = function(_) { 359 | if (!arguments.length) return width; 360 | width = _; 361 | return chart; 362 | }; 363 | 364 | chart.height = function(_) { 365 | if (!arguments.length) return height; 366 | height = _; 367 | return chart; 368 | }; 369 | 370 | chart.svg = function(_) { 371 | if (!arguments.length) return svg; 372 | svg = _; 373 | return chart; 374 | }; 375 | 376 | chart.legend = function(_) { 377 | if (!arguments.length) return legend; 378 | legend = _; 379 | return chart; 380 | }; 381 | 382 | chart.animate = function(_) { 383 | if (!arguments.length) return animate; 384 | animate = _; 385 | return chart; 386 | } 387 | 388 | return chart; 389 | } 390 | 391 | -------------------------------------------------------------------------------- /_site/js/lib/D3-v2.8.1/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Michael Bostock 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * The name Michael Bostock may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT, 21 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 22 | BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 24 | OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /_site/js/lib/backbone/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /_site/js/lib/backbone/backbone-min.js: -------------------------------------------------------------------------------- 1 | // Backbone.js 0.9.1 2 | 3 | // (c) 2010-2012 Jeremy Ashkenas, DocumentCloud Inc. 4 | // Backbone may be freely distributed under the MIT license. 5 | // For all details and documentation: 6 | // http://backbonejs.org 7 | (function(){var i=this,r=i.Backbone,s=Array.prototype.slice,t=Array.prototype.splice,g;g="undefined"!==typeof exports?exports:i.Backbone={};g.VERSION="0.9.1";var f=i._;!f&&"undefined"!==typeof require&&(f=require("underscore"));var h=i.jQuery||i.Zepto||i.ender;g.setDomLibrary=function(a){h=a};g.noConflict=function(){i.Backbone=r;return this};g.emulateHTTP=!1;g.emulateJSON=!1;g.Events={on:function(a,b,c){for(var d,a=a.split(/\s+/),e=this._callbacks||(this._callbacks={});d=a.shift();){d=e[d]||(e[d]= 8 | {});var f=d.tail||(d.tail=d.next={});f.callback=b;f.context=c;d.tail=f.next={}}return this},off:function(a,b,c){var d,e,f;if(a){if(e=this._callbacks)for(a=a.split(/\s+/);d=a.shift();)if(f=e[d],delete e[d],b&&f)for(;(f=f.next)&&f.next;)if(!(f.callback===b&&(!c||f.context===c)))this.on(d,f.callback,f.context)}else delete this._callbacks;return this},trigger:function(a){var b,c,d,e;if(!(d=this._callbacks))return this;e=d.all;for((a=a.split(/\s+/)).push(null);b=a.shift();)e&&a.push({next:e.next,tail:e.tail, 9 | event:b}),(c=d[b])&&a.push({next:c.next,tail:c.tail});for(e=s.call(arguments,1);c=a.pop();){b=c.tail;for(d=c.event?[c.event].concat(e):e;(c=c.next)!==b;)c.callback.apply(c.context||this,d)}return this}};g.Events.bind=g.Events.on;g.Events.unbind=g.Events.off;g.Model=function(a,b){var c;a||(a={});b&&b.parse&&(a=this.parse(a));if(c=j(this,"defaults"))a=f.extend({},c,a);b&&b.collection&&(this.collection=b.collection);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");if(!this.set(a, 10 | {silent:!0}))throw Error("Can't create an invalid model");delete this._changed;this._previousAttributes=f.clone(this.attributes);this.initialize.apply(this,arguments)};f.extend(g.Model.prototype,g.Events,{idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a];return this._escapedAttributes[a]=f.escape(null==b?"":""+b)},has:function(a){return null!= 11 | this.attributes[a]},set:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c||(c={});if(!d)return this;d instanceof g.Model&&(d=d.attributes);if(c.unset)for(e in d)d[e]=void 0;if(!this._validate(d,c))return!1;this.idAttribute in d&&(this.id=d[this.idAttribute]);var b=this.attributes,k=this._escapedAttributes,n=this._previousAttributes||{},h=this._setting;this._changed||(this._changed={});this._setting=!0;for(e in d)if(a=d[e],f.isEqual(b[e],a)||delete k[e],c.unset?delete b[e]:b[e]= 12 | a,this._changing&&!f.isEqual(this._changed[e],a)&&(this.trigger("change:"+e,this,a,c),this._moreChanges=!0),delete this._changed[e],!f.isEqual(n[e],a)||f.has(b,e)!=f.has(n,e))this._changed[e]=a;h||(!c.silent&&this.hasChanged()&&this.change(c),this._setting=!1);return this},unset:function(a,b){(b||(b={})).unset=!0;return this.set(a,null,b)},clear:function(a){(a||(a={})).unset=!0;return this.set(f.clone(this.attributes),a)},fetch:function(a){var a=a?f.clone(a):{},b=this,c=a.success;a.success=function(d, 13 | e,f){if(!b.set(b.parse(d,f),a))return!1;c&&c(b,d)};a.error=g.wrapError(a.error,b,a);return(this.sync||g.sync).call(this,"read",this,a)},save:function(a,b,c){var d,e;f.isObject(a)||null==a?(d=a,c=b):(d={},d[a]=b);c=c?f.clone(c):{};c.wait&&(e=f.clone(this.attributes));a=f.extend({},c,{silent:!0});if(d&&!this.set(d,c.wait?a:c))return!1;var k=this,h=c.success;c.success=function(a,b,e){b=k.parse(a,e);c.wait&&(b=f.extend(d||{},b));if(!k.set(b,c))return!1;h?h(k,a):k.trigger("sync",k,a,c)};c.error=g.wrapError(c.error, 14 | k,c);b=this.isNew()?"create":"update";b=(this.sync||g.sync).call(this,b,this,c);c.wait&&this.set(e,a);return b},destroy:function(a){var a=a?f.clone(a):{},b=this,c=a.success,d=function(){b.trigger("destroy",b,b.collection,a)};if(this.isNew())return d();a.success=function(e){a.wait&&d();c?c(b,e):b.trigger("sync",b,e,a)};a.error=g.wrapError(a.error,b,a);var e=(this.sync||g.sync).call(this,"delete",this,a);a.wait||d();return e},url:function(){var a=j(this.collection,"url")||j(this,"urlRoot")||o();return this.isNew()? 15 | a:a+("/"==a.charAt(a.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(a){if(this._changing||!this.hasChanged())return this;this._moreChanges=this._changing=!0;for(var b in this._changed)this.trigger("change:"+b,this,this._changed[b],a);for(;this._moreChanges;)this._moreChanges=!1,this.trigger("change",this,a);this._previousAttributes=f.clone(this.attributes); 16 | delete this._changed;this._changing=!1;return this},hasChanged:function(a){return!arguments.length?!f.isEmpty(this._changed):this._changed&&f.has(this._changed,a)},changedAttributes:function(a){if(!a)return this.hasChanged()?f.clone(this._changed):!1;var b,c=!1,d=this._previousAttributes,e;for(e in a)if(!f.isEqual(d[e],b=a[e]))(c||(c={}))[e]=b;return c},previous:function(a){return!arguments.length||!this._previousAttributes?null:this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)}, 17 | isValid:function(){return!this.validate(this.attributes)},_validate:function(a,b){if(b.silent||!this.validate)return!0;var a=f.extend({},this.attributes,a),c=this.validate(a,b);if(!c)return!0;b&&b.error?b.error(this,c,b):this.trigger("error",this,c,b);return!1}});g.Collection=function(a,b){b||(b={});b.comparator&&(this.comparator=b.comparator);this._reset();this.initialize.apply(this,arguments);a&&this.reset(a,{silent:!0,parse:b.parse})};f.extend(g.Collection.prototype,g.Events,{model:g.Model,initialize:function(){}, 18 | toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){var c,d,e,g,h,i={},j={};b||(b={});a=f.isArray(a)?a.slice():[a];for(c=0,d=a.length;c=b))this.iframe=h('