26
26
</template >
27
27
28
28
</v-checkbox >
29
+
30
+ <v-checkbox
31
+ v-model =" form.posterStretch"
32
+ @change =" $v.form.posterStretch.$touch()"
33
+ :label =" $t('ui_settings.label_poster_stretch')"
34
+ hide-details
35
+ />
29
36
</v-col >
30
37
</v-row >
31
38
<v-row >
48
55
49
56
<script lang="ts">
50
57
import Vue from ' vue'
51
- import {helpers } from ' vuelidate/lib/validators'
52
58
import ConfirmationDialog from ' @/components/dialogs/ConfirmationDialog.vue'
53
59
import FileBrowserDialog from ' @/components/dialogs/FileBrowserDialog.vue'
54
60
import {CLIENT_SETTING , ClientSettingDto } from ' @/types/komga-clientsettings'
55
61
56
- const contextPath = helpers .regex (' contextPath' , / ^ \/ [-a-zA-Z0-9 _\/ ] * [a-zA-Z0-9 ] $ / )
57
-
58
62
export default Vue .extend ({
59
63
name: ' UISettings' ,
60
64
components: {FileBrowserDialog , ConfirmationDialog },
61
65
data : () => ({
62
66
form: {
63
67
oauth2HideLogin: false ,
64
68
oauth2AutoLogin: false ,
69
+ posterStretch: false ,
65
70
},
66
71
existingSettings: [] as ClientSettingDto [],
67
72
}),
68
73
validations: {
69
74
form: {
70
75
oauth2HideLogin: {},
71
76
oauth2AutoLogin: {},
77
+ posterStretch: {},
72
78
},
73
79
},
74
80
mounted() {
@@ -87,6 +93,7 @@ export default Vue.extend({
87
93
await this .$store .dispatch (' getClientSettings' )
88
94
this .form .oauth2HideLogin = this .$store .getters .getClientSettingByKey (CLIENT_SETTING .WEBUI_OAUTH2_HIDE_LOGIN )?.value === ' true'
89
95
this .form .oauth2AutoLogin = this .$store .getters .getClientSettingByKey (CLIENT_SETTING .WEBUI_OAUTH2_AUTO_LOGIN )?.value === ' true'
96
+ this .form .posterStretch = this .$store .getters .getClientSettingByKey (CLIENT_SETTING .WEBUI_POSTER_STRETCH )?.value === ' true'
90
97
this .$v .form .$reset ()
91
98
},
92
99
async saveSettings() {
@@ -104,6 +111,13 @@ export default Vue.extend({
104
111
allowUnauthorized: true ,
105
112
})
106
113
114
+ if (this .$v .form ?.posterStretch ?.$dirty )
115
+ await this .$komgaSettings .updateClientSettingGlobal ({
116
+ key: CLIENT_SETTING .WEBUI_POSTER_STRETCH ,
117
+ value: this .form .posterStretch ? ' true' : ' false' ,
118
+ allowUnauthorized: false ,
119
+ })
120
+
107
121
await this .refreshSettings ()
108
122
},
109
123
},
0 commit comments