enable tape backup by default

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2021-04-12 12:31:56 +02:00
parent 79e2473c63
commit a21f9852fd
5 changed files with 19 additions and 42 deletions

View File

@ -4,12 +4,7 @@ Tape Backup
=========== ===========
.. CAUTION:: Tape Backup is a technical preview feature, not meant for .. CAUTION:: Tape Backup is a technical preview feature, not meant for
production use. To enable it in the GUI, you need to issue the production use.
following command (as root user on the console):
.. code-block:: console
# touch /etc/proxmox-backup/tape.cfg
Proxmox tape backup provides an easy way to store datastore content Proxmox tape backup provides an easy way to store datastore content
onto magnetic tapes. This increases data safety because you get: onto magnetic tapes. This increases data safety because you get:

View File

@ -91,11 +91,6 @@ async fn run() -> Result<(), Error> {
default_api_auth(), default_api_auth(),
)?; )?;
// 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("novnc", "/usr/share/novnc-pve");
config.add_alias("extjs", "/usr/share/javascript/extjs"); config.add_alias("extjs", "/usr/share/javascript/extjs");
config.add_alias("qrcodejs", "/usr/share/javascript/qrcodejs"); config.add_alias("qrcodejs", "/usr/share/javascript/qrcodejs");

View File

@ -23,7 +23,6 @@ pub struct ApiConfig {
templates: RwLock<Handlebars<'static>>, templates: RwLock<Handlebars<'static>>,
template_files: RwLock<HashMap<String, (SystemTime, PathBuf)>>, template_files: RwLock<HashMap<String, (SystemTime, PathBuf)>>,
request_log: Option<Arc<Mutex<FileLogger>>>, request_log: Option<Arc<Mutex<FileLogger>>>,
pub enable_tape_ui: bool,
pub api_auth: Arc<dyn ApiAuth + Send + Sync>, pub api_auth: Arc<dyn ApiAuth + Send + Sync>,
} }
@ -42,7 +41,6 @@ impl ApiConfig {
templates: RwLock::new(Handlebars::new()), templates: RwLock::new(Handlebars::new()),
template_files: RwLock::new(HashMap::new()), template_files: RwLock::new(HashMap::new()),
request_log: None, request_log: None,
enable_tape_ui: false,
api_auth, api_auth,
}) })
} }

View File

@ -497,7 +497,6 @@ fn get_index(
"CSRFPreventionToken": csrf_token, "CSRFPreventionToken": csrf_token,
"language": lang, "language": lang,
"debug": debug, "debug": debug,
"enableTapeUI": api.enable_tape_ui,
}); });
let (ct, index) = match api.render_template(template_file, &data) { let (ct, index) = match api.render_template(template_file, &data) {

View File

@ -79,6 +79,14 @@ Ext.define('PBS.store.NavigationStore', {
}, },
], ],
}, },
{
text: "Tape Backup",
iconCls: 'pbs-icon-tape',
id: 'tape_management',
path: 'pbsTapeManagement',
expanded: true,
children: [],
},
{ {
text: gettext('Datastore'), text: gettext('Datastore'),
iconCls: 'fa fa-archive', iconCls: 'fa fa-archive',
@ -118,7 +126,6 @@ Ext.define('PBS.view.main.NavigationTree', {
view.rstore.on('load', this.onLoad, this); view.rstore.on('load', this.onLoad, this);
view.on('destroy', view.rstore.stopUpdate); view.on('destroy', view.rstore.stopUpdate);
if (PBS.enableTapeUI) {
if (view.tapestore === undefined) { if (view.tapestore === undefined) {
view.tapestore = Ext.create('Proxmox.data.UpdateStore', { view.tapestore = Ext.create('Proxmox.data.UpdateStore', {
autoStart: true, autoStart: true,
@ -129,19 +136,6 @@ Ext.define('PBS.view.main.NavigationTree', {
view.tapestore.on('load', this.onTapeDriveLoad, this); view.tapestore.on('load', this.onTapeDriveLoad, this);
view.on('destroy', view.tapestore.stopUpdate); view.on('destroy', view.tapestore.stopUpdate);
} }
let root = view.getStore().getRoot();
if (root.findChild('id', 'tape_management', false) === null) {
root.insertChild(3, {
text: "Tape Backup",
iconCls: 'pbs-icon-tape',
id: 'tape_management',
path: 'pbsTapeManagement',
expanded: true,
children: [],
});
}
}
}, },
onTapeDriveLoad: function(store, records, success) { onTapeDriveLoad: function(store, records, success) {
@ -271,16 +265,12 @@ Ext.define('PBS.view.main.NavigationTree', {
reloadTapeStore: function() { reloadTapeStore: function() {
let me = this; let me = this;
if (!PBS.enableTapeUI) {
return;
}
me.tapestore.load(); me.tapestore.load();
}, },
select: function(path, silent) { select: function(path, silent) {
var me = this; var me = this;
if (me.rstore.isLoaded() && (!PBS.enableTapeUI || me.tapestore.isLoaded())) { if (me.rstore.isLoaded() && me.tapestore.isLoaded()) {
if (silent) { if (silent) {
me.suspendEvents(false); me.suspendEvents(false);
} }