mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-17 08:04:21 +00:00
Replaced reinitialize and save all button to a sync button in config.… (#701)
Replaced reinitialize and save all button to a sync button in config
This commit is contained in:
parent
c39c4e4ec4
commit
abf6f963ea
2 changed files with 17 additions and 23 deletions
4
src/khoj/interface/web/assets/icons/sync.svg
Normal file
4
src/khoj/interface/web/assets/icons/sync.svg
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg width="800px" height="800px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M14.3935 5.37371C18.0253 6.70569 19.8979 10.7522 18.5761 14.4118C17.6363 17.0135 15.335 18.7193 12.778 19.0094M12.778 19.0094L13.8253 17.2553M12.778 19.0094L14.4889 20M9.60651 18.6263C5.97465 17.2943 4.10205 13.2478 5.42394 9.58823C6.36371 6.98651 8.66504 5.28075 11.222 4.99059M11.222 4.99059L10.1747 6.74471M11.222 4.99059L9.51114 4" stroke="#464455" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
After Width: | Height: | Size: 639 B |
|
@ -162,10 +162,12 @@
|
|||
<div class="section finalize-actions general-settings">
|
||||
<div class="section-cards">
|
||||
<div class="finalize-buttons">
|
||||
<button id="configure" type="submit" title="Update index with the latest changes">💾 Save All</button>
|
||||
</div>
|
||||
<div class="finalize-buttons">
|
||||
<button id="reinitialize" type="submit" title="Regenerate index from scratch">🔄 Reinitialize</button>
|
||||
<button id="sync" type="submit" title="Regenerate index from scratch for Notion, GitHub configuration" style="display: flex; justify-content: center;">
|
||||
<img class="card-icon" src="/static/assets/icons/sync.svg" alt="Sync">
|
||||
<h3 class="card-title">
|
||||
Sync
|
||||
</h3>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -478,28 +480,16 @@
|
|||
})
|
||||
}
|
||||
|
||||
var configure = document.getElementById("configure");
|
||||
configure.addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
updateIndex(
|
||||
force=false,
|
||||
successText="Saved!",
|
||||
errorText="Unable to configure. Raise issue on Khoj <a href='https://github.com/khoj-ai/khoj/issues'>Github</a> or <a href='https://discord.gg/BDgyabRM6e'>Discord</a>.",
|
||||
button=configure,
|
||||
loadingText="Saving...",
|
||||
emoji="💾");
|
||||
});
|
||||
|
||||
var reinitialize = document.getElementById("reinitialize");
|
||||
reinitialize.addEventListener("click", function(event) {
|
||||
var sync = document.getElementById("sync");
|
||||
sync.addEventListener("click", function(event) {
|
||||
event.preventDefault();
|
||||
updateIndex(
|
||||
force=true,
|
||||
successText="Reinitialized!",
|
||||
errorText="Unable to reinitialize. Raise issue on Khoj <a href='https://github.com/khoj-ai/khoj/issues'>Github</a> or <a href='https://discord.gg/BDgyabRM6e'>Discord</a>.",
|
||||
button=reinitialize,
|
||||
loadingText="Reinitializing...",
|
||||
emoji="🔄");
|
||||
successText="Synced!",
|
||||
errorText="Unable to sync. Raise issue on Khoj <a href='https://github.com/khoj-ai/khoj/issues'>Github</a> or <a href='https://discord.gg/BDgyabRM6e'>Discord</a>.",
|
||||
button=sync,
|
||||
loadingText="Syncing...",
|
||||
emoji="");
|
||||
});
|
||||
|
||||
function updateIndex(force, successText, errorText, button, loadingText, emoji) {
|
||||
|
|
Loading…
Add table
Reference in a new issue