Commit e22e8f62 by Oláh István Gergely

dashboard: removing pk from js, changing tag colors

parent 0a7dbb2e
......@@ -234,7 +234,6 @@ $(function () {
for(var i in result) {
console.log(result[i]);
my_nodes.push({
'pk': result[i].pk,
'name': result[i].name.toLowerCase(),
'icon': result[i].icon,
'status': result[i].status,
......@@ -274,7 +273,7 @@ $(function () {
// if there is only one result and ENTER is pressed redirect
if(e.keyCode == 13 && search_result.length == 1) {
window.location.href = "/dashboard/node/" + search_result[0].pk + "/";
window.location.href = search_result[0].url;
}
if(e.keyCode == 13 && search_result.length > 1 && input.length > 0) {
window.location.href = "/dashboard/node/list/?s=" + input;
......
......@@ -929,7 +929,6 @@ class NodeList(LoginRequiredMixin, SuperuserRequiredMixin, SingleTableView):
if self.request.is_ajax():
nodes = Node.objects.all()
nodes = [{
'pk': i.pk,
'name': i.name,
'icon': i.get_status_icon(),
'url': i.get_absolute_url(),
......
......@@ -278,9 +278,9 @@ class Node(OperatedMixin, TimeStampedModel):
def get_status_label(self):
return {
'OFFLINE': 'label-danger',
'DISABLED': 'label-danger',
'MISSING': 'label-warning',
'OFFLINE': 'label-warning',
'DISABLED': 'label-warning',
'MISSING': 'label-danger',
'ONLINE': 'label-success'}.get(self.get_state(),
'label-danger')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment