]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - frontend/index.html
Add raw/tar/zip endpoints
[perso/Immae/Projets/Nodejs/Surfer.git] / frontend / index.html
index 920f8cc58f6c42fab19e6d45ca341a6a2d7a2bd4..20f2c8df4a64d67624b8d3dbe16a856754f73306 100644 (file)
@@ -36,9 +36,9 @@
     </span>
   </el-dialog>
 
-  <el-dialog title="Access Tokens" :visible.sync="accessTokensDialogVisible" width="30%">
+  <el-dialog title="Access Tokens" :visible.sync="accessTokensDialogVisible" width="40%">
     Access tokens are useful to programmatically deploy assets for example within a CI/CD pipeline.
-    For this they can be used with the surfer <a href="https://www.npmjs.com/package/cloudron-surfer" target="_blank">cli tool</a> or using the Api directly.
+    See the <a href="https://cloudron.io/documentation/apps/surfer/" target="_blank">docs</a> for more information on how to use this token.
     <br/>
     <br/>
     <el-alert title="Tokens are shared between all users." type="warning" show-icon :closable="false"></el-alert>
@@ -55,9 +55,6 @@
 
   <el-header>
     <el-row type="flex" justify="space-between">
-      <div style="padding: 7px;">
-        <span>Surfer</span>
-      </div>
       <div v-show="session.valid">
         <el-button type="primary" size="small" icon="el-icon-arrow-left" :disabled="!pathParts.slice(-1).length" @click="onUp"></el-button>
       </div>
         </el-breadcrumb>
       </div>
       <div align="right" v-show="session.valid">
+        <el-button-group>
+          <a v-bind:href="'/raw' + path">
+            <el-button type="primary" icon="el-icon-download" size="small">Raw (curl/wget friendly)</el-button>
+          </a>
+          <a v-bind:href="'/tar' + path">
+            <el-button type="primary" icon="el-icon-download" size="small">Download Tar.gz</el-button>
+          </a>
+          <a v-bind:href="'/zip' + path">
+            <el-button type="primary" icon="el-icon-download" size="small">Download Zip</el-button>
+          </a>
+        </el-button-group>
         <el-button-group>
           <el-button type="primary" icon="el-icon-upload2" size="small" @click="onUpload">Upload File</el-button>
           <el-button type="primary" icon="el-icon-upload" size="small" @click="onUploadFolder">Upload Folder</el-button>
 
     <div v-show="!busy && session.valid" v-cloak>
       <center>
-        <el-table :data="entries" style="max-width: 1280px;width: 100%" height="100%" empty-text="Folder is emtpy" :default-sort="{ prop: 'filePath', order: 'descending' }" @row-click="open">
-          <el-table-column prop="previewUrl" label="Type" width="100px" sortable>
+        <el-table :data="entries" style="max-width: 1280px; width: 100%" height="100%" empty-text="Folder is emtpy" :default-sort="{ prop: 'filePath', order: 'descending' }" @row-click="open">
+          <el-table-column prop="previewUrl" label="Type" width="80px" sortable>
             <template slot-scope="scope">
-              <img v-bind:src="scope.row.previewUrl" height="48px" width="48px" style="object-fit: cover;"/>
+              <el-image v-bind:src="scope.row.previewUrl" class="list-icon" style="width: 32px; height: 32px" fit="cover"></el-image>
             </template>
           </el-table-column>
           <el-table-column prop="filePath" label="Name" sortable>
             <template slot-scope="scope">
-              <el-input v-on:keyup.native.enter="onRenameSubmit(scope.row)" v-on:keyup.native.esc="onRenameEnd(scope.row)" @blur="onRenameEnd(scope.row)" v-model="scope.row.filePathNew" :id="'filePathRenameInputId-' + scope.$index" v-show="scope.row.rename"></el-input>
+              <el-input size="small" v-on:keyup.native.enter="onRenameSubmit(scope.row)" v-on:keyup.native.esc="onRenameEnd(scope.row)" @blur="onRenameEnd(scope.row)" v-model="scope.row.filePathNew" :id="'filePathRenameInputId-' + scope.$index" v-show="scope.row.rename"></el-input>
               <span v-show="!scope.row.rename">{{ scope.row.filePath }}</span>
+              <el-button size="small" icon="el-icon-edit" type="text" plain circle class="rename-action" v-show="!scope.row.rename" @click.stop="onRename(scope.row, scope)"></el-button>
             </template>
           </el-table-column>
           <el-table-column prop="size" label="Size" width="150px" sortable :formatter="prettyFileSize"></el-table-column>
           <el-table-column prop="mtime" label="Modified" width="150px" sortable :formatter="prettyDate"></el-table-column>
           <el-table-column label="Actions" align="right" width="200px" class-name="list-actions">
             <template slot-scope="scope">
-              <el-button size="small" icon="el-icon-edit" circle v-show="!scope.row.rename" @click.stop="onRename(scope.row, scope)"></el-button>
-              <el-button size="small" icon="el-icon-download" circle v-show="!scope.row.rename && scope.row.isFile" @click.stop="onDownload(scope.row)"></el-button>
-              <el-button size="small" icon="el-icon-delete" circle v-show="!scope.row.rename" @click.stop="onDelete(scope.row)"></el-button>
+              <el-button size="small" icon="el-icon-download" type="text" plain circle v-show="!scope.row.rename && scope.row.isFile" @click.stop="onDownload(scope.row)"></el-button>
+              <el-button size="small" icon="el-icon-delete" type="text" plain circle v-show="!scope.row.rename" @click.stop="onDelete(scope.row)"></el-button>
             </template>
           </el-table-column>
         </el-table>
       </center>
     </div>
 
+    <el-drawer :title="activeEntry.filePath":with-header="false" :visible.sync="previewDrawerVisible" direction="rtl" size="50%">
+      <div style="display: flex; flex-direction: column; height: 100%;">
+        <iframe :src="activeEntry.fullPath" style="width: 100%; height: 100%; border: none; margin: 10px;"></iframe>
+        <center>
+          <el-button size="small" icon="el-icon-download" style="margin: 10px;" @click.stop="onDownload(activeEntry)">Download</el-button>
+          <a :href="activeEntry.fullPath" target="_blank">
+            <el-button size="small" icon="el-icon-link" style="margin: 10px;">Open</el-button>
+          </a>
+        </center>
+      </div>
+    </el-drawer>
+
   </el-main>
   <el-footer v-show="uploadStatus.busy">
     <el-row v-if="uploadStatus.uploadListCount">