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

Add header fields when loading DataTable #160

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Changes from all 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
20 changes: 19 additions & 1 deletion src/spaceone/dashboard/manager/data_table_manager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,31 @@ def response_data(self, sort: list = None, page: dict = None) -> dict:
self.apply_page_df(page)

df = self.df.copy(deep=True)
data_info, labels_info = self.get_data_and_labels_info()

self.df = None

return {
results = {
"results": df.to_dict(orient="records"),
"total_count": total_count,
}

if labels_info:
results["labels_info"] = labels_info

if data_info:
results["data_info"] = data_info

if self.data_keys:
if self.label_keys is None:
order = self.data_keys
else:
order = self.label_keys + self.data_keys

results["order"] = order

return results

def apply_sort_to_df(self, sort: list) -> None:
if len(self.df) > 0:
keys = []
Expand Down
Loading