Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Register
    • Login
    Introducing Netgate Nexus: Multi-Instance Management at Your Fingertips.

    pfSense Todo Widget

    Scheduled Pinned Locked Moved General pfSense Questions
    1 Posts 1 Posters 302 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • matyi.szabolcsM
      matyi.szabolcs
      last edited by matyi.szabolcs

      Hi everyone,
      I created a Todo widget and would like to share it in case you are interested. To ensure it remains after updates, it needs to be set up with the Filer plugin. It’s very simple; it only requires a PHP file and writes to a TXT file (/conf/todo_list.txt).

      So the steps are:

      System / Package Manager / Available Packages / Install "Filer"
      Diagnostics / Filer / Files / "Add"

      File: /usr/local/www/widgets/widgets/todo.widget.php
      Description: Todo Widget
      File Contents:

      <?php
      if ($_SERVER['REQUEST_METHOD'] === 'POST') {
          file_put_contents('/conf/todo_list.txt', $_POST['todo_list']);
          exit;
      }
      ?>
      
      <div>
          <form id="todo_form">
              <textarea name="todo_list" id="todo_list" rows="10" style="width:100%;"><?=htmlspecialchars(file_get_contents('/conf/todo_list.txt'))?></textarea>
              <button type="button" class="btn btn-primary btn-sm" id="save_todo">Save</button>
          </form>
          <div id="save_status"></div>
      </div>
      
      <script>
      document.getElementById('save_todo').addEventListener('click', function() {
          var xhr = new XMLHttpRequest();
          xhr.open('POST', '/widgets/widgets/todo.widget.php', true);
          xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
          xhr.onreadystatechange = function () {
              if (xhr.readyState === 4 && xhr.status === 200) {
                  document.getElementById('save_status').innerHTML = 'Saved!';
                  setTimeout(function() {
                      document.getElementById('save_status').innerHTML = '';
                  }, 2000);
              }
          };
          var data = 'todo_list=' + encodeURIComponent(document.getElementById('todo_list').value);
          xhr.send(data);
      });
      </script>
      

      Save

      Then you can add the Todo widget on the Status page.
      Enjoy!

      Filer_add_todo.png

      pfSense_todo-widget.png

      1 Reply Last reply
      Reply Quote 3

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post
      Copyright 2026 Rubicon Communications LLC (Netgate). All rights reserved.
      Privacy Policy · Cookie Policy