@gehennawu/dsh-service 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +8 -8
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -1291,13 +1291,14 @@ window.__ModuleLoader__.load({
|
|
|
1291
1291
|
: null)))
|
|
1292
1292
|
: null))
|
|
1293
1293
|
|
|
1294
|
-
const versionRow = (id, label, fallbackVersion, state) => React.createElement('div', { key: id, style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '16px', padding: '10px 2px', borderTop: id === 'dsh' ? 0 : '1px solid var(--dsw-alias-border-l1)' } },
|
|
1295
|
-
React.createElement('div', { style: { whiteSpace: 'nowrap' } },
|
|
1294
|
+
const versionRow = (id, label, fallbackVersion, state, action) => React.createElement('div', { key: id, style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', gap: '16px', padding: '10px 2px', borderTop: id === 'dsh' ? 0 : '1px solid var(--dsw-alias-border-l1)' } },
|
|
1295
|
+
React.createElement('div', { style: { whiteSpace: 'nowrap', display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
1296
1296
|
React.createElement('span', { style: { fontSize: '13px', fontWeight: 650 } }, `${label} `),
|
|
1297
1297
|
state?.url
|
|
1298
1298
|
? React.createElement('a', { 'data-testid': `version-${id}-link`, href: state.url, target: '_blank', rel: 'noreferrer', style: { color: 'var(--dsw-alias-label-primary)', textDecoration: 'underline', fontSize: '12px', whiteSpace: 'nowrap', marginLeft: '16px' } }, state.current || fallbackVersion || translate('version.loading'))
|
|
1299
1299
|
: React.createElement('code', { style: { fontSize: '12px', color: 'var(--dsw-alias-label-primary)', marginLeft: '16px' } }, state?.current || fallbackVersion || translate('version.loading'))),
|
|
1300
1300
|
state?.tags && id === 'dsh' ? React.createElement('span', { style: { marginLeft: '8px', fontSize: '11px', color: 'var(--dsw-alias-label-secondary)', whiteSpace: 'nowrap' } }, translate('update.channels', { latest: state.tags.latest || '—', next: state.tags.next || '—' })) : null,
|
|
1301
|
+
action || null,
|
|
1301
1302
|
React.createElement('div', { style: { textAlign: 'right', fontSize: '12px' } },
|
|
1302
1303
|
React.createElement('div', { style: { color: !state ? 'var(--dsw-alias-label-secondary)' : state.upToDate ? 'var(--dsw-alias-state-success-primary)' : 'var(--dsw-alias-state-warn-primary)', fontWeight: 600 } }, !state
|
|
1303
1304
|
? (updateError || translate('update.checking'))
|
|
@@ -1306,16 +1307,15 @@ window.__ModuleLoader__.load({
|
|
|
1306
1307
|
: state.upToDate ? translate('update.current') : translate('update.available', { version: state.latest }))))
|
|
1307
1308
|
// 版本信息区块
|
|
1308
1309
|
const pluginUpdate = updateInfo?.plugin && !updateInfo.plugin.upToDate && updateInfo.plugin.status === 'available'
|
|
1310
|
+
const pluginAction = pluginUpdate
|
|
1311
|
+
? React.createElement('button', { style: Object.assign({}, neutral, { minHeight: '24px', padding: '2px 8px', fontSize: '11px' }), disabled: upgradeBusy, onClick: upgradePlugin }, translate(upgradeBusy ? 'update.upgrading' : 'update.upgrade'))
|
|
1312
|
+
: null
|
|
1309
1313
|
const versionBlock = React.createElement('div', { key: 'version-card', 'data-testid': 'version-card', style: card },
|
|
1310
1314
|
React.createElement('div', { key: 'title', style: sectionTitle }, translate('version.title')),
|
|
1311
1315
|
React.createElement('div', { style: displaySurface },
|
|
1312
1316
|
versionRow('dsh', 'DSH', version, updateInfo?.dsh),
|
|
1313
|
-
versionRow('plugin', 'dsh-service', pluginVersion, updateInfo?.plugin),
|
|
1314
|
-
|
|
1315
|
-
? React.createElement('div', { style: { marginTop: '8px', display: 'flex', alignItems: 'center', gap: '8px' } },
|
|
1316
|
-
pluginUpdate ? React.createElement('button', { style: primary, disabled: upgradeBusy, onClick: upgradePlugin }, translate(upgradeBusy ? 'update.upgrading' : 'update.upgrade')) : null,
|
|
1317
|
-
upgradeError ? React.createElement('span', { style: { fontSize: '12px', color: 'var(--dsw-alias-state-error-primary)' } }, upgradeError) : null)
|
|
1318
|
-
: null))
|
|
1317
|
+
versionRow('plugin', 'dsh-service', pluginVersion, updateInfo?.plugin, pluginAction),
|
|
1318
|
+
upgradeError ? React.createElement('p', { style: Object.assign({}, hint, { color: 'var(--dsw-alias-state-error-primary)', margin: '4px 0 0' }) }, upgradeError) : null))
|
|
1319
1319
|
|
|
1320
1320
|
// 重启后提示
|
|
1321
1321
|
if (stage === 2) {
|