tensorgrid-ui 1.1.0 → 1.1.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.
Files changed (2) hide show
  1. package/lib/client.js +31 -1
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -188,6 +188,9 @@ window.__ModuleLoader__.load({
188
188
  'auth.done': 'Signed in.',
189
189
  'auth.cancelled': 'Sign-in cancelled.',
190
190
  'auth.unavailable': 'Sign-in is unavailable: the authorization row is not mounted in this profile.',
191
+ 'auth.needsRestart': 'Restart the application: the browser already has the new version, the server does not yet.',
192
+ 'auth.badResponse': 'The server answered {status} instead of data.',
193
+ 'auth.empty': 'No provider offers subscription sign-in.',
191
194
  'update.title': 'Updates',
192
195
  'update.check': 'Check',
193
196
  'update.apply': 'Update',
@@ -230,6 +233,9 @@ window.__ModuleLoader__.load({
230
233
  'auth.done': '已登录。',
231
234
  'auth.cancelled': '登录已取消。',
232
235
  'auth.unavailable': '无法登录:此配置文件未挂载授权行。',
236
+ 'auth.needsRestart': '请重启应用:浏览器已是新版本,服务端还不是。',
237
+ 'auth.badResponse': '服务端返回 {status},而不是数据。',
238
+ 'auth.empty': '没有服务商提供订阅登录。',
233
239
  'update.title': '更新',
234
240
  'update.check': '检查',
235
241
  'update.apply': '更新',
@@ -1569,6 +1575,9 @@ window.__ModuleLoader__.load({
1569
1575
  'auth.done': 'Вход выполнен.',
1570
1576
  'auth.cancelled': 'Вход отменён.',
1571
1577
  'auth.unavailable': 'Вход недоступен: в профиле не смонтирована строка авторизации.',
1578
+ 'auth.needsRestart': 'Перезапустите приложение: у браузера уже новая версия, у сервера ещё нет.',
1579
+ 'auth.badResponse': 'Сервер ответил {status} вместо данных.',
1580
+ 'auth.empty': 'Ни один провайдер не предлагает вход по подписке.',
1572
1581
  'update.title': 'Обновления',
1573
1582
  'update.check': 'Проверить',
1574
1583
  'update.apply': 'Обновить',
@@ -1945,8 +1954,23 @@ window.__ModuleLoader__.load({
1945
1954
  headers: { 'content-type': 'application/json' },
1946
1955
  body: JSON.stringify(body),
1947
1956
  })
1957
+
1958
+ // Маршрут поднимает host-половина, а она читается только при старте
1959
+ // приложения. После обновления браузер получает новый код раньше
1960
+ // Host-а, запрос уходит в общий заслон и возвращает 401 страницей, а
1961
+ // не JSON. Без этой проверки строка молча показывала пустоту.
1962
+ const type = response.headers.get('content-type') || ''
1963
+ if (!type.includes('application/json')) {
1964
+ return {
1965
+ available: true,
1966
+ providers: [],
1967
+ problem: response.status === 401 || response.status === 404
1968
+ ? t('auth.needsRestart')
1969
+ : t('auth.badResponse').replace('{status}', String(response.status)),
1970
+ }
1971
+ }
1948
1972
  return response.json()
1949
- }, [])
1973
+ }, [t])
1950
1974
 
1951
1975
  const refresh = React.useCallback(async (body) => {
1952
1976
  setBusy(true)
@@ -2069,6 +2093,12 @@ window.__ModuleLoader__.load({
2069
2093
  jsx('div', { className: 'dsx-setting__hint', children: t('auth.hint') }),
2070
2094
  ],
2071
2095
  }),
2096
+ state !== null && state.problem && (attempt === null || !attempt.problem)
2097
+ ? jsx('div', { className: 'dsx-setting__hint dsx-setting__hint--warn', children: state.problem })
2098
+ : null,
2099
+ state !== null && !state.problem && subscription.length === 0
2100
+ ? jsx('div', { className: 'dsx-setting__hint', children: t('auth.empty') })
2101
+ : null,
2072
2102
  jsx('div', {
2073
2103
  className: 'dsx-auth__list',
2074
2104
  children: subscription.map((provider) =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tensorgrid-ui",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "TENSOR GRID — фирменный интерфейс поверх DeepSeek Harness: палитра, живой ambient-слой, айдентика и русский язык-пакет",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",