-
Notifications
You must be signed in to change notification settings - Fork 321
Add functionality to list plugin package requirements #3135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Caelion
wants to merge
1
commit into
jeedom:alpha
Choose a base branch
from
Caelion:patch-9
base: alpha
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+62
−2
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,14 +87,14 @@ | |
| </tbody> | ||
| </table> | ||
| </div> | ||
|
|
||
| <div role="tabpanel" class="tab-pane" id="log" style="overflow:auto;overflow-x: hidden"> | ||
| <legend><i class="fas fa-info-circle"></i> {{Log :}}</legend> | ||
| <div id="div_log"> | ||
| <pre id="pre_updateInfo"></pre> | ||
| </div> | ||
| </div> | ||
|
|
||
|
|
||
| <div role="tabpanel" class="tab-pane" id="os" style="overflow:auto;overflow-x: hidden"> | ||
| <div class="alert alert-info">{{IMPORTANT : Ne sont affichés ici que les packages Linux n’étant pas à jour. Une liste vide signifiant que votre système Linux est à jour.}}</div> | ||
|
|
||
|
|
@@ -107,6 +107,66 @@ | |
| </span> | ||
| </div> | ||
|
|
||
| <?php | ||
| // --- Recherche de tous les packages.json dans les plugins --- | ||
| $pluginsDir = dirname(__FILE__) . '/../../plugins'; | ||
| $packagesList = []; | ||
|
|
||
| if (is_dir($pluginsDir)) { | ||
| foreach (scandir($pluginsDir) as $plugin) { | ||
| if ($plugin == '.' || $plugin == '..') continue; | ||
| $packageFile = $pluginsDir . '/' . $plugin . '/plugin_info/packages.json'; | ||
| if (file_exists($packageFile)) { | ||
| $json = file_get_contents($packageFile); | ||
| $data = json_decode($json, true); | ||
| if (is_array($data)) { | ||
| foreach ($data as $type => $entries) { | ||
| if (!is_array($entries)) continue; | ||
| foreach ($entries as $name => $info) { | ||
| $packagesList[] = [ | ||
| 'plugin' => $plugin, | ||
| 'type' => $type, | ||
| 'name' => $name, | ||
| 'version' => isset($info['version']) ? $info['version'] : '', | ||
| 'reinstall' => isset($info['reinstall']) ? $info['reinstall'] : false, | ||
| ]; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ?> | ||
| <h4><i class="fas fa-cubes"></i> {{Prérequis pip2 et pip3 des plugins installés :}}</h4> | ||
| <?php if (!empty($packagesList)) { ?> | ||
| <table class="ui-table-reflow table table-condensed" id="table_pluginPackages"> | ||
| <thead> | ||
| <tr> | ||
| <th>{{Plugin}}</th> | ||
| <th>{{Type}}</th> | ||
| <th>{{Nom}}</th> | ||
| <th>{{Version requise}}</th> | ||
| <th>{{Réinstallation}}</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <?php foreach ($packagesList as $pkg) { ?> | ||
| <tr> | ||
| <td><?php echo htmlspecialchars($pkg['plugin']); ?></td> | ||
| <td><?php echo htmlspecialchars($pkg['type']); ?></td> | ||
| <td><?php echo htmlspecialchars($pkg['name']); ?></td> | ||
| <td><?php echo !empty($pkg['version']) ? '<span class="icon_red">' . htmlspecialchars($pkg['version']) . '</span>' : 'Non spécifiée'; ?></td> | ||
| <td><?php echo $pkg['reinstall'] ? '<i class="fas fa-check icon_green"></i>' : ''; ?></td> | ||
| </tr> | ||
| <?php } ?> | ||
| </tbody> | ||
| </table> | ||
| <?php } else { ?> | ||
| <div class="alert alert-info"> | ||
| {{Aucun fichier packages.json trouvé dans les plugins.}} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't write such alert |
||
| </div> | ||
| <?php } ?> | ||
|
|
||
| <table class="ui-table-reflow table table-condensed" id="table_osUpdate"> | ||
| <thead> | ||
| <tr> | ||
|
|
@@ -209,4 +269,4 @@ | |
| </div> | ||
| </div> | ||
|
|
||
| <?php include_file('desktop', 'update', 'js'); ?> | ||
| <?php include_file('desktop', 'update', 'js'); ?> | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment in french