refactor: credential table columns

This commit is contained in:
jialin
2025-09-16 11:26:17 +08:00
parent 43936e21d9
commit 0c1057d554
34 changed files with 648 additions and 503 deletions
+20
View File
@@ -1,4 +1,5 @@
import _ from 'lodash';
import tinycolor from 'tinycolor2';
export const isNotEmptyValue = (value: any) => {
if (Array.isArray(value)) {
@@ -219,3 +220,22 @@ export const base64ToFile = (base64String: string, fileName: string) => {
export const isOnline = () => {
return window.navigator.onLine;
};
export const genColors = ({
color,
alpha1,
alpha2
}: {
color: string;
alpha1?: number;
alpha2?: number;
}) => {
const base = tinycolor(color);
const alpha_start = alpha1 || base.getAlpha();
const alpha_end = alpha2 || base.getAlpha();
return [
base.setAlpha(alpha_start).toRgbString(),
base.setAlpha(alpha_end).toRgbString()
];
};