Skip to content

Commit

Permalink
dirty fix before ditching primevue
Browse files Browse the repository at this point in the history
  • Loading branch information
jsawo committed Jan 17, 2023
1 parent bbf042f commit ae48cb1
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 15 deletions.
Binary file modified build/appicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,16 @@
"vue": "^3.2.37"
},
"devDependencies": {
"@types/node": "^18.11.18",
"@babel/types": "^7.18.10",
"@vitejs/plugin-vue": "^3.0.3",
"typescript": "^4.6.4",
"vite": "^3.0.7",
"vue-tsc": "^0.39.5"
},
"engines": {
"node": "^18 || ^16 || ^14.19",
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
}
2 changes: 1 addition & 1 deletion frontend/package.json.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c89c3e260822cde2a0954e98d00d2d2b
c2400366737b24b88ff15be9b2118889
29 changes: 18 additions & 11 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import dayjs from 'dayjs'
import timezone from 'dayjs/plugin/timezone'
import utc from 'dayjs/plugin/utc'
import { reactive, onMounted, computed } from 'vue'
import { reactive, onMounted, computed, ref } from 'vue'
import { EventsOn } from '@wails/runtime'
import { GetConfig } from '@wails/go/main/App'
import JsonFormatter from '@/components/pages/JsonFormatter.vue'
Expand All @@ -11,8 +11,6 @@ import Tinker from '@/components/pages/Tinker.vue'
import ProjectSettings from '@/components/pages/ProjectSettings.vue'
import Toast from 'primevue/toast'
import Toolbar from 'primevue/toolbar'
import TabView from 'primevue/tabview'
import TabPanel from 'primevue/tabpanel'
import Tag from 'primevue/tag'
import 'primevue/resources/themes/saga-blue/theme.css'
import 'primevue/resources/primevue.min.css'
Expand All @@ -31,6 +29,8 @@ const tabs = [
{ id: "beam", title: 'Beam', content: Beam },
]
const activeTab = ref(tabs[0].id)
const data = reactive({
currentSection: "app", // app / projectSettings
tabs: tabs,
Expand Down Expand Up @@ -105,14 +105,21 @@ onMounted(() => refreshAppConfig())
</template>
</Toolbar>

<TabView v-if="data.currentSection === 'app'">
<TabPanel v-for="tab in tabs" :header="tab.title" :key="tab.id">
<div class="component-wrapper h-full">
<Beam v-if="tab.id === 'beam'" :messages="data.messages" class="component" @clear-beam-messages="clearMessages" />
<component v-else class="component" :is="tab.content" />
</div>
</TabPanel>
</TabView>
<div class="flex pl-2 border-gray-300 bg-gray-100" style="border-bottom: solid 2px;">
<div v-for="tab in tabs"
:style="[activeTab == tab.id ? 'border-bottom: solid 2px' : '', 'position: relative; top: 2px;']"
:class="[activeTab == tab.id ? 'text-blue-500' : '', 'px-3 py-3 font-medium cursor-pointer']"
@click="activeTab = tab.id"
>
{{ tab.title }}
</div>
</div>
<div v-if="data.currentSection === 'app'" class="component-wrapper h-full p-4">
<Beam v-if="activeTab === 'beam'" :messages="data.messages" class="component" @clear-beam-messages="clearMessages" />
<Tinker v-else-if="activeTab === 'tinker'" class="component" />
<JsonFormatter v-else-if="activeTab === 'jsonformatter'" class="component" />
</div>

<div v-else-if="data.currentSection === 'projectSettings'" class="component-wrapper pb-5 h-full m-3">
<ProjectSettings
:app-config="data.appConfig"
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: string;
}
}
4 changes: 2 additions & 2 deletions frontend/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {createApp} from 'vue'
import { createApp } from 'vue'
import App from './App.vue'
import PrimeVue from 'primevue/config';
import PrimeVue from 'primevue/config'
import ToastService from 'primevue/toastservice'

const app = createApp(App)
Expand Down
13 changes: 12 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/jsawo/renfield/tinker"
"github.com/wailsapp/wails/v2"
"github.com/wailsapp/wails/v2/pkg/options"
"github.com/wailsapp/wails/v2/pkg/options/linux"
)

var (
Expand All @@ -21,6 +22,9 @@ var (
//go:embed all:frontend/dist
var assets embed.FS

//go:embed build/appicon.png
var icon []byte

func main() {
config.Load()
appService = NewApp()
Expand All @@ -34,12 +38,19 @@ func main() {
Assets: assets,
BackgroundColour: &options.RGBA{R: 27, G: 38, B: 54, A: 1},
OnStartup: appStartup,
WindowStartState: options.Minimised,
Bind: []interface{}{
appService,
tinkerService,
jsonFormatter,
},
Linux: &linux.Options{
Icon: icon,
WindowIsTranslucent: false,
},
// WindowStartState: options.Minimised,
// Debug: options.Debug{
// OpenInspectorOnStartup: true,
// },
})

if err != nil {
Expand Down

0 comments on commit ae48cb1

Please sign in to comment.