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 = { export const defaultValue: AutoUpdateConfig = {
strategy_setting: AUTO_UPDATE_STRATEGY.fixOnly, // For test strategy_setting: AUTO_UPDATE_STRATEGY.fixOnly, // For test
upgrade_time_of_day: 0, upgrade_time_of_day: 0,
upgrade_mode: AUTO_UPDATE_MODE.update_all, upgrade_mode: AUTO_UPDATE_MODE.exclude, // For test
exclude_plugins: [], exclude_plugins: [],
include_plugins: [], include_plugins: [],
} }

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

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

@ -151,6 +151,10 @@ const translation = {
exclude: 'Exclude selected', exclude: 'Exclude selected',
partial: 'Only 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: { pluginInfoModal: {
title: 'Plugin info', title: 'Plugin info',

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

Loading…
Cancel
Save