Skip to content

Commit

Permalink
Refs #2, display site and project dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
doumdi committed Mar 15, 2024
1 parent a698662 commit 612fc6d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
23 changes: 17 additions & 6 deletions Frontend/DashboardsViewer/content/screens/DashboardSelector.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ DashboardSelectorForm {
}
}

projectGridView.delegate.onItemClicked: function(id, definition){
onItemClicked: function(id, definition){
stackview.push("Dashboard.qml")

// get current pushed element
Expand Down Expand Up @@ -131,9 +131,23 @@ DashboardSelectorForm {

model.onCountChanged: function() {

selectorForm.siteGridView.model.clear();
for (var i = 0; i < model.count; ++i) {
var dashboard = model.get(i);
console.log(dashboard);

var description = dashboard.dashboard_description;
var enabled = dashboard.dashboard_enabled;
var name = dashboard.dashboard_name;
var definition = dashboard.versions.dashboard_definition;

console.log(description, enabled, name, definition);


selectorForm.siteGridView.model.append({"id": dashboard.id_dashboard,
"name": name,
"definition": definition,
"color": "Blue"})
}
}
} // projectsDashboardDataSource
Expand All @@ -154,7 +168,7 @@ DashboardSelectorForm {

model.onCountChanged: function() {

selectorForm.projetGridView.model.clear();
selectorForm.projectGridView.model.clear();


for (var i = 0; i < model.count; ++i) {
Expand All @@ -166,10 +180,7 @@ DashboardSelectorForm {
var name = dashboard.dashboard_name;
var definition = dashboard.versions.dashboard_definition;

console.log(description, enabled, name, definition);


selectorForm.projetGridView.model.append({"id": dashboard.id_dashboard,
selectorForm.projectGridView.model.append({"id": dashboard.id_dashboard,
"name": name,
"definition": definition,
"color": "Blue"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import "../delegates"
import DashboardsViewer 1.0

Item {
id: rootItem
//property alias btnOK: btnStart
//property alias fileName: inputJSON.text
property alias cmbSites: cmbSites
property alias cmbProjects: cmbProjects
property alias siteGridView: siteGridView
property alias projectGridView: projectGridView

signal itemClicked(var id, var definition)


Item {
anchors.centerIn: parent
width: 0.8 * parent.width
Expand Down Expand Up @@ -115,7 +119,15 @@ Item {
clip: true
ScrollBar.vertical: FlickableScrollBar {}
model: ListModel {}
delegate: SiteProjectDelegate {}
delegate: SiteProjectDelegate {
id: siteProjectDelegateSite

Connections {
target: siteProjectDelegateSite
onItemClicked: rootItem.itemClicked
}

}
} // GridView 1

GridView {
Expand All @@ -128,7 +140,15 @@ Item {
clip: true

ScrollBar.vertical: FlickableScrollBar {}
delegate: SiteProjectDelegate {}
delegate: SiteProjectDelegate {
id: siteProjectdelegateProject

Connections {
target: siteProjectdelegateProject
onItemClicked: rootItem.itemClicked
}

}
} // GridView 2
} //RowLayout (2)
} // Rectangle 2
Expand Down

0 comments on commit 612fc6d

Please sign in to comment.