Skip to content

Commit

Permalink
added the about settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
GChristensen committed Oct 25, 2022
1 parent cd6ee79 commit 1edf2da
Show file tree
Hide file tree
Showing 22 changed files with 261 additions and 170 deletions.
127 changes: 0 additions & 127 deletions changelog.md

This file was deleted.

4 changes: 2 additions & 2 deletions enso/commands/dd_wrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ def cmd_switch_wireless(ensoapi):
tn.read_all()

def cmd_wake(ensoapi, machine):
"""Wake a workstation with a magic packet sent to a given MAC-address
"""Wake a machine with a magic packet sent to a given MAC-address
Requires the following variables at the custom initialization block:<br>
DD_WRT_HOST = "dd-wrt router ip" #default: "192.168.1.1"<br>
DD_WRT_USER = "dd-wrt user" #default: "root"<br>
DD_WRT_PASSWORD = "my_dd_wrt_password"<br>
DD_WRT_MACHINES = {'server': "AA:BB:CC:DD:EE:FF", 'gateway': "AA:BB:CC:DD:EE:FE"}
DD_WRT_MACHINES = {'server': "AA:BB:CC:DD:EE:FF"} # machine MACs
"""
tn = Telnet(HOST, 23)
tn.read_until(b"login: ")
Expand Down
5 changes: 3 additions & 2 deletions enso/enso/webui.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import threading, uuid, platform, logging, os, random, string, json
import threading, uuid, platform, logging, os, random, string, json, mimetypes
import enso.messages

import enso
Expand Down Expand Up @@ -40,6 +40,7 @@ def my_static(filename):
if filename.endswith(".html"):
return inject_enso_token(filename)
else:
print(mimetypes.guess_type(filename))
return send_from_directory("webui", filename)


Expand Down Expand Up @@ -114,7 +115,7 @@ def get_enso_set_config(key, value):
@app.route('/api/enso/get/config_dir')
@requires_auth
def get_enso_get_config_dir():
return config.ENSO_USER_DIR
return config.ENSO_USER_DIR.replace("\\", "/")


@app.route('/api/enso/open/config_dir')
Expand Down
6 changes: 4 additions & 2 deletions enso/enso/webui/API.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@
<li><a href="edit.html">Command Editor</a></li>
<li class="selected"><a href="API.html">API Reference</a></li>
<li><a href="tutorial.html">Tutorial</a></li>
<li><a href="about.html">About</a></li>
</ul>
</div>

<br clear="all"/>

<h1 style="margin-top: 25px"><a id="user-content-ubiquitywe-api-reference" class="anchor" aria-hidden="true" href="#ubiquitywe-api-reference"></a>Enso API Reference</h1>
<div style="width: 870px">
<h1 style="margin-top: 25px"><a id="user-content-enso-api-reference" class="anchor" aria-hidden="true" href="#enso-api-reference"></a>Enso API Reference</h1>
<h2>ensoapi object methods</h2>
<h3><a class="anchor" aria-hidden="true" href="#"></a>display_message(msg, caption=None)</h3>
<blockquote>
Expand Down Expand Up @@ -91,5 +92,6 @@ <h3><a class="anchor" aria-hidden="true" href="#"></a>findfirst_probe(category,
<p>Uses the default shell program to open the first <i>file</i> in the <b>directory</b>; uses the <b>player</b> if given. Obtains command arguments from the directory entries.<br><br>
The <b>category</b> parameter sets the name of the generated command argument.<br></p>
</blockquote>
</div>
</body>
</html>
138 changes: 138 additions & 0 deletions enso/enso/webui/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html>
<head>
<title>About iShell</title>
<meta charset="utf-8">
<meta name="enso-token" content="%%ENSO_TOKEN%%">
<link href="images/enso-16.png" rel="icon"/>
<link rel="stylesheet" type="text/css" media="all" href="options.css"/>

<style>
html, body {
height: 100%;
overflow: hidden;
}

body {
text-align: justify;
}

h1 {
color: #66bb00;
border-top: none;
margin-top: 60px;
}
h2 {
font-size: 18px;
margin-top: auto;
border-top: none
}

p {
font-size: 11pt;
}

#about-container {
width: 875px;
display: flex;
flex-direction: column;
height: 100%;
}

.about-link {
font-size: 12pt;
}

#about-version-panel {
margin-top: 15px;
}

#about-changes-header {
flex: 0;
width: 100%;
margin-top: 20px;
margin-bottom: 0;
text-align: center;
}

#about-changes {
margin: auto;
flex: 1;
width: 100%;
overflow-y: scroll;
font-size: 12pt;
}

#donation-links {
font-size: 12pt;
width: max-content;
margin: auto;
}

#about-changes * {
font-size: 12pt;
}

.change-date {
display: inline-block;
margin-left: 10px;
}

.change-info {
padding-left: 20px;
}

</style>

<script src="lib/jquery.min.js"></script>
<script src="enso.js"></script>
<script src="about.js"></script>
</head>
<body dir="ltr">
<div id="about-container">

<div class="head"><span class="large">Enso: </span>About</div>
<div id="nav-container">
<ul id="nav">
<li><a href="options.html">Settings</a></li>
<li><a href="commands.html">Your Commands</a></li>
<li><a href="cmenu.html">Context Menu</a></li>
<li><a href="edit.html">Command Editor</a></li>
<li><a href="API.html">API Reference</a></li>
<li><a href="tutorial.html">Tutorial</a></li>
<li class="selected"><a href="about.html">About</a></li>
</ul>
</div>

<br clear="all"/>

<div id="about-version-panel">
<div style="text-align: center">
<img id="enso-logo" src="images/logo.png" height="145"/>
<h1 style="font-size: 24pt; margin: 10px">Enso Launcher (Open-Source)</h1>
<h2 id="about-version">Version: </h2>
<div class="about-links">
<img width="16px" height="16px" src="images/enso-16.png" style="margin-bottom: -2px;"/>
<a class="about-link" href="https://gchristensen.github.io/enso-portable/" target="_blank">Homepage</a>
| <img width="16px" height="16px" src="icons/github.ico" style="margin-bottom: -2px;"/>
<a class="about-link" href="https://github.com/GChristensen/enso-portable/" target="_blank">GitHub</a>
</div>
<div class="about-links" style="margin-top: 20px;">
<div id="donation-links">
Donate:
<img width="16px" height="16px" src="icons/patreon.png" style="margin-bottom: -2px;"/>
<a class="about-link donation-link" href="https://patreon.com/gchristnsn" target="_blank">Patreon</a>
| <img width="16px" height="16px" src="icons/bitcoin.png" style="margin-bottom: -2px;"/>
<a class="about-link donation-link" href="bitcoin:bc1qvamez2h9x4y8txkjlzz8v3yuglmh7tq5wf5afg" target="_blank">Bitcoin</a>
</div>
</div>
</div>
</div>
<div id="about-changes-header">
<h2>Changes</h2>
</div>
<div id="about-changes"></div>

</div>
</body>
</html>
15 changes: 15 additions & 0 deletions enso/enso/webui/about.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//$("#about-changes").html(await fetchText("changes.html"));
//$("#about-version").text(`Version: ${chrome.runtime.getManifest().version}`);

$(() => {
$(".donation-link").on("mouseenter", e => { $("#enso-logo").prop("src", "images/donation_kitty.png"); console.log("aaa")});
$(".donation-link").on("mouseleave", e => $("#enso-logo").prop("src", "images/logo.png"));

ensoGet("/api/enso/version", function (data) {
$("#about-version").text("Version: " + data);
});

ensoGet("/changes.html", function (data) {
$("#about-changes").html(data);
});
});
Loading

0 comments on commit 1edf2da

Please sign in to comment.