title = '文件管理'; $this->params['breadcrumbs'][] = $this->title; FontAwesomeAsset::register($this); JqueryAsset::register($this); ViewerJsAsset::register($this); $this->registerCssFile('@web/css/home_style.css'); ?>

title) ?>

'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 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], ['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(); $this->registerJsFile('@web/js/home_script.js', ['depends' => [JqueryAsset::class], 'position' => View::POS_END]); ?>