From 5383c2d4c8c68c7b0a4e3ec7345e15fd8ab47f44 Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 4 Jun 2019 19:56:40 +0200 Subject: [PATCH] [mod] use manifest.json/actions.json args format for the config_panel.toml --- src/css/style.less | 3 +++ src/js/yunohost/controllers/apps.js | 6 +++++ src/views/app/app_config-panel.ms | 38 ++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/css/style.less b/src/css/style.less index e1496f71..78bccd4b 100644 --- a/src/css/style.less +++ b/src/css/style.less @@ -613,6 +613,9 @@ input[type='radio'].nice-radio { margin-top: -5px; } +.auto-width { + width: auto; +} .app-card .panel-body { padding: 1.5rem; diff --git a/src/js/yunohost/controllers/apps.js b/src/js/yunohost/controllers/apps.js index 9a7aafc9..74eaf76a 100644 --- a/src/js/yunohost/controllers/apps.js +++ b/src/js/yunohost/controllers/apps.js @@ -294,6 +294,11 @@ // Get app config panel app.get('#/apps/:app/config-panel', function (c) { c.api('/apps/'+c.params['app']+'/config-panel', function(data) { + $.each(data.config_panel.panel, function(_, panel) { + $.each(panel.sections, function(_, section) { + formatYunoHostStyleArguments(section.options, c.params); + }); + }); c.view('app/app_config-panel', data); }); }); @@ -430,6 +435,7 @@ if (args[k].type == 'boolean') { args[k].inputType = 'checkbox'; + console.log(args[k]); // Checked or not ? if (typeof args[k].default !== 'undefined') { if (args[k].default == true) { diff --git a/src/views/app/app_config-panel.ms b/src/views/app/app_config-panel.ms index 3d00f64c..011513ee 100644 --- a/src/views/app/app_config-panel.ms +++ b/src/views/app/app_config-panel.ms @@ -36,18 +36,48 @@