fix upload

This commit is contained in:
samunohito 2024-02-26 08:29:35 +09:00
parent 390af67949
commit b60951e7ea
2 changed files with 19 additions and 10 deletions

View File

@ -252,17 +252,21 @@ function setupGrid(): GridSetting {
row: {
showNumber: true,
selectable: true,
// 100
minimumDefinitionCount: 100,
styleRules: [
{
//
condition: ({ row }) => JSON.stringify(gridItems.value[row.index]) !== JSON.stringify(originGridItems.value[row.index]),
applyStyle: { className: 'changedRow' },
},
{
//
condition: ({ cells }) => cells.some(it => !it.violation.valid),
applyStyle: { className: 'violationRow' },
},
],
//
contextMenuFactory: (row, context) => {
return [
{
@ -285,6 +289,7 @@ function setupGrid(): GridSetting {
},
events: {
delete(rows) {
//
for (const row of rows) {
gridItems.value[row.index].checked = true;
}
@ -351,6 +356,7 @@ function setupGrid(): GridSetting {
{ bindTo: 'originalUrl', type: 'text', editable: false, width: 180 },
],
cells: {
//
contextMenuFactory(col, row, value, context) {
return [
{

View File

@ -136,10 +136,12 @@ function setupGrid(): GridSetting {
minimumDefinitionCount: 100,
styleRules: [
{
// 1
condition: ({ cells }) => cells.some(it => !it.violation.valid),
applyStyle: { className: 'violationRow' },
},
],
//
contextMenuFactory: (row, context) => {
return [
{
@ -209,6 +211,7 @@ function setupGrid(): GridSetting {
},
],
cells: {
//
contextMenuFactory: (col, row, value, context) => {
return [
{
@ -307,9 +310,18 @@ async function onClearClicked() {
async function onDrop(ev: DragEvent) {
isDragOver.value = false;
const droppedFiles = await extractDroppedItems(ev).then(it => flattenDroppedFiles(it));
const confirm = await os.confirm({
type: 'info',
title: '確認',
text: `ドラッグ&ドロップされた${droppedFiles.length}個のファイルをドライブにアップロードします。実行しますか?`,
});
if (confirm.canceled) {
return;
}
const uploadedItems = Array.of<{ droppedFile: DroppedFile, driveFile: Misskey.entities.DriveFile }>();
try {
const droppedFiles = await extractDroppedItems(ev).then(it => flattenDroppedFiles(it));
uploadedItems.push(
...await os.promiseDialog(
Promise.all(
@ -335,15 +347,6 @@ async function onDrop(ev: DragEvent) {
return;
}
const confirm = await os.confirm({
type: 'info',
title: '確認',
text: `ドラッグ&ドロップされた${uploadedItems.length}個のファイルをドライブにアップロードします。実行しますか?`,
});
if (confirm.canceled) {
return;
}
const items = uploadedItems.map(({ droppedFile, driveFile }) => {
const item = fromDriveFile(driveFile);
if (directoryToCategory.value) {