New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webui: added sysNames to pulldowns and the main page #8137

Merged
merged 8 commits into from Feb 10, 2018

Conversation

Projects
None yet
4 participants
@aldemira
Contributor

aldemira commented Jan 23, 2018

Also made dev dependency list look more like devices page

DO NOT DELETE THIS TEXT

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

Testers

If you would like to test this pull request then please run: ./scripts/github-apply <pr_id>, i.e ./scripts/github-apply 5926

@laf

This comment has been minimized.

Member

laf commented Jan 24, 2018

So this needs a little update. The devices page does some checks on the hostname to decide what it should show. We should wrap the existing code from html/includes/table/devices.inc.php into a function and use it in both places:

        if (format_hostname($device) !== $device['sysName']) {
            $hostname .= '<br />' . $device['sysName'];
        } elseif ($device['hostname'] !== $device['ip']) {
            $hostname .= '<br />' . $device['hostname'];
        }
@aldemira

This comment has been minimized.

Contributor

aldemira commented Jan 29, 2018

@laf Can you give me a couple weeks to sort it out? I'm a bit too busy nowadays.

@laf

This comment has been minimized.

Member

laf commented Jan 29, 2018

@aldemira Absolutely.

* @param device array
* @return string
*/
function add_sysname_or_hostname($device)

This comment has been minimized.

@laf

laf Feb 8, 2018

Member

Maybe return_sysname_or_hostname?

This comment has been minimized.

@murrant

murrant Feb 9, 2018

Member

How about get_device_name()

This comment has been minimized.

@laf

laf Feb 9, 2018

Member

I'm wondering if we pass a $html = false flag to it and it can then be re-used in other places.

This comment has been minimized.

@aldemira

aldemira Feb 9, 2018

Contributor

I removed the html bits altogether.

@aldemira

This comment has been minimized.

Contributor

aldemira commented Feb 9, 2018

Thanks guys, I wasn't keen on that function name as well :) 👍

@scrutinizer-notifier

This comment has been minimized.

scrutinizer-notifier commented Feb 9, 2018

The inspection completed: 1 updated code elements

@laf laf merged commit 5880f06 into librenms:master Feb 10, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details

@aldemira aldemira deleted the aldemira:hostdepsui branch Feb 22, 2018

inetAnt added a commit to criteo-forks/librenms that referenced this pull request Mar 19, 2018

webui: Added sysNames to pulldowns and the main page (librenms#8137)
* Add dependency info for api

* webui: made dev dependency list more like devices page. Also added sysNames to pulldowns and the manin page

* Create common function for sysname display

* A better function name
@lock

This comment has been minimized.

lock bot commented May 16, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed.

@lock lock bot locked as resolved and limited conversation to collaborators May 16, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.