]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blobdiff - frontend/index.html
use el-image instead of manual img tag
[perso/Immae/Projets/Nodejs/Surfer.git] / frontend / index.html
index 0c18b5242b002b1c8e2886ea17c232805abb38db..95fe31b45fab43632db335d49f96c800568d7f9c 100644 (file)
@@ -6,12 +6,13 @@
 
     <link rel="icon" type="image/png" href="/_admin/img/logo.png">
 
-    <link rel="stylesheet" href="/_admin/css/theme-chalk.css">
+    <link rel="stylesheet" href="/_admin/css/theme-chalk_2.11.1.css">
     <link rel="stylesheet" href="/_admin/css/style.css">
 
     <script src="/_admin/js/jquery-1.12.1.min.js"></script>
-    <script src="/_admin/js/vue.js"></script>
-    <script src="/_admin/js/element-ui.js"></script>
+    <script src="/_admin/js/vue.min.js"></script>
+    <script src="/_admin/js/element-ui_2.11.1.min.js"></script>
+    <script src="/_admin/js/element-ui_en_2.11.1.min.js"></script>
     <script src="/_admin/js/filesize.min.js"></script>
     <script src="/_admin/js/superagent.js"></script>
 
     </span>
   </el-dialog>
 
+  <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.
+    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>
+    <br/>
+    <div>
+      <div v-for="accessToken in accessTokens">
+        <el-input suffix-icon="el-icon-copy-document" v-model="accessToken" class="access-token-input" @focus="onCopyAccessToken" size="small"></el-input>
+        <el-button icon="el-icon-delete" type="danger" size="small" @click="onDeleteAccessToken(accessToken)"></el-button>
+      </div>
+    </div>
+    <br/>
+    <el-button @click="onCreateAccessToken()" size="small" type="primary">Create Access Token</el-button>
+  </el-dialog>
+
   <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-dropdown-menu slot="dropdown">
             <el-dropdown-item disabled>Public Folder Listing</el-dropdown-item>
             <el-dropdown-item command="folderListing">
-              <el-switch v-model="folderListingEnabled" active-text="Enabled" inactive-text="Disabled">
-            </el-switch>
+              <el-switch v-model="folderListingEnabled" active-text="Enabled" inactive-text="Disabled"></el-switch>
             </el-dropdown-item>
+            <el-dropdown-item disabled divided>WebDAV Endpoint</el-dropdown-item>
+            <el-dropdown-item><a href="/_webdav/" target="_blank">{{ origin }}/_webdav/</a></el-dropdown-item>
+            <el-dropdown-item command="apiAccess" divided><i class="el-icon-connection"></i> Access Tokens</el-dropdown-item>
             <el-dropdown-item command="about" divided><i class="el-icon-info"></i> About</el-dropdown-item>
             <el-dropdown-item command="logout" id="logoutButton"><i class="el-icon-circle-close"></i> Logout</el-dropdown-item>
           </el-dropdown-menu>
         <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>
             <template slot-scope="scope">
-              <img v-bind:src="scope.row.previewUrl" height="48px" width="48px"/>
+              <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>
               <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-download" circle v-show="scope.row.isFile" @click.stop="onDownload(scope.row)"></el-button>
-              <el-button size="small" icon="el-icon-edit" circle @click.stop="onRename(scope.row, scope)"></el-button>
-              <el-button size="small" icon="el-icon-delete" circle @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>