Add "(coming soon)" label for unsupported upstream source types
Only pypi and generic are currently supported. Other types now show "(coming soon)" in both the dropdown and the sources table.
This commit is contained in:
@@ -132,6 +132,12 @@
|
|||||||
color: #c62828;
|
color: #c62828;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.coming-soon-badge {
|
||||||
|
color: #9e9e9e;
|
||||||
|
font-style: italic;
|
||||||
|
font-size: 0.85em;
|
||||||
|
}
|
||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
.actions-cell {
|
.actions-cell {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { UpstreamSource, SourceType, AuthType } from '../types';
|
|||||||
import './AdminCachePage.css';
|
import './AdminCachePage.css';
|
||||||
|
|
||||||
const SOURCE_TYPES: SourceType[] = ['npm', 'pypi', 'maven', 'docker', 'helm', 'nuget', 'deb', 'rpm', 'generic'];
|
const SOURCE_TYPES: SourceType[] = ['npm', 'pypi', 'maven', 'docker', 'helm', 'nuget', 'deb', 'rpm', 'generic'];
|
||||||
|
const SUPPORTED_SOURCE_TYPES: Set<SourceType> = new Set(['pypi', 'generic']);
|
||||||
const AUTH_TYPES: AuthType[] = ['none', 'basic', 'bearer', 'api_key'];
|
const AUTH_TYPES: AuthType[] = ['none', 'basic', 'bearer', 'api_key'];
|
||||||
|
|
||||||
function AdminCachePage() {
|
function AdminCachePage() {
|
||||||
@@ -285,7 +286,12 @@ function AdminCachePage() {
|
|||||||
<span className="env-badge" title="Defined via environment variable">ENV</span>
|
<span className="env-badge" title="Defined via environment variable">ENV</span>
|
||||||
)}
|
)}
|
||||||
</td>
|
</td>
|
||||||
<td>{source.source_type}</td>
|
<td>
|
||||||
|
{source.source_type}
|
||||||
|
{!SUPPORTED_SOURCE_TYPES.has(source.source_type) && (
|
||||||
|
<span className="coming-soon-badge"> (coming soon)</span>
|
||||||
|
)}
|
||||||
|
</td>
|
||||||
<td className="url-cell" title={source.url}>{source.url}</td>
|
<td className="url-cell" title={source.url}>{source.url}</td>
|
||||||
<td>{source.priority}</td>
|
<td>{source.priority}</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -359,7 +365,7 @@ function AdminCachePage() {
|
|||||||
>
|
>
|
||||||
{SOURCE_TYPES.map((type) => (
|
{SOURCE_TYPES.map((type) => (
|
||||||
<option key={type} value={type}>
|
<option key={type} value={type}>
|
||||||
{type}
|
{type}{!SUPPORTED_SOURCE_TYPES.has(type) ? ' (coming soon)' : ''}
|
||||||
</option>
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user