mirror of
https://github.com/unraid/webgui.git
synced 2026-01-01 06:59:56 -06:00
Instead of styling defined inside a page file, these settings are now kept in a dedicated css file. This has several advantages: - It comes much easier to maintain styling, all css files are easy to find and update - Browser can cache css files, which may improve page loading time - Separate theme css files exist, no more need to make selection by coding - This PR is a 1-to-1 move of existing inline styling to css files - In future more optimization can be made by consolidating css files
91 lines
3.3 KiB
Plaintext
91 lines
3.3 KiB
Plaintext
Menu='Buttons'
|
|
Link='nav-user'
|
|
---
|
|
<?
|
|
/* Copyright 2023, Lime Technology
|
|
* Copyright 2023, Andrew Zawadzki.
|
|
*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License version 2,
|
|
* as published by the Free Software Foundation.
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*/
|
|
?>
|
|
<script>
|
|
const ca_args = {};
|
|
|
|
function ca_refresh() {
|
|
<?if ($task == 'Plugins'):?>
|
|
loadlist();
|
|
<?else:?>
|
|
refresh();
|
|
<?endif;?>
|
|
}
|
|
|
|
function ca_hidePluginUpdate(plugin,version,element) {
|
|
$.cookie(plugin,version);
|
|
$(element).hide();
|
|
}
|
|
|
|
function ca_pluginUpdateInstall(plugin) {
|
|
if (plugin == null) {
|
|
openPlugin(ca_args.cmd,ca_args.title,'','ca_refresh');
|
|
return;
|
|
}
|
|
ca_args.cmd = 'plugin update '+plugin;
|
|
ca_args.title = "_(Installing Update)_";
|
|
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{cmd:'alert'},function(data) {
|
|
if (data==0) {
|
|
// no alert message - proceed with update
|
|
setTimeout(ca_pluginUpdateInstall);
|
|
} else {
|
|
// show alert message and ask for confirmation
|
|
openAlert("showchanges <?=$alerts?>","_(Alert Message)_","ca_pluginUpdateInstall");
|
|
}
|
|
});
|
|
}
|
|
|
|
function caPluginUpdateCheck(plugin,options=[],callback) {
|
|
var pluginFilename = plugin.substr(0, plugin.lastIndexOf("."));
|
|
console.time("checkPlugin "+plugin);
|
|
console.log("checkPlugin "+plugin);
|
|
$.post("/plugins/dynamix.plugin.manager/scripts/PluginAPI.php",{action:'checkPlugin',options:{plugin:plugin,name:options.name}},function(caAPIresult) {
|
|
console.groupCollapsed("Result checkPlugin "+plugin);
|
|
console.log(caAPIresult);
|
|
console.timeEnd("checkPlugin "+plugin);
|
|
console.groupEnd();
|
|
var result = JSON.parse(caAPIresult);
|
|
|
|
if ( options.debug == true ) result.updateAvailable = true;
|
|
if ( ! options.element && ! options.dontShow ) {
|
|
if ( result.updateAvailable ) {
|
|
var HTML = result.updateMessage+"<span class='bannerInfo fa fa-info-circle big' title=\"_(View Release Notes)_\" onclick='openChanges(\"showchanges /tmp/plugins/"+pluginFilename+".txt\",\"_(Release Notes)_\")'></span><a class='ca_PluginUpdateInstall' onclick='ca_pluginUpdateInstall(\""+plugin+"\")'>"+result.linkMessage+"</a>";
|
|
addBannerWarning(HTML,false,options.noDismiss);
|
|
}
|
|
} else {
|
|
if ( $.cookie(plugin) != result.version ) {
|
|
if ( result.updateAvailable ) {
|
|
var HTML = result.updateMessage+"<span class='bannerInfo fa fa-info-circle big' title=\"_(View Release Notes)_\" onclick='openChanges(\"showchanges /tmp/plugins/"+pluginFilename+".txt\",\"_(Release Notes)_\")'></span><a class='ca_PluginUpdateInstall' onclick='ca_pluginUpdateInstall(\""+plugin+"\")'>"+result.linkMessage+"</a>";
|
|
if ( ! options.noDismiss ) {
|
|
HTML = HTML.concat("<span class='ca_PluginUpdateDismiss'><i class='fa fa-close' onclick='ca_hidePluginUpdate(\""+plugin+"\",\""+result.version+"\",\""+options.element+"\")'></i></span>");
|
|
}
|
|
result.HTML = HTML;
|
|
if ( ! options.dontShow ) {
|
|
$(options.element).html(HTML);
|
|
$(options.element).addClass("ca_element_notice");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if ( typeof options === "function" ) {
|
|
callback = options;
|
|
}
|
|
if ( typeof callback === "function" ) {
|
|
callback(JSON.stringify(result));
|
|
}
|
|
});
|
|
}
|
|
</script>
|