About update-check #141
This commit is contained in:
parent
4f858cf7d6
commit
b3ca402842
|
@ -715,3 +715,41 @@ window.onload = function () {
|
||||||
function asReadEnd() {
|
function asReadEnd() {
|
||||||
postMessage(["asReadComp", ""], "*")
|
postMessage(["asReadComp", ""], "*")
|
||||||
}
|
}
|
||||||
|
function checkupd(){
|
||||||
|
var ver = localStorage.getItem("ver");
|
||||||
|
var start = "https://thedesk.top/ver.json";
|
||||||
|
fetch(start, {
|
||||||
|
method: 'GET'
|
||||||
|
}).then(function (response) {
|
||||||
|
return response.json();
|
||||||
|
}).catch(function (error) {
|
||||||
|
todo(error);
|
||||||
|
console.error(error);
|
||||||
|
}).then(function (mess) {
|
||||||
|
console.table(mess);
|
||||||
|
if (mess) {
|
||||||
|
var platform = localStorage.getItem("platform");
|
||||||
|
if (platform == "darwin") {
|
||||||
|
var newest = mess.desk_mac;
|
||||||
|
} else {
|
||||||
|
var newest = mess.desk;
|
||||||
|
}
|
||||||
|
if (newest == ver) {
|
||||||
|
Swal.fire({
|
||||||
|
type: 'info',
|
||||||
|
title: lang.lang_setting_noupd,
|
||||||
|
html: ver
|
||||||
|
})
|
||||||
|
} else if (ver.indexOf("beta") != -1 || winstore) {
|
||||||
|
Swal.fire({
|
||||||
|
type: 'info',
|
||||||
|
title: lang.lang_setting_thisisbeta,
|
||||||
|
html: ver
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
localStorage.removeItem("new-ver-skip")
|
||||||
|
location.href="index.html"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
|
@ -249,5 +249,7 @@
|
||||||
"lang_setting_notftest": " Notification test ",
|
"lang_setting_notftest": " Notification test ",
|
||||||
"lang_setting_notftestprof": "Your icon is shown.",
|
"lang_setting_notftestprof": "Your icon is shown.",
|
||||||
"lang_setting_exportwarn": "Only important data will be exported. You must keep this data secure.",
|
"lang_setting_exportwarn": "Only important data will be exported. You must keep this data secure.",
|
||||||
"lang_setting_importwarn": "All data will be deleted."
|
"lang_setting_importwarn": "All data will be deleted.",
|
||||||
|
"lang_setting_noupd": "No available update",
|
||||||
|
"lang_setting_thisisbeta": "This is beta version. You have to update manually."
|
||||||
}
|
}
|
|
@ -249,5 +249,7 @@
|
||||||
"lang_setting_notftest": "通知テスト",
|
"lang_setting_notftest": "通知テスト",
|
||||||
"lang_setting_notftestprof": "アイコンはあなたのアカウントのものです。",
|
"lang_setting_notftestprof": "アイコンはあなたのアカウントのものです。",
|
||||||
"lang_setting_exportwarn": "重要なデータのみエクスポートされます。エクスポートされたデータは外部に公開しないでください。全ての認証データが含まれています。",
|
"lang_setting_exportwarn": "重要なデータのみエクスポートされます。エクスポートされたデータは外部に公開しないでください。全ての認証データが含まれています。",
|
||||||
"lang_setting_importwarn": "全てのデータがリセットされます。"
|
"lang_setting_importwarn": "全てのデータがリセットされます。",
|
||||||
|
"lang_setting_noupd": "お使いのTheDeskは最新です",
|
||||||
|
"lang_setting_thisisbeta": "お使いのTheDeskはベータ版のため、アップデートは手動で行う必要があります。"
|
||||||
}
|
}
|
|
@ -4,10 +4,13 @@ if (process.argv.indexOf("--automatic") === -1) {
|
||||||
if (input) {
|
if (input) {
|
||||||
ver = input;
|
ver = input;
|
||||||
}
|
}
|
||||||
var basefile="../../"
|
//var basefile="../../"
|
||||||
} else {
|
} else {
|
||||||
var basefile="./"
|
//var basefile="./"
|
||||||
}
|
}
|
||||||
|
//const { app } = require('electron');
|
||||||
|
const path = require('path');
|
||||||
|
const basefile = path.join(__dirname, "../../")
|
||||||
function main(ver, basefile) {
|
function main(ver, basefile) {
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const execSync = require("child_process").execSync;
|
const execSync = require("child_process").execSync;
|
||||||
|
@ -23,6 +26,7 @@ function main(ver, basefile) {
|
||||||
const pages = ["acct.html", "index.html", "setting.html", "update.html", "setting.vue.js"];
|
const pages = ["acct.html", "index.html", "setting.html", "update.html", "setting.vue.js"];
|
||||||
let langstr = "";
|
let langstr = "";
|
||||||
let refKey = [];
|
let refKey = [];
|
||||||
|
const enJson=JSON.parse(fs.readFileSync(basefile + "view/make/language/en/main.json", "utf8"))
|
||||||
for (let n = 0; n < langs.length; n++) {
|
for (let n = 0; n < langs.length; n++) {
|
||||||
let lang = langs[n];
|
let lang = langs[n];
|
||||||
let targetDir = basefile + "view/" + lang;
|
let targetDir = basefile + "view/" + lang;
|
||||||
|
@ -30,7 +34,15 @@ function main(ver, basefile) {
|
||||||
fs.mkdirSync(targetDir);
|
fs.mkdirSync(targetDir);
|
||||||
}
|
}
|
||||||
langstr = langstr + "<a onclick=\"changelang('" + lang + '\')" class="pointer" style="margin:4px;border: 1px solid var(--color); padding: 3px">' + langsh[n] + "</a>";
|
langstr = langstr + "<a onclick=\"changelang('" + lang + '\')" class="pointer" style="margin:4px;border: 1px solid var(--color); padding: 3px">' + langsh[n] + "</a>";
|
||||||
fs.writeFileSync(basefile + "view/" + lang + "/main.js", fs.readFileSync(basefile + "view/make/language/" + lang + "/main.json", "utf8").replace(/^{/, "var lang = {"));
|
let mainJson=JSON.parse(fs.readFileSync(basefile + "view/make/language/" + lang + "/main.json", "utf8"))
|
||||||
|
if(lang != "en"){
|
||||||
|
Object.keys(enJson).forEach(function(key) {
|
||||||
|
if(!mainJson[key]){
|
||||||
|
mainJson[key]=enJson[key]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
fs.writeFileSync(basefile + "view/" + lang + "/main.js", JSON.stringify(mainJson).replace(/^{/, "var lang = {"));
|
||||||
}
|
}
|
||||||
for (let i = 0; i < samples.length; i++) {
|
for (let i = 0; i < samples.length; i++) {
|
||||||
let sample = samples[i];
|
let sample = samples[i];
|
||||||
|
|
|
@ -511,12 +511,11 @@
|
||||||
style="width:100%; max-width:500px;"><img src="../../img/desk_full.svg" class="left" width="25"
|
style="width:100%; max-width:500px;"><img src="../../img/desk_full.svg" class="left" width="25"
|
||||||
style="padding-top:5px;">Main author: Cutls@cutls.com</a>
|
style="padding-top:5px;">Main author: Cutls@cutls.com</a>
|
||||||
<br>
|
<br>
|
||||||
TheDesk @ <a href="https://github.com/cutls/TheDesk/commits/@@gitHash@@">@@gitHash@@</a><br>
|
TheDesk @ <a href="https://github.com/cutls/TheDesk/commits/@@gitHash@@">@@gitHash@@</a> - <a onclick="checkupd(); return localStorage.removeItem('new-ver-skip'); location.href='index.html';"
|
||||||
|
class="pointer">@@checkup@@</a><br>
|
||||||
<br>
|
<br>
|
||||||
Kyash<br>
|
Kyash<br>
|
||||||
<img src="../../img/kyash.png" width="100"><br>
|
<img src="../../img/kyash.png" width="100"><br>
|
||||||
<a onclick="localStorage.removeItem('new-ver-skip'); location.href='index.html';"
|
|
||||||
class="pointer">@@checkup@@</a><br>
|
|
||||||
<a href="https://status.cutls.com/">
|
<a href="https://status.cutls.com/">
|
||||||
<img src="https://status.cutls.com/badge-service?site=thedesk.top">
|
<img src="https://status.cutls.com/badge-service?site=thedesk.top">
|
||||||
</a><br>
|
</a><br>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user