MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / openDialog

Function openDialog

frontend/src/hooks/useFileManager.ts:261–296  ·  view source on GitHub ↗
(
    title: string,
    info: string,
    defaultValue?: string,
    mode?: string,
    style?: object
  )

Source from the content-addressed store, hash-verified

259 });
260
261 const openDialog = (
262 title: string,
263 info: string,
264 defaultValue?: string,
265 mode?: string,
266 style?: object
267 ): Promise<string> => {
268 dialog.value.style = style || {};
269 dialog.value.value = defaultValue || "";
270 dialog.value.mode = mode || "";
271
272 dialog.value.title = title;
273 dialog.value.info = info;
274 dialog.value.show = true;
275
276 (dialog.value?.ref as any)?.focus();
277
278 return new Promise((resolve) => {
279 dialog.value.ok = () => {
280 if (
281 dialog.value.value == "" &&
282 dialog.value.mode != "unzip" &&
283 dialog.value.mode != "permission"
284 ) {
285 return reportErrorMsg(t("TXT_CODE_4ea93630"));
286 }
287 resolve(dialog.value.value);
288 dialog.value.show = false;
289 dialog.value.value = "";
290 dialog.value.info = "";
291 dialog.value.mode = "";
292 dialog.value.style = {};
293 dialog.value.ok = () => {};
294 };
295 });
296 };
297
298 const getFileList = async (throwErr = false, initPath?: string) => {
299 const { execute } = getFileListApi();

Callers 5

touchFileFunction · 0.70
resetNameFunction · 0.70
zipFileFunction · 0.70
unzipFileFunction · 0.70
changePermissionFunction · 0.70

Calls 1

reportErrorMsgFunction · 0.90

Tested by

no test coverage detected