Skip to content

Commit

Permalink
Upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
ParisNeo committed Nov 23, 2023
1 parent 96b245e commit 7e95ce1
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 52 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions web/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-c54d7272.js"></script>
<link rel="stylesheet" href="/assets/index-6c6983a2.css">
<script type="module" crossorigin src="/assets/index-50afe6ea.js"></script>
<link rel="stylesheet" href="/assets/index-62d6a6f7.css">
</head>
<body>
<div id="app"></div>
Expand Down
10 changes: 10 additions & 0 deletions web/src/components/TopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
</RouterLink>
<!-- GITHUB AND THEME BUTTONS -->
<div class="flex gap-3 flex-1 items-center justify-end">

<div v-if="!isGenerating" title="Connection status" class="text-green-500">
<i data-feather="flag"></i>
</div>
<div v-if="isGenerating" title="Connection status" class="text-red-500">
<i data-feather="flag"></i>
</div>
<div v-if="isConnected" title="Connection status" class="text-green-500">
<i data-feather="zap"></i>
</div>
Expand Down Expand Up @@ -82,6 +89,9 @@ import { mapState } from 'vuex';
export default {
name: 'TopBar',
computed:{
isGenerating(){
return this.$store.state.isGenerating;
},
isConnected(){
return this.$store.state.isConnected;
}
Expand Down
10 changes: 10 additions & 0 deletions web/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const store = createStore({
version : "unknown",
settingsChanged:false,
isConnected: false, // Add the isConnected property
isGenerating: false,
config:null,
mountedPers:null,
mountedPersArr:[],
Expand All @@ -53,6 +54,10 @@ export const store = createStore({
setIsConnected(state, isConnected) {
state.isConnected = isConnected;
},
setIsGenerating(state, isGenerating) {
state.isGenerating = isGenerating;
},

setConfig(state, config) {
state.config = config;
},
Expand Down Expand Up @@ -108,6 +113,11 @@ export const store = createStore({
getIsConnected(state) {
return state.isConnected
},
getIsGenerating(state) {
return state.isGenerating
},


getConfig(state) {
return state.config
},
Expand Down
11 changes: 9 additions & 2 deletions web/src/views/DiscussionsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ export default {
filterTitle: '',
filterInProgress: false,
isCreated: false,
isGenerating: false,
isCheckbox: false,
isSelectAll: false,
showSaveConfirmation: false,
Expand Down Expand Up @@ -1791,13 +1790,13 @@ export default {
};
socket.on("connect_error", (error) => {
if (error.message === "ERR_CONNECTION_REFUSED") {
this.$store.state.isConnected = false
console.error("Connection refused. The server is not available.");
// Handle the ERR_CONNECTION_REFUSED error here
} else {
console.error("Connection error:", error);
// Handle other connection errors here
}
this.$store.state.isConnected = false
});
socket.onerror = (event) => {
console.log('WebSocket connection error:', event.code, event.reason);
Expand Down Expand Up @@ -1928,6 +1927,14 @@ export default {
},
computed: {
isGenerating:{
get(){
return this.$store.state.isGenerating;
},
set(val){
this.$store.state.isGenerating=val
}
},
formatted_database_name() {
const db_name = this.$store.state.config.db_path;
const trimmed_name = db_name.slice(0, db_name.length - 3);
Expand Down
3 changes: 1 addition & 2 deletions web/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export default async ({ mode }) => {
try{
serverURL = await getFlaskServerURL()
console.log(serverURL)

}catch{
serverURL = process.env.VITE_LOLLMS_API
console.log(`Server address: ${serverAddress}`)
Expand All @@ -49,7 +48,7 @@ export default async ({ mode }) => {
server: {
proxy: {
"/api/": {
target: serverURL,//process.env.VITE_LOLLMS_API,//getFlaskServerURL(),// process.env.VITE_LOLLMS_API,
target: serverURL,//process.env.VITE_LOLLMS_API,//process.env.VITE_LOLLMS_API,//getFlaskServerURL(),// process.env.VITE_LOLLMS_API,
changeOrigin: process.env.VITE_LOLLMS_API_CHANGE_ORIGIN,
secure: process.env.VITE_LOLLMS_API_SECURE,
rewrite: (path) => path.replace(/^\/api/, ""),
Expand Down

0 comments on commit 7e95ce1

Please sign in to comment.