]> git.immae.eu Git - perso/Immae/Projets/Nodejs/Surfer.git/blob - frontend/index.html
link to surfer docs instead
[perso/Immae/Projets/Nodejs/Surfer.git] / frontend / index.html
1 <html>
2 <head>
3 <title> Surfer </title>
4
5 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
6
7 <link rel="icon" type="image/png" href="/_admin/img/logo.png">
8
9 <link rel="stylesheet" href="/_admin/css/theme-chalk_2.11.1.css">
10 <link rel="stylesheet" href="/_admin/css/style.css">
11
12 <script src="/_admin/js/jquery-1.12.1.min.js"></script>
13 <script src="/_admin/js/vue.min.js"></script>
14 <script src="/_admin/js/element-ui_2.11.1.min.js"></script>
15 <script src="/_admin/js/element-ui_en_2.11.1.min.js"></script>
16 <script src="/_admin/js/filesize.min.js"></script>
17 <script src="/_admin/js/superagent.js"></script>
18
19 </head>
20 <body>
21
22 <div id="app" @drop="drop" @dragover="dragOver">
23
24 <el-container>
25 <input type="file" ref="upload" style="display: none" multiple/>
26 <input type="file" ref="uploadFolder" style="display: none" multiple webkitdirectory directory/>
27
28 <el-dialog title="Login" :visible.sync="ready && !session.valid" width="30%" :close-on-press-escape="false" :show-close="false">
29 <el-form :model="loginData" label-position="top" @submit.native.prevent>
30 <el-form-item label="Username"><el-input v-model="loginData.username" id="loginUsernameInput" required autofocus :disabled="loginData.busy"></el-input></el-form-item>
31 <el-form-item label="Password"><el-input v-model="loginData.password" id="loginPasswordInput" type="password" required :disabled="loginData.busy"></el-input></el-form-item>
32 <input type="submit" @click="onLogin" v-show="false"/>
33 </el-form>
34 <span slot="footer" class="dialog-footer">
35 <el-button type="primary" @click="onLogin" id="loginSubmitButton"><i class="el-icon-loading" v-show="loginData.busy"></i><span v-show="!loginData.busy">Login</span></el-button>
36 </span>
37 </el-dialog>
38
39 <el-dialog title="Access Tokens" :visible.sync="accessTokensDialogVisible" width="40%">
40 Access tokens are useful to programmatically deploy assets for example within a CI/CD pipeline.
41 See the [docs](https://cloudron.io/documentation/apps/surfer/) for more information on how to use this token.
42 <br/>
43 <br/>
44 <el-alert title="Tokens are shared between all users." type="warning" show-icon :closable="false"></el-alert>
45 <br/>
46 <div>
47 <div v-for="accessToken in accessTokens">
48 <el-input suffix-icon="el-icon-copy-document" v-model="accessToken" class="access-token-input" @focus="onCopyAccessToken" size="small"></el-input>
49 <el-button icon="el-icon-delete" type="danger" size="small" @click="onDeleteAccessToken(accessToken)"></el-button>
50 </div>
51 </div>
52 <br/>
53 <el-button @click="onCreateAccessToken()" size="small" type="primary">Create Access Token</el-button>
54 </el-dialog>
55
56 <el-header>
57 <el-row type="flex" justify="space-between">
58 <div style="padding: 7px;">
59 <span>Surfer</span>
60 </div>
61 <div v-show="session.valid">
62 <el-button type="primary" size="small" icon="el-icon-arrow-left" :disabled="!pathParts.slice(-1).length" @click="onUp"></el-button>
63 </div>
64 <div style="flex-grow: 2; padding: 0 7px;" v-show="session.valid">
65 <el-breadcrumb separator-class="el-icon-arrow-right">
66 <el-breadcrumb-item><a href="#/">Path /</a></el-breadcrumb-item>
67 <el-breadcrumb-item v-for="part in pathParts.slice(0, -1)"><a :href="part.link">{{ part.name }}</a></el-breadcrumb-item>
68 <el-breadcrumb-item v-show="pathParts.slice(-1).length">{{ pathParts.slice(-1).length ? pathParts.slice(-1)[0].name : '' }}</el-breadcrumb-item>
69 </el-breadcrumb>
70 </div>
71 <div align="right" v-show="session.valid">
72 <el-button-group>
73 <el-button type="primary" icon="el-icon-upload2" size="small" @click="onUpload">Upload File</el-button>
74 <el-button type="primary" icon="el-icon-upload" size="small" @click="onUploadFolder">Upload Folder</el-button>
75 <el-button type="primary" icon="el-icon-plus" size="small" @click="onNewFolder">New Folder</el-button>
76 </el-button-group>
77 <el-dropdown @command="onOptionsMenu" :hide-on-click="false" trigger="click">
78 <el-button size="small" icon="el-icon-more" id="burgerMenuButton"></el-button>
79 <el-dropdown-menu slot="dropdown">
80 <el-dropdown-item disabled>Public Folder Listing</el-dropdown-item>
81 <el-dropdown-item command="folderListing">
82 <el-switch v-model="folderListingEnabled" active-text="Enabled" inactive-text="Disabled"></el-switch>
83 </el-dropdown-item>
84 <el-dropdown-item disabled divided>WebDAV Endpoint</el-dropdown-item>
85 <el-dropdown-item><a href="/_webdav/" target="_blank">{{ origin }}/_webdav/</a></el-dropdown-item>
86 <el-dropdown-item command="apiAccess" divided><i class="el-icon-connection"></i> Access Tokens</el-dropdown-item>
87 <el-dropdown-item command="about" divided><i class="el-icon-info"></i> About</el-dropdown-item>
88 <el-dropdown-item command="logout" id="logoutButton"><i class="el-icon-circle-close"></i> Logout</el-dropdown-item>
89 </el-dropdown-menu>
90 </el-dropdown>
91 </div>
92 </el-row>
93 </el-header>
94 <el-main>
95
96 <div v-show="busy">
97 <center><h1><i class="el-icon-loading"></i></h1></center>
98 </div>
99
100 <div v-show="!busy && session.valid" v-cloak>
101 <center>
102 <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">
103 <el-table-column prop="previewUrl" label="Type" width="100px" sortable>
104 <template slot-scope="scope">
105 <img v-bind:src="scope.row.previewUrl" height="48px" width="48px" style="object-fit: cover;"/>
106 </template>
107 </el-table-column>
108 <el-table-column prop="filePath" label="Name" sortable>
109 <template slot-scope="scope">
110 <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>
111 <span v-show="!scope.row.rename">{{ scope.row.filePath }}</span>
112 </template>
113 </el-table-column>
114 <el-table-column prop="size" label="Size" width="150px" sortable :formatter="prettyFileSize"></el-table-column>
115 <el-table-column prop="mtime" label="Modified" width="150px" sortable :formatter="prettyDate"></el-table-column>
116 <el-table-column label="Actions" align="right" width="200px" class-name="list-actions">
117 <template slot-scope="scope">
118 <el-button size="small" icon="el-icon-edit" circle v-show="!scope.row.rename" @click.stop="onRename(scope.row, scope)"></el-button>
119 <el-button size="small" icon="el-icon-download" circle v-show="!scope.row.rename && scope.row.isFile" @click.stop="onDownload(scope.row)"></el-button>
120 <el-button size="small" icon="el-icon-delete" circle v-show="!scope.row.rename" @click.stop="onDelete(scope.row)"></el-button>
121 </template>
122 </el-table-column>
123 </el-table>
124 </center>
125 </div>
126
127 </el-main>
128 <el-footer v-show="uploadStatus.busy">
129 <el-row v-if="uploadStatus.uploadListCount">
130 <center><i class="el-icon-loading"></i> Fetching file information for upload <el-badge class="mark" :value="uploadStatus.uploadListCount"/></center>
131 </el-row>
132 <el-row v-else>
133 <el-col :span="4">
134 Uploading {{ uploadStatus.count }} files ({{ Math.round(uploadStatus.done/1000/1000) }}MB / {{ Math.round(uploadStatus.size/1000/1000) }}MB)
135 </el-col>
136 <el-col :span="20">
137 <el-progress :text-inside="true" :stroke-width="18" :percentage="uploadStatus.percentDone"></el-progress>
138 </el-col>
139 </el-row>
140 </el-footer>
141 </el-container>
142
143 </div>
144
145 <script src="/_admin/js/app.js"></script>
146
147 </body>
148 </html>