From 4f0c7795fe1eef6f898452599c89107b967b1e86 Mon Sep 17 00:00:00 2001 From: kanoi Date: Wed, 28 Jan 2015 18:58:05 +1100 Subject: [PATCH 1/4] php - LQ iDevice menus --- pool/page.php | 53 +++++++++++++++++++++++++++++++++----------------- pool/prime.php | 6 ++---- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/pool/page.php b/pool/page.php index 3c957351..ce30eac1 100644 --- a/pool/page.php +++ b/pool/page.php @@ -84,6 +84,8 @@ function pghead($script_marker, $name) { global $page_title; + $iCrap = strpos($_SERVER['HTTP_USER_AGENT'],'iP'); + $head = "\n"; $head .= "$page_title$name"; @@ -118,10 +120,15 @@ input.tiny {width: 0px; height: 0px; margin: 0px; padding: 0px; outline: none; b #n42 td {min-width: 100px; float: left; vertical-align: top; padding: 0px 2px;} #n42 td.navboxr {float: right;} #n42 td.nav {position: relative;} +#n42 td.ts {border-width: 1px; border-color: #02e; border-style: solid none none none;}"; +if (!$iCrap) +{ + $head .= " #n42 div.sub {left: 0px; z-index: 42; position: absolute; visibility: hidden;} -#n42 td.ts {border-width: 1px; border-color: #02e; border-style: solid none none none;} #n42 td.nav:hover {background:#09e;} -#n42 td.nav:hover div.sub {background:#07e; visibility: visible;} +#n42 td.nav:hover div.sub {background:#07e; visibility: visible;}"; +} + $head .= " h1 {margin-top: 20px; float:middle; font-size: 20px;} .foot, .push {height: 50px; font-size: 10pt;} .title {background-color: #909090;} @@ -295,34 +302,34 @@ function pgtop($info, $dotop, $user, $douser) $lhn = $info['now'] - $info['lasthb']; $lwn = $info['now'] - $info['lastwi']; if ($lsn < 2) - $lsc = 'green'; + $lsc = 'green.gif'; else { if ($lsn < 4) - $lsc = 'orange'; + $lsc = 'orange.png'; else - $lsc = 'red'; + $lsc = 'red.png'; } if ($lhn < 3) - $lhc = 'green'; + $lhc = 'green.gif'; else { if ($lhn < 6) - $lhc = 'orange'; + $lhc = 'orange.png'; else - $lhc = 'red'; + $lhc = 'red.png'; } if ($lwn < 36) - $lwc = 'green'; + $lwc = 'green.gif'; else { if ($lwn < 46) - $lwc = 'orange'; + $lwc = 'orange.png'; else - $lwc = 'red'; + $lwc = 'red.png'; } $img1 = ' $item) + if ($iCrap) { + foreach ($submenus as $submenu => $item) + $ret .= "".makeLink($item)."$submenu"; + } + else + { + $ret .= ""; + $first = true; + foreach ($submenus as $submenu => $item) + { if ($first == true) { $first = false; @@ -437,10 +453,11 @@ function pgmenu($menus) $ret .= '
'; } $ret .= ""; - } - if ($first == false) + } + if ($first == false) $ret .= '
".makeLink($item,'class=as')."$submenu
'; - $ret .= ''; + $ret .= ''; + } } $ret .= "\n"; return $ret; diff --git a/pool/prime.php b/pool/prime.php index 2ac16d2e..ebecb23e 100644 --- a/pool/prime.php +++ b/pool/prime.php @@ -53,7 +53,7 @@ function def_menu() ), 'gap' => array( # options not shown 'API' => 'api'), - 'Help' => array('Help' => 'help', + 'Help' => array( 'Payouts' => 'payout')); return $dmenu; } @@ -84,9 +84,7 @@ function check() 'PBlocks' => 'pblocks' ), 'Help' => array( - 'Payouts' => 'payout', - 'Workers ' => 'workers', - 'Blocks' => 'blocks' + 'Payouts' => 'payout' ) ); tryLogInOut(); From b0374a878538a40505cafb236496fa2a57408c1c Mon Sep 17 00:00:00 2001 From: kanoi Date: Wed, 28 Jan 2015 19:05:00 +1100 Subject: [PATCH 2/4] php - increase page light limits --- pool/page.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pool/page.php b/pool/page.php index ce30eac1..633ea0d1 100644 --- a/pool/page.php +++ b/pool/page.php @@ -301,26 +301,26 @@ function pgtop($info, $dotop, $user, $douser) $lsn = $info['now'] - $info['lastsh']; $lhn = $info['now'] - $info['lasthb']; $lwn = $info['now'] - $info['lastwi']; - if ($lsn < 2) - $lsc = 'green.gif'; + if ($lsn < 8) + $lsc = 'green.png'; else { - if ($lsn < 4) + if ($lsn < 10) $lsc = 'orange.png'; else $lsc = 'red.png'; } - if ($lhn < 3) - $lhc = 'green.gif'; + if ($lhn < 5) + $lhc = 'green.png'; else { - if ($lhn < 6) + if ($lhn < 10) $lhc = 'orange.png'; else $lhc = 'red.png'; } if ($lwn < 36) - $lwc = 'green.gif'; + $lwc = 'green.png'; else { if ($lwn < 46) From f85d87b93c2cdd91768823dd3d24b1fa82fc044a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 28 Jan 2015 19:35:21 +1100 Subject: [PATCH 3/4] Push version to 0.8.4 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index a403b1f5..c16c6dff 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(ckpool, 0.8.3, kernel@kolivas.org) +AC_INIT(ckpool, 0.8.4, kernel@kolivas.org) AC_CANONICAL_SYSTEM AC_CONFIG_MACRO_DIR([m4]) From b584cd06548833fea839db0bca64fec73cb4bf64 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 28 Jan 2015 20:16:09 +1100 Subject: [PATCH 4/4] Don't try to respawn dead processes for now --- src/ckpool.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ckpool.c b/src/ckpool.c index ca07b3c2..bcc28fd0 100644 --- a/src/ckpool.c +++ b/src/ckpool.c @@ -1204,14 +1204,18 @@ static proc_instance_t *child_by_pid(ckpool_t *ckp, pid_t pid) static void *watchdog(void *arg) { +#if 0 time_t last_relaunch_t = time(NULL); +#endif ckpool_t *ckp = (ckpool_t *)arg; rename_proc("watchdog"); sleep(1); while (42) { proc_instance_t *pi; +#if 0 time_t relaunch_t; +#endif int pid, status; pid = waitpid(0, &status, 0); @@ -1220,6 +1224,9 @@ static void *watchdog(void *arg) LOGWARNING("Child process %s exited, terminating!", pi->processname); break; } +#if 0 + /* Don't bother trying to respawn for now since communication + * breakdown between the processes will make them exit. */ relaunch_t = time(NULL); if (relaunch_t == last_relaunch_t) { LOGEMERG("Respawning processes too fast, exiting!"); @@ -1233,6 +1240,12 @@ static void *watchdog(void *arg) LOGEMERG("Unknown child process %d dead, exiting!", pid); break; } +#else + if (pi) + LOGEMERG("%s process dead, terminating!", pi->processname); + else + LOGEMERG("Unknown child process %d dead, exiting!", pid); +#endif } send_proc(&ckp->main, "shutdown"); return NULL;