mirror of
https://github.com/hanxi/xiaomusic.git
synced 2025-12-06 14:52:50 +08:00
feat: 删掉没用的网页更新功能
This commit is contained in:
27
xiaomusic/static/default/index.html
vendored
27
xiaomusic/static/default/index.html
vendored
@@ -25,7 +25,7 @@
|
||||
<body class="index_page">
|
||||
<div class="player">
|
||||
<h1>小爱音箱播放器
|
||||
<a id="version" href="javascript:void(0);">0.3.0</a><span id="versionnew" class="new-badge"></span>
|
||||
<a id="version" href="https://xdocs.hanxi.cc/issues/changelog.html" target="_blank">0.3.0</a><span id="versionnew" class="new-badge"></span>
|
||||
</h1>
|
||||
|
||||
<label for="did">选择播放设备:</label>
|
||||
@@ -192,31 +192,6 @@
|
||||
<button onclick="toggleWarning()">取消</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 更新组件 -->
|
||||
<div class="component" id="update-component" style="display: none;">
|
||||
<h2>更新</h2>
|
||||
<label for="update-version" style="display: flex;align-items: center;">选择版本:
|
||||
<a class="option-inline changelog-button" href="https://xdocs.hanxi.cc/issues/changelog.html" target="_blank">
|
||||
<span class="material-icons">list_alt</span>
|
||||
<span>版本日志</span>
|
||||
</a>
|
||||
</label>
|
||||
|
||||
<select id="update-version" class="version-selector">
|
||||
<option value="test" selected>test</option>
|
||||
</select>
|
||||
|
||||
<label for="lite">选择类型:</label>
|
||||
<select id="lite" class="version-selector">
|
||||
<option value="true" selected>轻量(不更新ffmpeg,推荐)</option>
|
||||
<option value="false">完整(更新ffmpeg)</option>
|
||||
</select>
|
||||
|
||||
<div class="component-button-group">
|
||||
<button onclick="doUpdates()">更新</button>
|
||||
<button onclick="toggleUpdate()">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
Powered by XiaoMusic
|
||||
</div>
|
||||
|
||||
42
xiaomusic/static/default/md.js
vendored
42
xiaomusic/static/default/md.js
vendored
@@ -635,48 +635,6 @@ function timedShutDown(cmd) {
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
// 绑定点击事件,显示弹窗
|
||||
$('#version').on('click', function () {
|
||||
$.get("https://xdocs.hanxi.cc/versions.json", function (data, status) {
|
||||
console.log(data);
|
||||
const versionSelect = document.getElementById("update-version");
|
||||
versionSelect.innerHTML = "";
|
||||
data.forEach((item) => {
|
||||
const option = document.createElement("option");
|
||||
option.value = item.version;
|
||||
option.textContent = item.version;
|
||||
versionSelect.appendChild(option);
|
||||
});
|
||||
});
|
||||
$('#update-component').show();
|
||||
});
|
||||
|
||||
// 关闭更新弹窗
|
||||
function toggleUpdate() {
|
||||
$('#update-component').hide();
|
||||
}
|
||||
|
||||
function doUpdates() {
|
||||
const version = $("#update-version").val();
|
||||
let lite = $("#lite").val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: `/updateversion?version=${version}&lite=${lite}`,
|
||||
contentType: "application/json; charset=utf-8",
|
||||
success: (data) => {
|
||||
if (data.ret == "OK") {
|
||||
alert(`更新成功,请刷新页面`);
|
||||
location.reload();
|
||||
} else {
|
||||
alert(`更新失败: ${data.ret}`);
|
||||
}
|
||||
},
|
||||
error: () => {
|
||||
alert(`更新失败`);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function confirmSearch() {
|
||||
var search_key = $("#search").val();
|
||||
if (search_key == null) {
|
||||
|
||||
Reference in New Issue
Block a user