Add: GIt hash

This commit is contained in:
Cutls 2019-08-26 21:06:07 +09:00
parent 5007b70683
commit 46dbc9ae62
14 changed files with 47 additions and 25 deletions

View File

@ -15,6 +15,8 @@
font-family: 'Open Sans';
-webkit-app-region: drag;
cursor: move;
padding: 5px;
padding-top: 15px;
}
a,
@ -27,7 +29,7 @@
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5';
grid-template-areas: 'name1 data1''name2 data2''name3 data3''name4 data4''name5 data5''name6 data6';
text-align: left;
margin: 5px;
}
@ -71,6 +73,14 @@
.area-data5 {
grid-area: data5;
}
.area-name6 {
grid-area: name6;
}
.area-data6 {
grid-area: data6;
}
</style>
</head>
@ -85,12 +95,14 @@
<div class="area-data1" id="now"></div>
<div class="area-name2">Internal version</div>
<div class="area-data2" id="ver"></div>
<div class="area-name3">Chromium</div>
<div class="area-data3" id="chrome"></div>
<div class="area-name4">Electron</div>
<div class="area-data4" id="electron"></div>
<div class="area-name5">Node.js</div>
<div class="area-data5" id="node"></div>
<div class="area-name3">Commit(7chars)</div>
<div class="area-data3" id="hash"></div>
<div class="area-name4">Chromium</div>
<div class="area-data4" id="chrome"></div>
<div class="area-name5">Electron</div>
<div class="area-data5" id="electron"></div>
<div class="area-name6">Node.js</div>
<div class="area-data6" id="node"></div>
</div>
<div class="cp">Copyright &copy; TheDesk 2018<br>
Main developer(author): <a href="https://cutls.com/@Cutls" target="_blank">Cutls P</a><br>
@ -114,6 +126,7 @@
var ver = m[1];
$("#ver").text(ver);
}
$("#hash").html('<a href="https://github.com/cutls/TheDesk/commits/' + about[3] + '" target="_blank">' + about[3].slice(0, 7) + '</a>');
$(document).on('click', 'a', e => {
var url = $(e.target).attr('href');
postMessage(["openUrl", url], "*")

View File

@ -47,6 +47,10 @@
#bottom .leftside {
display: flex;
}
#tips{
display: flex;
align-items: center;
}
#bottom #tips img {
vertical-align: -3px;
}

View File

@ -2,6 +2,7 @@ var electron = require("electron");
const shell = electron.shell;
var ipc = electron.ipcRenderer;
onmessage = function (e) {
console.log(e)
if (e.data[0] == "openUrl") {
urls = e.data[1].match(/https?:\/\/(.+)/);
if (urls) {

View File

@ -25,7 +25,7 @@ function tips(mode) {
clearInterval(spotStart);
if (mode == "ver") {
tipsToggle()
$("#tips-text").html('<img src="../../img/desk.png" width="20" onclick="todo(\'TheDesk is a nice client!: TheDesk ' + localStorage.getItem("ver") + ' git: '+ gitHash +'\')"><span style="font-size:20px">TheDesk</span> <span title="git: '+ gitHash +'">' + localStorage.getItem("ver") + '</span>[<i class="material-icons" style="font-size:1.2rem;top: 3px;position: relative;">supervisor_account</i><span id="persons">1+</span>]')
$("#tips-text").html('<img src="../../img/desk.png" width="20" onclick="todo(\'TheDesk is a nice client!: TheDesk ' + localStorage.getItem("ver") + ' git: '+ gitHash +'\')">TheDesk ' + localStorage.getItem("ver") + ' {'+ gitHash.slice(0, 7) +'} [<i class="material-icons" style="font-size:1.2rem;top: 3px;position: relative;">supervisor_account</i><span id="persons">1+</span>]')
localStorage.setItem("tips", "ver")
} else if (mode == "clock") {
tipsToggle()

View File

@ -202,7 +202,7 @@ function createWindow() {
var platform = process.platform;
var bit = process.arch;
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir)));
Menu.setApplicationMenu(Menu.buildFromTemplate(language.template(lang, mainWindow, packaged, dir, dirname)));
//CSS
css.css(mainWindow);
//アップデータとダウンロード

View File

@ -26,11 +26,9 @@ function dl(mainWindow, lang_path, base, dirname) {
"transparent": false, // ウィンドウの背景を透過
"frame": false, // 枠の無いウィンドウ
"resizable": false
});
//updatewin.openDevTools()
})
var lang = fs.readFileSync(lang_path, 'utf8');
updatewin.loadURL(base + lang + '/update.html');
return "true"
} else {
return false;

View File

@ -1,11 +1,12 @@
// Create the Application's main menu
function templete(lang, mainWindow, packaged, dir) {
function templete(lang, mainWindow, packaged, dir, dirname) {
if(lang !="ja" && lang != "en"){
lang = "en"
}
const electron = require("electron");
const app = electron.app;
const BrowserWindow = electron.BrowserWindow;
const join = require('path').join;
const dict = {
"application": {
"ja": "アプリケーション",
@ -101,9 +102,9 @@ function templete(lang, mainWindow, packaged, dir) {
webviewTag: false,
nodeIntegration: false,
contextIsolation: true,
preload: "../js/platform/preload.js"
preload: join(dirname , "js", "platform", "preload.js")
},
width: 300, height: 460,
width: 300, height: 500,
"transparent": false, // ウィンドウの背景を透過
"frame": false, // 枠の無いウィンドウ
"resizable": false

View File

@ -130,10 +130,12 @@ function system(mainWindow, dir, lang, dirname) {
var window = new BrowserWindow({
webPreferences: {
webviewTag: false,
nodeIntegration: false
nodeIntegration: false,
contextIsolation: true,
preload: join(dirname, "js", "platform", "preload.js")
},
width: 300,
height: 480,
height: 500,
"transparent": false, // ウィンドウの背景を透過
"frame": false, // 枠の無いウィンドウ
"resizable": false

View File

@ -992,10 +992,10 @@
</div>
</div>
<div id="tips" class="hide">
<a onclick="tipsToggle()" class="nex waves-effect" style="float:left">
<a onclick="tipsToggle()" class="nex waves-effect">
<i class="material-icons nex" title="@@changeTips@@" data-trans-title="tips">bubble_chart</i>
</a>
<div id="tips-text" style="float:left; width:300px;"></div>
<div id="tips-text" style="width:300px;"></div>
</div>
</div>
</div>

View File

@ -10,7 +10,7 @@
"nexttl":"Until next TL loading",
"nextver":"Until next version",
"problem1":"Some problems?",
"problem2":"Please download on <a href=\"https://thedesk.top\">Oficial HP</a>.",
"problem2":"Please download on <a href='https://thedesk.top'>Oficial HP</a>.",
"continue":"Continue updating",
"dlnow":"Downloading..."
}

View File

@ -9,7 +9,7 @@
"nexttl":"次回TL表示時まで",
"nextver":"次のバージョンが出るまで",
"problem1":"問題が発生しますか?",
"problem2":"<a href=\"https://thedesk.top\">公式HP</a>からダウンロードをお試しください。",
"problem2":"<a href='https://thedesk.top'>公式HP</a>からダウンロードをお試しください。",
"continue":"アップデートを続行",
"dlnow":"ダウンロード中"
}

View File

@ -43,6 +43,7 @@ for (let i = 0; i < samples.length; i++) {
}
source = source.replace(/@@versionLetter@@/g, ver)
source = source.replace(/@@gitHash@@/g, gitHash)
source = source.replace(/@@gitHashShort@@/g, gitHash.slice(0, 7))
source = source.replace(/@@lang@@/g, lang)
source = source.replace(/@@langlist@@/g, langstr)
fs.writeFileSync("../" + lang + "/" + pages[i], source)

View File

@ -449,14 +449,16 @@
style="width:100%; max-width:500px;"><img src="../../img/desk_full.svg" class="left" width="25"
style="padding-top:5px;">Developer: Cutls@cutls.com</a>
<br>
TheDesk @ <a href="https://github.com/cutls/TheDesk/commits/@@gitHash@@">@@gitHash@@</a><br>
<br>
Kyash<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="oss.html">OSS License@@ossJP@@</a><br>
<br>
<span style="font-family:Open Sans;">Copyright &copy; TheDesk 2018
Under <a href="https://github.com/cutls/TheDesk/blob/master/LICENSE">GNU General Public License v3.0</a> and <a
href="https://thedesk.top/tos.html">Terms of Use</a>/<a href="https://thedesk.top/priv.html">Privacy
Under <a href="https://github.com/cutls/TheDesk/blob/master/LICENSE">GNU General Public License v3.0</a> and <a href="https://thedesk.top/priv.html">Privacy
Policy</a>
<br>Developer: Cutls P(
<a href="index.html?mode=user&code=Cutls@cutls.com">@Cutls@cutls.com</a>)

View File

@ -178,7 +178,7 @@
}
} else if (sel == "mac") {
var url = json["mac"];
shell.openExternal(url);
postMessage(["openUrl", url], "*")
return false;
}
postMessage(["downloadButton", [url, file]], "*")