DashMachine/dashmachine/static/js/main/config-editor.js
Ross Mountjoy 62191b21b8 ##### Updated to version 0.6!
> Version 0.6 brings DashMachine one big step forward to being a finished product by adding a gui to edit the various settings in the config.ini.

**Changelog**
- improvements to /home including 'pinned' cards, multi-select tag filtering, 'action providers' allowing you to do web searches from the searchbar
- rebuilt sidenav with list view, mirroring filter/search/collapse state of the homepage
- /settings and /home now on same route
- dynamic reloading of settings (no more page reloads)
- dedicated config.ini editor slide-out
- settings editor slide-out
- card editor slide-out
- better access group control
- dedicated documentation pages
- improved documentation
- new system for automatically generating documentation for platforms
- ability to load custom platforms
- added an 'on_starup' method for platforms allowing for registering api routes. (example coming soon)
2020-05-07 09:27:18 -04:00

30 lines
1.1 KiB
JavaScript

sleep(500).then(() => {
var config_textarea_codemirror = CodeMirror.fromTextArea(document.getElementById("config-textarea"), {
lineNumbers: true,
mode: 'properties',
theme: 'dashmachine',
scrollbarStyle: null,
});
$("#save-config-btn").on('click', function(e) {
$.ajax({
url: $(this).attr('data-url'),
type: 'POST',
data: {config: config_textarea_codemirror.getValue()},
success: function(data){
if (data.data.msg === "success"){
M.toast({html: 'Config applied successfully'});
$("#config-editor-error-div").closest('.col').addClass('hide');
fetch_settings();
load_apps();
load_card_editor();
load_settings_editor();
} else {
$("#config-editor-error-div").empty();
$("#config-editor-error-div").closest('.col').removeClass('hide');
$("#config-editor-error-div").append(data.data.msg);
}
}
});
});
});