tape: correctly sort drive api subdir
This commit is contained in:
parent
f70d8091d3
commit
55118ca18e
@ -2,7 +2,7 @@ use anyhow::{bail, Error};
|
|||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use proxmox::api::{api, Router, SubdirMap};
|
use proxmox::api::{api, Router, SubdirMap};
|
||||||
use proxmox::list_subdirs_api_method;
|
use proxmox::{sortable, identity, list_subdirs_api_method};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
config,
|
config,
|
||||||
@ -216,17 +216,18 @@ pub fn eject_media(drive: String) -> Result<(), Error> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const SUBDIRS: SubdirMap = &[
|
#[sortable]
|
||||||
(
|
pub const SUBDIRS: SubdirMap = &sorted!([
|
||||||
"erase-media",
|
|
||||||
&Router::new()
|
|
||||||
.put(&API_METHOD_ERASE_MEDIA)
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
"eject-media",
|
"eject-media",
|
||||||
&Router::new()
|
&Router::new()
|
||||||
.put(&API_METHOD_EJECT_MEDIA)
|
.put(&API_METHOD_EJECT_MEDIA)
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"erase-media",
|
||||||
|
&Router::new()
|
||||||
|
.put(&API_METHOD_ERASE_MEDIA)
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"load-slot",
|
"load-slot",
|
||||||
&Router::new()
|
&Router::new()
|
||||||
@ -247,7 +248,7 @@ pub const SUBDIRS: SubdirMap = &[
|
|||||||
&Router::new()
|
&Router::new()
|
||||||
.put(&API_METHOD_UNLOAD)
|
.put(&API_METHOD_UNLOAD)
|
||||||
),
|
),
|
||||||
];
|
]);
|
||||||
|
|
||||||
pub const ROUTER: Router = Router::new()
|
pub const ROUTER: Router = Router::new()
|
||||||
.get(&list_subdirs_api_method!(SUBDIRS))
|
.get(&list_subdirs_api_method!(SUBDIRS))
|
||||||
|
Loading…
Reference in New Issue
Block a user