diff --git a/Khoj.spec b/Khoj.spec
index 0e025ab8..7076e0c0 100644
--- a/Khoj.spec
+++ b/Khoj.spec
@@ -50,7 +50,7 @@ pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
if system() != 'Darwin':
# Add Splash screen to show on app launch
splash = Splash(
- 'src/khoj/interface/web/assets/icons/favicon-144x144.png',
+ 'src/khoj/interface/web/assets/icons/favicon-128x128.png',
binaries=a.binaries,
datas=a.datas,
text_pos=(10, 160),
@@ -82,7 +82,7 @@ if system() != 'Darwin':
target_arch='x86_64',
codesign_identity=None,
entitlements_file=None,
- icon='src/khoj/interface/web/assets/icons/favicon-144x144.ico',
+ icon='src/khoj/interface/web/assets/icons/favicon-128x128.ico',
)
else:
exe = EXE(
diff --git a/src/khoj/interface/desktop/main_window.py b/src/khoj/interface/desktop/main_window.py
index 24239772..f4ca7f8c 100644
--- a/src/khoj/interface/desktop/main_window.py
+++ b/src/khoj/interface/desktop/main_window.py
@@ -49,7 +49,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.setFixedWidth(600)
# Set Window Icon
- icon_path = constants.web_directory / "assets/icons/favicon-144x144.png"
+ icon_path = constants.web_directory / "assets/icons/favicon-128x128.png"
self.setWindowIcon(QtGui.QIcon(f"{icon_path.absolute()}"))
# Initialize Configure Window Layout
@@ -228,6 +228,8 @@ class MainWindow(QtWidgets.QMainWindow):
# Search Type (re)-Enabled
if child.isChecked():
current_search_config = self.current_config["content-type"].get(child.search_type, {})
+ if current_search_config == None:
+ current_search_config = {}
default_search_config = self.get_default_config(search_type=child.search_type)
self.new_config["content-type"][child.search_type.value] = merge_dicts(
current_search_config, default_search_config
diff --git a/src/khoj/interface/desktop/system_tray.py b/src/khoj/interface/desktop/system_tray.py
index 52baec80..526d7da6 100644
--- a/src/khoj/interface/desktop/system_tray.py
+++ b/src/khoj/interface/desktop/system_tray.py
@@ -17,7 +17,7 @@ def create_system_tray(gui: QtWidgets.QApplication, main_window: MainWindow):
"""
# Create the system tray with icon
- icon_path = constants.web_directory / "assets/icons/favicon-144x144.png"
+ icon_path = constants.web_directory / "assets/icons/favicon-128x128.png"
icon = QtGui.QIcon(f"{icon_path.absolute()}")
tray = QtWidgets.QSystemTrayIcon(icon)
tray.setVisible(True)
diff --git a/src/khoj/interface/web/404.html b/src/khoj/interface/web/404.html
new file mode 100644
index 00000000..7041ff80
--- /dev/null
+++ b/src/khoj/interface/web/404.html
@@ -0,0 +1,22 @@
+
+
+
+ Khoj: An AI Personal Assistant for your digital brain
+
+
+
+
+
+ Go Home
+
+
+
+
+
diff --git a/src/khoj/interface/web/assets/config.css b/src/khoj/interface/web/assets/config.css
deleted file mode 100644
index eff882ba..00000000
--- a/src/khoj/interface/web/assets/config.css
+++ /dev/null
@@ -1,29 +0,0 @@
-:root {
- --primary-color: #ffffff;
- --bold-color: #2073ee;
- --complementary-color: #124408;
- --accent-color-0: #57f0b5;
-}
-
-input[type=text] {
- width: 40%;
-}
-
-div.config-element {
- color: var(--bold-color);
- margin: 8px;
-}
-
-div.config-title {
- font-weight: bold;
-}
-
-span.config-element-value {
- color: var(--complementary-color);
- font-weight: normal;
- cursor: pointer;
-}
-
-button {
- cursor: pointer;
-}
diff --git a/src/khoj/interface/web/assets/config.js b/src/khoj/interface/web/assets/config.js
deleted file mode 100644
index ede4c65d..00000000
--- a/src/khoj/interface/web/assets/config.js
+++ /dev/null
@@ -1,125 +0,0 @@
-// Retrieve elements from the DOM.
-var showConfig = document.getElementById("show-config");
-var configForm = document.getElementById("config-form");
-var regenerateButton = document.getElementById("config-regenerate");
-
-// Global variables.
-var rawConfig = {};
-var emptyValueDefault = "🖊️";
-
-/**
- * Fetch the existing config file.
- */
-fetch("/api/config/data")
- .then(response => response.json())
- .then(data => {
- rawConfig = data;
- configForm.style.display = "block";
- processChildren(configForm, data);
-
- var submitButton = document.createElement("button");
- submitButton.type = "submit";
- submitButton.innerHTML = "update";
- configForm.appendChild(submitButton);
-
- // The config form's submit handler.
- configForm.addEventListener("submit", (event) => {
- event.preventDefault();
- console.log(rawConfig);
- fetch("/api/config/data", {
- method: "POST",
- credentials: "same-origin",
- headers: {
- 'Content-Type': 'application/json'
- },
- body: JSON.stringify(rawConfig)
- })
- .then(response => response.json())
- .then(data => console.log(data));
- });
-});
-
-/**
- * The click handler for the Regenerate button.
- */
-regenerateButton.addEventListener("click", (event) => {
- event.preventDefault();
- regenerateButton.style.cursor = "progress";
- regenerateButton.disabled = true;
- fetch("/api/update?force=true&client=web")
- .then(response => response.json())
- .then(data => {
- regenerateButton.style.cursor = "pointer";
- regenerateButton.disabled = false;
- console.log(data);
- });
-})
-
-/**
- * Adds config elements to the DOM representing the sub-components
- * of one of the fields in the raw config file.
- * @param {the parent element} element
- * @param {the data to be rendered for this element and its children} data
- */
-function processChildren(element, data) {
- for (let key in data) {
- var child = document.createElement("div");
- child.id = key;
- child.className = "config-element";
- child.appendChild(document.createTextNode(key + ": "));
- if (data[key] === Object(data[key]) && !Array.isArray(data[key])) {
- child.className+=" config-title";
- processChildren(child, data[key]);
- } else {
- child.appendChild(createValueNode(data, key));
- }
- element.appendChild(child);
- }
-}
-
-/**
- * Takes an element, and replaces it with an editable
- * element with the same data in place.
- * @param {the original element to be replaced} original
- * @param {the source data to be rendered for the new element} data
- * @param {the key for this input in the source data} key
- */
-function makeElementEditable(original, data, key) {
- original.addEventListener("click", () => {
- var inputNewText = document.createElement("input");
- inputNewText.type = "text";
- inputNewText.className = "config-element-edit";
- inputNewText.value = (original.textContent == emptyValueDefault) ? "" : original.textContent;
- fixInputOnFocusOut(inputNewText, data, key);
- original.parentNode.replaceChild(inputNewText, original);
- inputNewText.focus();
- });
-}
-
-/**
- * Creates a node corresponding to the value of a config element.
- * @param {the source data} data
- * @param {the key corresponding to this node's data} key
- * @returns A new element which corresponds to the value in some field.
- */
-function createValueNode(data, key) {
- var valueElement = document.createElement("span");
- valueElement.className = "config-element-value";
- valueElement.textContent = !data[key] ? emptyValueDefault : data[key];
- makeElementEditable(valueElement, data, key);
- return valueElement;
-}
-
-/**
- * Replaces an existing input element with an element with the same data, which is not an input.
- * If the input data for this element was changed, update the corresponding data in the raw config.
- * @param {the original element to be replaced} original
- * @param {the source data} data
- * @param {the key corresponding to this node's data} key
- */
-function fixInputOnFocusOut(original, data, key) {
- original.addEventListener("blur", () => {
- data[key] = (original.value != emptyValueDefault) ? original.value : "";
- original.parentNode.replaceChild(createValueNode(data, key), original);
- })
-}
diff --git a/src/khoj/interface/web/assets/icons/favicon-128x128.ico b/src/khoj/interface/web/assets/icons/favicon-128x128.ico
new file mode 100644
index 00000000..ed751b2d
Binary files /dev/null and b/src/khoj/interface/web/assets/icons/favicon-128x128.ico differ
diff --git a/src/khoj/interface/web/assets/icons/favicon-128x128.png b/src/khoj/interface/web/assets/icons/favicon-128x128.png
index 7fba4f64..0e467e57 100644
Binary files a/src/khoj/interface/web/assets/icons/favicon-128x128.png and b/src/khoj/interface/web/assets/icons/favicon-128x128.png differ
diff --git a/src/khoj/interface/web/assets/icons/favicon-144x144.ico b/src/khoj/interface/web/assets/icons/favicon-144x144.ico
deleted file mode 100644
index 9641ed71..00000000
Binary files a/src/khoj/interface/web/assets/icons/favicon-144x144.ico and /dev/null differ
diff --git a/src/khoj/interface/web/assets/icons/favicon-144x144.png b/src/khoj/interface/web/assets/icons/favicon-144x144.png
deleted file mode 100644
index 6a1b7b4f..00000000
Binary files a/src/khoj/interface/web/assets/icons/favicon-144x144.png and /dev/null differ
diff --git a/src/khoj/interface/web/assets/icons/favicon.icns b/src/khoj/interface/web/assets/icons/favicon.icns
index 6e0c6c75..3b375fa0 100644
Binary files a/src/khoj/interface/web/assets/icons/favicon.icns and b/src/khoj/interface/web/assets/icons/favicon.icns differ
diff --git a/src/khoj/interface/web/base_config.html b/src/khoj/interface/web/base_config.html
new file mode 100644
index 00000000..d5d8107c
--- /dev/null
+++ b/src/khoj/interface/web/base_config.html
@@ -0,0 +1,44 @@
+
+
+
+
+ Khoj - Settings
+
+
+
+
+
+ {% block content %}
+ {% endblock %}
+
+
+
+