feat: plugin no data

pull/19758/head
Joel 8 months ago committed by Junyan Qin
parent cadf3eac00
commit 44c5f5c5fc
No known key found for this signature in database
GPG Key ID: 22FE3AFADC710CEB

@ -3,7 +3,7 @@ import { AUTO_UPDATE_MODE, AUTO_UPDATE_STRATEGY } from './types'
export const defaultValue: AutoUpdateConfig = {
strategy_setting: AUTO_UPDATE_STRATEGY.fixOnly, // For test
upgrade_time_of_day: 0,
upgrade_mode: AUTO_UPDATE_MODE.update_all,
upgrade_mode: AUTO_UPDATE_MODE.exclude, // For test
exclude_plugins: [],
include_plugins: [],
}

@ -132,10 +132,13 @@ const AutoUpdateSetting: FC<Props> = ({
))}
</div>
<PluginsPicker
value={plugins}
onChange={handlePluginsChange}
/>
{upgrade_mode !== AUTO_UPDATE_MODE.update_all && (
<PluginsPicker
value={plugins}
onChange={handlePluginsChange}
updateMode={upgrade_mode}
/>
)}
</div>
</>
)}

@ -1,28 +1,31 @@
'use client'
import type { FC } from 'react'
import React from 'react'
import NoPluginSelected from './no-plugin-selected'
import type { AUTO_UPDATE_MODE } from './types'
type Props = {
updateMode: AUTO_UPDATE_MODE
value: string[] // plugin ids
onChange: (value: string[]) => void
}
const PluginsPicker: FC<Props> = ({
updateMode,
value,
onChange,
}) => {
const hasSelected = value.length > 0
return (
<div className='rounded-xl'>
<div className='mt-2 rounded-[10px] bg-background-section-burn p-2.5'>
{hasSelected ? (
<div className='flex justify-between'>
<div>Selected plugins will not auto-update</div>
</div>
) : (
<div className='system-xs-regular text-center text-text-tertiary'>
Only selected plugins will auto-update. No plugins are currently selected, so no plugins will auto-update.
</div>
<NoPluginSelected updateMode={updateMode} />
)}
</div>
)
}

@ -151,6 +151,10 @@ const translation = {
exclude: 'Exclude selected',
partial: 'Only selected',
},
upgradeModePlaceholder: {
exclude: 'Selected plugins will not auto-update',
partial: 'Only selected plugins will auto-update. No plugins are currently selected, so no plugins will auto-update.',
},
},
pluginInfoModal: {
title: 'Plugin info',

@ -151,6 +151,10 @@ const translation = {
exclude: '排除选定',
partial: '仅选定',
},
upgradeModePlaceholder: {
exclude: '选定的插件将不会自动更新',
partial: '仅选定的插件将自动更新。目前未选择任何插件,因此不会自动更新任何插件。',
},
},
pluginInfoModal: {
title: '插件信息',

Loading…
Cancel
Save