[Update] Plugins: Adjust designs.
Add localizations.
This commit is contained in:
@@ -244,7 +244,19 @@ config_page:
|
|||||||
label: "Open Config File"
|
label: "Open Config File"
|
||||||
switch_compute_device:
|
switch_compute_device:
|
||||||
label: "Switch VRCT To CPU/GPU Version"
|
label: "Switch VRCT To CPU/GPU Version"
|
||||||
section_label_plugins: Plugins
|
section_label_plugins: Plugins # Exception, It'll be moved later.
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
downloaded_version: "Downloaded version: {{downloaded_version}}"
|
||||||
|
latest_version: "Latest version: {{latest_version}}"
|
||||||
|
available_after_updating: "Available after updating to the latest version"
|
||||||
|
unavailable_downloaded: "Currently unavailable due to incompatibility with the VRCT version in use"
|
||||||
|
no_latest_info: "Unable to retrieve the latest information"
|
||||||
|
using_latest_version: "Using the latest version"
|
||||||
|
available_latest_version: "Latest version available"
|
||||||
|
unavailable_latest_version: "Latest version currently unavailable"
|
||||||
|
available_in_latest_vrct_version: "Available in the latest VRCT version"
|
||||||
|
unavailable_not_downloaded: "Currently unavailable"
|
||||||
|
|
||||||
plugin_notifications:
|
plugin_notifications:
|
||||||
downloading: Downloading the plugin.
|
downloading: Downloading the plugin.
|
||||||
|
|||||||
@@ -244,4 +244,30 @@ config_page:
|
|||||||
label: "設定ファイルを開く"
|
label: "設定ファイルを開く"
|
||||||
switch_compute_device:
|
switch_compute_device:
|
||||||
label: "VRCT CPU/GPUバージョンの切り替え"
|
label: "VRCT CPU/GPUバージョンの切り替え"
|
||||||
section_label_plugins: プラグイン
|
section_label_plugins: プラグイン # Exception, It'll be moved later.
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
downloaded_version: "ダウンロード済バージョン: {{downloaded_version}}"
|
||||||
|
latest_version: "最新バージョン: {{latest_version}}"
|
||||||
|
available_after_updating: 最新版にアップデート後 利用可能
|
||||||
|
unavailable_downloaded: 現在利用不可 使用中VRCTバージョンとの互換性なし
|
||||||
|
no_latest_info: 最新情報が取得できません
|
||||||
|
using_latest_version: 最新版を使用中
|
||||||
|
available_latest_version: 最新版を利用可能
|
||||||
|
unavailable_latest_version: 最新版は現在利用不可
|
||||||
|
available_in_latest_vrct_version: VRCT最新版で利用可能
|
||||||
|
unavailable_not_downloaded: 現在利用不可
|
||||||
|
|
||||||
|
plugin_notifications:
|
||||||
|
downloading: プラグインをダウンロード中。
|
||||||
|
downloaded_success: プラグインのダウンロードが完了しました。
|
||||||
|
downloaded_error: プラグインのダウンロードに失敗しました。
|
||||||
|
|
||||||
|
updating: プラグインをアップデート中。
|
||||||
|
updated_success: プラグインのアップデートが完了しました。
|
||||||
|
updated_error: プラグインのアップデートに失敗しました。
|
||||||
|
|
||||||
|
disabled_out_of_support: 現在のバージョンとの互換性がありません。プラグインを無効にしました。
|
||||||
|
|
||||||
|
is_enabled: プラグインを有効にしました。
|
||||||
|
is_disabled: プラグインを無効にしました。
|
||||||
@@ -2,6 +2,7 @@ import React from "react";
|
|||||||
import { SwitchBox } from "../index";
|
import { SwitchBox } from "../index";
|
||||||
import { _DownloadButton } from "../_atoms/_download_button/_DownloadButton";
|
import { _DownloadButton } from "../_atoms/_download_button/_DownloadButton";
|
||||||
import styles from "./PluginsControlComponent.module.scss";
|
import styles from "./PluginsControlComponent.module.scss";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export const PluginsControlComponent = ({
|
export const PluginsControlComponent = ({
|
||||||
variable_state,
|
variable_state,
|
||||||
@@ -9,6 +10,8 @@ export const PluginsControlComponent = ({
|
|||||||
toggleFunction,
|
toggleFunction,
|
||||||
downloadStartFunction,
|
downloadStartFunction,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
id: plugin_status.plugin_id,
|
id: plugin_status.plugin_id,
|
||||||
is_pending: plugin_status.is_pending,
|
is_pending: plugin_status.is_pending,
|
||||||
@@ -19,6 +22,16 @@ export const PluginsControlComponent = ({
|
|||||||
progress: null,
|
progress: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const downloaded_version = plugin_status.downloaded_plugin_info?.plugin_version;
|
||||||
|
const latest_version = plugin_status.latest_plugin_info?.plugin_version;
|
||||||
|
|
||||||
|
const downloaded_version_label = t("config_page.plugins.downloaded_version",
|
||||||
|
{ downloaded_version: downloaded_version }
|
||||||
|
);
|
||||||
|
const latest_version_label = t("config_page.plugins.latest_version",
|
||||||
|
{ latest_version: latest_version }
|
||||||
|
);
|
||||||
|
|
||||||
if (plugin_status.is_downloaded) {
|
if (plugin_status.is_downloaded) {
|
||||||
return (
|
return (
|
||||||
<DownloadedPluginControl
|
<DownloadedPluginControl
|
||||||
@@ -26,6 +39,8 @@ export const PluginsControlComponent = ({
|
|||||||
plugin_status={plugin_status}
|
plugin_status={plugin_status}
|
||||||
toggleFunction={toggleFunction}
|
toggleFunction={toggleFunction}
|
||||||
downloadStartFunction={downloadStartFunction}
|
downloadStartFunction={downloadStartFunction}
|
||||||
|
downloaded_version_label={downloaded_version_label}
|
||||||
|
latest_version_label={latest_version_label}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -34,6 +49,8 @@ export const PluginsControlComponent = ({
|
|||||||
option={option}
|
option={option}
|
||||||
plugin_status={plugin_status}
|
plugin_status={plugin_status}
|
||||||
downloadStartFunction={downloadStartFunction}
|
downloadStartFunction={downloadStartFunction}
|
||||||
|
downloaded_version_label={downloaded_version_label}
|
||||||
|
latest_version_label={latest_version_label}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -45,49 +62,51 @@ const DownloadedPluginControl = ({
|
|||||||
plugin_status,
|
plugin_status,
|
||||||
toggleFunction,
|
toggleFunction,
|
||||||
downloadStartFunction,
|
downloadStartFunction,
|
||||||
|
downloaded_version_label,
|
||||||
|
latest_version_label,
|
||||||
}) => {
|
}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const togglePlugin = () => {
|
const togglePlugin = () => {
|
||||||
toggleFunction(plugin_status.plugin_id);
|
toggleFunction(plugin_status.plugin_id);
|
||||||
};
|
};
|
||||||
|
|
||||||
const latest_version = plugin_status.latest_plugin_info?.plugin_version;
|
|
||||||
|
|
||||||
|
|
||||||
if (!plugin_status.downloaded_plugin_info.is_plugin_supported) {
|
if (!plugin_status.downloaded_plugin_info.is_plugin_supported) {
|
||||||
if (plugin_status.is_latest_version_available) {
|
if (plugin_status.is_latest_version_available) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新のバージョン: {latest_version}</p>
|
<p>{downloaded_version_label}</p>
|
||||||
<p>最新版にアップデート後 利用可能</p>
|
<p>{latest_version_label}</p>
|
||||||
|
<p>{t("config_page.plugins.available_after_updating")}</p>
|
||||||
<_DownloadButton option={option} downloadStartFunction={downloadStartFunction} />
|
<_DownloadButton option={option} downloadStartFunction={downloadStartFunction} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>現在利用不可 使用中VRCTバージョンとの互換性なし</p>
|
<p>{t("config_page.plugins.unavailable_downloaded")}</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else if (plugin_status.is_outdated) {
|
} else if (plugin_status.is_outdated) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新情報が取得できません</p>
|
<p>{t("config_page.plugins.no_latest_info")}</p>
|
||||||
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else if (plugin_status.is_latest_version_already) {
|
} else if (plugin_status.is_latest_version_already) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新のバージョン: {latest_version}</p>
|
<p>{latest_version_label}</p>
|
||||||
<p>最新版を使用中</p>
|
<p>{t("config_page.plugins.using_latest_version")}</p>
|
||||||
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else if (plugin_status.is_latest_version_available) {
|
} else if (plugin_status.is_latest_version_available) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新のバージョン: {latest_version}</p>
|
<p>{latest_version_label}</p>
|
||||||
<p>最新版を利用可能</p>
|
<p>{t("config_page.plugins.available_latest_version")}</p>
|
||||||
<_DownloadButton option={option} downloadStartFunction={downloadStartFunction} />
|
<_DownloadButton option={option} downloadStartFunction={downloadStartFunction} />
|
||||||
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
||||||
</div>
|
</div>
|
||||||
@@ -95,7 +114,7 @@ const DownloadedPluginControl = ({
|
|||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新版は現在利用不可</p>
|
<p>{t("config_page.plugins.available_latest_version")}</p>
|
||||||
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
<SwitchBox variable={option} toggleFunction={togglePlugin} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
@@ -103,28 +122,34 @@ const DownloadedPluginControl = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const NotDownloadedPluginControl = ({ option, plugin_status, downloadStartFunction }) => {
|
const NotDownloadedPluginControl = ({
|
||||||
const latest_version = plugin_status.latest_plugin_info?.plugin_version;
|
option,
|
||||||
|
plugin_status,
|
||||||
|
downloadStartFunction,
|
||||||
|
downloaded_version_label,
|
||||||
|
latest_version_label,
|
||||||
|
}) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
if (plugin_status.is_latest_version_available) {
|
if (plugin_status.is_latest_version_available) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新バージョン: {latest_version}</p>
|
<p>{latest_version_label}</p>
|
||||||
<_DownloadButton option={option} downloadStartFunction={downloadStartFunction} />
|
<_DownloadButton option={option} downloadStartFunction={downloadStartFunction} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else if (plugin_status.latest_plugin_info?.is_plugin_supported_latest_vrct) {
|
} else if (plugin_status.latest_plugin_info?.is_plugin_supported_latest_vrct) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新のバージョン: {latest_version}</p>
|
<p>{latest_version_label}</p>
|
||||||
<p>VRCT最新版で利用可能</p>
|
<p>{t("config_page.plugins.available_in_latest_vrct_version")}</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
<p>最新バージョン: {latest_version}</p>
|
<p>{latest_version_label}</p>
|
||||||
<p>現在利用不可</p>
|
<p>{t("config_page.plugins.unavailable_not_downloaded")}</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
@import "@scss_mixins";
|
@import "@scss_mixins";
|
||||||
|
|
||||||
.switchbox_container {
|
.switchbox_container {
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: end;
|
justify-content: end;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -61,14 +61,18 @@ const PluginDownloadContainer = () => {
|
|||||||
|
|
||||||
const variable_state = currentSavedPluginsStatus.state;
|
const variable_state = currentSavedPluginsStatus.state;
|
||||||
|
|
||||||
|
const filtered_plugins_data = currentPluginsData.data.filter(plugin => !plugin.is_outdated)
|
||||||
|
|
||||||
// plugin_id で ABC 順にソート
|
// plugin_id で ABC 順にソート
|
||||||
const sorted_plugins_data = [...currentPluginsData.data].sort((a, b) =>
|
const sorted_plugins_data = filtered_plugins_data.sort((a, b) =>
|
||||||
a.plugin_id.localeCompare(b.plugin_id)
|
a.plugin_id.localeCompare(b.plugin_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Duplicate
|
// Duplicate
|
||||||
const is_failed_to_fetch = currentFetchedPluginsInfo.state === "error";
|
const is_failed_to_fetch = currentFetchedPluginsInfo.state === "error";
|
||||||
const is_fetching = currentFetchedPluginsInfo.state === "pending";
|
const is_fetching = currentFetchedPluginsInfo.state === "pending";
|
||||||
|
console.log(sorted_plugins_data);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.plugins_list_container}>
|
<div className={styles.plugins_list_container}>
|
||||||
@@ -88,32 +92,27 @@ const PluginDownloadContainer = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div key={plugin.plugin_id} className={styles.plugin_wrapper}>
|
<div key={plugin.plugin_id} className={styles.plugin_wrapper}>
|
||||||
<p className={styles.title}>
|
<div className={styles.labels_wrapper}>
|
||||||
{target_locale.title}
|
<p className={styles.title}>
|
||||||
</p>
|
{target_locale.title}
|
||||||
<p className={styles.plugin_id}>{plugin.plugin_id}</p>
|
</p>
|
||||||
<p className={styles.desc}>
|
<p className={styles.desc}>
|
||||||
{target_locale.desc}
|
{target_locale.desc}
|
||||||
</p>
|
</p>
|
||||||
{plugin.is_error ? (
|
{/* <p className={styles.plugin_id}>{plugin.plugin_id}</p> */}
|
||||||
<p style={{ color: "red" }}>Error: {plugin.error_message}</p>
|
</div>
|
||||||
) : (
|
<div className={styles.plugin_info_wrapper}>
|
||||||
<div className={styles.plugin_info_wrapper}>
|
{plugin.is_error ? (
|
||||||
<div className={styles.plugin_info}>
|
<p style={{ color: "red" }}>Error: {plugin.error_message}</p>
|
||||||
<p>
|
) : (
|
||||||
{plugin.is_downloaded
|
|
||||||
? `現在のバージョン: ${plugin.downloaded_plugin_info?.plugin_version}`
|
|
||||||
: null}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<PluginsControlComponent
|
<PluginsControlComponent
|
||||||
variable_state={variable_state}
|
variable_state={variable_state}
|
||||||
toggleFunction={toggleFunction}
|
toggleFunction={toggleFunction}
|
||||||
downloadStartFunction={downloadStartFunction}
|
downloadStartFunction={downloadStartFunction}
|
||||||
plugin_status={plugin}
|
plugin_status={plugin}
|
||||||
/>
|
/>
|
||||||
</div>
|
)}
|
||||||
)}
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -13,30 +13,45 @@
|
|||||||
.plugin_wrapper {
|
.plugin_wrapper {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
&:not(:last-child) {
|
&:not(:last-child) {
|
||||||
border-bottom: 0.1rem solid var(--dark_750_color);
|
border-bottom: 0.1rem solid var(--dark_750_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.labels_wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 0.4rem;
|
||||||
|
max-width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
.plugin_info_wrapper {
|
.plugin_info_wrapper {
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
justify-content: end;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 1.6rem;
|
font-size: 1.6rem;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
.desc {
|
||||||
.plugin_id {
|
font-size: 1.4rem;
|
||||||
font-size: 1rem;
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
color: var(--dark_500_color);
|
||||||
}
|
}
|
||||||
|
// .plugin_id {
|
||||||
.download_button {
|
// font-size: 1rem;
|
||||||
background-color: var(--dark_750_color);
|
// color: var(--dark_600_color);
|
||||||
padding: 0.4rem 0.6rem;
|
// width: 100%;
|
||||||
font-size: 1.2rem;
|
// overflow: hidden;
|
||||||
}
|
// white-space: nowrap;
|
||||||
|
// text-overflow: ellipsis;
|
||||||
|
// }
|
||||||
Reference in New Issue
Block a user