Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,8 @@ namespace config {
"ipv4", // Address family
platf::appdata().string() + "/sunshine.log", // log file
false, // notify_pre_releases
{}, // prep commands
{}, // prep commands
true, // open_webui
};

bool endline(char ch) {
Expand Down Expand Up @@ -1227,6 +1228,7 @@ namespace config {
bool_f(vars, "native_pen_touch", input.native_pen_touch);

bool_f(vars, "notify_pre_releases", sunshine.notify_pre_releases);
bool_f(vars, "open_webui", sunshine.open_webui);

int port = sunshine.port;
int_between_f(vars, "port"s, port, {1024 + nvhttp::PORT_HTTPS, 65535 - rtsp_stream::RTSP_SETUP_PORT});
Expand Down Expand Up @@ -1442,8 +1444,10 @@ namespace config {
service_ctrl::wait_for_ui_ready();
}

// Launch the web UI
launch_ui();
if (config::sunshine.open_webui) {
// Launch the web UI
launch_ui();
}

// Always return 1 to ensure Sunshine doesn't start normally
return 1;
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ namespace config {
std::string log_file;
bool notify_pre_releases;
std::vector<prep_cmd_t> prep_cmds;
bool open_webui;
};

extern video_t video;
Expand Down
1 change: 1 addition & 0 deletions src_assets/common/assets/web/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ <h1 class="my-4">{{ $t('config.configuration') }}</h1>
"min_log_level": 2,
"global_prep_cmd": [],
"notify_pre_releases": "disabled",
"open_webui": "enabled",
},
},
{
Expand Down
8 changes: 8 additions & 0 deletions src_assets/common/assets/web/configs/tabs/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ function removeCmd(index) {
v-model="config.notify_pre_releases"
default="false"
></Checkbox>

<!-- open_webui -->
<Checkbox class="mb-3"
id="open_webui"
locale-prefix="config"
v-model="config.open_webui"
default="false"
></Checkbox>
</div>
</template>

Expand Down
2 changes: 2 additions & 0 deletions src_assets/common/assets/web/public/assets/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@
"nvenc_twopass_quarter_res": "Quarter resolution (faster, default)",
"nvenc_vbv_increase": "Single-frame VBV/HRD percentage increase",
"nvenc_vbv_increase_desc": "By default sunshine uses single-frame VBV/HRD, which means any encoded video frame size is not expected to exceed requested bitrate divided by requested frame rate. Relaxing this restriction can be beneficial and act as low-latency variable bitrate, but may also lead to packet loss if the network doesn't have buffer headroom to handle bitrate spikes. Maximum accepted value is 400, which corresponds to 5x increased encoded video frame upper size limit.",
"open_webui": "Open web UI on launch",
"open_webui_desc": "Whether the web UI is automatically opened in your browser when Sunshine is started from the shortcut",
"origin_web_ui_allowed": "Origin Web UI Allowed",
"origin_web_ui_allowed_desc": "The origin of the remote endpoint address that is not denied access to Web UI",
"origin_web_ui_allowed_lan": "Only those in LAN may access Web UI",
Expand Down