Skip to content

Commit

Permalink
Logout and settings (0.7.2)
Browse files Browse the repository at this point in the history
  • Loading branch information
iiPythonx committed Feb 19, 2024
1 parent 059ee85 commit 1ebd02a
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nightwatch/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.7.1"
__version__ = "0.7.2"
2 changes: 1 addition & 1 deletion nightwatch/desktop/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion nightwatch/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nightwatch-desktop"
version = "0.7.1"
version = "0.7.2"
description = "The chatting application to end all chatting applications."
authors = ["iiPython"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion nightwatch/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "nightwatch-desktop",
"version": "0.7.1"
"version": "0.7.2"
},
"tauri": {
"allowlist": {
Expand Down
32 changes: 26 additions & 6 deletions nightwatch/desktop/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@
<a class = "navbar-brand" id = "server-name">Nightwatch Server</a>
<ul class = "navbar-nav ms-auto mb-2 mb-lg-0">
<li class = "nav-item">
<a class = "nav-link">
<a class = "nav-link" id = "btn-settings" type = "button" data-bs-toggle="modal" data-bs-target = "#settings-modal">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-gear" viewBox="0 0 16 16">
<path d="M8 4.754a3.246 3.246 0 1 0 0 6.492 3.246 3.246 0 0 0 0-6.492M5.754 8a2.246 2.246 0 1 1 4.492 0 2.246 2.246 0 0 1-4.492 0"/>
<path d="M9.796 1.343c-.527-1.79-3.065-1.79-3.592 0l-.094.319a.873.873 0 0 1-1.255.52l-.292-.16c-1.64-.892-3.433.902-2.54 2.541l.159.292a.873.873 0 0 1-.52 1.255l-.319.094c-1.79.527-1.79 3.065 0 3.592l.319.094a.873.873 0 0 1 .52 1.255l-.16.292c-.892 1.64.901 3.434 2.541 2.54l.292-.159a.873.873 0 0 1 1.255.52l.094.319c.527 1.79 3.065 1.79 3.592 0l.094-.319a.873.873 0 0 1 1.255-.52l.292.16c1.64.893 3.434-.902 2.54-2.541l-.159-.292a.873.873 0 0 1 .52-1.255l.319-.094c1.79-.527 1.79-3.065 0-3.592l-.319-.094a.873.873 0 0 1-.52-1.255l.16-.292c.893-1.64-.902-3.433-2.541-2.54l-.292.159a.873.873 0 0 1-1.255-.52zm-2.633.283c.246-.835 1.428-.835 1.674 0l.094.319a1.873 1.873 0 0 0 2.693 1.115l.291-.16c.764-.415 1.6.42 1.184 1.185l-.159.292a1.873 1.873 0 0 0 1.116 2.692l.318.094c.835.246.835 1.428 0 1.674l-.319.094a1.873 1.873 0 0 0-1.115 2.693l.16.291c.415.764-.42 1.6-1.185 1.184l-.291-.159a1.873 1.873 0 0 0-2.693 1.116l-.094.318c-.246.835-1.428.835-1.674 0l-.094-.319a1.873 1.873 0 0 0-2.692-1.115l-.292.16c-.764.415-1.6-.42-1.184-1.185l.159-.291A1.873 1.873 0 0 0 1.945 8.93l-.319-.094c-.835-.246-.835-1.428 0-1.674l.319-.094A1.873 1.873 0 0 0 3.06 4.377l-.16-.292c-.415-.764.42-1.6 1.185-1.184l.292.159a1.873 1.873 0 0 0 2.692-1.115z"/>
</svg>
</a>
</li>
<li class = "nav-item">
<a class = "nav-link">
<a class = "nav-link" id = "btn-logout">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-box-arrow-right" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M10 12.5a.5.5 0 0 1-.5.5h-8a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 .5.5v2a.5.5 0 0 0 1 0v-2A1.5 1.5 0 0 0 9.5 2h-8A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h8a1.5 1.5 0 0 0 1.5-1.5v-2a.5.5 0 0 0-1 0z"/>
<path fill-rule="evenodd" d="M15.854 8.354a.5.5 0 0 0 0-.708l-3-3a.5.5 0 0 0-.708.708L14.293 7.5H5.5a.5.5 0 0 0 0 1h8.793l-2.147 2.146a.5.5 0 0 0 .708.708z"/>
Expand All @@ -82,18 +82,38 @@
</div>
</div>

<!-- JS dependencies -->
<script src = "./js/lib/jquery.slim.min.js"></script>
<!-- Settings modal -->
<div class = "modal fade" id = "settings-modal" tabindex = "-1" role = "dialog">
<div class = "modal-dialog" role = "document">
<div class = "modal-content">
<div class = "modal-header">
<h5 class = "modal-title">Nightwatch Settings</h5>
<button type = "button" class = "close" data-bs-dismiss = "modal" aria-label = "Close">
<span>&times;</span>
</button>
</div>
<div class = "modal-body">
<p>Content to be decided.</p>
</div>
<div class = "modal-footer">
<button type = "button" class = "btn btn-primary">Save changes</button>
<button type = "button" class = "btn btn-secondary" data-bs-dismiss = "modal">Close</button>
</div>
</div>
</div>
</div>

<!-- JS -->
<script src = "./js/lib/nanoid.min.js"></script>

<!-- Nightwatch JS -->
<script src = "./js/nightwatch.js"></script>
<script src = "./js/lib/jquery.slim.min.js"></script>
<script src = "./js/lib/pickr.min.js"></script>
<script src = "./js/lib/notifications.min.js"></script>
<script src = "./js/lib/marked.min.js"></script>
<script src = "./js/lib/purify.min.js"></script>
<script src = "./js/lib/emoji.min.js"></script>
<script src = "./js/lib/tauri.store.min.js"></script>
<script src = "./js/main.js"></script>
<script src = "./js/lib/bootstrap.min.js"></script>
</body>
</html>
7 changes: 7 additions & 0 deletions nightwatch/desktop/src/js/lib/bootstrap.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions nightwatch/desktop/src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ $("#connect-form").on("submit", (e) => {
// Expose our API
window.nightwatch = nw;
});
$("#btn-logout").on("click", () => {
window.nightwatch.close();
delete window.nightwatch;
ui.switch("connect");
});

// Handle message sending
const messageInput = document.getElementById("message-input");
Expand Down

0 comments on commit 1ebd02a

Please sign in to comment.