feat: configuration options for navigate-on-start icons

This commit is contained in:
jamesread 2026-01-25 21:50:03 +00:00
parent bcc2d50299
commit e807cb5231
7 changed files with 34 additions and 13 deletions

View File

@ -1,4 +1,4 @@
// @generated by protoc-gen-es v2.10.2
// @generated by protoc-gen-es v2.11.0
// @generated from file olivetin/api/v1/olivetin.proto (package olivetin.api.v1, syntax proto3)
/* eslint-disable */
@ -1458,6 +1458,11 @@ export declare type InitResponse = Message<"olivetin.api.v1.InitResponse"> & {
* @generated from field: repeated string available_themes = 24;
*/
availableThemes: string[];
/**
* @generated from field: bool show_navigate_on_start_icons = 25;
*/
showNavigateOnStartIcons: boolean;
};
/**
@ -1841,4 +1846,3 @@ export declare const OliveTinApiService: GenService<{
output: typeof EntitySchema;
},
}>;

File diff suppressed because one or more lines are too long

View File

@ -3,7 +3,7 @@
<button :id="`actionButtonInner-${bindingId}`" :title="title" :disabled="!canExec || isDisabled"
:class="combinedClasses" @click="handleClick">
<div class="navigate-on-start-container">
<div v-if="showNavigateOnStartIcons" class="navigate-on-start-container">
<div v-if="navigateOnStart == 'pop'" class="navigate-on-start" title="Opens a popup dialog on start">
<HugeiconsIcon :icon="ComputerTerminal01Icon" />
</div>
@ -69,6 +69,11 @@ let rateLimitInterval = null
// Animation classes
const buttonClasses = ref([])
// Show navigate on start icons - defaults to true if not set
const showNavigateOnStartIcons = computed(() => {
return window.initResponse?.showNavigateOnStartIcons ?? true
})
// Combined classes including custom cssClass
const combinedClasses = computed(() => {
const classes = [...buttonClasses.value]

View File

@ -333,6 +333,7 @@ message InitResponse {
bool show_log_list = 22;
bool login_required = 23;
repeated string available_themes = 24; // List of available theme names
bool show_navigate_on_start_icons = 25;
}
message AdditionalLink {

View File

@ -3237,6 +3237,7 @@ type InitResponse struct {
ShowLogList bool `protobuf:"varint,22,opt,name=show_log_list,json=showLogList,proto3" json:"show_log_list,omitempty"`
LoginRequired bool `protobuf:"varint,23,opt,name=login_required,json=loginRequired,proto3" json:"login_required,omitempty"`
AvailableThemes []string `protobuf:"bytes,24,rep,name=available_themes,json=availableThemes,proto3" json:"available_themes,omitempty"` // List of available theme names
ShowNavigateOnStartIcons bool `protobuf:"varint,25,opt,name=show_navigate_on_start_icons,json=showNavigateOnStartIcons,proto3" json:"show_navigate_on_start_icons,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
@ -3439,6 +3440,13 @@ func (x *InitResponse) GetAvailableThemes() []string {
return nil
}
func (x *InitResponse) GetShowNavigateOnStartIcons() bool {
if x != nil {
return x.ShowNavigateOnStartIcons
}
return false
}
type AdditionalLink struct {
state protoimpl.MessageState `protogen:"open.v1"`
Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
@ -4096,7 +4104,7 @@ const file_olivetin_api_v1_olivetin_proto_rawDesc = "" +
"\x16GetDiagnosticsResponse\x12 \n" +
"\vSshFoundKey\x18\x01 \x01(\tR\vSshFoundKey\x12&\n" +
"\x0eSshFoundConfig\x18\x02 \x01(\tR\x0eSshFoundConfig\"\r\n" +
"\vInitRequest\"\xcd\b\n" +
"\vInitRequest\"\x8d\t\n" +
"\fInitResponse\x12\x1e\n" +
"\n" +
"showFooter\x18\x01 \x01(\bR\n" +
@ -4125,7 +4133,8 @@ const file_olivetin_api_v1_olivetin_proto_rawDesc = "" +
"\x10show_diagnostics\x18\x15 \x01(\bR\x0fshowDiagnostics\x12\"\n" +
"\rshow_log_list\x18\x16 \x01(\bR\vshowLogList\x12%\n" +
"\x0elogin_required\x18\x17 \x01(\bR\rloginRequired\x12)\n" +
"\x10available_themes\x18\x18 \x03(\tR\x0favailableThemes\"8\n" +
"\x10available_themes\x18\x18 \x03(\tR\x0favailableThemes\x12>\n" +
"\x1cshow_navigate_on_start_icons\x18\x19 \x01(\bR\x18showNavigateOnStartIcons\"8\n" +
"\x0eAdditionalLink\x12\x14\n" +
"\x05title\x18\x01 \x01(\tR\x05title\x12\x10\n" +
"\x03url\x18\x02 \x01(\tR\x03url\"L\n" +

View File

@ -905,6 +905,7 @@ func (api *oliveTinAPI) Init(ctx ctx.Context, req *connect.Request[apiv1.InitReq
ShowLogList: user.EffectivePolicy.ShowLogList,
LoginRequired: loginRequired,
AvailableThemes: discoverAvailableThemes(api.cfg),
ShowNavigateOnStartIcons: api.cfg.ShowNavigateOnStartIcons,
}
return connect.NewResponse(res), nil

View File

@ -128,6 +128,7 @@ type Config struct {
ShowFooter bool `koanf:"showFooter"`
ShowNavigation bool `koanf:"showNavigation"`
ShowNewVersions bool `koanf:"showNewVersions"`
ShowNavigateOnStartIcons bool `koanf:"showNavigateOnStartIcons"`
EnableCustomJs bool `koanf:"enableCustomJs"`
AuthJwtCookieName string `koanf:"authJwtCookieName"`
AuthJwtHeader string `koanf:"authJwtHeader"`
@ -244,6 +245,7 @@ func DefaultConfigWithBasePort(basePort int) *Config {
config.ShowFooter = true
config.ShowNavigation = true
config.ShowNewVersions = true
config.ShowNavigateOnStartIcons = true
config.EnableCustomJs = false
config.ExternalRestAddress = "."
config.LogLevel = "INFO"