-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathPluginReadmeImageSourceSetting.vue
More file actions
70 lines (60 loc) · 1.68 KB
/
Copy pathPluginReadmeImageSourceSetting.vue
File metadata and controls
70 lines (60 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<template>
<div class="readme-image-source">
<v-switch
v-model="readmeImageUseGitHub"
class="readme-image-source-switch"
color="primary"
density="compact"
hide-details
:label="tm('network.proxySelector.readmeImages.useGitHub')">
</v-switch>
<div class="text-caption text-medium-emphasis mt-1">
{{ tm('network.proxySelector.readmeImages.hint') }}
</div>
</div>
</template>
<script setup>
import { computed, ref, watch } from 'vue';
import { useModuleI18n } from '@/i18n/composables';
import {
PLUGIN_README_IMAGE_SOURCE,
getPluginReadmeImageSource,
setPluginReadmeImageSource
} from '@/utils/githubProxy';
const { tm } = useModuleI18n('features/settings');
const readmeImageSource = ref(getPluginReadmeImageSource());
const readmeImageUseGitHub = computed({
get() {
return readmeImageSource.value === PLUGIN_README_IMAGE_SOURCE.GITHUB;
},
set(value) {
readmeImageSource.value = value
? PLUGIN_README_IMAGE_SOURCE.GITHUB
: PLUGIN_README_IMAGE_SOURCE.LOCAL;
}
});
watch(readmeImageSource, (newVal) => {
setPluginReadmeImageSource(newVal);
});
</script>
<style scoped>
.readme-image-source {
max-width: 100%;
overflow: visible;
padding-left: 10px;
}
.readme-image-source-switch {
overflow: visible;
}
.readme-image-source-switch :deep(.v-selection-control) {
min-height: 32px;
overflow: visible;
}
.readme-image-source-switch :deep(.v-selection-control__wrapper) {
overflow: visible;
}
.readme-image-source-switch :deep(.v-label) {
line-height: 1.35;
white-space: normal;
}
</style>