-
Notifications
You must be signed in to change notification settings - Fork 464
/
Copy pathindex.html
159 lines (145 loc) · 4.52 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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html ng-app="web" ng-controller="mainCtrl">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width"
/>
<title>OSS Browser</title>
<script>
var path = require("path");
var os = require("os");
var fs = require("fs");
var request = require("request");
// var OSS = require('ali-oss');
var custom = {};
try {
custom = require(path.join(__dirname, "../custom/index.js"));
} catch (e) {
console.log("没有自定义模块");
}
document.title = custom.title || "OSS Browser";
</script>
<!-- <link href="icons/icon.ico" rel="shortcut icon"/> -->
<link href="css/lib.css" rel="stylesheet" />
<link href="app.css" rel="stylesheet" />
</head>
<body>
<!-- <div ng-include="'main/_/loading.html'"></div> -->
<toast-list></toast-list>
<div ui-view="">
<!-- loading -->
<section
style="
text-align: center;
display: block;
width: 128px;
height: 120px;
margin: 250px auto 0;
"
>
<div class="loadEffect">
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
<div><span></span></div>
</div>
</section>
</div>
<!-- Insert this line above script imports -->
<script>
if (typeof module === "object") {
window.module = module;
module = undefined;
}
</script>
<script src="lib.js"></script>
<!-- Insert this line after script imports -->
<script>
if (window.module) module = window.module;
</script>
<script src="aliyun-sdk-oss.js"></script>
<script src="templates.js"></script>
<script>
const { ipcRenderer, shell } = require("electron");
var isDev = process.env.NODE_ENV == "development";
ipcRenderer.on("asynchronous-reply", (event, data) => {
switch (data.key) {
case "getStaticServerPort":
Global.staticServerPort = data.port;
break;
}
});
setTimeout(function () {
ipcRenderer.send("asynchronous", { key: "getStaticServerPort" });
}, 1000);
//自动升级
// setTimeout(function(){
// ipcRenderer.send('asynchronous-message', 'checkUpgrade');
// },2000);
// setInterval(function(){
// ipcRenderer.send('asynchronous-message', 'checkUpgrade');
// },60000);
function openExternal(url) {
// Open a URL in the default way
shell.openExternal(url);
}
function openLocaleFolder(p) {
shell.showItemInFolder(p);
}
function openDevTools() {
ipcRenderer.send("asynchronous", { key: "openDevTools" });
}
function gInstallAndRestart(version) {
ipcRenderer.send("asynchronous", {
key: "installRestart",
version: version,
});
// setTimeout(function(){
// process.exit(0);
// },1);
}
var pkg = require("./package");
// var ALYD = require('aliyun-sdk');
// ALYD.util.isBrowser = function(){
// return false;
// };
var Global = {
//ossEndpointProtocol:'https:',
app: {
id: custom.appId || "oss-browser",
logo: custom.logo_png || "icons/icon.png", //logo
version: custom.version || pkg.version, //自定义版本号
},
i18n: require("./node/i18n"),
config_path: path.join(os.homedir(), ".oss-browser"),
//release notes目录后缀,里面有 ${version}.md, 如 1.0.0.md
release_notes_url: `https://oss-browser-attachment.oss-cn-hangzhou.aliyuncs.com/release-notes/`,
// 升级检测链接
upgrade_url: `https://oss-browser-attachment.oss-cn-hangzhou.aliyuncs.com/upgrade.json`,
about_html: custom.about_html,
};
(function () {
if (custom.appName)
for (var k in custom.appName) {
if (Global.i18n[k])
Global.i18n[k].content["app.name"] =
custom.appName[k] || "OSS Browser";
}
})();
$(function () {
$(document).on("dragover", function (ev) {
ev.preventDefault();
return false;
});
$(document).on("drop", function (ev) {
ev.preventDefault();
return false;
});
});
//require('./node/crc64/test')
</script>
<script src="app.js"></script>
</body>
</html>