Skip to content

Commit

Permalink
RC candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
Squidly271 committed Mar 12, 2017
1 parent 9bf6208 commit 64e1f98
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 4 deletions.
Binary file modified archive/ca.turbo-2017.03.11-x86_64-1.txz
Binary file not shown.
2 changes: 1 addition & 1 deletion plugins/ca.turbo.plg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!ENTITY name "ca.turbo">
<!ENTITY author "Andrew Zawadzki">
<!ENTITY version "2017.03.11">
<!ENTITY md5 "a16345d0e51b66c0977bf30d20c801c8">
<!ENTITY md5 "3e9b43551741d7b6364e339258d1075a">
<!ENTITY launch "Settings/Turbo">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY github "Squidly271/ca.turbo">
Expand Down
41 changes: 38 additions & 3 deletions source/ca.turbo/usr/local/emhttp/plugins/ca.turbo/Turbo.page
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ Icon="turbo.png"
---
<?
$plugin = "ca.turbo";

require_once("/usr/local/emhttp/plugins/ca.turbo/include/caCredits.php");
$installedVersion = exec("/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin version /var/log/plugins/ca.turbo.plg");
if ( is_file("/tmp/plugins/community.applications.plg") ) {
$upgradeVersion = exec("/usr/local/emhttp/plugins/dynamix.plugin.manager/scripts/plugin version /tmp/plugins/ca.turbo.plg");
} else {
$upgradeVersion = "0";
}
function getPluginSettings() {
$settings = @parse_ini_file("/usr/local/emhttp/plugins/ca.turbo/default.ini");
$userSettings = @parse_ini_file("/boot/config/plugins/ca.turbo/settings.ini");
Expand Down Expand Up @@ -32,6 +38,7 @@ foreach ($unRaidDisks as $disk) {
var URL = "/plugins/ca.turbo/include/exec.php";

$(function() {
if ( "<?=$installedVersion?>" < "<?=$upgradeVersion?>" ) { $('#update').show(); }
<?$keys = array_keys($cfg);?>
<?foreach($keys as $key):?>
$('#<?=$key?>').val("<?=$cfg[$key]?>");
Expand Down Expand Up @@ -83,9 +90,34 @@ function applySettings() {
}
});
}

function showCredits() {
myAlert("CA Auto Turbo Mode","<?=$caCredits?>","/plugins/<?=$plugin?>/images/turbo.png","40x40", true, false, true);
}

function myAlert(description,textdescription,textimage,imagesize, outsideClick, showCancel, showConfirm, alertType) {
if ( !outsideClick ) outsideClick = false;
if ( !showCancel ) showCancel = false;
if ( !showConfirm ) showConfirm = false;
if ( imagesize == "" ) { imagesize = "80x80"; }
swal({
title: description,
text: textdescription,
imageUrl: textimage,
imageSize: imagesize,
allowOutsideClick: outsideClick,
showConfirmButton: showConfirm,
showCancelButton: showCancel,
type: alertType,
html: true
});
}

</script>

> help
<span id='update' hidden><font color='red'>An update to this plugin is available</font><br><br></span>

> Note that certain hardware combinations may actually result in lower speeds when utilizing Turbo (read / reconstruct) mode

<dl>
<dt>Enable Automatic Turbo Mode:</dt>
Expand Down Expand Up @@ -144,4 +176,7 @@ function applySettings() {
<dt>Turbo Mode Enabled:</dt>
<dd><span id='turboOn'><font color='red'>Script Not Running</font></span></dd>
</dl>
<span id='miscScript'></span>
<span id='miscScript'></span>

<center><b>For support for this plugin, visit <a href='https://forums.lime-technology.com/topic/55671-plugin-ca-auto-turbo-write-mode/'>HERE</a></center>
<a href="Settings/caHelp" target='_blank'>CA Manual</a><a style='float:right;cursor:pointer' onclick='showCredits();'>Credits</a><br><br></span>
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?
######################################################
# #
# CA Auto Turbo Mode copyright 2017, Andrew Zawadzki #
# #
######################################################

function getLineCount($directory) {
global $lineCount;

$allFiles = array_diff(scandir($directory),array(".",".."));
foreach ($allFiles as $file) {
if (is_dir("$directory/$file")) {
getLineCount("$directory/$file");
continue;
}
$extension = pathinfo("$directory/$file",PATHINFO_EXTENSION);
if ( $extension == "sh" || $extension == "php" || $extension == "page" ) {
$lineCount = $lineCount + count(file("$directory/$file"));
}
}
}

$caCredits = "
<center><table align:'center'>
<tr>
<td><img src='http://www.jrj-socrates.com/Cartoon%20Pics/Misc/Tripping%20The%20Rift/Chode_300.gif' width='50px';height='48px'></td>
<td><strong>Andrew Zawadzki</strong></td>
<td>Main Development</td>
</tr>
</table></center>
<br>
<center><em><font size='1'>Copyright 2017 Andrew Zawadzki</font></em></center>
<center><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7M7CBCVU732XG' target='_blank'><img src='https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif'></a></center>
<br><center><a href='http://lime-technology.com/forum/index.php?topic=40262.0' target='_blank'>Plugin Support Thread</a></center>
";
getLineCount("/usr/local/emhttp/plugins/ca.turbo");
$caCredits .= "<center>$lineCount Lines of code and counting!</center>";
$caCredits = str_replace("\n","",$caCredits);
?>

0 comments on commit 64e1f98

Please sign in to comment.