Skip to content
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

Uptime is not sorted correct #440

Closed
emlun007 opened this issue Nov 9, 2017 · 8 comments
Closed

Uptime is not sorted correct #440

emlun007 opened this issue Nov 9, 2017 · 8 comments

Comments

@emlun007
Copy link
Contributor

emlun007 commented Nov 9, 2017

Uptime in facts is sorted alphabetically, and hours are treated as days:
uptime2

I am trying to create a class for sorting but I cannot find the right way to capture the values in ('.dataTable td'). Any suggestions?

@mterzo
Copy link
Contributor

mterzo commented Nov 10, 2017

The Fact section doesn't know anything about the data it's sorting on, it's all string sort.

@emlun007
Copy link
Contributor Author

@mterzo, I have been trying to detect and convert uptime to string and them make sorting. Something like:

day_search=/(days)/g;
str.match(day_search);
alert(parseInt(day_search,10));

function sortNumber(a,b) {
return a - b;
};

But still it doesn't work. What is wrong with the code?

@kirkins
Copy link
Contributor

kirkins commented Nov 16, 2017

I have come the conclusion that @emlun007 is a troll account.

@larsnaesbye
Copy link
Contributor

Nope, @emlun007 is my coworker and not a troll.

@kirkins
Copy link
Contributor

kirkins commented Nov 28, 2017

Yesterday someone was asking me about a device and they didn't know the hostname/IP. But it had recently been turned on. I started trying to look for recently turned on devices but the sort doesn't actually work.

Then you get a little bit down the list and the page automatically refreshes.

I definitely think this would be a good improvement but it won't be a small patch. Fact types would need to be classified by sort type and have classes added.

I saw a PR that was trying to run regex on every fact to see if it was a type of date/time. I don't think that is a good way about going about it.

@emlun007
Copy link
Contributor Author

@kirkins , it is definately not a small patch. I've been trying to make a class for ip addresses and it is a lot of work as I need to make changes in layout.html and marcos.html

@emlun007
Copy link
Contributor Author

This is solved in PR 435:

#435

Closing the issue

@dal00
Copy link

dal00 commented Oct 13, 2018

Why was this never merged? :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants