mirror of https://github.com/portainer/portainer
parent
cee241e77c
commit
d85149e328
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
.refresh-environments-button {
|
.refresh-environments-button {
|
||||||
margin-left: 0 !important;
|
margin-left: 0 !important;
|
||||||
padding: 8px 15px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-container {
|
.filter-container {
|
||||||
|
@ -73,7 +72,6 @@
|
||||||
.filterSearchbar {
|
.filterSearchbar {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-left: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.filterSearchbar input[type='text'] {
|
.filterSearchbar input[type='text'] {
|
||||||
|
|
|
@ -192,8 +192,10 @@ export function EnvironmentList({ onClickItem, onRefresh }: Props) {
|
||||||
<Button
|
<Button
|
||||||
onClick={onRefresh}
|
onClick={onRefresh}
|
||||||
data-cy="home-refreshEndpointsButton"
|
data-cy="home-refreshEndpointsButton"
|
||||||
|
size="medium"
|
||||||
|
color="secondary"
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'vertical-center',
|
'vertical-center !ml-0',
|
||||||
styles.refreshEnvironmentsButton
|
styles.refreshEnvironmentsButton
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
@ -215,7 +217,7 @@ export function EnvironmentList({ onClickItem, onRefresh }: Props) {
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.filterSearchbar}>
|
<div className={clsx(styles.filterSearchbar, 'ml-3')}>
|
||||||
<FilterSearchBar
|
<FilterSearchBar
|
||||||
value={searchBarValue}
|
value={searchBarValue}
|
||||||
onChange={setSearchBarValue}
|
onChange={setSearchBarValue}
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
.kubeconfig-button {
|
|
||||||
padding: 8px 15px;
|
|
||||||
}
|
|
|
@ -8,7 +8,6 @@ import { Query } from '@/portainer/environments/queries/useEnvironmentList';
|
||||||
|
|
||||||
import { Button } from '@@/buttons';
|
import { Button } from '@@/buttons';
|
||||||
|
|
||||||
import styles from './KubeconfigButton.module.css';
|
|
||||||
import { KubeconfigPrompt } from './KubeconfigPrompt';
|
import { KubeconfigPrompt } from './KubeconfigPrompt';
|
||||||
|
|
||||||
import '@reach/dialog/styles.css';
|
import '@reach/dialog/styles.css';
|
||||||
|
@ -30,8 +29,8 @@ export function KubeconfigButton({ environments, envQueryParams }: Props) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button className={styles.kubeconfigButton} onClick={handleClick}>
|
<Button onClick={handleClick} size="medium" className="!ml-3">
|
||||||
<Download className="feather-icon-white" aria-hidden="true" />{' '}
|
<Download className="feather icon-white" aria-hidden="true" />{' '}
|
||||||
Kubeconfig
|
Kubeconfig
|
||||||
</Button>
|
</Button>
|
||||||
{prompt()}
|
{prompt()}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { X } from 'react-feather';
|
||||||
|
import clsx from 'clsx';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { DialogOverlay } from '@reach/dialog';
|
import { DialogOverlay } from '@reach/dialog';
|
||||||
|
|
||||||
|
@ -59,7 +61,7 @@ export function KubeconfigPrompt({
|
||||||
<div className="modal-content">
|
<div className="modal-content">
|
||||||
<div className="modal-header">
|
<div className="modal-header">
|
||||||
<button type="button" className="close" onClick={onClose}>
|
<button type="button" className="close" onClick={onClose}>
|
||||||
×
|
<X />
|
||||||
</button>
|
</button>
|
||||||
<h5 className="modal-title">Download kubeconfig file</h5>
|
<h5 className="modal-title">Download kubeconfig file</h5>
|
||||||
</div>
|
</div>
|
||||||
|
@ -74,16 +76,24 @@ export function KubeconfigPrompt({
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<br />
|
<br />
|
||||||
<Checkbox
|
<div className="h-8 flex items-center">
|
||||||
id="settings-container-truncate-nae"
|
<Checkbox
|
||||||
label="Select all (in this page)"
|
id="settings-container-truncate-name"
|
||||||
checked={isAllPageSelected}
|
label="Select all (in this page)"
|
||||||
onChange={handleSelectAll}
|
checked={isAllPageSelected}
|
||||||
/>
|
onChange={handleSelectAll}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div className="datatable">
|
<div className="datatable">
|
||||||
<div className="bootbox-checkbox-list">
|
<div className="bootbox-checkbox-list">
|
||||||
{environments.map((env) => (
|
{environments.map((env) => (
|
||||||
<div className={styles.checkbox}>
|
<div
|
||||||
|
key={env.Id}
|
||||||
|
className={clsx(
|
||||||
|
styles.checkbox,
|
||||||
|
'h-8 flex items-center pt-1'
|
||||||
|
)}
|
||||||
|
>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id={`${env.Id}`}
|
id={`${env.Id}`}
|
||||||
label={`${env.Name} (${env.URL})`}
|
label={`${env.Name} (${env.URL})`}
|
||||||
|
@ -95,7 +105,7 @@ export function KubeconfigPrompt({
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="footer">
|
<div className="pt-3 flex justify-end w-full">
|
||||||
<PaginationControls
|
<PaginationControls
|
||||||
showAll={totalCount <= 100}
|
showAll={totalCount <= 100}
|
||||||
page={page}
|
page={page}
|
||||||
|
@ -111,7 +121,9 @@ export function KubeconfigPrompt({
|
||||||
<Button onClick={onClose} color="default">
|
<Button onClick={onClose} color="default">
|
||||||
Cancel
|
Cancel
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={handleDownload}>Download File</Button>
|
<Button onClick={handleDownload} disabled={selectionSize < 1}>
|
||||||
|
Download File
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -143,7 +155,7 @@ export function KubeconfigPrompt({
|
||||||
}
|
}
|
||||||
|
|
||||||
export function expiryMessage(expiry: string) {
|
export function expiryMessage(expiry: string) {
|
||||||
const prefix = 'Kubeconfig file will';
|
const prefix = 'The kubeconfig file will';
|
||||||
switch (expiry) {
|
switch (expiry) {
|
||||||
case '24h':
|
case '24h':
|
||||||
return `${prefix} expire in 1 day.`;
|
return `${prefix} expire in 1 day.`;
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
.searchBar {
|
|
||||||
padding: 8px;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .iconSpan {
|
|
||||||
display: inline-block;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchBar .textSpan {
|
|
||||||
display: inline-block;
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { useLocalStorage } from '@/portainer/hooks/useLocalStorage';
|
import { Search } from 'react-feather';
|
||||||
|
|
||||||
import styles from './FilterSearchBar.module.css';
|
import { useLocalStorage } from '@/portainer/hooks/useLocalStorage';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
value: string;
|
value: string;
|
||||||
|
@ -14,19 +14,16 @@ export function FilterSearchBar({
|
||||||
onChange,
|
onChange,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.searchBar}>
|
<div className="searchBar items-center flex h-[34px]">
|
||||||
<span className={styles.iconSpan}>
|
<Search className="searchIcon feather" />
|
||||||
<i className="fa fa-search" aria-hidden="true" />
|
<input
|
||||||
</span>
|
type="text"
|
||||||
<span className={styles.textSpan}>
|
className="searchInput"
|
||||||
<input
|
value={value}
|
||||||
type="text"
|
onChange={(e) => onChange(e.target.value)}
|
||||||
className="searchInput"
|
placeholder={placeholder}
|
||||||
value={value}
|
data-cy="home-environmentSearch"
|
||||||
onChange={(e) => onChange(e.target.value)}
|
/>
|
||||||
placeholder={placeholder}
|
|
||||||
/>
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue