mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
hotfix-part2
This commit is contained in:
@@ -104,10 +104,36 @@ This will return a new DataFrame with all the columns from both tables, and only
|
||||
.then(data => {
|
||||
console.log('Success:', data);
|
||||
localStorage.setItem("docsIndex", JSON.stringify(data));
|
||||
generateOptions()
|
||||
}
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
function generateOptions(){
|
||||
docsIndex = localStorage.getItem('docsIndex')
|
||||
// create option on select with id select-docs
|
||||
var select = document.getElementById("select-docs");
|
||||
// convert docsIndex to json
|
||||
docsIndex = JSON.parse(docsIndex)
|
||||
// create option for each key in docsIndex
|
||||
for (var key in docsIndex) {
|
||||
var option = document.createElement("option");
|
||||
console.log(key)
|
||||
console.log(docsIndex[key])
|
||||
if (docsIndex[key].name == docsIndex[key].language) {
|
||||
option.text = docsIndex[key].name + " " + docsIndex[key].version;
|
||||
option.value = docsIndex[key].name + "/" + ".project" + "/" + docsIndex[key].version + "/";
|
||||
select.add(option);
|
||||
}
|
||||
else {
|
||||
option.text = docsIndex[key].name + " " + docsIndex[key].version;
|
||||
option.value = docsIndex[key].language + "/" + docsIndex[key].name + "/" + docsIndex[key].version + "/";
|
||||
select.add(option);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// check if api_key is set
|
||||
if (localStorage.getItem('apiKey') === null) {
|
||||
console.log("apiKey is not set")
|
||||
@@ -118,29 +144,7 @@ This will return a new DataFrame with all the columns from both tables, and only
|
||||
docsIndex()
|
||||
}
|
||||
|
||||
docsIndex = localStorage.getItem('docsIndex')
|
||||
// create option on select with id select-docs
|
||||
var select = document.getElementById("select-docs");
|
||||
// convert docsIndex to json
|
||||
docsIndex = JSON.parse(docsIndex)
|
||||
// create option for each key in docsIndex
|
||||
for (var key in docsIndex) {
|
||||
var option = document.createElement("option");
|
||||
console.log(key)
|
||||
console.log(docsIndex[key])
|
||||
if (docsIndex[key].name == docsIndex[key].language) {
|
||||
option.text = docsIndex[key].name + " " + docsIndex[key].version;
|
||||
option.value = docsIndex[key].name + "/" + ".project" + "/" + docsIndex[key].version + "/";
|
||||
select.add(option);
|
||||
}
|
||||
else {
|
||||
option.text = docsIndex[key].name + " " + docsIndex[key].version;
|
||||
option.value = docsIndex[key].language + "/" + docsIndex[key].name + "/" + docsIndex[key].version + "/";
|
||||
select.add(option);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
generateOptions()
|
||||
|
||||
</script>
|
||||
<script src="{{url_for('static',filename='src/authapi.js')}}"></script>
|
||||
|
||||
Reference in New Issue
Block a user