Skip to content

Commit c6a27e3

Browse files
committed
feat: display plugin and Docker Compose versions in the credits section
1 parent f4ee662 commit c6a27e3

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

source/compose.manager/compose.manager.settings.page

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ $ui_patch_help_class = $option_patch_ui ? "hidden" : "inline_help"; // hide help
1818

1919
$projects_exist = intval(shell_exec("ls -l " . $compose_root . " | grep ^d | wc -l")) != 0;
2020

21+
$pluginVersion = get_plugin_attr('version', '/var/log/plugins/compose.manager.plg') ?: 'unknown';
22+
$composeCliVersion = trim(shell_exec('docker compose version --short 2>/dev/null') ?? '');
23+
2124
$acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js')
2225
? '/webGui/javascript/ace'
2326
: '/plugins/compose.manager/javascript/ace';
@@ -2477,6 +2480,13 @@ $acePath = file_exists('/usr/local/emhttp/plugins/dynamix/javascript/ace/ace.js'
24772480
<div id="compose-tab-credits" class="compose-tab-content">
24782481
<div class="title"><span class="left"><i class="fa fa-star icon"></i>_(Credits)_</span></div>
24792482

2483+
<div class="credits-section" style="padding:16px 12px;border-bottom:1px solid var(--dynamix-sb-border-color, #ccc);">
2484+
<span style="font-size:1.2em;font-weight:bold;">Plugin Version: <?= htmlspecialchars($pluginVersion) ?></span><br>
2485+
<?php if ($composeCliVersion): ?>
2486+
<span style="font-size:1.2em;font-weight:bold;">Docker Compose: v<?= htmlspecialchars($composeCliVersion) ?></span>
2487+
<?php endif; ?>
2488+
</div>
2489+
24802490
<div class="credits-section" style="padding:12px;">
24812491
<p><strong>Original GitHub repository:</strong> <a href="https://github.com/dcflachs/compose_plugin" target="_blank" rel="noopener noreferrer">dcflachs/compose_plugin</a></p>
24822492
<p>Thanks to the original authors and all contributors for their work on the upstream project.</p>

source/compose.manager/include/ComposeManager.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,15 +1632,7 @@ functionBefore: function(instance, helper) {
16321632
} else {
16331633
$('body').prepend($toggleContainer);
16341634
}
1635-
// Inject Compose CLI version next to the page title
1636-
if (composeCliVersion) {
1637-
$('div.content').children('div.title').each(function() {
1638-
var txt = $(this).text().trim();
1639-
if (/Compose/i.test(txt) && !/Docker\s*Containers/i.test(txt)) {
1640-
$(this).append(' <span class="compose-text-muted" style="font-size:0.75em;font-weight:normal;vertical-align:middle;">v' + composeEscapeHtml(composeCliVersion) + '</span>');
1641-
}
1642-
});
1643-
}
1635+
16441636

16451637
// Initialize the Advanced/Basic view toggle.
16461638
// labels_placement:'left' puts both labels to the left of the slider.

0 commit comments

Comments
 (0)