-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #436 from benjamin-747/main
refactor ui
- Loading branch information
Showing
54 changed files
with
1,342 additions
and
7,526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
pub mod create_file; | ||
pub mod objects; | ||
pub mod mr; | ||
pub mod query; | ||
pub mod tree; | ||
|
||
#[derive(PartialEq, Eq, Debug, Clone, Default, Serialize, Deserialize)] | ||
|
||
pub struct CommonResult<T> { | ||
pub req_result: bool, | ||
pub data: Option<T>, | ||
pub err_message: String, | ||
} | ||
|
||
impl<T> CommonResult<T> { | ||
pub fn success(data: Option<T>) -> Self { | ||
CommonResult { | ||
req_result: true, | ||
data, | ||
err_message: "".to_owned(), | ||
} | ||
} | ||
pub fn failed(err_message: &str) -> Self { | ||
CommonResult { | ||
req_result: false, | ||
data: None, | ||
err_message: err_message.to_string(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
use callisto::{mega_mr, mega_mr_conv}; | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct MrInfoItem { | ||
pub id: i64, | ||
pub title: String, | ||
pub status: String, | ||
pub open_timestamp: i64, | ||
pub merge_timestamp: Option<i64>, | ||
} | ||
|
||
impl From<mega_mr::Model> for MrInfoItem { | ||
fn from(value: mega_mr::Model) -> Self { | ||
Self { | ||
id: value.id, | ||
title: String::new(), | ||
status: value.status.to_string(), | ||
open_timestamp: value.created_at.and_utc().timestamp(), | ||
merge_timestamp: value.merge_date.map(|dt| dt.and_utc().timestamp()), | ||
} | ||
} | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct MRDetail { | ||
pub id: i64, | ||
pub title: String, | ||
pub status: String, | ||
pub open_timestamp: i64, | ||
pub merge_timestamp: Option<i64>, | ||
pub conversions: Vec<MRConversion>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize)] | ||
pub struct MRConversion { | ||
pub user_id: i64, | ||
pub conv_type: String, | ||
pub created_at: i64, | ||
pub updated_at: i64, | ||
} | ||
|
||
impl From<mega_mr::Model> for MRDetail { | ||
fn from(value: mega_mr::Model) -> Self { | ||
Self { | ||
id: value.id, | ||
title: String::new(), | ||
status: value.status.to_string(), | ||
open_timestamp: value.created_at.and_utc().timestamp(), | ||
merge_timestamp: value.merge_date.map(|dt| dt.and_utc().timestamp()), | ||
conversions: vec![], | ||
} | ||
} | ||
} | ||
|
||
impl From<mega_mr_conv::Model> for MRConversion { | ||
fn from(value: mega_mr_conv::Model) -> Self { | ||
Self { | ||
user_id: value.user_id, | ||
conv_type: value.conv_type.to_string(), | ||
created_at: value.created_at.and_utc().timestamp(), | ||
updated_at: value.updated_at.and_utc().timestamp(), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
eea221e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
mega – ./
mega-git-main-gitmono.vercel.app
gitmega.dev
www.gitmega.dev
mega-gitmono.vercel.app