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

Feature Added Percentage memory in widget #2335

Merged
merged 16 commits into from
Mar 19, 2024
Merged
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
330 changes: 178 additions & 152 deletions extensions/CoreWidgetProvider/Widgets/Templates/SystemMemoryTemplate.json
Original file line number Diff line number Diff line change
@@ -1,152 +1,178 @@
{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"$when": "${errorMessage != null}",
"items": [
{
"type": "TextBlock",
"text": "${errorMessage}",
"wrap": true,
"size": "small"
}
],
"style": "warning"
},
{
"type": "Container",
"$when": "${errorMessage == null}",
"items": [
{
"type": "Image",
"url": "${memGraphUrl}",
"height": "${chartHeight}",
"width": "${chartWidth}",
"horizontalAlignment": "center"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/UsedMemory%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${usedMem}",
"type": "TextBlock",
"size": "large",
"weight": "bolder"
}
]
},
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/AllMemory%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${allMem}",
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"horizontalAlignment": "right"
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/Committed%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${committedMem}/${committedLimitMem}",
"type": "TextBlock",
"size": "medium"
}
]
},
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/Cached%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${cachedMem}",
"type": "TextBlock",
"size": "medium",
"horizontalAlignment": "right"
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/PagedPool%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${pagedPoolMem}",
"type": "TextBlock",
"size": "medium"
}
]
},
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/NonPagedPool%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${nonPagedPoolMem}",
"type": "TextBlock",
"size": "medium",
"horizontalAlignment": "right"
}
]
}
]
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}
Here's the corrected Adaptive Card JSON with the brackets fixed:
Gobinath-B marked this conversation as resolved.
Show resolved Hide resolved


{
"type": "AdaptiveCard",
"body": [
{
"type": "Container",
"$when": "${errorMessage != null}",
"items": [
{
"type": "TextBlock",
"text": "${errorMessage}",
"wrap": true,
"size": "small"
}
],
"style": "warning"
},
{
"type": "Container",
"$when": "${errorMessage == null}",
"items": [
{
"type": "Image",
"url": "${memGraphUrl}",
"height": "${chartHeight}",
"width": "${chartWidth}",
"horizontalAlignment": "center"
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/UsedMemory%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${usedMem}",
"type": "TextBlock",
"size": "large",
"weight": "bolder"
}
]
},
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/AllMemory%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${allMem}",
"type": "TextBlock",
"size": "large",
"weight": "bolder",
"horizontalAlignment": "right"
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/Committed%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${committedMem}/${committedLimitMem}",
"type": "TextBlock",
"size": "medium"
}
]
},
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/Cached%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${cachedMem}",
"type": "TextBlock",
"size": "medium",
"horizontalAlignment": "right"
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/PagedPool%",
"type": "TextBlock",
"size": "small",
"isSubtle": true
},
{
"text": "${pagedPoolMem}",
"type": "TextBlock",
"size": "medium"
}
]
},
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/NonPagedPool%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${nonPagedPoolMem}",
"type": "TextBlock",
"size": "medium",
"horizontalAlignment": "right"
}
]
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"items": [
{
"text": "%Memory_Widget_Template/MemoryUsage%",
"type": "TextBlock",
"size": "small",
"isSubtle": true,
"horizontalAlignment": "right"
},
{
"text": "${Utilization}",
"type": "TextBlock",
"size": "medium",
"horizontalAlignment": "right"
}
]
}
]
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5"
}