KV存储改为默认开启

保存

保存
This commit is contained in:
eoao
2025-12-31 23:33:52 +08:00
parent 69632c8cc6
commit 88a4b9dff5
16 changed files with 75 additions and 80 deletions

View File

@@ -92,8 +92,8 @@ function initEditor() {
statusbar: false,
height: "100%",
auto_focus: true,
relative_urls: false, //阻止 img标签域名和网站域名相同 自动把链接转换相对路径
remove_script_host: false, // 阻止删除 URL 中的域名
//relative_urls: false, //阻止 img标签域名和网站域名相同 自动把链接转换相对路径
//remove_script_host: false, // 阻止删除 URL 中的域名
forced_root_block: 'div',
skin: `${uiStore.dark ? 'oxide-dark' : 'oxide'}`,
content_css: `/tinymce/css/index.css,${uiStore.dark ? 'dark' : 'default'}`,

View File

@@ -150,6 +150,7 @@ const en = {
resendToken: 'Resend Token',
oss: 'Object Storage',
osDomain: 'Domain',
ossDomainDesc: 'Leave empty if using KV storage.',
emailPush: 'Email Push',
tgBot: 'Telegram Bot',
disable: 'Disable',
@@ -293,13 +294,11 @@ const en = {
include: 'Include',
delAllEmailConfirm: 'Do you really want to delete it?',
s3Configuration: 'S3 Configuration',
s3Desc: 'If another S3-compatible storage is configured, R2 will take priority if its already connected',
confirmDeletionOfContacts: 'Confirm clearing contacts?',
recentContacts: 'Recent contacts',
selectContacts: 'Select',
forcePathStyleDesc: 'Some self-hosted object storages require path-style access to be enabled',
kvStorageDesc: 'Replace object storage with KV, and update the access domain to a Worker custom domain',
kvStorage: 'KV Storage',
storageType: 'Storage Location',
customDomainDesc: 'Worker custom domain',
show: 'Show',
hide: 'Hide',

View File

@@ -150,6 +150,7 @@ const zh = {
resendToken: 'Resend Token',
oss: '对象存储',
osDomain: '访问域名',
ossDomainDesc: '如果是KV存储不要填',
emailPush: '邮件推送',
tgBot: 'Telegram 机器人',
disable: '关闭',
@@ -293,13 +294,11 @@ const zh = {
include: '包含',
delAllEmailConfirm: '确定要删除吗?',
s3Configuration: 'S3 配置',
s3Desc: '设置其他S3协议存储如果绑定了R2会优先用R2',
confirmDeletionOfContacts: '确认清除这些联系人吗?',
recentContacts: '最近联系人',
selectContacts: '选中',
forcePathStyleDesc: '路径样式访问,一些自建的对象存储需要打开',
kvStorageDesc: '使用KV替代对象存储访问域名改成worker自定义域',
kvStorage: 'KV 存储',
storageType: '存储类型',
customDomainDesc: 'Worker 自定义域',
show: '显示',
hide: '隐藏',

View File

@@ -13,6 +13,10 @@ export function cvtR2Url(key) {
let domain = settings.r2Domain
if (!domain) {
return key;
}
if (!domain.startsWith('http')) {
return 'https://' + domain + '/' + key
}
@@ -26,7 +30,7 @@ export function cvtR2Url(key) {
export function toOssDomain(domain) {
if (!domain) {
return null
return ''
}
if (!domain.startsWith('http')) {

View File

@@ -197,7 +197,12 @@
<div class="card-title">{{ $t('oss') }}</div>
<div class="card-content">
<div class="r2domain-item">
<div><span>{{ $t('osDomain') }}</span></div>
<div>
<span>{{ $t('osDomain') }}</span>
<el-tooltip effect="dark" :content="$t('ossDomainDesc')">
<Icon class="warning" icon="fe:warning" width="18" height="18"/>
</el-tooltip>
</div>
<div class="r2domain">
<span>{{ setting.r2Domain || '' }}</span>
<el-button class="opt-button" size="small" type="primary" @click="r2DomainShow = true">
@@ -208,9 +213,6 @@
<div class="setting-item">
<div>
<span>{{ $t('s3Configuration') }}</span>
<el-tooltip effect="dark" :content="$t('s3Desc')">
<Icon class="warning" icon="fe:warning" width="18" height="18"/>
</el-tooltip>
</div>
<div class="r2domain">
<el-button class="opt-button" size="small" type="primary" @click="addS3Show = true">
@@ -220,14 +222,12 @@
</div>
<div class="setting-item">
<div>
<span>{{ $t('kvStorage') }}</span>
<el-tooltip effect="dark" :content="$t('kvStorageDesc')">
<Icon class="warning" icon="fe:warning" width="18" height="18"/>
</el-tooltip>
<span>{{ $t('storageType') }}</span>
</div>
<div class="r2domain">
<el-switch @change="change" :before-change="beforeChange" :active-value="0" :inactive-value="1"
v-model="setting.kvStorage"/>
<div class="storage-type">
<el-tag>{{ setting.storageType }}</el-tag>
</div>
</div>
</div>
</div>
@@ -1703,6 +1703,10 @@ function editSetting(settingForm, refreshStatus = true) {
grid-template-columns: 1fr auto;
align-items: center;
.storage-type {
margin-right: 3px;
}
span {
overflow: hidden;
white-space: nowrap;