aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-01 15:59:50 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-01 15:59:50 +0800
commit06cd1295fd4035fc01dde2212fe403de7545857b (patch)
tree50e268fa7123aa872ac7cb24c8d6cf6897390f10
parent9bf32d1c5f522cdc205f1d9d9b98d92bd7b45011 (diff)
downloadfg21sim-06cd1295fd4035fc01dde2212fe403de7545857b.tar.bz2
webui: Add the index and configs templates
-rw-r--r--fg21sim/webui/templates/configs.html451
-rw-r--r--fg21sim/webui/templates/index.html38
2 files changed, 489 insertions, 0 deletions
diff --git a/fg21sim/webui/templates/configs.html b/fg21sim/webui/templates/configs.html
new file mode 100644
index 0000000..2c6aaf6
--- /dev/null
+++ b/fg21sim/webui/templates/configs.html
@@ -0,0 +1,451 @@
+{#
+ # Copyright (c) 2016 Weitian LI <liweitianux@live.com>
+ # MIT license
+ #
+ # Configuration part
+ #}
+<section id="configs" class="container target">
+ <h2>Configurations</h2>
+ <hr />
+
+ <!-- Configuration Form -->
+ <form id="conf-form" class="form-inline">
+ <!-- General controlling configs -->
+ <fieldset id="conf-control">
+ <div class="row">
+ <div class="column column-50 form-group">
+ <label for="conf-workdir">Working Directory:</label>
+ <input class="form-control" type="text" id="conf-workdir" name="workdir" />
+ </div>
+ <div class="column column-40 form-group">
+ <label for="conf-configfile">Configuration File:</label>
+ <input class="form-control" type="text" id="conf-configfile" name="configfile" />
+ </div>
+ </div>
+ <div class="text-center">
+ <!-- NOTE: HTML5 "button" element has a default behavior of submit.
+ Credit: https://stackoverflow.com/a/10836076/4856091
+ -->
+ <button type="button" class="button-small" id="reset-defaults"><span class="fa fa-undo" aria-hidden="true"></span> Reset to Defaults</button>
+ <button type="button" class="button-small" id="load-configfile"><span class="fa fa-download" aria-hidden="true"></span> Load from Configuration File</button>
+ <button type="button" class="button-small" id="save-configfile"><span class="fa fa-save" aria-hidden="true"></span> Save to Configuration File</button>
+ </div>
+ </fieldset>
+
+ <!-- Configuration section "[common]" -->
+ <fieldset id="conf-common">
+ <h4>Common</h4>
+ <hr class="hr-thin hr-condensed hr-dashed" />
+ <div class="row">
+ <div class="column column-30 form-group">
+ <label for="conf-common-nside"><i>N</i><sub>side</sub>:</label>
+ <input class="form-control" type="number" id="conf-common-nside" name="common/nside" />
+ </div>
+ <div class="column column-30 form-group">
+ <label for="conf-common-lmin"><i>l</i><sub>min</sub>:</label>
+ <input class="form-control" type="number" id="conf-common-lmin" name="common/lmin" />
+ </div>
+ <div class="column column-30 form-group">
+ <label for="conf-common-lmax"><i>l</i><sub>max</sub>:</label>
+ <input class="form-control" type="number" id="conf-common-lmax" name="common/lmax" />
+ </div>
+ </div>
+ <div class="row">
+ <fieldset id="conf-common-components" class="column checkboxes">
+ <!-- XXX: cannot inline if use "legend" tag -->
+ <label class="legend">Components:</label>
+ <div class="form-group">
+ <input class="form-control" type="checkbox" id="conf-common-components-gsync" name="common/components" value="galactic/synchrotron" />
+ <label for="conf-common-components-gsync">galactic/synchrotron</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="checkbox" id="conf-common-components-gfree" name="common/components" value="galactic/freefree" />
+ <label for="conf-common-components-gsync">galactic/freefree</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="checkbox" id="conf-common-components-gsnr" name="common/components" value="galactic/freefree" />
+ <label for="conf-common-components-gsync">galactic/snr</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="checkbox" id="conf-common-components-egcluster" name="common/components" value="extragalactic/clusters" />
+ <label for="conf-common-components-gsync">extragalactic/clusters</label>
+ </div>
+ </fieldset>
+ </div>
+ </fieldset>
+
+ <!-- Configuration section "[frequency]" -->
+ <fieldset id="conf-frequency">
+ <h4>Frequency</h4>
+ <hr class="hr-thin hr-condensed hr-dashed" />
+ <div class="row">
+ <div class="column column-30 form-group">
+ <label for="conf-frequency-unit">Unit:</label>
+ <input class="form-control" type="text" id="conf-frequency-unit" name="frequency/unit" />
+ </div>
+ </div>
+ <div class="row">
+ <fieldset id="conf-frequency-type" class="column radios">
+ <!-- XXX: cannot inline if use "legend" tag -->
+ <label class="legend">Type:</label>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-frequency-type-custom" name="frequency/type" value="custom" />
+ <label for="conf-frequency-type-custom">custom</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-frequency-type-calc" name="frequency/type" value="calc" />
+ <label for="conf-frequency-type-calc">calculate</label>
+ </div>
+ </fieldset>
+ </div>
+ <div class="row">
+ <div class="column column-60 form-group">
+ <label for="conf-frequency-frequencies">Custom Frequencies:</label>
+ <input class="form-control" type="text" id="conf-frequency-frequencies" name="frequency/frequencies" placeholder="comma-separated list of frequencies" />
+ </div>
+ </div>
+ <div class="row">
+ <fieldset id="conf-frequency-calc" class="column">
+ <!-- XXX: cannot inline if use "legend" tag -->
+ <label class="legend">Calculate Frequencies:</label>
+ <div class="form-group">
+ <label class="sr-only" for="conf-frequency-strat">Start</label>
+ <input class="form-control" type="number" id="conf-frequency-start" name="frequency/start" placeholder="start frequency" />
+ </div>
+ <div class="form-group">
+ <label class="sr-only" for="conf-frequency-stop">Stop</label>
+ <input class="form-control" type="number" id="conf-frequency-stop" name="frequency/stop" placeholder="stop frequency" />
+ </div>
+ <div class="form-group">
+ <label class="sr-only" for="conf-frequency-step">Step</label>
+ <input class="form-control" type="number" id="conf-frequency-step" name="frequency/step" placeholder="frequency step" />
+ </div>
+ </fieldset>
+ </div>
+ </fieldset>
+
+ <!-- Configuration section "[output]" -->
+ <fieldset id="conf-output">
+ <h4>Output</h4>
+ <hr class="hr-thin hr-condensed hr-dashed" />
+ <div class="row">
+ <div class="column column-30 form-group">
+ <label for="conf-output-unit">Unit:</label>
+ <input class="form-control" type="text" id="conf-output-unit" name="output/unit" />
+ </div>
+ </div>
+ <div class="row">
+ <fieldset id="conf-output-filetype" class="column radios">
+ <!-- XXX: cannot inline if use "legend" tag -->
+ <label class="legend">File Type:</label>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-output-filetype-fits" name="output/filetype" value="fits" checked="checked" />
+ <label for="conf-output-filetype-fits">FITS</label>
+ </div>
+ </fieldset>
+ </div>
+ <div class="row">
+ <div class="column column-50 form-group">
+ <label for="conf-output-filename-pattern">Filename Pattern:</label>
+ <input class="form-control" type="text" id="conf-output-filename-pattern" name="output/filename_pattern" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-output-use-float" name="output/use_float" value="true" checked="checked" />
+ <label for="conf-output-use-float">Use single-precision float instead of double</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-output-checksum" name="output/checksum" value="true" />
+ <label for="conf-output-checksum">Calculate the checksum for output files</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-output-clobber" name="output/clobber" value="true" />
+ <label for="conf-output-clobber">Overwrite existing files</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-output-combine" name="output/combine" value="true" />
+ <label for="conf-output-combine">Add all components and save the combined maps</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-output-combine-prefix">Combined Filename Prefix:</label>
+ <input class="form-control" type="text" id="conf-output-combine-prefix" name="output/combine_prefix" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-output-outdir">Combined Files Output Directory:</label>
+ <input class="form-control" type="text" id="conf-output-outdir" name="output/output_dir" />
+ </div>
+ </div>
+ </fieldset>
+
+ <!-- Configuration section "[cosmology]" -->
+ <fieldset id="conf-cosmology">
+ <h4>Cosmology</h4>
+ <hr class="hr-thin hr-condensed hr-dashed" />
+ <div class="row">
+ <div class="column column-50 form-group">
+ <label for="conf-cosmology-h0">Hubble Parameter (<i>H</i><sub>0</sub>):</label>
+ <input class="form-control" type="number" id="conf-cosmology-h0" name="cosmology/H0" />
+ </div>
+ <div class="column column-50 form-group">
+ <label for="conf-cosmology-omegam0">Matter Density (<i>Ω</i><sub>M0</sub>):</label>
+ <input class="form-control" type="number" id="conf-cosmology-omegam0" name="cosmology/OmegaM0" />
+ </div>
+ </div>
+ </fieldset>
+
+ <!-- Configuration section "[logging]" -->
+ <fieldset id="conf-logging">
+ <h4>Logging</h4>
+ <hr class="hr-thin hr-condensed hr-dashed" />
+ <div class="row">
+ <fieldset id="conf-logging-level" class="column radios">
+ <!-- XXX: cannot inline if use "legend" tag -->
+ <label class="legend">Level:</label>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-logging-level-debug" name="logging/level" value="DEBUG" />
+ <label for="conf-logging-level-debug">debug</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-logging-level-info" name="logging/level" value="INFO" checked="checked" />
+ <label for="conf-logging-level-info">info</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-logging-level-warning" name="logging/level" value="WARNING" />
+ <label for="conf-logging-level-warning">warning</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-logging-level-error" name="logging/level" value="ERROR" />
+ <label for="conf-logging-level-error">error</label>
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="radio" id="conf-logging-level-critical" name="logging/level" value="CRITICAL" />
+ <label for="conf-logging-level-critical">critical</label>
+ </div>
+ </fieldset>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-logging-format">Message Format:</label>
+ <input class="form-control" type="text" id="conf-logging-format" name="logging/format" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-logging-datefmt">Date/time Format:</label>
+ <input class="form-control" type="text" id="conf-logging-datefmt" name="logging/datefmt" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column">
+ <div class="form-group">
+ <label for="conf-logging-logfile">Log File:</label>
+ <input class="form-control" type="text" id="conf-logging-logfile" name="logging/filename" />
+ </div>
+ <div class="form-group">
+ <input class="form-control" type="checkbox" id="conf-logging-logfile-append" name="logging/filemode" value="a" checked="checked" />
+ <label for="conf-logging-logfile-append">Append mode</label>
+ </div>
+ </div>
+ </div>
+ </fieldset>
+
+ <!-- Configuration section "[galactic]" -->
+ <fieldset id="conf-g">
+ <h4>Galactic Components</h4>
+ <hr class="hr-thin hr-condensed hr-dashed" />
+
+ <!-- Configuration sub-section "[galactic][synchrotron]" -->
+ <fieldset id="conf-g-synchrotron">
+ <h5>Synchrotron Emission</h5>
+ <div class="row">
+ <div class="column column-40 form-group">
+ <label for="conf-g-synchrotron-template">Template Map:</label>
+ <input class="form-control" type="text" id="conf-g-synchrotron-template" name="galactic/synchrotron/template" />
+ </div>
+ <div class="column column-30 form-group">
+ <label for="conf-g-synchrotron-template-freq">Frequency:</label>
+ <input class="form-control" type="number" id="conf-g-synchrotron-template-freq" name="galactic/synchrotron/template_freq" placeholder="MHz" />
+ </div>
+ <div class="column column-30 form-group">
+ <label for="conf-g-synchrotron-template-unit">Unit:</label>
+ <input class="form-control" type="text" id="conf-g-synchrotron-template-unit" name="galactic/synchrotron/template_unit" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column column-40 form-group">
+ <label for="conf-g-synchrotron-indexmap">Spectral Index Map:</label>
+ <input class="form-control" type="text" id="conf-g-synchrotron-indexmap" name="galactic/synchrotron/indexmap" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-g-synchrotron-smallscales" name="galactic/synchrotron/add_smallscales" value="true" checked="checked" />
+ <label for="conf-g-synchrotron-smallscales">Add fluctuations on the small scales based on the angular power spectrum</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-g-synchrotron-save" name="galactic/synchrotron/save" value="true" checked="checked" />
+ <label for="conf-g-synchrotron-save">Save this component standalone</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-g-synchrotron-prefix">Filename Prefix:</label>
+ <input class="form-control" type="text" id="conf-g-synchrotron-prefix" name="galactic/synchrotron/prefix" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-g-synchrotron-outdir">Output Directory:</label>
+ <input class="form-control" type="text" id="conf-g-synchrotron-outdir" name="galactic/synchrotron/output_dir" />
+ </div>
+ </div>
+ </fieldset>
+
+ <!-- Configuration sub-section "[galactic][freefree]" -->
+ <fieldset id="conf-g-freefree">
+ <h5>Free-free Emission</h5>
+ <div class="row">
+ <div class="column column-40 form-group">
+ <label for="conf-g-freefree-halphamap">Hα Template Map:</label>
+ <input class="form-control" type="text" id="conf-g-freefree-halphapam" name="galactic/freefree/halphamap" />
+ </div>
+ <div class="column column-30 form-group">
+ <label for="conf-g-freefree-halphamap-unit">Unit:</label>
+ <input class="form-control" type="text" id="conf-g-freefree-halphamap-unit" name="galactic/freefree/halphamap_unit" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column column-40 form-group">
+ <label for="conf-g-freefree-dustmap">Dust Template Map:</label>
+ <input class="form-control" type="text" id="conf-g-freefree-dustmap" name="galactic/freefree/dustmap" />
+ </div>
+ <div class="column column-30 form-group">
+ <label for="conf-g-freefree-dustmap-unit">Unit:</label>
+ <input class="form-control" type="text" id="conf-g-freefree-dustmap-unit" name="galactic/freefree/dustmap_unit" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-g-freefree-save" name="galactic/freefree/save" value="true" checked="checked" />
+ <label for="conf-g-freefree-save">Save this component standalone</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-g-freefree-prefix">Filename Prefix:</label>
+ <input class="form-control" type="text" id="conf-g-freefree-prefix" name="galactic/freefree/prefix" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-g-freefree-outdir">Output Directory:</label>
+ <input class="form-control" type="text" id="conf-g-freefree-outdir" name="galactic/freefree/output_dir" />
+ </div>
+ </div>
+ </fieldset>
+
+ <!-- Configuration sub-section "[galactic][snr]" -->
+ <fieldset id="conf-g-snr">
+ <h5>Supernova Remnants Emission</h5>
+ <div class="row">
+ <div class="column column-50 form-group">
+ <label for="conf-g-snr-catalog">Input Catalog:</label>
+ <input class="form-control" type="text" id="conf-g-snr-catalog" name="galactic/snr/catalog" />
+ </div>
+ <div class="column column-50 form-group">
+ <label for="conf-g-snr-catalog-out">Output Catalog:</label>
+ <input class="form-control" type="text" id="conf-g-snr-catalog-out" name="galactic/snr/catalog_outfile" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-g-snr-resolution">Grid Resolution:</label>
+ <input class="form-control" type="number" id="conf-g-snr-resolution" name="galactic/snr/resolution" placeholder="arcmin" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-g-snr-save" name="galactic/snr/save" value="true" checked="checked" />
+ <label for="conf-g-snr-save">Save this component standalone</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-g-snr-prefix">Filename Prefix:</label>
+ <input class="form-control" type="text" id="conf-g-snr-prefix" name="galactic/snr/prefix" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-g-snr-outdir">Output Directory:</label>
+ <input class="form-control" type="text" id="conf-g-snr-outdir" name="galactic/snr/output_dir" />
+ </div>
+ </div>
+ </fieldset>
+ </fieldset>
+
+ <!-- Configuration section "[extragalactic]" -->
+ <fieldset id="conf-eg">
+ <h4>Extragalactic Components</h4>
+ <hr class="hr-thin hr-condensed hr-dashed" />
+
+ <!-- Configuration sub-section "[extragalactic][clusters]" -->
+ <fieldset id="conf-eg-clusters">
+ <h5>Clusters of Galaxies Emission</h5>
+ <div class="row">
+ <div class="column column-50 form-group">
+ <label for="conf-eg-clusters-catalog">Input Catalog:</label>
+ <input class="form-control" type="text" id="conf-eg-clusters-catalog" name="extragalactic/clusters/catalog" />
+ </div>
+ <div class="column column-50 form-group">
+ <label for="conf-eg-clusters-catalog-out">Output Catalog:</label>
+ <input class="form-control" type="text" id="conf-eg-clusters-catalog-out" name="extragalactic/clusters/catalog_outfile" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-eg-clusters-halo-fraction">Halo Fraction:</label>
+ <input class="form-control" type="number" id="conf-eg-clusters-halo-fraction" name="extragalactic/clusters/halo_fraction" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-eg-clusters-resolution">Grid Resolution:</label>
+ <input class="form-control" type="number" id="conf-eg-clusters-resolution" name="extragalactic/clusters/resolution" placeholder="arcmin" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <input class="form-control" type="checkbox" id="conf-eg-clusters-save" name="extragalactic/clusters/save" value="true" checked="checked" />
+ <label for="conf-eg-clusters-save">Save this component standalone</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-eg-clusters-prefix">Filename Prefix:</label>
+ <input class="form-control" type="text" id="conf-eg-clusters-prefix" name="extragalactic/clusters/prefix" />
+ </div>
+ </div>
+ <div class="row">
+ <div class="column form-group">
+ <label for="conf-eg-clusters-outdir">Output Directory:</label>
+ <input class="form-control" type="text" id="conf-eg-clusters-outdir" name="extragalactic/clusters/output_dir" />
+ </div>
+ </div>
+ </fieldset>
+ </fieldset>
+ </form>
+</section>
diff --git a/fg21sim/webui/templates/index.html b/fg21sim/webui/templates/index.html
new file mode 100644
index 0000000..2d5091e
--- /dev/null
+++ b/fg21sim/webui/templates/index.html
@@ -0,0 +1,38 @@
+{#
+ # Copyright (c) 2016 Weitian LI <liweitianux@live.com>
+ # MIT license
+ #
+ # Index page for the Web UI of "fg21sim"
+ #}
+
+{% extends "base.html" %}
+
+{% block title %}fg21sim Web UI{% end %}
+
+{% block extra_head %}
+ <meta name="author" content="Weitian LI" />
+ <meta name="description" content="fg21sim: Realistic Foregrounds Simulation for EoR 21cm Signal Detection" />
+ <link rel="icon" type="image/png" href="{{ static_url('images/favicon.png') }}" />
+{% end %}
+
+{% block header %}
+ {% include "header.html" %}
+{% end %}
+
+{% block main %}
+ {% include "configs.html" %}
+
+ <section id="xxx-results" class="container target">
+ <h2 id="results">Results</h2>
+ <p>Simulation results go here :)</p>
+ </section>
+
+ <section id="logs" class="container target">
+ <h2>Logs</h2>
+ <p>Logging messages should go here :)</p>
+ </section>
+{% end %}
+
+{% block footer %}
+ {% include "footer.html" %}
+{% end %}