2020-04-30 17:48:53 +02:00
|
|
|
<template>
|
2022-03-22 16:13:44 +01:00
|
|
|
<div id="wrapper" :class="[`theme-${applicationTheme}`, !disableBlur || 'no-blur']">
|
2020-06-02 19:13:57 +02:00
|
|
|
<TheTitleBar />
|
|
|
|
<div id="window-content">
|
|
|
|
<TheSettingBar />
|
|
|
|
<div id="main-content" class="container">
|
2021-07-08 17:43:33 +02:00
|
|
|
<div class="columns col-gapless">
|
2020-06-03 20:56:44 +02:00
|
|
|
<Workspace
|
2020-06-02 19:13:57 +02:00
|
|
|
v-for="connection in connections"
|
|
|
|
:key="connection.uid"
|
|
|
|
:connection="connection"
|
|
|
|
/>
|
2022-03-24 17:34:24 +01:00
|
|
|
<div class="connection-panel-wrapper">
|
|
|
|
<WorkspaceAddConnectionPanel v-if="selectedWorkspace === 'NEW'" />
|
|
|
|
</div>
|
2020-06-02 19:13:57 +02:00
|
|
|
</div>
|
2021-07-08 17:43:33 +02:00
|
|
|
<TheFooter />
|
|
|
|
<TheNotificationsBoard />
|
|
|
|
<TheScratchpad v-if="isScratchpad" />
|
|
|
|
<ModalSettings v-if="isSettingModal" />
|
|
|
|
<BaseTextEditor class="d-none" value="" />
|
2020-05-14 15:21:57 +02:00
|
|
|
</div>
|
2020-05-07 17:45:04 +02:00
|
|
|
</div>
|
2020-04-30 17:48:53 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-04-21 14:39:24 +02:00
|
|
|
import { defineAsyncComponent } from 'vue';
|
2022-04-27 18:23:48 +02:00
|
|
|
import { storeToRefs } from 'pinia';
|
2021-04-26 10:07:47 +02:00
|
|
|
import { ipcRenderer } from 'electron';
|
|
|
|
import { Menu, getCurrentWindow } from '@electron/remote';
|
2022-04-27 18:23:48 +02:00
|
|
|
import { useApplicationStore } from '@/stores/application';
|
2022-04-30 00:47:37 +02:00
|
|
|
import { useConnectionsStore } from '@/stores/connections';
|
|
|
|
import { useSettingsStore } from '@/stores/settings';
|
|
|
|
import { useWorkspacesStore } from '@/stores/workspaces';
|
2022-04-21 14:39:24 +02:00
|
|
|
import TheSettingBar from '@/components/TheSettingBar';
|
2020-04-30 17:48:53 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
name: 'App',
|
|
|
|
components: {
|
2022-04-21 14:39:24 +02:00
|
|
|
TheTitleBar: defineAsyncComponent(() => import(/* webpackChunkName: "TheTitleBar" */'@/components/TheTitleBar')),
|
|
|
|
TheSettingBar,
|
|
|
|
TheFooter: defineAsyncComponent(() => import(/* webpackChunkName: "TheFooter" */'@/components/TheFooter')),
|
|
|
|
TheNotificationsBoard: defineAsyncComponent(() => import(/* webpackChunkName: "TheNotificationsBoard" */'@/components/TheNotificationsBoard')),
|
|
|
|
Workspace: defineAsyncComponent(() => import(/* webpackChunkName: "Workspace" */'@/components/Workspace')),
|
|
|
|
WorkspaceAddConnectionPanel: defineAsyncComponent(() => import(/* webpackChunkName: "WorkspaceAddConnectionPanel" */'@/components/WorkspaceAddConnectionPanel')),
|
|
|
|
ModalSettings: defineAsyncComponent(() => import(/* webpackChunkName: "ModalSettings" */'@/components/ModalSettings')),
|
|
|
|
TheScratchpad: defineAsyncComponent(() => import(/* webpackChunkName: "TheScratchpad" */'@/components/TheScratchpad')),
|
|
|
|
BaseTextEditor: defineAsyncComponent(() => import(/* webpackChunkName: "BaseTextEditor" */'@/components/BaseTextEditor'))
|
2020-05-07 17:45:04 +02:00
|
|
|
},
|
2022-04-27 18:23:48 +02:00
|
|
|
setup () {
|
|
|
|
const applicationStore = useApplicationStore();
|
2022-04-30 00:47:37 +02:00
|
|
|
const connectionsStore = useConnectionsStore();
|
|
|
|
const settingsStore = useSettingsStore();
|
|
|
|
const workspacesStore = useWorkspacesStore();
|
|
|
|
|
2022-04-27 18:23:48 +02:00
|
|
|
const {
|
|
|
|
isLoading,
|
|
|
|
isSettingModal,
|
|
|
|
isScratchpad
|
|
|
|
} = storeToRefs(applicationStore);
|
2022-04-30 00:47:37 +02:00
|
|
|
const { connections } = storeToRefs(connectionsStore);
|
|
|
|
const { applicationTheme, disableBlur } = storeToRefs(settingsStore);
|
|
|
|
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
|
2022-04-27 18:23:48 +02:00
|
|
|
|
|
|
|
const { checkVersionUpdate } = applicationStore;
|
|
|
|
|
|
|
|
return {
|
|
|
|
isLoading,
|
|
|
|
isSettingModal,
|
|
|
|
isScratchpad,
|
2022-04-30 00:47:37 +02:00
|
|
|
checkVersionUpdate,
|
|
|
|
connections,
|
|
|
|
applicationTheme,
|
|
|
|
disableBlur,
|
|
|
|
selectedWorkspace
|
2022-04-27 18:23:48 +02:00
|
|
|
};
|
|
|
|
},
|
2020-06-19 18:03:52 +02:00
|
|
|
mounted () {
|
2020-08-18 18:03:59 +02:00
|
|
|
ipcRenderer.send('check-for-updates');
|
2021-04-11 12:35:16 +02:00
|
|
|
this.checkVersionUpdate();
|
2021-02-21 21:24:25 +01:00
|
|
|
|
|
|
|
const InputMenu = Menu.buildFromTemplate([
|
|
|
|
{
|
|
|
|
label: this.$t('word.cut'),
|
|
|
|
role: 'cut'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: this.$t('word.copy'),
|
|
|
|
role: 'copy'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: this.$t('word.paste'),
|
|
|
|
role: 'paste'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: 'separator'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: this.$t('message.selectAll'),
|
|
|
|
role: 'selectall'
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
|
|
|
|
document.body.addEventListener('contextmenu', (e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
e.stopPropagation();
|
|
|
|
|
|
|
|
let node = e.target;
|
|
|
|
|
|
|
|
while (node) {
|
|
|
|
if (node.nodeName.match(/^(input|textarea)$/i) || node.isContentEditable) {
|
2021-04-26 10:07:47 +02:00
|
|
|
InputMenu.popup(getCurrentWindow());
|
2021-02-21 21:24:25 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
node = node.parentNode;
|
|
|
|
}
|
|
|
|
});
|
2020-04-30 17:48:53 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2020-05-14 15:21:57 +02:00
|
|
|
<style lang="scss">
|
2020-08-03 18:07:08 +02:00
|
|
|
html,
|
|
|
|
body {
|
|
|
|
height: 100%;
|
|
|
|
}
|
2020-05-08 18:02:18 +02:00
|
|
|
|
2020-08-03 18:07:08 +02:00
|
|
|
#wrapper {
|
|
|
|
height: 100vh;
|
|
|
|
position: relative;
|
|
|
|
}
|
2020-05-08 18:02:18 +02:00
|
|
|
|
2020-08-03 18:07:08 +02:00
|
|
|
#window-content {
|
|
|
|
display: flex;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
2020-06-02 19:13:57 +02:00
|
|
|
|
2020-08-03 18:07:08 +02:00
|
|
|
#main-content {
|
|
|
|
padding: 0;
|
|
|
|
justify-content: flex-start;
|
|
|
|
height: calc(100vh - #{$excluding-size});
|
|
|
|
width: calc(100% - #{$settingbar-width});
|
2020-05-14 15:21:57 +02:00
|
|
|
|
2020-08-03 18:07:08 +02:00
|
|
|
> .columns {
|
|
|
|
height: calc(100vh - #{$footer-height});
|
|
|
|
}
|
2022-03-24 17:34:24 +01:00
|
|
|
|
|
|
|
.connection-panel-wrapper{
|
|
|
|
height: calc(100vh - #{$excluding-size});
|
|
|
|
width: 100%;
|
|
|
|
padding-top: 15vh;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: flex-start;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
2020-08-03 18:07:08 +02:00
|
|
|
}
|
2020-04-30 17:48:53 +02:00
|
|
|
</style>
|