{"action":"created","comment":{"url":"https://api.github.com/repos/librenms/librenms/pulls/comments/45507825","id":45507825,"diff_hunk":"@@ -16,44 +16,88 @@\n     echo '</div>\n         <table class=\"table table-hover table-condensed table-striped\">';\n \n+    $totalPercent=0;\n+\n     foreach ($processors as $proc) {\n         $text_descr = rewrite_entity_descr($proc['processor_descr']);\n \n         // disable short hrDeviceDescr. need to make this prettier.\n         // $text_descr = short_hrDeviceDescr($proc['processor_descr']);\n         $percent      = $proc['processor_usage'];\n-        $background   = get_percentage_colours($percent);\n-        $graph_colour = str_replace('#', '', $row_colour);\n+        if ($config['cpu_details_overview'] === true)\n+        {\n+\n+            $background   = get_percentage_colours($percent);\n+            $graph_colour = str_replace('#', '', $row_colour);\n+\n+            $graph_array           = array();\n+            $graph_array['height'] = '100';\n+            $graph_array['width']  = '210';\n+            $graph_array['to']     = $config['time']['now'];\n+            $graph_array['id']     = $proc['processor_id'];\n+            $graph_array['type']   = $graph_type;\n+            $graph_array['from']   = $config['time']['day'];\n+            $graph_array['legend'] = 'no';\n+\n+            $link_array         = $graph_array;\n+            $link_array['page'] = 'graphs';\n+            unset($link_array['height'], $link_array['width'], $link_array['legend']);\n+            $link = generate_url($link_array);\n+\n+            $overlib_content = generate_overlib_content($graph_array, $device['hostname'].' - '.$text_descr);\n+\n+            $graph_array['width']  = 80;\n+            $graph_array['height'] = 20;\n+            $graph_array['bg']     = 'ffffff00';\n+            // the 00 at the end makes the area transparent.\n+            $minigraph =  generate_lazy_graph_tag($graph_array);\n+\n+            echo '<tr>\n+                <td>'.overlib_link($link, $text_descr, $overlib_content).'</td>\n+                <td>'.overlib_link($link, $minigraph, $overlib_content).'</td>\n+                <td>'.overlib_link($link, print_percentage_bar(200, 20, $percent, null, 'ffffff', $background['left'], $percent.'%', 'ffffff', $background['right']), $overlib_content).'\n+                </a></td>\n+              </tr>';\n+        }\n+        else {\n+            $totalPercent = $totalPercent + $percent;\n+        }\n \n-        $graph_array           = array();\n+    }//end foreach\n+\n+    if ($config['cpu_details_overview'] !== true)\n+    {\n         $graph_array['height'] = '100';\n-        $graph_array['width']  = '210';\n+        $graph_array['width']  = '485';\n         $graph_array['to']     = $config['time']['now'];\n-        $graph_array['id']     = $proc['processor_id'];\n-        $graph_array['type']   = $graph_type;\n+        $graph_array['device'] = $device['device_id'];\n+        $graph_array['type']   = 'device_processor';","path":"html/pages/device/overview/processors.inc.php","position":65,"original_position":65,"commit_id":"439193c9fa470cfcc28169173e228053e4ea798e","original_commit_id":"439193c9fa470cfcc28169173e228053e4ea798e","user":{"login":"laf","id":3941142,"avatar_url":"https://avatars.githubusercontent.com/u/3941142?v=3","gravatar_id":"","url":"https://api.github.com/users/laf","html_url":"https://github.com/laf","followers_url":"https://api.github.com/users/laf/followers","following_url":"https://api.github.com/users/laf/following{/other_user}","gists_url":"https://api.github.com/users/laf/gists{/gist_id}","starred_url":"https://api.github.com/users/laf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laf/subscriptions","organizations_url":"https://api.github.com/users/laf/orgs","repos_url":"https://api.github.com/users/laf/repos","events_url":"https://api.github.com/users/laf/events{/privacy}","received_events_url":"https://api.github.com/users/laf/received_events","type":"User","site_admin":false},"body":"Are these changes necessary?","created_at":"2015-11-20T19:29:14Z","updated_at":"2015-11-20T19:29:14Z","html_url":"https://github.com/librenms/librenms/pull/2470#discussion_r45507825","pull_request_url":"https://api.github.com/repos/librenms/librenms/pulls/2470","_links":{"self":{"href":"https://api.github.com/repos/librenms/librenms/pulls/comments/45507825"},"html":{"href":"https://github.com/librenms/librenms/pull/2470#discussion_r45507825"},"pull_request":{"href":"https://api.github.com/repos/librenms/librenms/pulls/2470"}}},"pull_request":{"url":"https://api.github.com/repos/librenms/librenms/pulls/2470","id":51373114,"html_url":"https://github.com/librenms/librenms/pull/2470","diff_url":"https://github.com/librenms/librenms/pull/2470.diff","patch_url":"https://github.com/librenms/librenms/pull/2470.patch","issue_url":"https://api.github.com/repos/librenms/librenms/issues/2470","number":2470,"state":"open","locked":false,"title":"Merge all cpu in one graph in device overview","user":{"login":"Alucardfh","id":1701397,"avatar_url":"https://avatars.githubusercontent.com/u/1701397?v=3","gravatar_id":"","url":"https://api.github.com/users/Alucardfh","html_url":"https://github.com/Alucardfh","followers_url":"https://api.github.com/users/Alucardfh/followers","following_url":"https://api.github.com/users/Alucardfh/following{/other_user}","gists_url":"https://api.github.com/users/Alucardfh/gists{/gist_id}","starred_url":"https://api.github.com/users/Alucardfh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alucardfh/subscriptions","organizations_url":"https://api.github.com/users/Alucardfh/orgs","repos_url":"https://api.github.com/users/Alucardfh/repos","events_url":"https://api.github.com/users/Alucardfh/events{/privacy}","received_events_url":"https://api.github.com/users/Alucardfh/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nThis provide a way to hide all separate graphs in the device overview and replace it by the average cpu usage.\r\n\r\nThis make the overview easier to read and render the page a bit faster as there is less graphs to draw.\r\n\r\nThis is an optional feature, disabled by default.\r\n\r\nJust add in your config.php : \r\n\r\n$config['cpu_details_overview'] = false;\r\n\r\nThis is related to issue #2218\r\n\r\n\r\n![cpuovreview](https://cloud.githubusercontent.com/assets/1701397/11304592/a9dfd19c-8fa0-11e5-85f5-2fdcede6a53f.PNG)\r\n\r\n![cpuovreviewchange](https://cloud.githubusercontent.com/assets/1701397/11304597/ac43f788-8fa0-11e5-85c3-10ce173be456.PNG)\r\n","created_at":"2015-11-20T15:56:58Z","updated_at":"2015-11-20T19:29:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60009991a25cb3de14a78f6ea6212ad3785c21d7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/librenms/librenms/pulls/2470/commits","review_comments_url":"https://api.github.com/repos/librenms/librenms/pulls/2470/comments","review_comment_url":"https://api.github.com/repos/librenms/librenms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/librenms/librenms/issues/2470/comments","statuses_url":"https://api.github.com/repos/librenms/librenms/statuses/439193c9fa470cfcc28169173e228053e4ea798e","head":{"label":"Alucardfh:mergeCpu","ref":"mergeCpu","sha":"439193c9fa470cfcc28169173e228053e4ea798e","user":{"login":"Alucardfh","id":1701397,"avatar_url":"https://avatars.githubusercontent.com/u/1701397?v=3","gravatar_id":"","url":"https://api.github.com/users/Alucardfh","html_url":"https://github.com/Alucardfh","followers_url":"https://api.github.com/users/Alucardfh/followers","following_url":"https://api.github.com/users/Alucardfh/following{/other_user}","gists_url":"https://api.github.com/users/Alucardfh/gists{/gist_id}","starred_url":"https://api.github.com/users/Alucardfh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alucardfh/subscriptions","organizations_url":"https://api.github.com/users/Alucardfh/orgs","repos_url":"https://api.github.com/users/Alucardfh/repos","events_url":"https://api.github.com/users/Alucardfh/events{/privacy}","received_events_url":"https://api.github.com/users/Alucardfh/received_events","type":"User","site_admin":false},"repo":{"id":46483253,"name":"librenms","full_name":"Alucardfh/librenms","owner":{"login":"Alucardfh","id":1701397,"avatar_url":"https://avatars.githubusercontent.com/u/1701397?v=3","gravatar_id":"","url":"https://api.github.com/users/Alucardfh","html_url":"https://github.com/Alucardfh","followers_url":"https://api.github.com/users/Alucardfh/followers","following_url":"https://api.github.com/users/Alucardfh/following{/other_user}","gists_url":"https://api.github.com/users/Alucardfh/gists{/gist_id}","starred_url":"https://api.github.com/users/Alucardfh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Alucardfh/subscriptions","organizations_url":"https://api.github.com/users/Alucardfh/orgs","repos_url":"https://api.github.com/users/Alucardfh/repos","events_url":"https://api.github.com/users/Alucardfh/events{/privacy}","received_events_url":"https://api.github.com/users/Alucardfh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Alucardfh/librenms","description":"Community-based GPL-licensed network monitoring system","fork":true,"url":"https://api.github.com/repos/Alucardfh/librenms","forks_url":"https://api.github.com/repos/Alucardfh/librenms/forks","keys_url":"https://api.github.com/repos/Alucardfh/librenms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Alucardfh/librenms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Alucardfh/librenms/teams","hooks_url":"https://api.github.com/repos/Alucardfh/librenms/hooks","issue_events_url":"https://api.github.com/repos/Alucardfh/librenms/issues/events{/number}","events_url":"https://api.github.com/repos/Alucardfh/librenms/events","assignees_url":"https://api.github.com/repos/Alucardfh/librenms/assignees{/user}","branches_url":"https://api.github.com/repos/Alucardfh/librenms/branches{/branch}","tags_url":"https://api.github.com/repos/Alucardfh/librenms/tags","blobs_url":"https://api.github.com/repos/Alucardfh/librenms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Alucardfh/librenms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Alucardfh/librenms/git/refs{/sha}","trees_url":"https://api.github.com/repos/Alucardfh/librenms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Alucardfh/librenms/statuses/{sha}","languages_url":"https://api.github.com/repos/Alucardfh/librenms/languages","stargazers_url":"https://api.github.com/repos/Alucardfh/librenms/stargazers","contributors_url":"https://api.github.com/repos/Alucardfh/librenms/contributors","subscribers_url":"https://api.github.com/repos/Alucardfh/librenms/subscribers","subscription_url":"https://api.github.com/repos/Alucardfh/librenms/subscription","commits_url":"https://api.github.com/repos/Alucardfh/librenms/commits{/sha}","git_commits_url":"https://api.github.com/repos/Alucardfh/librenms/git/commits{/sha}","comments_url":"https://api.github.com/repos/Alucardfh/librenms/comments{/number}","issue_comment_url":"https://api.github.com/repos/Alucardfh/librenms/issues/comments{/number}","contents_url":"https://api.github.com/repos/Alucardfh/librenms/contents/{+path}","compare_url":"https://api.github.com/repos/Alucardfh/librenms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Alucardfh/librenms/merges","archive_url":"https://api.github.com/repos/Alucardfh/librenms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Alucardfh/librenms/downloads","issues_url":"https://api.github.com/repos/Alucardfh/librenms/issues{/number}","pulls_url":"https://api.github.com/repos/Alucardfh/librenms/pulls{/number}","milestones_url":"https://api.github.com/repos/Alucardfh/librenms/milestones{/number}","notifications_url":"https://api.github.com/repos/Alucardfh/librenms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Alucardfh/librenms/labels{/name}","releases_url":"https://api.github.com/repos/Alucardfh/librenms/releases{/id}","created_at":"2015-11-19T09:52:35Z","updated_at":"2015-11-19T09:53:21Z","pushed_at":"2015-11-20T15:53:37Z","git_url":"git://github.com/Alucardfh/librenms.git","ssh_url":"git@github.com:Alucardfh/librenms.git","clone_url":"https://github.com/Alucardfh/librenms.git","svn_url":"https://github.com/Alucardfh/librenms","homepage":"http://www.librenms.org/","size":61154,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"librenms:master","ref":"master","sha":"cb290308ad71d7d8a5591b94196272f2ed1f1f15","user":{"login":"librenms","id":5791783,"avatar_url":"https://avatars.githubusercontent.com/u/5791783?v=3","gravatar_id":"","url":"https://api.github.com/users/librenms","html_url":"https://github.com/librenms","followers_url":"https://api.github.com/users/librenms/followers","following_url":"https://api.github.com/users/librenms/following{/other_user}","gists_url":"https://api.github.com/users/librenms/gists{/gist_id}","starred_url":"https://api.github.com/users/librenms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/librenms/subscriptions","organizations_url":"https://api.github.com/users/librenms/orgs","repos_url":"https://api.github.com/users/librenms/repos","events_url":"https://api.github.com/users/librenms/events{/privacy}","received_events_url":"https://api.github.com/users/librenms/received_events","type":"Organization","site_admin":false},"repo":{"id":13914116,"name":"librenms","full_name":"librenms/librenms","owner":{"login":"librenms","id":5791783,"avatar_url":"https://avatars.githubusercontent.com/u/5791783?v=3","gravatar_id":"","url":"https://api.github.com/users/librenms","html_url":"https://github.com/librenms","followers_url":"https://api.github.com/users/librenms/followers","following_url":"https://api.github.com/users/librenms/following{/other_user}","gists_url":"https://api.github.com/users/librenms/gists{/gist_id}","starred_url":"https://api.github.com/users/librenms/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/librenms/subscriptions","organizations_url":"https://api.github.com/users/librenms/orgs","repos_url":"https://api.github.com/users/librenms/repos","events_url":"https://api.github.com/users/librenms/events{/privacy}","received_events_url":"https://api.github.com/users/librenms/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/librenms/librenms","description":"Community-based GPL-licensed network monitoring system","fork":false,"url":"https://api.github.com/repos/librenms/librenms","forks_url":"https://api.github.com/repos/librenms/librenms/forks","keys_url":"https://api.github.com/repos/librenms/librenms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/librenms/librenms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/librenms/librenms/teams","hooks_url":"https://api.github.com/repos/librenms/librenms/hooks","issue_events_url":"https://api.github.com/repos/librenms/librenms/issues/events{/number}","events_url":"https://api.github.com/repos/librenms/librenms/events","assignees_url":"https://api.github.com/repos/librenms/librenms/assignees{/user}","branches_url":"https://api.github.com/repos/librenms/librenms/branches{/branch}","tags_url":"https://api.github.com/repos/librenms/librenms/tags","blobs_url":"https://api.github.com/repos/librenms/librenms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/librenms/librenms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/librenms/librenms/git/refs{/sha}","trees_url":"https://api.github.com/repos/librenms/librenms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/librenms/librenms/statuses/{sha}","languages_url":"https://api.github.com/repos/librenms/librenms/languages","stargazers_url":"https://api.github.com/repos/librenms/librenms/stargazers","contributors_url":"https://api.github.com/repos/librenms/librenms/contributors","subscribers_url":"https://api.github.com/repos/librenms/librenms/subscribers","subscription_url":"https://api.github.com/repos/librenms/librenms/subscription","commits_url":"https://api.github.com/repos/librenms/librenms/commits{/sha}","git_commits_url":"https://api.github.com/repos/librenms/librenms/git/commits{/sha}","comments_url":"https://api.github.com/repos/librenms/librenms/comments{/number}","issue_comment_url":"https://api.github.com/repos/librenms/librenms/issues/comments{/number}","contents_url":"https://api.github.com/repos/librenms/librenms/contents/{+path}","compare_url":"https://api.github.com/repos/librenms/librenms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/librenms/librenms/merges","archive_url":"https://api.github.com/repos/librenms/librenms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/librenms/librenms/downloads","issues_url":"https://api.github.com/repos/librenms/librenms/issues{/number}","pulls_url":"https://api.github.com/repos/librenms/librenms/pulls{/number}","milestones_url":"https://api.github.com/repos/librenms/librenms/milestones{/number}","notifications_url":"https://api.github.com/repos/librenms/librenms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/librenms/librenms/labels{/name}","releases_url":"https://api.github.com/repos/librenms/librenms/releases{/id}","created_at":"2013-10-28T01:37:13Z","updated_at":"2015-11-19T05:53:04Z","pushed_at":"2015-11-20T19:17:53Z","git_url":"git://github.com/librenms/librenms.git","ssh_url":"git@github.com:librenms/librenms.git","clone_url":"https://github.com/librenms/librenms.git","svn_url":"https://github.com/librenms/librenms","homepage":"http://www.librenms.org/","size":87042,"stargazers_count":268,"watchers_count":268,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":178,"mirror_url":null,"open_issues_count":239,"forks":178,"open_issues":239,"watchers":268,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/librenms/librenms/pulls/2470"},"html":{"href":"https://github.com/librenms/librenms/pull/2470"},"issue":{"href":"https://api.github.com/repos/librenms/librenms/issues/2470"},"comments":{"href":"https://api.github.com/repos/librenms/librenms/issues/2470/comments"},"review_comments":{"href":"https://api.github.com/repos/librenms/librenms/pulls/2470/comments"},"review_comment":{"href":"https://api.github.com/repos/librenms/librenms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/librenms/librenms/pulls/2470/commits"},"statuses":{"href":"https://api.github.com/repos/librenms/librenms/statuses/439193c9fa470cfcc28169173e228053e4ea798e"}}}}