mirror of
https://github.com/will-moss/isaiah.git
synced 2024-08-22 23:27:15 +03:00
feat(client): added a Version command to display the current version of Isaiah in the browser
This commit is contained in:
@@ -715,27 +715,6 @@ html {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mobile blocker
|
*.has-accent {
|
||||||
.mobile-blocker {
|
color: var(--color-terminal-accent) !important;
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
z-index: 99;
|
|
||||||
pointer-events: none;
|
|
||||||
background: var(--color-terminal-background);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
p {
|
|
||||||
padding: 0 24px;
|
|
||||||
line-height: 125%;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (min-width: 920px) {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -756,6 +756,10 @@
|
|||||||
<span class="cell">G </span>
|
<span class="cell">G </span>
|
||||||
<span class="cell">open project on Github</span>
|
<span class="cell">open project on Github</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="row is-not-interactive">
|
||||||
|
<span class="cell">V </span>
|
||||||
|
<span class="cell">show version</span>
|
||||||
|
</div>
|
||||||
<div class="row is-not-interactive"></div>
|
<div class="row is-not-interactive"></div>
|
||||||
<div class="row is-not-interactive">
|
<div class="row is-not-interactive">
|
||||||
<span class="cell">T </span>
|
<span class="cell">T </span>
|
||||||
@@ -3556,10 +3560,28 @@
|
|||||||
websocketSend({ action: `enumerate`, Host: host }, true);
|
websocketSend({ action: `enumerate`, Host: host }, true);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Public - Display current version
|
||||||
|
*/
|
||||||
|
version: function () {
|
||||||
|
state.message.category = 'report';
|
||||||
|
state.message.type = 'success';
|
||||||
|
state.message.title = 'Version';
|
||||||
|
state.message.content = `You are currently running the version <em class="has-accent">${VERSION}</em> of Isaiah.`;
|
||||||
|
state.message.isEnabled = true;
|
||||||
|
state.helper = 'message';
|
||||||
|
cmdRun(cmds._showPopup, 'message');
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// === Variables
|
// === Variables
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
const VERSION = '-VERSION-';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
@@ -3650,6 +3672,7 @@
|
|||||||
'?': 'help',
|
'?': 'help',
|
||||||
'/': 'search',
|
'/': 'search',
|
||||||
J: 'jump',
|
J: 'jump',
|
||||||
|
V: 'version',
|
||||||
|
|
||||||
// Appearance
|
// Appearance
|
||||||
'+': 'nextLayout', // Next layout
|
'+': 'nextLayout', // Next layout
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ npx --yes terser ./client/assets/js/isaiah.js -o ./client/assets/js/isaiah.js
|
|||||||
VERSION=$(git describe --tags --abbrev=0)
|
VERSION=$(git describe --tags --abbrev=0)
|
||||||
sed -i.bak "s/isaiah.js/isaiah.js?v=$VERSION/" ./client/index.html
|
sed -i.bak "s/isaiah.js/isaiah.js?v=$VERSION/" ./client/index.html
|
||||||
sed -i.bak "s/style.css/style.css?v=$VERSION/" ./client/index.html
|
sed -i.bak "s/style.css/style.css?v=$VERSION/" ./client/index.html
|
||||||
|
sed -i.bak "s/-VERSION-/$VERSION/" ./client/assets/js/isaiah.js
|
||||||
|
|
||||||
# Build the app
|
# Build the app
|
||||||
go build -o isaiah main.go
|
go build -o isaiah main.go
|
||||||
@@ -37,6 +38,7 @@ mv ./client/assets/js/isaiah.backup.js ./client/assets/js/isaiah.js
|
|||||||
|
|
||||||
# Remove backup files
|
# Remove backup files
|
||||||
rm -f ./client/index.html.bak
|
rm -f ./client/index.html.bak
|
||||||
|
rm -f ./client/assets/js/isaiah.js.bak
|
||||||
|
|
||||||
DESTINATION="/usr/bin"
|
DESTINATION="/usr/bin"
|
||||||
if [ -d "/usr/local/bin" ]; then
|
if [ -d "/usr/local/bin" ]; then
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ mv ./client/assets/js/isaiah.backup.js ./client/assets/js/isaiah.js
|
|||||||
# Remove the version parameter from the main JS & CSS linked files
|
# Remove the version parameter from the main JS & CSS linked files
|
||||||
sed -i.bak -E 's/\?v=[0-9.]+//' ./client/index.html
|
sed -i.bak -E 's/\?v=[0-9.]+//' ./client/index.html
|
||||||
rm -f ./client/index.html.bak
|
rm -f ./client/index.html.bak
|
||||||
|
rm -f ./client/assets/js/isaiah.js.bak
|
||||||
|
|
||||||
# Remove dist folder generated by goreleaser
|
# Remove dist folder generated by goreleaser
|
||||||
rm -rf ./dist/
|
rm -rf ./dist/
|
||||||
|
|||||||
@@ -25,3 +25,4 @@ npx --yes terser ./client/assets/js/isaiah.js -o ./client/assets/js/isaiah.js
|
|||||||
VERSION=$(git describe --tags --abbrev=0)
|
VERSION=$(git describe --tags --abbrev=0)
|
||||||
sed -i.bak "s/isaiah.js/isaiah.js?v=$VERSION/" ./client/index.html
|
sed -i.bak "s/isaiah.js/isaiah.js?v=$VERSION/" ./client/index.html
|
||||||
sed -i.bak "s/style.css/style.css?v=$VERSION/" ./client/index.html
|
sed -i.bak "s/style.css/style.css?v=$VERSION/" ./client/index.html
|
||||||
|
sed -i.bak "s/-VERSION-/$VERSION/" ./client/assets/js/isaiah.js
|
||||||
|
|||||||
Reference in New Issue
Block a user