-
-
+
+
+
+
+
+
-
+
+
+
+
@@ -42,11 +51,14 @@
No active connection
-
Saved hosts
-
@@ -63,6 +75,7 @@ export default {
data: function () {
return {
+ localMode: true,
hostname: "localhost",
port: 5000,
selectedHost: "",
@@ -77,6 +90,8 @@ export default {
},
mounted() {
+ // Propagate localMode settings
+ this.setLocalMode(this.localMode)
// Try loading and parsing savedHosts from localStorage
if (localStorage.getItem('savedHosts')) {
try {
@@ -97,19 +112,34 @@ export default {
methods: {
handleSubmit: function(event) {
+ // Split host and port if needed
if (this.hostname.includes(':')) {
- this.port = this.computedPort
+ this.port = this.computedPort;
this.hostname = this.hostname.split(':')[0];
}
+ // Handle auto-local-connect
+ if (this.localMode) {
+ var hostname = "localhost";
+ }
+ else {
+ var hostname = this.hostname;
+ }
// Commit the hostname and port to store
this.$store.commit('changeHost', [
- this.hostname,
+ hostname,
this.port
]);
// Try to get config and state JSON from the newly submitted host
this.$store.dispatch('firstConnect')
},
+ setLocalMode: function (state) {
+ this.$store.commit("changeSetting", ['trackWindow', state]);
+ this.$store.commit("changeSetting", ['disableStream', state]);
+ this.$store.commit("changeSetting", ['autoGpuPreview', state]);
+ this.$root.$emit('globalTogglePreview', state)
+ },
+
autofillHost: function (host) {
this.hostname = host.hostname;
this.port = host.port
@@ -144,6 +174,16 @@ export default {
}
},
+ computedLocalMode: {
+ get: function() {
+ return this.localMode
+ },
+ set: function(state) {
+ this.localMode = state;
+ this.setLocalMode(state)
+ }
+ },
+
computedPort: {
get: function() {
if (this.hostname.includes(':')) {
diff --git a/src/components/paneSettingsComponents/streamSettings.vue b/src/components/paneSettingsComponents/streamSettings.vue
index 36205037..aa342530 100644
--- a/src/components/paneSettingsComponents/streamSettings.vue
+++ b/src/components/paneSettingsComponents/streamSettings.vue
@@ -1,13 +1,11 @@
@@ -20,23 +18,10 @@ export default {
name: 'appSettings',
data: function () {
- return {
- isLocalMode: false
- }
+ return {}
},
computed: {
- localMode: {
- get() {
- return this.isLocalMode
- },
- set(value) {
- this.isLocalMode = value;
- this.trackWindow = value;
- this.disableStream = value;
- this.autoGpuPreview = value;
- }
- },
disableStream: {
get() {
@@ -64,10 +49,6 @@ export default {
set(value) {
this.$store.commit("changeSetting", ['trackWindow', value]);
}
- },
-
- disableIfLocalMode: function () {
- return {'uk-disabled': this.localMode}
}
}