Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit764a6a6

Browse files
authored
Dashboard fix for 2.7.8 (#963)
1 parentfbe9724 commit764a6a6

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed

‎pgml-dashboard/sqlx-data.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@
566566
"nullable": [
567567
false,
568568
false,
569-
false,
569+
true,
570570
false,
571571
false,
572572
null,
@@ -864,7 +864,7 @@
864864
"nullable": [
865865
false,
866866
false,
867-
false,
867+
true,
868868
false,
869869
false,
870870
null,
@@ -1113,7 +1113,7 @@
11131113
"nullable": [
11141114
false,
11151115
false,
1116-
false,
1116+
true,
11171117
false,
11181118
false,
11191119
null,

‎pgml-dashboard/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,12 @@ pub async fn models_index(cluster: ConnectedCluster<'_>) -> Result<ResponseOk, E
367367
#[get("/models/<id>")]
368368
pubasyncfnmodels_get(cluster:ConnectedCluster<'_>,id:i64) ->Result<ResponseOk,Error>{
369369
let model = models::Model::get_by_id(cluster.pool(), id).await?;
370-
let snapshot = models::Snapshot::get_by_id(cluster.pool(), model.snapshot_id).await?;
370+
let snapshot =ifletSome(snapshot_id) = model.snapshot_id{
371+
Some(models::Snapshot::get_by_id(cluster.pool(), snapshot_id).await?)
372+
}else{
373+
None
374+
};
375+
371376
let project = models::Project::get_by_id(cluster.pool(), model.project_id).await?;
372377

373378
Ok(ResponseOk(

‎pgml-dashboard/src/models.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ pub enum Runtime {
444444
pubstructModel{
445445
pubid:i64,
446446
pubproject_id:i64,
447-
pubsnapshot_id:i64,
447+
pubsnapshot_id:Option<i64>,
448448
pubnum_features:i32,
449449
pubalgorithm:String,
450450
pubruntime:Option<String>,

‎pgml-dashboard/src/templates/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ pub struct Models {
397397
pubstructModel{
398398
pubmodel: models::Model,
399399
pubproject: models::Project,
400-
pubsnapshot: models::Snapshot,
400+
pubsnapshot:Option<models::Snapshot>,
401401
pubdeployed:bool,
402402
}
403403

‎pgml-dashboard/templates/content/dashboard/panels/model.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ <h1><span class="material-symbols-outlined">model_training</span>
1313
<dl>
1414
<dt>Project</dt>
1515
<dd><ahref="/dashboard?tab=Project&id=<%= project.id %>"data-turbo="false"><%= project.name %></a></dd>
16-
<dt>Snapshot</dt>
17-
<dd><ahref="/dashboard?tab=Snapshot&id=<%= snapshot.id %>"data-turbo="false"><%= snapshot.relation_name %></a></dd>
16+
<% if let Some(snapshot) = snapshot { %>
17+
<dt>Snapshot</dt>
18+
<dd><ahref="/dashboard?tab=Snapshot&id=<%= snapshot.id %>"data-turbo="false"><%= snapshot.relation_name %></a></dd>
19+
<% } %>
1820
<dt>Created</dt>
1921
<dd><timedatetime="<% model.created_at; %>"><% model.created_at; %></time></dd>
2022
</dl>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp