Host: " + host + "
";
var ips = data[host];
for (var ip in ips) {
if (ips.hasOwnProperty(ip)) {
result = ips[ip];
html += "
" + ip + "
" + result + "
";
}
}
html += "
";
}
}
target.html(html);
}
}
function populateGitHubInfo(target, error) {
$('#generic_error_title', target).text(error.message);
$('#generic_error_details', target).text(error.details);
$('#error_github_search', target).attr("href", "https://github.com/sabeechen/hassio-google-drive-backup/issues?q=" + encodeURIComponent("\"" + error.message.replace("\"", "\\\"") + "\""));
}
function simulateError() {
$.get("simerror?error=This%20is%20a%20fake%20error.%20Select%20'Stop%20Simulated%20Error'%20from%20the%20menu%20to%20stop%20it.",
function (data) {
sync()
})
}
function stopSimulateError() {
$.get("simerror?error=",
function (data) {
sync()
})
}
function newBackupClick() {
setInputValue("retain_drive_one_off", false);
setInputValue("retain_ha_one_off", false);
setInputValue("backup_name_one_off", "");
setInputValue("backup_note_one_off", "");
backupNameOneOffExample();
M.Modal.getInstance(document.querySelector('#backupmodal')).open();
}
function doNewBackup() {
var drive = $("#retain_drive_one_off").prop('checked');
var ha = $("#retain_ha_one_off").prop('checked');
var name = $("#backup_name_one_off").val()
let note = $("#backup_note_one_off").val()
var url = "backup?custom_name=" + encodeURIComponent(name) + "&retain_drive=" + drive + "&retain_ha=" + ha + "¬e=" + encodeURIComponent(note);
postJson(url, {}, refreshstats, null, "Requesting backup (takes a few seconds)...");
return false;
}
function allowDeletion(always) {
var url = "confirmdelete?always=" + always;
postJson(url, {}, refreshstats, null, "Allowing deletion and syncing...");
}
function chooseBackupFolder() {
window.open(last_data.choose_folder_url);
}
function skipLowSpaceWarning() {
postJsonCloseErrorDialog("skipspacecheck", "low_space");
}
$(document).ready(function () {
if (window.top.location === window.location) {
// We're in a standard webpage, show the full header
$(".ingress-only").hide();
$(".nav-wrapper .right").addClass("hide-on-med-and-down")
} else {
// We're in an ingress iframe.
$(".non-ingress").hide();
$(".nav-wrapper .brand-logo").addClass("hide-on-med-and-down")
}
M.Tabs.init(document.querySelector("#bug_report_tabs"), { "onShow": renderMarkdown });
});
function copyFromInput(id) {
var copyText = document.getElementById(id);
copyText.select();
document.execCommand("copy");
}
function saveFolder(id) {
url = "changefolder?id=" + id
postJson(url, {}, refreshstats, null, "Setting backup folder...");
}
function exampleBackupName(backup_type, template) {
name_keys["{type}"] = $("#partial_backups").is(':checked') ? "Partial" : "Full";
if (template.length == 0) {
template = last_data.backup_name_template;
}
for (key in name_keys) {
template = template.replace(key, name_keys[key]);
}
return template;
}