brightway2-ui / bw2ui / web / templates / settings.html

{% extends "base.html" %}

{% block body %}
<h1>Brightway2 settings</h1>
<form action="/settings" method="POST">
  <div class="span-12">
  <fieldset>
    <legend>Basic configuration</legend>
    <p>Use temporary directories (default: <b>No</b>): <input type="checkbox" name="use-temp-dir" {% if config.p.use_temp_dir %}checked{% endif %}></p>
    <p>Use process cache (default: <b>Yes</b>): <input type="checkbox" name="use-cache" {% if config.p.use_cache %}checked{% endif %}></p>
  </fieldset>
  <fieldset>
    <legend>Monte Carlo</legend>
    <p>Number of CPU cores to use (maximum <b>{{ cpu_count }}</b>): <br><input type="number" name="cpu-cores" min="1" max="{{ cpu_count }}" step="1" value="{% if config.p.cpu_cores %}{{ config.p.cpu_cores }}{% else %}{{ cpu_count }}{% endif %}"></p>
    <p>Number of Monte Carlo iterations in a calculation (default <b>10000</b>, minimum: <b>100</b>): <br> <button id="speedtest">Set this value based on my computer</button> <input name="iterations" type="number" value="{% if config.p.iterations %}{{ config.p.iterations }}{% else %}10000{% endif %}" min="100"> </p>
  </fieldset>
  </div>
  <div class="span-12 last">
  <fieldset>
    <legend>Report uploading</legend>
    <p>Upload report data to external server (experimental; default: <b>No</b>): <input type="checkbox" name="upload-reports" {% if config.p.upload_reports %}checked{% endif %}></p>
    <p>External report server (experimental; default <i>reports.brightwaylca.org</i>): <br> <button id="reset-server">Reset to default</button> <input size="60" name="report-server" type="url" value="{% if config.p.report_server %}{{ config.p.report_server }}{% else %}http://reports.brightwaylca.org{% endif %}"> </p>
  </fieldset>
    <button type="submit">Save preferences</button>
  </div>
</form>

<script type="text/javascript">
$(document).ready( function() {
  $('#speedtest').click( function (e) {
    e.preventDefault();
    $("#speedtest").html("Working...");
    $.ajax({
      type: "GET",
      url: "/speedtest",
      success: function (a) {
        $('form input[name=iterations]').attr("value", a);
        $("#speedtest").html("Test again");
      }
    });
  });

  $('#reset-server').click( function (e) {
    e.preventDefault();
    $("form input[name=report-server]").attr("value", "http://reports.brightwaylca.org");
  });
});
</script>
{% endblock %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.