mirror of
https://github.com/OliveTin/OliveTin
synced 2026-09-22 09:45:36 +00:00
Feat nav on start icons (#849)
This commit is contained in:
+4
-6
@@ -1,10 +1,8 @@
|
||||
---
|
||||
#branches:
|
||||
# - name: main
|
||||
# range: '3000.x.x'
|
||||
|
||||
# - name: release/2k
|
||||
# range: '>=2000.0.0 <3000.0.0'
|
||||
# Only allow releases on the main branch (for 3k)
|
||||
# releases for 2k are published manaually.
|
||||
branches:
|
||||
- name: main
|
||||
|
||||
plugins:
|
||||
- '@semantic-release/commit-analyzer'
|
||||
|
||||
@@ -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
@@ -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]
|
||||
@@ -110,7 +115,7 @@ function constructFromJson(json) {
|
||||
isDisabled.value = !json.canExec
|
||||
displayTitle.value = title.value
|
||||
unicodeIcon.value = getUnicodeIcon(json.icon)
|
||||
|
||||
|
||||
// Initialize rate limit from action data (parse datetime string)
|
||||
if (json.datetimeRateLimitExpires) {
|
||||
const date = new Date(json.datetimeRateLimitExpires.replace(' ', 'T'))
|
||||
@@ -130,7 +135,7 @@ function updateFromJson(json) {
|
||||
// title - as the callback URL relies on it
|
||||
|
||||
unicodeIcon.value = getUnicodeIcon(json.icon)
|
||||
|
||||
|
||||
// Update rate limiting if changed (parse datetime string)
|
||||
if (json.datetimeRateLimitExpires) {
|
||||
const date = new Date(json.datetimeRateLimitExpires.replace(' ', 'T'))
|
||||
@@ -171,7 +176,7 @@ function updateRateLimitStatus() {
|
||||
isRateLimited.value = true
|
||||
const secondsRemaining = expires - now
|
||||
rateLimitMessage.value = `Rate limited, available in ${secondsRemaining} second${secondsRemaining !== 1 ? 's' : ''}`
|
||||
|
||||
|
||||
// Set up interval to update every second
|
||||
if (!rateLimitInterval) {
|
||||
rateLimitInterval = setInterval(() => {
|
||||
@@ -282,7 +287,7 @@ function onExecStatusChanged() {
|
||||
|
||||
onMounted(() => {
|
||||
constructFromJson(props.actionData)
|
||||
|
||||
|
||||
// Watch the central rate limit store for updates to this button's bindingId
|
||||
// Watch the entire rateLimits object to ensure reactivity with dynamic keys
|
||||
watch(
|
||||
|
||||
@@ -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 {
|
||||
@@ -394,7 +395,7 @@ service OliveTinApiService {
|
||||
rpc ExecutionStatus(ExecutionStatusRequest) returns (ExecutionStatusResponse) {}
|
||||
|
||||
rpc GetLogs(GetLogsRequest) returns (GetLogsResponse) {}
|
||||
|
||||
|
||||
rpc GetActionLogs(GetActionLogsRequest) returns (GetActionLogsResponse) {}
|
||||
|
||||
rpc ValidateArgumentType(ValidateArgumentTypeRequest) returns (ValidateArgumentTypeResponse) {}
|
||||
|
||||
@@ -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" +
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user