🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions pgml-dashboard/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
DATABASE_URL=postgres:///pgml_dashboard_development
DEV_MODE=true
RUST_LOG=debug,tantivy=error,rocket=info
SITE_SEARCH_DATABASE_URL=postgres:///pgml_dashboard_development
6 changes: 5 additions & 1 deletion pgml-dashboard/src/components/tables/large/row/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl Row {
pub fn new(columns: &[Component]) -> Row {
Row {
columns: columns.to_vec(),
action: "click->tables-large-table#selectRow".to_string(),
action: "".to_string(),
data: vec![],
}
}
Expand All @@ -28,6 +28,10 @@ impl Row {
self.data.push((name.to_owned(), value.to_owned()));
self
}

pub fn selectable(self) -> Self {
self.action("click->tables-large-table#selectRow")
}
}

component!(Row);
1 change: 1 addition & 0 deletions pgml-dashboard/src/components/tables/large/table/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ impl Table {

pub fn selectable(mut self) -> Self {
self.classes.push_str(" selectable");
self.rows = self.rows.into_iter().map(|r| r.selectable()).collect();
self
}
}
Expand Down
109 changes: 68 additions & 41 deletions pgml-dashboard/src/components/tables/large/table/table.scss
Original file line number Diff line number Diff line change
@@ -1,54 +1,81 @@
table.table.table-lg {
td, tr, th {
border-width: 0;
}
td,
tr,
th {
border-width: 0;
}

border-collapse: separate;
border-spacing: 0 16px;
border-collapse: separate;
border-spacing: 0 16px;

thead {
th {
color: #{$slate-shade-100};
background: #{$gray-800};
text-transform: uppercase;
font-size: 0.75rem;
padding: 16px 0;
thead {
th {
color: #{$slate-shade-100};
background: #{$gray-800};
text-transform: uppercase;
font-size: 0.75rem;
padding: 16px 0;

&:first-of-type {
padding-left: 67px;
}
}
&:first-of-type {
padding-left: 67px;
}
}

tbody {
tr {
&:hover, &.active {
td {
background: #{$gray-800};
}
}

td {
background: #{$gray-600};
vertical-align: middle;
padding: 20px 0;

&:first-of-type {
padding-left: 67px;
}
}
}
tr {
th:first-child {
border-top-left-radius: $border-radius;
}
th:last-child {
border-top-right-radius: $border-radius;
}
}
}

tbody {
tr {
&.active {
td {
background: #{$gray-800};
}
}

&.selectable {
tbody {
tr:hover {
cursor: pointer;
}
td {
background: #{$gray-600};
vertical-align: middle;
padding: 20px 0;

&:first-of-type {
padding-left: 67px;
}
}

td:first-child {
border-top-left-radius: $border-radius;
border-bottom-left-radius: $border-radius;
}
td:last-child {
border-top-right-radius: $border-radius;
border-bottom-right-radius: $border-radius;
}
}
}

&.selectable {
--bs-table-hover-bg: #{$gray-700};

.table-cell-content {
height: 100%;
tbody {
tr:hover {
cursor: pointer;
background: #{$gray-800};
}
}
}

& {
--bs-table-hover-bg: #{$gray-600};
}

.table-cell-content {
height: 100%;
}
}