ui: enable experimental tape UI if tape.cfg exists
This commit is contained in:
@ -86,6 +86,11 @@ async fn run() -> Result<(), Error> {
|
||||
let mut config = ApiConfig::new(
|
||||
buildcfg::JS_DIR, &proxmox_backup::api2::ROUTER, RpcEnvironmentType::PUBLIC)?;
|
||||
|
||||
// Enable experimental tape UI if tape.cfg exists
|
||||
if Path::new("/etc/proxmox-backup/tape.cfg").exists() {
|
||||
config.enable_tape_ui = true;
|
||||
}
|
||||
|
||||
config.add_alias("novnc", "/usr/share/novnc-pve");
|
||||
config.add_alias("extjs", "/usr/share/javascript/extjs");
|
||||
config.add_alias("qrcodejs", "/usr/share/javascript/qrcodejs");
|
||||
|
@ -22,6 +22,7 @@ pub struct ApiConfig {
|
||||
templates: RwLock<Handlebars<'static>>,
|
||||
template_files: RwLock<HashMap<String, (SystemTime, PathBuf)>>,
|
||||
request_log: Option<Arc<Mutex<FileLogger>>>,
|
||||
pub enable_tape_ui: bool,
|
||||
}
|
||||
|
||||
impl ApiConfig {
|
||||
@ -35,7 +36,8 @@ impl ApiConfig {
|
||||
templates: RwLock::new(Handlebars::new()),
|
||||
template_files: RwLock::new(HashMap::new()),
|
||||
request_log: None,
|
||||
})
|
||||
enable_tape_ui: false,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn find_method(
|
||||
|
@ -457,6 +457,7 @@ fn get_index(
|
||||
"CSRFPreventionToken": csrf_token,
|
||||
"language": lang,
|
||||
"debug": debug,
|
||||
"enableTapeUI": api.enable_tape_ui,
|
||||
});
|
||||
|
||||
let (ct, index) = match api.render_template(template_file, &data) {
|
||||
|
Reference in New Issue
Block a user