-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
129 lines (116 loc) · 3.76 KB
/
index.html
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
122
123
124
125
126
127
128
129
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Origin Private File System</title>
<link rel="shortcut icon" type="image/x-icon" href="https://s2.loli.net/2023/11/10/avJNBlkrHU4Z62g.png" media="screen" >
<style type="text/css">
#app {
border-style: dashed;
border-bottom: 1px solid #aaa;
border-top: none;
border-left: none;
border-right: none;
margin: 10px;
}
.tool {
display: flex;
}
.tool > * {
margin: 10px;
align-items: center;
}
.view {
display: flex;
height: 400px;
}
.status {
margin: 10px;
}
#box {
flex: auto;
border: 1px solid #333;
border-radius: 5px;
margin: 10px;
overflow: auto;
}
#box > div {
border: 1px solid #999;
border-radius: 5px;
width: 150px;
height: 150px;
float: left;
margin: 10px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
overflow: hidden;
}
#box > div > * {
flex: auto;
}
#box > div > span {
width: 140px;
text-align: center;
font-size: 12px;
}
#box > div > img {
height: 80%;
}
#box > div > img:hover {
cursor: pointer;
}
#box > div.active {
background-color: #eee;
}
#detail {
flex: 0 0 200px;
border: 1px solid #aaa;
border-radius: 5px;
margin: 10px;
overflow: auto;
}
[draggable=true] {
cursor: grab;
&:active {
cursor: grabbing;
}
}
</style>
</head>
<body>
<script type="module" src="./dist/index.js"></script>
<div v-scope="App({ })" @vue:mounted="onMounted"></div>
<template id="page">
<div id="app" v-html="store.info"></div>
<div class="tool">
<button class="info" @click="info">空间信息</button>
<div>Location:<input type="text" readonly v-model:value="store.ctx.pwd" /></div>
<button class="list" @click="postMessage({action: 'list'})">刷新</button>
<button class="createFile" @click="createFile">新建文件</button>
<button class="createDirectory" @click="createDirectory">新建目录</button>
<button class="remove" @click="remove">删除该项</button>
<button class="clean" @click="clean">全部清空</button>
<button class="upload" @click="upload">上传文件</button>
<button class="saveAs" @click="saveAs">另存为</button>
</div>
<div class="view">
<div id="box">
<div v-for="item in store.items" :key="`${item.kind}:${item.name}`" :class="{active: !!item.active}" @drop="ondrop(item)" @dragover="ondragover">
<img alt="文件" src="./public/f.svg" v-if="item.kind == 'file'" @click="active(item)" @dblclick="read(item)" draggable="true" @dragstart="ondragstart(item)"/>
<img alt="文件夹" src="./public/d.svg" v-if="item.kind == 'directory'" @click="active(item)" @dblclick="cd(item)"/>
<input type="text" v-if="!!item.editable" :value="item.name" @keyup="editend(item, $event)"/>
<span v-else @dblclick="editable(item, $event)" >{{ item.name }}</span>
</div>
<div v-if="store.ctx.pwd != '/'">
<img alt="返回上层" src="./public/r.svg" @dblclick="cd({name: '..'})"/>
<span>返回上层</span>
</div>
</div>
<div id="detail">{{ store.detail }}</div>
</div>
<div class="status">{{ store.error }}</div>
</template>
</body>
</html>