Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions assets/_load.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,28 @@
<img src="loading-animation.gif" />
<h1 class="header">Starting Endless Key</h1>
<p class="message">Please wait; this may take some time.</p>
<p class="message">Is online? <span id="mytest" /></p>
</div>
<div class="footer">
<h5>Powered by Kolibri</h5>
<img src="kolibri-icon.png" />
</div>
<script>
function setOnlineLabel (online) {
const text = online ? "yes" : "no";
document.getElementById("mytest").textContent = text;
}

const online = navigator.onLine;
setOnlineLabel(online);

window.addEventListener('offline', function(e) {
setOnlineLabel(false);
});

window.addEventListener('online', function(e) {
setOnlineLabel(true);
});
</script>
</body>
</html>
22 changes: 11 additions & 11 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ def _enable_kolibri_plugin(plugin_name: str, optional=False) -> bool:
except FileNotFoundError:
pass

# we need to initialize Kolibri to allow us to access the app key
initialize()
# # we need to initialize Kolibri to allow us to access the app key
# initialize()

# start kolibri server
logging.info("Starting kolibri server via Android service...")
start_service("server")
# # start kolibri server
# logging.info("Starting kolibri server via Android service...")
# start_service("server")

# Tie up this thread until the server is running
wait_for_status(STATUS_RUNNING, timeout=120)
# # Tie up this thread until the server is running
# wait_for_status(STATUS_RUNNING, timeout=120)

_, port, _, _ = _read_pid_file(PID_FILE)
# _, port, _, _ = _read_pid_file(PID_FILE)

start_url = "http://127.0.0.1:{port}".format(port=port) + interface.get_initialize_url()
loadUrl(start_url)
# start_url = "http://127.0.0.1:{port}".format(port=port) + interface.get_initialize_url()
# loadUrl(start_url)

start_service("remoteshell")
# start_service("remoteshell")

while True:
time.sleep(0.05)