1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-01-18 21:17:59 +00:00

Tweaked some options

This commit is contained in:
Romein van Buren 2023-01-16 16:56:16 +01:00
parent dc1e30455a
commit 89d9a92136
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
5 changed files with 145 additions and 96 deletions

View File

@ -12,6 +12,7 @@
const connections = {};
let hosts = {};
let environment;
let activeHostKey = '';
let activeDbKey = '';
@ -104,11 +105,18 @@
}
onMount(() => {
window.runtime.Environment().then(e => environment = e);
Hosts().then(h => hosts = h);
});
</script>
<main class:empty={!host || !connection}>
<div id="app" class="platform-{environment?.platform}">
{#if environment}
{#if environment.platform === 'darwin'}
<div class="darwin-titlebar"></div>
{/if}
<main class:empty={!host || !connection}>
<AddressBar {hosts} bind:activeHostKey on:select={e => openConnection(e.detail)} bind:modalOpen={addressBarModalOpen} />
{#if host && connection}
@ -167,9 +175,9 @@
{:else}
<BlankState label="A database client is nothing without a host" image="/fish.svg" />
{/if}
</main>
</main>
{#if newDb}
{#if newDb}
<Modal bind:show={newDb}>
<p><strong>Create a database</strong></p>
<p>Note: databases in MongoDB do not exist until they have a collection and an item. Your new database will not persist on the server; fill it to have it created.</p>
@ -180,9 +188,9 @@
<button class="btn create" type="submit">Create database</button>
</form>
</Modal>
{/if}
{/if}
{#if newColl}
{#if newColl}
<Modal bind:show={newColl}>
<p><strong>Create a collections</strong></p>
<p>Note: collections in MongoDB do not exist until they have at least one item. Your new collection will not persist on the server; fill it to have it created.</p>
@ -193,13 +201,21 @@
<button class="btn create" type="submit">Create collection</button>
</form>
</Modal>
{/if}
{/if}
{#key $contextMenu}
{#key $contextMenu}
<ContextMenu {...$contextMenu} on:close={contextMenu.hide} />
{/key}
{/key}
{/if}
</div>
<style>
.darwin-titlebar {
--wails-draggable: drag;
height: var(--darwin-titlebar-height, 36px);
background-color: #00002a;
}
main {
height: 100vh;
display: grid;
@ -207,6 +223,9 @@
gap: 0.5rem;
padding: 0.5rem;
}
#app.platform-darwin main {
height: calc(100vh - var(--darwin-titlebar-height, 46px));
}
main.empty {
grid-template: 3rem auto / 1fr;
}

View File

@ -45,6 +45,7 @@
.contextmenu {
position: fixed;
background-color: rgba(230, 230, 230, 0.7);
-webkit-backdrop-filter: blur(30px);
backdrop-filter: blur(30px);
border-radius: 10px;
padding: 5px;

View File

@ -1,4 +1,5 @@
<script>
import { onMount } from 'svelte';
import { fade, fly } from 'svelte/transition';
import Icon from './icon.svelte';
@ -47,9 +48,12 @@
height: 100vh;
background-color: rgba(0, 0, 0, 0.5);
margin: 0;
padding-top: 1rem;
padding-top: 50px;
cursor: pointer;
}
:global(#app.platform-darwin) .outer {
margin-top: var(--darwin-titlebar-height, 46px);
}
.inner {
max-width: 80vw;

View File

@ -1,3 +1,7 @@
:root {
--darwin-titlebar-height: 36px;
}
html,
body {
height: 100vh;
@ -10,7 +14,7 @@ body {
cursor: default;
font-size: 15px;
line-height: 15px;
background-color: #eee;
background-color: rgba(0, 0, 0, 0);
}
* {

29
main.go
View File

@ -7,10 +7,16 @@ import (
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
"github.com/wailsapp/wails/v2/pkg/options/mac"
)
//go:embed all:frontend/dist
var assets embed.FS
var (
//go:embed all:frontend/dist
assets embed.FS
//go:embed build/appicon.png
appIcon []byte
)
func main() {
app := app.NewApp()
@ -19,14 +25,29 @@ func main() {
Title: "Mongodup",
Width: 1000,
Height: 600,
MinWidth: 1000,
MinHeight: 600,
BackgroundColour: &options.RGBA{R: 0, G: 0, B: 139, A: 1},
OnStartup: app.Startup,
AssetServer: &assetserver.Options{
Assets: assets,
},
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: app.Startup,
Bind: []interface{}{
app,
},
Mac: &mac.Options{
TitleBar: mac.TitleBarHiddenInset(),
WebviewIsTransparent: true,
WindowIsTranslucent: true,
About: &mac.AboutInfo{
Title: "Mongodup - MongoDB client",
Message: "© 2023 Romein van Buren",
Icon: appIcon,
},
},
})
if err != nil {