Skip to content

Commit

Permalink
Merge pull request #55 from simatec/multiplatform
Browse files Browse the repository at this point in the history
Multiplatform
  • Loading branch information
simatec authored Nov 7, 2018
2 parents fb8b27b + 01c6669 commit dc0673e
Show file tree
Hide file tree
Showing 11 changed files with 326 additions and 63 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ package-lock.json
/lib/total.json
/lib/*.sh
/lib/restore.json
.vscode
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ appveyor.yml
/lib/total.json
/lib/*.sh
/lib/restore.json
.vscode
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ Backitup is a backup solution that allows cyclical backup of an IoBroker install

## Changelog

### 0.3.7 (07.11.2018)
* (simatec) Added e-mail notification
* (simatec) Create backup directory on first boot
* (simatec) many small changes
* (peoples) Fix Telegram SilentNotice
* (peoples) Added Possibility to select a Telegram Receiver
* (peoples) Added Possibility to select a Telegram Notification length
* (peoples) Some Translations

### 0.3.6 (16.10.2018)
* (simatec) Fix Dropbox Backup
* (simatec) Fix Restore path for ownDir
Expand Down
181 changes: 141 additions & 40 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,11 @@
getAdapterInstances('telegram', function (instances) {
fillInstances('telegramInstance', instances, settings['telegramInstance']);
});

getAdapterInstances('email', function (instances) {
fillInstances('emailInstance', instances, settings['emailInstance']);
});

if (!settings.ccuHost) {
fetchCcuConfig(true);
}
Expand All @@ -412,8 +417,24 @@
}
$('.detect-mysql').on('click', function () {fetchMySqlConfig()});
$('.detect-ccu').on('click', function () {fetchCcuConfig()});

sendTo(null, 'getTelegramUser', null, function (obj) {
fillTelegramUser(settings['telegramUser'], obj)
});

initDialog();
}
function fillTelegramUser(id, str) {
var user = str.replace(/[{}"\\]/g,"").split(',');
var $sel = $('#telegramUser');
$sel.html('<option value="allTelegramUsers">' + _('All Receiver') + '</option>');

user.forEach(function(val){
val = val.split(':');
$('#telegramUser').append('<option value="' + val[1] + '"' + (id === val[1] ? ' selected' : '') + '>' + val[1] +'</option>');
});
$sel.select();
}
function fillInstances(id, arr, val) {
var $sel = $('#' + id);
$sel.html('<option value="">' + _('none') + '</option>');
Expand Down Expand Up @@ -518,7 +539,6 @@
$('.copy').hide();
}
}).trigger('change');

$('#restoreSource').on('change', function () {
if ($(this).val() === 'NAS / Copy' && $('#cifsOwnDir').prop('checked')) {
$('.bkpType').show();
Expand All @@ -530,6 +550,16 @@
$('.bkpType').hide();
}
}).trigger('change');

$('#notificationsType').on('change', function () {
if ($(this).val() === 'Telegram') {
$('.email').hide();
$('.telegram').show();
} else if ($(this).val() === 'E-Mail') {
$('.email').show();
$('.telegram').hide();
}
}).trigger('change');
/*
if ($('#mySqlEnabled').prop('checked')) {
$('.tab-my-sql').show();
Expand All @@ -552,11 +582,21 @@
$('.tab-ftp').hide();
}
*/
if ($('#notificationEnabled').prop('checked')) {
$('.tab-notification').removeClass('disabled');
} else {
$('.tab-notification').addClass('disabled');
}
if ($('#mySqlEnabled').prop('checked')) {
$('.tab-my-sql').removeClass('disabled');
} else {
$('.tab-my-sql').addClass('disabled');
}
if ($('#redisEnabled').prop('checked')) {
$('.tab-redis').removeClass('disabled');
} else {
$('.tab-redis').addClass('disabled');
}
if ($('#dropboxEnabled').prop('checked')) {
$('.tab-dropbox').removeClass('disabled');
} else {
Expand All @@ -572,7 +612,7 @@
} else {
$('.tab-ftp').addClass('disabled');
}
}
}
</script>
</head>
<body>
Expand All @@ -585,10 +625,12 @@
<li class="tab col s6 l2 tab-total-backup"><a href="#tab-total-backup" class="translate">Total backup</a></li>
<li class="tab col s6 l2 tab-ccu-backup"><a href="#tab-ccu-backup" class="translate">CCU Backup</a></li>
<li class="tab col s6 l2 tab-my-sql"><a href="#tab-my-sql" class="translate">MySql Backup</a></li>
<li class="tab col s6 l2 tab-redis"><a href="#tab-redis" class="translate">Redis Backup</a></li>
<li class="tab col s6 l2 tab-notification"><a href="#tab-notification" class="translate">Notifications</a></li>
<li class="tab col s6 l3 tab-cifs"><a href="#tab-cifs" class="translate">NAS / Copy settings</a></li>
<li class="tab col s6 l2 tab-ftp"><a href="#tab-ftp" class="translate">FTP settings</a></li>
<li class="tab col s6 l3 tab-dropbox"><a href="#tab-dropbox" class="translate">Dropbox settings</a></li>
<li class="tab col s6 l2 tab-restore"><a href="#tab-restore" class="translate">Restore</a></li>
<li class="tab col s6 l4 tab-cifs"><a href="#tab-cifs" class="translate">NAS / Copy settings</a></li>
<li class="tab col s6 l4 tab-ftp"><a href="#tab-ftp" class="translate">FTP settings</a></li>
<li class="tab col s6 l4 tab-dropbox"><a href="#tab-dropbox" class="translate">Dropbox settings</a></li>
</ul>
</div>
<div class="row">
Expand All @@ -605,6 +647,12 @@
<label for="debugLevel" class="translate">Enable / disable debug</label>
</div>
</div>
<div class="row">
<div class="input-field col s12 m6 l4">
<input class="value" id="notificationEnabled" type="checkbox"/>
<label for="notificationEnabled" class="translate">Enable / Disable Notifications</label>
</div>
</div>
<div class="row">
<div class="input-field col s6 l3 ">
<input class="value" id="mySqlEnabled" type="checkbox"/>
Expand All @@ -614,10 +662,6 @@
<input class="value" id="redisEnabled" type="checkbox"/>
<label for="redisEnabled" class="translate">Save Redis state</label>
</div>
<div class="input-field col s6 l6 redis_path">
<input class="value" id="redisPath" type="text"/>
<label for="redisPath" class="translate">Redis file path</label>
</div>
</div>
<div class="row">

Expand All @@ -634,20 +678,6 @@
<span for="dropboxEnabled" class="translate">Dropbox</span>
</div>
</div>
<div class="row">
<div class="input-field col s6 l3">
<input class="value" id="telegramEnabled" type="checkbox"/>
<label for="telegramEnabled" class="translate">Notifications by telegram</label>
</div>
<div class="input-field col s12 m6 l3 telegram_inst">
<input class="value" id="telegramSilentNotice" type="checkbox"/>
<label for="telegramSilentNotice" class="translate">Silent Notice</label>
</div>
<div class="input-field col s12 m6 l3 telegram_inst">
<select id="telegramInstance" class="value"></select>
<label for="telegramInstance" class="translate">Telegram instance</label>
</div>
</div>
<div class="row">
<div class="input-field col s12 m6 l3">
<input type="number" class="value" id="historyEntriesNumber" min="1" max="50"/>
Expand All @@ -667,12 +697,6 @@
<a class="waves-effect waves-light btn btn-minimal do-backup" data-type="minimal"><i class="material-icons right">backup</i><span class="translate">backup now</span></a>
</div>
</div>
<div class="row minimal">
<div class="input-field col s3">
<input class="value" id="minimalExtensionsEnabled" type="checkbox"/>
<label for="minimalExtensionsEnabled" class="translate">Extensions Enabled (Mysql / Redis)</label>
</div>
</div>
<div class="row minimal">
<div class="input-field col s12 m6 l3">
<input class="value" id="minimalTime" type="text">
Expand Down Expand Up @@ -831,19 +855,96 @@
<label for="mySqlDumpExe" class="translate">Full path</label>
<span class="translate">Path with filename to mysqldump executable (leave empty to use default)</span>
</div>
<!--<div class="input-field col s12 m4 l4">
<input type="number" class="value" id="mySqlDeleteAfter" min="1" max="100"/>
<label for="mySqlDeleteAfter" class="translate">piece</label>
<span class="translate">old MySQL backups delete after X days</span>
</div>-->
</div>
<!--<div class="row mysql">
<div class="input-field col s12 m8 l8">
<input type="number" class="value" id="mySqlDumpExe" min="1" max="100"/>
<label for="mySqlDumpExe" class="translate">Full path</label>
<span class="translate">Path with filename to mysqldump executable (leave empty to use default)</span>
<div class="row mysql">
<div class="input-field col s6 l3">
<input class="value" id="mysqlMinimalEnabled" type="checkbox"/>
<label for="mysqlMinimalEnabled" class="translate">mysql Backup by minimal</label>
</div>
</div>-->
</div>
</div>

<!-- Redis -->
<div id="tab-redis" class="col s12 page">
<div class="row">
</div>
<div class="row">
<div class="input-field col s6 l6 redis_path">
<input class="value" id="redisPath" type="text"/>
<label for="redisPath" class="translate">Redis file path</label>
</div>
</div>
<div class="row">
<div class="input-field col s6 l3">
<input class="value" id="redisMinimalEnabled" type="checkbox"/>
<label for="redisMinimalEnabled" class="translate">Redis Backup by minimal</label>
</div>
</div>
</div>

<!-- notifications -->
<div id="tab-notification" class="col s12 page">
<div class="row">
</div>
<div class="row">
<div class="input-field col s11 m2">
<select class="value" id="notificationsType">
<option value="Telegram" class="translate">Telegram</option>
<option value="E-Mail" class="translate">E-Mail</option>
</select>
<label for="notificationsType" class="translate">notifications type</label>
</div>
</div>
<!-- Telegram -->
<div class="row telegram">
<div class="input-field col s12 m6 l3 telegram">
<select id="telegramInstance" class="value"></select>
<label for="telegramInstance" class="translate">Telegram instance</label>
</div>
<div class="input-field col s12 m6 l3 telegram">
<select class="value" id="telegramUser"></select>
<label class="translate" for="telegramUser">Telegram Receiver</label>
</div>
</div>
<div class="row telegram">
<div class="input-field col s12 m6 l3 telegram">
<input class="value" id="telegramSilentNotice" type="checkbox"/>
<label for="telegramSilentNotice" class="translate">Silent Notice</label>
</div>
<div class="input-field col s12 m6 l3 telegram">
<select class="value" id="telegramNoticeType">
<option value="longTelegramNotice" class="translate">Long Notifications</option>
<option value="shortTelegramNotice" class="translate">Short Notifications</option>
</select>
<label class="translate" for="telegramNoticeType">Notification Style</label>
</div>
</div>
<!-- email -->
<div class="row email">
<div class="input-field col s12 m6 l3 email">
<input class="value" id="emailReceiver" type="text">
<label for="emailReceiver" class="translate">email receiver</label>
<span class="translate">email receiver</span>
</div>
<div class="input-field col s12 m6 l3 email">
<input class="value" id="emailSender" type="text">
<label for="emailSender" class="translate">email sender</label>
<span class="translate">email sender</span>
</div>
</div>
<div class="row email">
<div class="input-field col s12 m6 l3 email">
<select id="emailInstance" class="value"></select>
<label for="emailInstance" class="translate">email instance</label>
</div>
<div class="input-field col s12 m6 l3 email">
<select class="value" id="emailNoticeType">
<option value="longEmailNotice" class="translate">Long Notifications</option>
<option value="shortEmailNotice" class="translate">Short Notifications</option>
</select>
<label class="translate" for="emailNoticeType">Notification Style</label>
</div>
</div>
</div>

<!-- nas / copy settings -->
Expand Down
Loading

0 comments on commit dc0673e

Please sign in to comment.