aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/index.html
blob: 2e2e5e3e3549cccab39839a4d9ccc73fcd2c25a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<html>
<head>
    <title> Cloudron Surfer </title>

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">

    <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/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/filesize.min.js"></script>
    <script src="/_admin/js/superagent.js"></script>
    <script src="/_admin/js/sorttable.js"></script>

</head>
<body>

<div id="app" @drop="drop" @dragover="dragOver">

<el-container>
  <input type="file" ref="upload" style="display: none" id="uploadInput" multiple/>

  <el-dialog title="Login" :visible.sync="ready && !session.valid" width="30%" :close-on-press-escape="false" :show-close="false">
    <el-form :model="loginData" label-position="top" @submit.native.prevent>
      <el-form-item label="Username"><el-input v-model="loginData.username" required autofocus></el-input></el-form-item>
      <el-form-item label="Password"><el-input v-model="loginData.password" type="password" required></el-input></el-form-item>
      <input type="submit" @click="onLogin" v-show="false"/>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button type="primary" @click="onLogin"><i class="el-icon-loading" v-show="busy"></i><span v-show="!busy">Login</span></el-button>
    </span>
  </el-dialog>

  <el-header>
    <el-row type="flex" justify="space-between">
      <div style="padding: 7px;">
        <span>Surfer</span>
      </div>
      <div style="flex-grow: 2; padding: 0 7px;" v-show="session.valid">
        <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item><a href="#/">Path /</a></el-breadcrumb-item>
          <el-breadcrumb-item v-for="part in pathParts.slice(0, -1)"><a :href="part.link">{{ part.name }}</a></el-breadcrumb-item>
          <el-breadcrumb-item v-show="pathParts.slice(-1).length">{{ pathParts.slice(-1).length ? pathParts.slice(-1)[0].name : '' }}</el-breadcrumb-item>
        </el-breadcrumb>
      </div>
      <div align="right" v-show="session.valid">
        <el-button-group>
          <el-button type="primary" icon="el-icon-upload" size="small" @click="onUpload">Upload</el-button>
          <el-button type="primary" icon="el-icon-plus" size="small" @click="onNewFolder">New Folder</el-button>

        </el-button-group>
        <el-dropdown @command="onOptionsMenu">
          <el-button size="small" icon="el-icon-more"></el-button>
          <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-dropdown-item>
            <el-dropdown-item command="about" divided><i class="el-icon-info"></i> About</el-dropdown-item>
            <el-dropdown-item command="logout"><i class="el-icon-circle-close"></i> Logout</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </el-row>
  </el-header>
  <el-main>

    <!-- <div class="container" v-show="uploadStatus.busy" v-cloak>
        <div class="row">
            <div class="col-lg-12">
                <p>Uploading... ({{ uploadStatus.done }} / {{ uploadStatus.count }}) </p>
                <center>
                    <div class="progress">
                        <div class="progress-bar progress-bar-striped" role="progressbar" v-bind:style="{ width: uploadStatus.percentDone + '%' }">
                            <span class="sr-only">{{ uploadStatus.percentDone }}% Complete</span>
                        </div>
                    </div>
                </center>
            </div>
        </div>
    </div> -->

    <div v-show="busy">
      <center><h1><i class="el-icon-loading"></i></h1></center>
    </div>

    <div v-show="!busy && session.valid" v-cloak>
      <el-table :data="entries" style="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"/>
          </template>
        </el-table-column>
        <el-table-column prop="filePath" label="Name" sortable></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)"></el-button>
            <el-button size="small" icon="el-icon-delete" circle @click.stop="onDelete(scope.row)"></el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>

  </el-main>
  <el-footer style="height: 24px">Built by the <a href="https://cloudron.io" target="_blank">Cloudron.io</a> team. <a href="https://git.cloudron.io/cloudron/surfer" target="_blank">Get the code</a></el-footer>
</el-container>

</div>

<script src="/_admin/js/app.js"></script>

</body>
</html>