add indicator when disconnected = shortcut to connection modal

This commit is contained in:
marlon-erler
2026-04-01 08:38:40 +00:00
parent 9d400a9929
commit fd8aafed6d
6 changed files with 51 additions and 6 deletions
+22 -6
View File
@@ -2495,7 +2495,8 @@
setButton: "Set", setButton: "Set",
reloadAppButton: "Reload App", reloadAppButton: "Reload App",
fileVersionLabel: "Version", fileVersionLabel: "Version",
searchLabel: "Search" searchLabel: "Search",
restoreConnection: "Restore connection"
}, },
regional: { regional: {
weekdays: { weekdays: {
@@ -2683,7 +2684,8 @@
setButton: "OK", setButton: "OK",
reloadAppButton: "Neu laden", reloadAppButton: "Neu laden",
fileVersionLabel: "Version", fileVersionLabel: "Version",
searchLabel: "Suche" searchLabel: "Suche",
restoreConnection: "Verbindung wiederherstellen"
}, },
regional: { regional: {
weekdays: { weekdays: {
@@ -2852,7 +2854,8 @@
setButton: "OK", setButton: "OK",
reloadAppButton: "Recargar app", reloadAppButton: "Recargar app",
fileVersionLabel: "Versi\xF3n", fileVersionLabel: "Versi\xF3n",
searchLabel: "Buscar" searchLabel: "Buscar",
restoreConnection: "Conectar de nuevo"
}, },
regional: { regional: {
weekdays: { weekdays: {
@@ -3011,7 +3014,7 @@
// src/ViewModel/Chat/chatViewModel.ts // src/ViewModel/Chat/chatViewModel.ts
var ChatViewModel = class { var ChatViewModel = class {
// init // init
constructor(coreViewModel, storageModel2, chatModel, settingsViewModel2, chatListViewModel2) { constructor(coreViewModel, storageModel2, chatModel, settingsViewModel2, connectionViewModel2, chatListViewModel2) {
this.coreViewModel = coreViewModel; this.coreViewModel = coreViewModel;
// state // state
this.displayedColor = new State("standard" /* Standard */); this.displayedColor = new State("standard" /* Standard */);
@@ -3074,6 +3077,7 @@
this.storageModel = storageModel2; this.storageModel = storageModel2;
this.chatModel = chatModel; this.chatModel = chatModel;
this.settingsViewModel = settingsViewModel2; this.settingsViewModel = settingsViewModel2;
this.connectionViewModel = connectionViewModel2;
this.chatListViewModel = chatListViewModel2; this.chatListViewModel = chatListViewModel2;
this.calendarViewModel = new CalendarPageViewModel( this.calendarViewModel = new CalendarPageViewModel(
coreViewModel, coreViewModel,
@@ -3111,7 +3115,7 @@
// src/ViewModel/Chat/chatListViewModel.ts // src/ViewModel/Chat/chatListViewModel.ts
var ChatListViewModel = class { var ChatListViewModel = class {
// init // init
constructor(coreViewModel, storageModel2, chatListModel2, settingsViewModel2) { constructor(coreViewModel, storageModel2, chatListModel2, settingsViewModel2, connectionViewModel2) {
this.coreViewModel = coreViewModel; this.coreViewModel = coreViewModel;
// data // data
this.chatIndexManager = new IndexManager( this.chatIndexManager = new IndexManager(
@@ -3151,6 +3155,7 @@
this.storageModel, this.storageModel,
chatModel, chatModel,
this.settingsViewModel, this.settingsViewModel,
this.connectionViewModel,
this this
); );
}; };
@@ -3179,6 +3184,7 @@
this.storageModel = storageModel2; this.storageModel = storageModel2;
this.chatListModel = chatListModel2; this.chatListModel = chatListModel2;
this.settingsViewModel = settingsViewModel2; this.settingsViewModel = settingsViewModel2;
this.connectionViewModel = connectionViewModel2;
this.loadChats(); this.loadChats();
} }
}; };
@@ -4540,6 +4546,15 @@
"on:click": chatViewModel.close "on:click": chatViewModel.close
}, },
/* @__PURE__ */ createElement("span", { class: "icon" }, "close") /* @__PURE__ */ createElement("span", { class: "icon" }, "close")
), /* @__PURE__ */ createElement(
"button",
{
class: "danger",
"aria-label": translations.general.restoreConnection,
"on:click": chatViewModel.connectionViewModel.showConnectionModal,
"toggle:hidden": chatViewModel.connectionViewModel.isConnected
},
/* @__PURE__ */ createElement("span", { class: "icon" }, "signal_disconnected")
), /* @__PURE__ */ createElement("span", null, ChatViewToggleButton( ), /* @__PURE__ */ createElement("span", null, ChatViewToggleButton(
translations.chatPage.pages.calendar, translations.chatPage.pages.calendar,
"calendar_month", "calendar_month",
@@ -6102,7 +6117,8 @@
coreVieWModel, coreVieWModel,
storageModel, storageModel,
chatListModel, chatListModel,
settingsViewModel settingsViewModel,
connectionViewModel
); );
var fileTransferViewModel = new FileTransferViewModel( var fileTransferViewModel = new FileTransferViewModel(
fileTransferModel, fileTransferModel,
+13
View File
@@ -49,6 +49,19 @@ export function ChatPage(chatViewModel: ChatViewModel) {
> >
<span class="icon">close</span> <span class="icon">close</span>
</button> </button>
<button
class="danger"
aria-label={translations.general.restoreConnection}
on:click={
chatViewModel.connectionViewModel
.showConnectionModal
}
toggle:hidden={
chatViewModel.connectionViewModel.isConnected
}
>
<span class="icon">signal_disconnected</span>
</button>
<span> <span>
{ChatViewToggleButton( {ChatViewToggleButton(
+6
View File
@@ -21,6 +21,8 @@ const englishTranslations = {
fileVersionLabel: "Version", fileVersionLabel: "Version",
searchLabel: "Search", searchLabel: "Search",
restoreConnection: "Restore connection",
}, },
regional: { regional: {
@@ -295,6 +297,8 @@ const allTranslations: { [language: string]: typeof englishTranslations } = {
fileVersionLabel: "Version", fileVersionLabel: "Version",
searchLabel: "Suche", searchLabel: "Suche",
restoreConnection: "Verbindung wiederherstellen",
}, },
regional: { regional: {
@@ -537,6 +541,8 @@ const allTranslations: { [language: string]: typeof englishTranslations } = {
fileVersionLabel: "Versión", fileVersionLabel: "Versión",
searchLabel: "Buscar", searchLabel: "Buscar",
restoreConnection: "Conectar de nuevo",
}, },
regional: { regional: {
+5
View File
@@ -7,11 +7,13 @@ import CoreViewModel from "../Global/coreViewModel";
import { IndexManager } from "../../Model/Utility/utility"; import { IndexManager } from "../../Model/Utility/utility";
import SettingsViewModel from "../Global/settingsViewModel"; import SettingsViewModel from "../Global/settingsViewModel";
import StorageModel from "../../Model/Global/storageModel"; import StorageModel from "../../Model/Global/storageModel";
import ConnectionViewModel from "../Global/connectionViewModel";
export default class ChatListViewModel { export default class ChatListViewModel {
storageModel: StorageModel; storageModel: StorageModel;
chatListModel: ChatListModel; chatListModel: ChatListModel;
settingsViewModel: SettingsViewModel; settingsViewModel: SettingsViewModel;
connectionViewModel: ConnectionViewModel;
// data // data
chatIndexManager: IndexManager<ChatViewModel> = new IndexManager( chatIndexManager: IndexManager<ChatViewModel> = new IndexManager(
@@ -61,6 +63,7 @@ export default class ChatListViewModel {
this.storageModel, this.storageModel,
chatModel, chatModel,
this.settingsViewModel, this.settingsViewModel,
this.connectionViewModel,
this, this,
); );
}; };
@@ -97,10 +100,12 @@ export default class ChatListViewModel {
storageModel: StorageModel, storageModel: StorageModel,
chatListModel: ChatListModel, chatListModel: ChatListModel,
settingsViewModel: SettingsViewModel, settingsViewModel: SettingsViewModel,
connectionViewModel: ConnectionViewModel,
) { ) {
this.storageModel = storageModel; this.storageModel = storageModel;
this.chatListModel = chatListModel; this.chatListModel = chatListModel;
this.settingsViewModel = settingsViewModel; this.settingsViewModel = settingsViewModel;
this.connectionViewModel = connectionViewModel;
this.loadChats(); this.loadChats();
} }
+4
View File
@@ -18,11 +18,13 @@ import SettingsPageViewModel from "../Pages/settingsPageViewModel";
import SettingsViewModel from "../Global/settingsViewModel"; import SettingsViewModel from "../Global/settingsViewModel";
import TaskPageViewModel from "../Pages/taskPageViewModel"; import TaskPageViewModel from "../Pages/taskPageViewModel";
import { translations } from "../../View/translations"; import { translations } from "../../View/translations";
import ConnectionViewModel from "../Global/connectionViewModel";
export default class ChatViewModel { export default class ChatViewModel {
chatModel: ChatModel; chatModel: ChatModel;
storageModel: StorageModel; storageModel: StorageModel;
settingsViewModel: SettingsViewModel; settingsViewModel: SettingsViewModel;
connectionViewModel: ConnectionViewModel;
chatListViewModel: ChatListViewModel; chatListViewModel: ChatListViewModel;
calendarViewModel: CalendarPageViewModel; calendarViewModel: CalendarPageViewModel;
@@ -109,12 +111,14 @@ export default class ChatViewModel {
storageModel: StorageModel, storageModel: StorageModel,
chatModel: ChatModel, chatModel: ChatModel,
settingsViewModel: SettingsViewModel, settingsViewModel: SettingsViewModel,
connectionViewModel: ConnectionViewModel,
chatListViewModel: ChatListViewModel, chatListViewModel: ChatListViewModel,
) { ) {
// models // models
this.storageModel = storageModel; this.storageModel = storageModel;
this.chatModel = chatModel; this.chatModel = chatModel;
this.settingsViewModel = settingsViewModel; this.settingsViewModel = settingsViewModel;
this.connectionViewModel = connectionViewModel;
this.chatListViewModel = chatListViewModel; this.chatListViewModel = chatListViewModel;
// page viewModels // page viewModels
+1
View File
@@ -50,6 +50,7 @@ const chatListViewModel = new ChatListViewModel(
storageModel, storageModel,
chatListModel, chatListModel,
settingsViewModel, settingsViewModel,
connectionViewModel,
); );
const fileTransferViewModel = new FileTransferViewModel( const fileTransferViewModel = new FileTransferViewModel(
fileTransferModel, fileTransferModel,