Merge branch 'main' into kubernetes

This commit is contained in:
James Wynn 2022-12-08 09:57:51 -06:00
commit 174cb651b4
81 changed files with 2717 additions and 342 deletions

View file

@ -15,22 +15,21 @@ const textSizes = {
export default function DateTime({ options }) {
const { text_size: textSize, format } = options;
const { i18n } = useTranslation();
const [date, setDate] = useState(new Date());
const [date, setDate] = useState("");
useEffect(() => {
const dateFormat = new Intl.DateTimeFormat(i18n.language, { ...format });
const interval = setInterval(() => {
setDate(new Date());
setDate(dateFormat.format(new Date()));
}, 1000);
return () => clearInterval(interval);
}, [setDate]);
const dateFormat = new Intl.DateTimeFormat(i18n.language, { ...format });
}, [date, setDate, i18n.language, format]);
return (
<div className="flex flex-col justify-center first:ml-0 ml-4">
<div className="flex flex-row items-center grow justify-end">
<span className={`text-theme-800 dark:text-theme-200 ${textSizes[textSize || "lg"]}`}>
{dateFormat.format(date)}
{date}
</span>
</div>
</div>

View file

@ -1,4 +1,4 @@
import mapIcon from "utils/weather/owm-condition-map";
import mapIcon from "utils/weather/openmeteo-condition-map";
export default function Icon({ condition, timeOfDay }) {
const IconComponent = mapIcon(condition, timeOfDay);

View file

@ -52,7 +52,7 @@ export default function Memory({ expanded }) {
<div className="flex flex-col ml-3 text-left min-w-[85px]">
<span className="text-theme-800 dark:text-theme-200 text-xs flex flex-row justify-between">
<div className="pl-0.5">
{t("common.bytes", { value: data.memory.freeMemMb * 1024 * 1024, maximumFractionDigits: 0, binary: true })}
{t("common.bytes", { value: data.memory.freeMemMb * 1024 * 1024, maximumFractionDigits: 1, binary: true })}
</div>
<div className="pr-1">{t("resources.free")}</div>
</span>
@ -61,7 +61,7 @@ export default function Memory({ expanded }) {
<div className="pl-0.5">
{t("common.bytes", {
value: data.memory.totalMemMb * 1024 * 1024,
maximumFractionDigits: 0,
maximumFractionDigits: 1,
binary: true,
})}
</div>