mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-03 00:33:57 +03:00
Bugfix: blank icon
This commit is contained in:
parent
638619b3b4
commit
19e664cc8d
4
client/demo/dist/index.js
vendored
4
client/demo/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@ -5,6 +5,7 @@ import { DDSPSVCModelSlot, DiffusionSVCModelSlot, MMVCv13ModelSlot, MMVCv15Model
|
|||||||
import { useMessageBuilder } from "../../hooks/useMessageBuilder";
|
import { useMessageBuilder } from "../../hooks/useMessageBuilder";
|
||||||
import { ModelSlotManagerDialogScreen } from "./904_ModelSlotManagerDialog";
|
import { ModelSlotManagerDialogScreen } from "./904_ModelSlotManagerDialog";
|
||||||
import { checkExtention, trimfileName } from "../../utils/utils";
|
import { checkExtention, trimfileName } from "../../utils/utils";
|
||||||
|
import { MODEL_ICON_BLANK_URL } from "../../const";
|
||||||
|
|
||||||
export type MainScreenProps = {
|
export type MainScreenProps = {
|
||||||
screen: ModelSlotManagerDialogScreen;
|
screen: ModelSlotManagerDialogScreen;
|
||||||
@ -98,8 +99,11 @@ export const MainScreen = (props: MainScreenProps) => {
|
|||||||
|
|
||||||
const slotRow = serverSetting.serverSetting.modelSlots.map((x, index) => {
|
const slotRow = serverSetting.serverSetting.modelSlots.map((x, index) => {
|
||||||
// モデルのアイコン
|
// モデルのアイコン
|
||||||
const generateIconArea = (slotIndex: number, iconUrl: string, tooltip: boolean) => {
|
const generateIconArea = (slotIndex: number, iconUrl: string | null, tooltip: boolean) => {
|
||||||
const realIconUrl = iconUrl.length > 0 ? serverSetting.serverSetting.voiceChangerParams.model_dir + "/" + slotIndex + "/" + iconUrl.split(/[\/\\]/).pop() : "/assets/icons/noimage.png";
|
let realIconUrl = MODEL_ICON_BLANK_URL;
|
||||||
|
if (iconUrl) {
|
||||||
|
realIconUrl = iconUrl.length > 0 ? serverSetting.serverSetting.voiceChangerParams.model_dir + "/" + slotIndex + "/" + iconUrl.split(/[\/\\]/).pop() : "/assets/icons/noimage.png";
|
||||||
|
}
|
||||||
const iconDivClass = tooltip ? "tooltip" : "";
|
const iconDivClass = tooltip ? "tooltip" : "";
|
||||||
const iconClass = tooltip ? "model-slot-icon-pointable" : "model-slot-icon";
|
const iconClass = tooltip ? "model-slot-icon-pointable" : "model-slot-icon";
|
||||||
return (
|
return (
|
||||||
@ -225,7 +229,7 @@ export const MainScreen = (props: MainScreenProps) => {
|
|||||||
fileRows.push(generateFileRow("model", slotInfo.modelFile));
|
fileRows.push(generateFileRow("model", slotInfo.modelFile));
|
||||||
infoRow = generateInfoRow(`tune:${slotInfo.defaultTune},mks:${slotInfo.kStepMax},ks:${slotInfo.defaultKstep}, sp:${slotInfo.defaultSpeedup}, l:${slotInfo.nLayers},${slotInfo.nnLayers},`);
|
infoRow = generateInfoRow(`tune:${slotInfo.defaultTune},mks:${slotInfo.kStepMax},ks:${slotInfo.defaultKstep}, sp:${slotInfo.defaultSpeedup}, l:${slotInfo.nLayers},${slotInfo.nnLayers},`);
|
||||||
} else {
|
} else {
|
||||||
iconArea = generateIconArea(index, "/assets/icons/blank.png", false);
|
iconArea = generateIconArea(index, null, false);
|
||||||
nameRow = generateNameRow(index, "", "");
|
nameRow = generateNameRow(index, "", "");
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -12,6 +12,7 @@ export const INDEXEDDB_KEY_AUDIO_OUTPUT = "INDEXEDDB_KEY_AUDIO_OUTPUT"
|
|||||||
export const INDEXEDDB_KEY_AUDIO_MONITR = "INDEXEDDB_KEY_AUDIO_MONITOR"
|
export const INDEXEDDB_KEY_AUDIO_MONITR = "INDEXEDDB_KEY_AUDIO_MONITOR"
|
||||||
export const INDEXEDDB_KEY_DEFAULT_MODEL_TYPE = "INDEXEDDB_KEY_DEFALT_MODEL_TYPE"
|
export const INDEXEDDB_KEY_DEFAULT_MODEL_TYPE = "INDEXEDDB_KEY_DEFALT_MODEL_TYPE"
|
||||||
|
|
||||||
|
export const MODEL_ICON_BLANK_URL = "/assets/icons/blank.png"
|
||||||
|
|
||||||
export const isDesktopApp = () => {
|
export const isDesktopApp = () => {
|
||||||
if (navigator.userAgent.indexOf('Electron') >= 0) {
|
if (navigator.userAgent.indexOf('Electron') >= 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user