mirror of
https://github.com/apankrat/nullboard.git
synced 2025-08-04 04:07:51 +02:00
Extract default backup agent config into a variable of its own
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<!--
|
<!--
|
||||||
@@ -1749,6 +1749,14 @@
|
|||||||
this.backupStatus = { }; // agentId => [ 'conf' ]
|
this.backupStatus = { }; // agentId => [ 'conf' ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const default_backup_agents =
|
||||||
|
[
|
||||||
|
{ base: 'http://127.0.0.1:10001', auth: '' }, // local agent
|
||||||
|
{ base: '', auth: '' } // remote agent
|
||||||
|
];
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
function BoardMeta()
|
function BoardMeta()
|
||||||
{
|
{
|
||||||
this.title = '';
|
this.title = '';
|
||||||
@@ -2102,22 +2110,26 @@
|
|||||||
agents[0].type != simp || agents[0].conf.base != 'http://127.0.0.1:10001' ||
|
agents[0].type != simp || agents[0].conf.base != 'http://127.0.0.1:10001' ||
|
||||||
agents[1].type != simp)
|
agents[1].type != simp)
|
||||||
{
|
{
|
||||||
|
const def = default_backup_agents;
|
||||||
|
|
||||||
console.log('Unexpected backup config, will re-initialize.', agents);
|
console.log('Unexpected backup config, will re-initialize.', agents);
|
||||||
|
|
||||||
conf.backups.agents = [];
|
conf.backups.agents = [];
|
||||||
|
|
||||||
conf.backups.agents.push({
|
conf.backups.agents.push({
|
||||||
|
// localhost
|
||||||
type : simp,
|
type : simp,
|
||||||
id : simp + '-' + (conf.backups.nextId++),
|
id : simp + '-' + (conf.backups.nextId++),
|
||||||
enabled: false,
|
enabled : def[0].base && def[0].auth,
|
||||||
conf: { base: 'http://127.0.0.1:10001', auth: '' }
|
conf : def[0],
|
||||||
})
|
})
|
||||||
|
|
||||||
conf.backups.agents.push({
|
conf.backups.agents.push({
|
||||||
|
// remote
|
||||||
type : simp,
|
type : simp,
|
||||||
id : simp + '-' + (conf.backups.nextId++),
|
id : simp + '-' + (conf.backups.nextId++),
|
||||||
enabled: false,
|
enabled : def[1].base && def[1].auth,
|
||||||
conf: { base: '', auth: '' }
|
conf : def[1],
|
||||||
})
|
})
|
||||||
|
|
||||||
this.saveConfig();
|
this.saveConfig();
|
||||||
@@ -5082,7 +5094,7 @@
|
|||||||
*/
|
*/
|
||||||
var NB =
|
var NB =
|
||||||
{
|
{
|
||||||
codeVersion: 20221112,
|
codeVersion: 20231105,
|
||||||
blobVersion: 20190412, // board blob format in Storage
|
blobVersion: 20190412, // board blob format in Storage
|
||||||
board: null,
|
board: null,
|
||||||
storage: null,
|
storage: null,
|
||||||
|
Reference in New Issue
Block a user