Skip to content

Commit

Permalink
We must get config from the original backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
JanWielemaker committed Dec 4, 2023
1 parent bf00de8 commit 6fb0d2b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
24 changes: 22 additions & 2 deletions web/js/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,32 @@
* @requires jquery
*/

define([ "jquery" ],
function($) {
define([ "jquery", "config", "form",
"laconic"
],
function($, config, form) {

var backend = {
ajax: function(options) {
return $.ajax(options);
},

selectBackend: function() {
function backendBody() {
this.append($.el.table(
{ class: "table table-striped table-condensed",
'data-click-to-select': true,
'data-single-select': true
},
$.el.tr($.el.th("Backend"),
$.el.th("URL")),
$.el.tbody()));
}

form.showDialog(
{ title: "SWISH backends",
body: backendBody
});
}
}

Expand Down
6 changes: 3 additions & 3 deletions web/js/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
* @requires jquery
*/

define([ "jquery", "backend" ],
function($, backend) {
define([ "jquery" ],
function($) {
var KEY = "SWISHCONFIG";

/* Configuration of various server components. We provide
Expand Down Expand Up @@ -86,7 +86,7 @@ function setCachedConfig(config) {

if ( !config ) {
if ( !(config = getCachedConfig()) ) {
backend.ajax(
$.ajax(
{ url: "swish_config.json",
dataType: "json",
async: false,
Expand Down

0 comments on commit 6fb0d2b

Please sign in to comment.