@@ -675,3 +675,121 @@ func (ui *LauncherUI) UpdateRunningState(isRunning bool) {
675
675
}
676
676
})
677
677
}
678
+
679
+ // ShowWelcomeWindow displays the welcome window with helpful information
680
+ func (ui * LauncherUI ) ShowWelcomeWindow () {
681
+ if ui .launcher == nil || ui .launcher .window == nil {
682
+ log .Printf ("Cannot show welcome window: launcher or window is nil" )
683
+ return
684
+ }
685
+
686
+ fyne .DoAndWait (func () {
687
+ // Create welcome window
688
+ welcomeWindow := ui .launcher .app .NewWindow ("Welcome to LocalAI Launcher" )
689
+ welcomeWindow .Resize (fyne .NewSize (600 , 500 ))
690
+ welcomeWindow .CenterOnScreen ()
691
+ welcomeWindow .SetCloseIntercept (func () {
692
+ welcomeWindow .Close ()
693
+ })
694
+
695
+ // Title
696
+ titleLabel := widget .NewLabel ("Welcome to LocalAI Launcher!" )
697
+ titleLabel .TextStyle = fyne.TextStyle {Bold : true }
698
+ titleLabel .Alignment = fyne .TextAlignCenter
699
+
700
+ // Welcome message
701
+ welcomeText := `LocalAI Launcher makes it easy to run LocalAI on your system.
702
+
703
+ What you can do:
704
+ • Start and stop LocalAI server
705
+ • Configure models and backends paths
706
+ • Set environment variables
707
+ • Check for updates automatically
708
+ • Access LocalAI WebUI when running
709
+
710
+ Getting Started:
711
+ 1. Configure your models and backends paths
712
+ 2. Click "Start LocalAI" to begin
713
+ 3. Use "Open WebUI" to access the interface
714
+ 4. Check the system tray for quick access`
715
+
716
+ welcomeLabel := widget .NewLabel (welcomeText )
717
+ welcomeLabel .Wrapping = fyne .TextWrapWord
718
+
719
+ // Useful links section
720
+ linksTitle := widget .NewLabel ("Useful Links:" )
721
+ linksTitle .TextStyle = fyne.TextStyle {Bold : true }
722
+
723
+ // Create link buttons
724
+ docsButton := widget .NewButton ("📚 Documentation" , func () {
725
+ ui .openURL ("https://localai.io/docs/" )
726
+ })
727
+
728
+ githubButton := widget .NewButton ("🐙 GitHub Repository" , func () {
729
+ ui .openURL ("https://github.com/mudler/LocalAI" )
730
+ })
731
+
732
+ modelsButton := widget .NewButton ("🤖 Model Gallery" , func () {
733
+ ui .openURL ("https://localai.io/models/" )
734
+ })
735
+
736
+ communityButton := widget .NewButton ("💬 Community" , func () {
737
+ ui .openURL ("https://discord.gg/XgwjKptP7Z" )
738
+ })
739
+
740
+ // Checkbox to disable welcome window
741
+ dontShowAgainCheck := widget .NewCheck ("Don't show this welcome window again" , func (checked bool ) {
742
+ if ui .launcher != nil {
743
+ config := ui .launcher .GetConfig ()
744
+ v := ! checked
745
+ config .ShowWelcome = & v
746
+ ui .launcher .SetConfig (config )
747
+ }
748
+ })
749
+
750
+ config := ui .launcher .GetConfig ()
751
+ if config .ShowWelcome != nil {
752
+ dontShowAgainCheck .SetChecked (* config .ShowWelcome )
753
+ }
754
+
755
+ // Close button
756
+ closeButton := widget .NewButton ("Get Started" , func () {
757
+ welcomeWindow .Close ()
758
+ })
759
+ closeButton .Importance = widget .HighImportance
760
+
761
+ // Layout
762
+ linksContainer := container .NewVBox (
763
+ linksTitle ,
764
+ docsButton ,
765
+ githubButton ,
766
+ modelsButton ,
767
+ communityButton ,
768
+ )
769
+
770
+ content := container .NewVBox (
771
+ titleLabel ,
772
+ widget .NewSeparator (),
773
+ welcomeLabel ,
774
+ widget .NewSeparator (),
775
+ linksContainer ,
776
+ widget .NewSeparator (),
777
+ dontShowAgainCheck ,
778
+ widget .NewSeparator (),
779
+ closeButton ,
780
+ )
781
+
782
+ welcomeWindow .SetContent (content )
783
+ welcomeWindow .Show ()
784
+ })
785
+ }
786
+
787
+ // openURL opens a URL in the default browser
788
+ func (ui * LauncherUI ) openURL (urlString string ) {
789
+ parsedURL , err := url .Parse (urlString )
790
+ if err != nil {
791
+ log .Printf ("Failed to parse URL %s: %v" , urlString , err )
792
+ return
793
+ }
794
+ fyne .CurrentApp ().OpenURL (parsedURL )
795
+ }
0 commit comments