diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 050adbfa1..ce6b12a21 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_schedule: quarterly repos: - repo: https://github.com/pre-commit/mirrors-eslint - rev: 'v9.20.1' + rev: 'v9.21.0' hooks: - id: eslint - repo: https://github.com/astral-sh/ruff-pre-commit diff --git a/htdocs/sites/hist.js b/htdocs/sites/hist.js new file mode 100644 index 000000000..52fe2e2f8 --- /dev/null +++ b/htdocs/sites/hist.js @@ -0,0 +1,5 @@ +/* global $ */ + +$(document).ready(() => { + $("#thetable").DataTable(); +}); \ No newline at end of file diff --git a/htdocs/sites/hist.phtml b/htdocs/sites/hist.phtml index df855e94d..a0feb02ea 100644 --- a/htdocs/sites/hist.phtml +++ b/htdocs/sites/hist.phtml @@ -1,5 +1,4 @@ {$lstr}{$title} {$nstr} SundayMondayTuesdayWednesday ThursdayFridaySaturday -EOF; +EOM; // Handle the first week $now = $sts; @@ -322,12 +321,12 @@ $htmlout .= <<< EOM exists as well.

EOM; -$content = <<
-EOF; +EOM; $startyear = 2002; if (!is_null($metadata["archive_begin"])) { $startyear = $metadata["archive_begin"]->format("Y"); @@ -365,11 +364,6 @@ $t->headextra = <<jsextra = << - - + EOM; $t->render('sites.phtml'); diff --git a/htdocs/vtec/yearly_counts.php b/htdocs/vtec/yearly_counts.php index c95fd7b87..f13a593bf 100644 --- a/htdocs/vtec/yearly_counts.php +++ b/htdocs/vtec/yearly_counts.php @@ -6,21 +6,23 @@ require_once "../../include/vtec.php"; require_once "../../include/network.php"; require_once "../../include/forms.php"; +require_once "../../include/imagemaps.php"; $nt = new NetworkTable("WFO"); $clobber = isset($_REQUEST["clobber"]); -$wfo = isset($_REQUEST["wfo"]) ? strtoupper(substr(xssafe($_REQUEST["wfo"]), 0, 3)) : null; +$wfo = isset($_REQUEST["wfo"]) ? strtoupper(substr(xssafe($_REQUEST["wfo"]), 0, 4)) : "_ALL"; +$wfo3 = unrectify_wfo($wfo); $phenomena = isset($_REQUEST["phenomena"]) ? strtoupper(substr(xssafe($_REQUEST["phenomena"]), 0, 2)) : null; $significance = isset($_REQUEST["significance"]) ? strtoupper(substr(xssafe($_REQUEST["significance"]), 0, 1)) : null; $wfoLimiter = ""; $wfoMsg = "Data for all WFOs shown"; -if ($wfo) { - $wfoLimiter = " and wfo = '{$wfo}' "; +if ($wfo != "_ALL") { + $wfoLimiter = " and wfo = '{$wfo3}' "; $wfoMsg = "Data for only $wfo shown"; } -$p1 = make_select("phenomena", $phenomena, $vtec_phenomena); -$s1 = make_select("significance", $significance, $vtec_significance); +$p1 = make_select("phenomena", $phenomena, $vtec_phenomena, $showvalue = TRUE); +$s1 = make_select("significance", $significance, $vtec_significance, $showvalue = TRUE); $t = new MyView(); $t->title = "VTEC Yearly Event Counts"; @@ -34,12 +36,13 @@ function get_data() $dbconn, " SELECT yr, phenomena, significance, count(*) from - (SELECT distinct extract(year from issue) as yr, wfo, + (SELECT distinct vtec_year as yr, wfo, phenomena, significance, eventid from warnings WHERE significance is not null and phenomena is not null and issue > '1980-01-01' $wfoLimiter) as foo GROUP by yr, phenomena, significance - "); + " + ); $data = array(); $pcodes = array(); @@ -64,12 +67,13 @@ function get_data2() $dbconn, " WITH data as ( - SELECT distinct wfo, eventid, extract(year from issue) as yr + SELECT distinct wfo, eventid, vtec_year as yr from warnings where phenomena = '$phenomena' and significance = '$significance' ) SELECT wfo, yr, count(*) from data GROUP by wfo, yr - "); + " + ); $data = array(); for ($i = 0; $row = pg_fetch_assoc($rs); $i++) { @@ -99,7 +103,7 @@ function get_data2() $table = << - PSPhenomenaSignificance + PSPhenomenaSignificance EOF; $years = array_keys($data); asort($years); @@ -144,7 +148,7 @@ function get_data2() $table = << - WFOWFO Name + WFOWFO Name EOF; $years = array_keys($data); asort($years); @@ -154,14 +158,15 @@ function get_data2() $table .= "\n"; foreach ($nt->table as $key => $val) { + $wfo3 = unrectify_wfo($key); $table .= sprintf( "%s%s", $key, $val["name"] ); foreach ($years as $i => $yr) { - if (array_key_exists($key, $data[$yr])) { - $table .= sprintf("%s", $data[$yr][$key]); + if (array_key_exists($wfo3, $data[$yr])) { + $table .= sprintf("%s", $data[$yr][$wfo3]); } else { $table .= "0"; } @@ -197,18 +202,18 @@ function get_data2() your favorite spreadsheet program for further analysis... $cachedwarning - +

Option 1: All VTEC Events by Year

Limit Numbers by WFO: EOF; -$content .= " diff --git a/scripts/util/set_iemdb_etc_hosts.py b/scripts/util/set_iemdb_etc_hosts.py index 186ae39d2..6f328c5f4 100644 --- a/scripts/util/set_iemdb_etc_hosts.py +++ b/scripts/util/set_iemdb_etc_hosts.py @@ -26,7 +26,7 @@ "-isuag": IPS[DB1], "-kcci": IPS[DB1], "-mesonet": IPS[DB1], - "-mesosite": IPS[DB1], + "-mesosite": IPS[DB2], # needs 10g "-mos": IPS[DB1], "-nc1018": IPS[DB1], "-nldn": IPS[DB2],