title = '文件管理'; $this->params['breadcrumbs'][] = $this->title; $totalUsed_F = FileSizeHelper::formatBytes($usedSpace + $vaultUsedSpace); //总已用空间 格式化文本 $storageLimit_F = FileSizeHelper::formatMegaBytes($storageLimit); //存储限制 格式化文本 $is_unlimited = ($storageLimit === -1); //检查是否为无限制容量 $usedPercent = $is_unlimited ? 0 : round($usedSpace / ($storageLimit * 1024 * 1024) * 100); //网盘已用百分比 $vaultUsedPercent = $is_unlimited ? 0 : round($vaultUsedSpace / ($storageLimit * 1024 * 1024) * 100); //保险箱已用百分比 $totalUsedPercent = min(($usedPercent + $vaultUsedPercent), 100); //总已用百分比 FontAwesomeAsset::register($this); JqueryAsset::register($this); ViewerJsAsset::register($this); PlyrAsset::register($this); AceAsset::register($this); $this->registerCssFile('@web/css/home_style.css'); ?>

title) ?>

'btn btn-outline-primary single-open-btn']) ?> 'btn btn-outline-primary single-download-btn']) ?> 'btn btn-outline-primary batch-zip-download-btn']) ?> 'btn btn-outline-primary batch-zip-btn']) ?> 'btn btn-outline-primary unzip-btn']) ?> 'btn btn-outline-primary single-rename-btn']) ?> 'btn btn-outline-primary batch-copy-btn']) ?> 'btn btn-outline-primary batch-cut-btn']) ?> 'btn btn-outline-primary batch-paste-btn']) ?> 'btn btn-outline-primary calc-sum-btn']) ?> 'btn btn-outline-primary single-share-btn']) ?> 'btn btn-outline-danger batch-delete-btn']) ?> 'btn btn-outline-primary create-collection-btn']) ?> 'btn btn-outline-primary refresh-btn']) ?> 'btn btn-outline-primary new-folder-btn', 'value' => $directory]) ?>
0, 'barOptions' => ['class' => ['bg-success', 'progress-bar-animated', 'progress-bar-striped']], 'label' => '123', //NMD 不是说可选吗 'options' => ['style' => 'display: none;margin-top: 10px;', 'id' => 'progress-bar'] ]); ?> user->id . '/' . $relativePath; ?>
名称 最近修改时间 大小 操作
$item['type'] . ' file_icon']) ?> $relativePath], ['class' => 'file_name']) ?> --- 'fa-solid fa-download']), [ 'value' => $relativePath, 'class' => 'btn btn-outline-primary folder-download-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '打包下载' ]) ?> 'fa-regular fa-pen-to-square']), ['value' => $relativePath, 'class' => 'btn btn-outline-secondary rename-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '重命名']) ?> 'fa-solid fa-share-nodes']), ['value' => $relativePath, 'class' => 'btn btn-outline-success shares-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '分享']) ?> 'fa-regular fa-trash-can']), ['value' => $relativePath, 'class' => 'btn btn-outline-danger delete-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '删除']) ?> $item['type'] . ' file_icon']) ?> $relativePath], ['class' => 'file_name', 'onclick' => 'previewImage(this, event)']) ?> $relativePath, 'type' => $item['rawType']], ['class' => 'file_name', 'onclick' => 'previewVideo(this, event)']) ?> $relativePath, 'type' => $item['rawType']], ['class' => 'file_name', 'onclick' => 'textEdit(this, event)']) ?> $relativePath, 'type' => $item['rawType']], ['class' => 'file_name', 'onclick' => 'previewAudio(this, event)']) ?> $relativePath, 'type' => $item['rawType']], ['class' => 'file_name', 'onclick' => 'previewPdf(this, event)']) ?> $relativePath], ['class' => 'file_name']) ?> formatter->asShortSize($item['size'], 2) : '' ?> 'fa-regular fa-circle-down']), [ 'value' => Url::to(['home/download', 'relativePath' => $relativePath]), 'class' => 'btn btn-outline-primary download-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '下载' ]) ?> 'fa-regular fa-pen-to-square']), ['value' => $relativePath, 'class' => 'btn btn-outline-secondary rename-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '重命名']) ?> 'fa-solid fa-share-nodes']), ['value' => $relativePath, 'class' => 'btn btn-outline-success shares-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '分享']) ?> 'fa-regular fa-trash-can']), ['value' => $relativePath, 'class' => 'btn btn-outline-danger delete-btn', 'data-bs-toggle' => 'tooltip', 'data-bs-placement' => 'top', 'data-bs-title' => '删除']) ?>
'

重命名文件/文件夹

', 'id' => 'renameModal', 'size' => 'modal-lg', ]); $model = new RenameForm(); $form = ActiveForm::begin(['id' => 'rename-form', 'action' => ['home/rename'], 'method' => 'post']); echo $form->field($model, 'newName')->textInput(['maxlength' => true])->label('新名称'); echo Html::hiddenInput('relativePath', '', ['id' => 'renameRelativePath']); echo Html::submitButton('提交', ['class' => 'btn btn-primary']); ActiveForm::end(); Modal::end(); Modal::begin([ 'title' => '

确认删除

', 'id' => 'deleteModal', 'size' => 'modal-sm', ]); echo Html::tag('div', '你确定要删除这个文件吗?', ['class' => 'modal-body']); echo Html::beginForm(['home/delete'], 'post', ['id' => 'delete-form']); echo Html::hiddenInput('relativePath', '', ['id' => 'deleteRelativePath']); echo Html::submitButton('确认', ['class' => 'btn btn-danger']); echo Html::endForm(); Modal::end(); Modal::begin([ 'title' => '

新建文件夹

', 'id' => 'newFolderModal', 'size' => 'modal-lg', ]); $model1 = new NewFolderForm(); $form = ActiveForm::begin(['id' => 'new-folder-form', 'action' => ['home/new-folder'], 'method' => 'post', 'enableAjaxValidation' => true]); echo $form->field($model1, 'folderName')->textInput(['maxlength' => true])->label('文件夹名称'); echo Html::hiddenInput('relativePath', '', ['id' => 'newDirRelativePath']); echo Html::submitButton('提交', ['class' => 'btn btn-primary']); ActiveForm::end(); Modal::end(); Modal::begin([ 'title' => '

创建压缩文件

', 'id' => 'zipModal', 'size' => 'modal-lg', ]); $model2 = new ZipForm(); $form = ActiveForm::begin(['id' => 'zip-form', 'action' => ['home/zip'], 'method' => 'post']); echo $form->field($model2, 'zipFilename')->textInput(['maxlength' => true])->label('压缩文件名'); echo $form->field($model2, 'zipFormat')->dropDownList(['zip' => 'ZIP', '7z' => '7Z'])->label('压缩格式'); echo Html::hiddenInput('relativePath', '', ['id' => 'zipRelativePath']); echo Html::hiddenInput('targetDirectory', $directory, ['id' => 'zipTargetDirectory']); // 添加这一行 echo Html::submitButton('创建', ['class' => 'btn btn-primary']); ActiveForm::end(); Modal::end(); Modal::begin([ 'id' => 'checksumModal', 'title' => '文件校验信息', 'size' => 'modal-lg', ]); echo Html::tag('p', '', ['id' => 'crc32b']); echo Html::tag('p', '', ['id' => 'sha256']); Modal::end(); Modal::begin([ 'title' => '

创建分享

', 'id' => 'shareModal', // 'size' => 'modal-sm', ]); $form = ActiveForm::begin(['id' => 'share-form', 'action' => ['share/create'], 'method' => 'post']); $model3 = new Share(); echo $form->field($model3, 'file_relative_path')->textInput(['readonly' => true])->label('文件位置'); echo $form->field($model3, 'access_code')->textInput(['maxlength' => 4])->label('访问密码(4位英文数字组合,不区分大小写)'); echo Html::button('生成密码', ['id' => 'generate_access_code', 'class' => 'btn btn-primary']); echo str_repeat(' ', 5); // 添加5个空格 echo Html::submitButton('提交', ['class' => 'btn btn-primary']); ActiveForm::end(); Modal::end(); Modal::begin([ 'title' => '

视频播放

', 'id' => 'videoModal', 'size' => 'modal-xl', ]); echo ''; Modal::end(); Modal::begin([ 'title' => '

音频播放

', 'id' => 'audioModal', ]); echo ''; Modal::end(); Modal::begin([ 'title' => '

文本编辑

', 'id' => 'textEditModal', 'size' => 'modal-lg', ]); echo ''; echo ''; echo ''; echo '
'; Modal::end(); Modal::begin([ 'title' => '

PDF预览

', 'id' => 'pdfModal', 'size' => 'modal-xl', ]); Modal::end(); Modal::begin([ 'title' => '

创建文件收集

', 'id' => 'collectionModal', ]); $collectionTasks = new CollectionTasks(); $collectionTasks->scenario = 'create'; echo $this->render('../collection/create', [ 'model' => $collectionTasks, ]); Modal::end(); $this->registerJsFile('@web/js/home_script.js', ['depends' => [JqueryAsset::class], 'position' => View::POS_END]); ?>