Skip to content

Commit

Permalink
fix: fix annotation attr
Browse files Browse the repository at this point in the history
  • Loading branch information
vicanso committed Oct 9, 2023
1 parent 6c4667c commit 1cdbbab
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ async fn get_latest_images() -> JSONResult<LatestImageResp> {
image_list.push(name.clone());
}
}
Ok(Json(LatestImageResp{
Ok(Json(LatestImageResp {
images: image_list,
version: VERSION.to_string(),
}))
Expand Down
2 changes: 1 addition & 1 deletion src/image/docker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ impl DockerClient {
headers.insert("Authorization".to_string(), format!("Bearer {token}"));
}
// 支持的类型
let accepts = vec![
let accepts = [
MEDIA_TYPE_IMAGE_INDEX,
MEDIA_TYPE_DOCKER_SCHEMA2_MANIFEST,
MEDIA_TYPE_MANIFEST_LIST,
Expand Down
4 changes: 2 additions & 2 deletions src/image/oci_image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ pub struct ImageIndexPlatform {
#[serde(rename_all = "camelCase")]
pub struct ImageIndexAnnotations {
#[serde(rename = "vnd.docker.reference.digest")]
pub vnd_docker_reference_digest: String,
pub vnd_docker_reference_digest: Option<String>,
#[serde(rename = "vnd.docker.reference.type")]
pub vnd_docker_reference_type: String,
pub vnd_docker_reference_type: Option<String>,
}

#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/ui/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub fn new_files_widget(
.split(opt.area);

let space_span = Span::from(" ");
let name_list = vec!["Permission", " UID:GID ", " Size", "FileTree"];
let name_list = ["Permission", " UID:GID ", " Size", "FileTree"];
let mode_tips = format!(
"Esc|0: All 1: Modified/Removed 2: File >= 1MB | Current: {}",
opt.mode
Expand Down
2 changes: 1 addition & 1 deletion src/ui/image_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn new_image_detail_widget<'a>(opt: ImageDetailWidgetOption) -> ImageDetailW

// 生成浪费空间的文件列表
let space_span = Span::from(" ");
let headers = vec!["Count", "Total Space", "Path"];
let headers = ["Count", "Total Space", "Path"];
let mut name = opt.name;
if !opt.arch.is_empty() {
name += &format!("({}/{})", opt.os, opt.arch);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/layers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub struct LayersWidgetOption {
}
// 创建layer列表的widget
pub fn new_layers_widget<'a>(layers: &[ImageLayer], opt: LayersWidgetOption) -> LayersWidget<'a> {
let mut row_max_counts = vec![0, 0, 0];
let mut row_max_counts = [0, 0, 0];
let mut row_data_list = vec![];
// 生成表格数据,并计算每列最大宽度
for (index, item) in layers.iter().enumerate() {
Expand Down

0 comments on commit 1cdbbab

Please sign in to comment.