feat: expose application version and update CI release workflow
Release / release (pull_request) Successful in 1m4s
Release / release (pull_request) Successful in 1m4s
This commit is contained in:
@@ -1,48 +0,0 @@
|
|||||||
name: Build and Upload Binaries
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-upload:
|
|
||||||
runs-on: build-htz-01
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Build Windows and Linux AMD64 binaries
|
|
||||||
run: |
|
|
||||||
mkdir -p dist
|
|
||||||
|
|
||||||
# Build Linux amd64 and Windows amd64 binaries
|
|
||||||
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace cr.jdbnet.co.uk/jdbnet/wails-builder:latest bash -c "
|
|
||||||
# Install frontend dependencies
|
|
||||||
cd frontend && npm install && cd ..
|
|
||||||
|
|
||||||
# Linux amd64
|
|
||||||
wails build -platform linux/amd64 -tags webkit2_41 -clean
|
|
||||||
cp build/bin/goexplore dist/goexplore-linux-amd64
|
|
||||||
|
|
||||||
# Windows amd64
|
|
||||||
wails build -platform windows/amd64 -clean -nsis
|
|
||||||
cp build/bin/GoExplore-amd64-installer.exe dist/goexplore-windows-installer.exe
|
|
||||||
"
|
|
||||||
|
|
||||||
- name: Upload to Cloudflare R2
|
|
||||||
env:
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_DEFAULT_REGION: auto
|
|
||||||
R2_ENDPOINT: ${{ secrets.R2_ENDPOINT_URL }}
|
|
||||||
run: |
|
|
||||||
aws s3 cp dist/goexplore-linux-amd64 s3://apps/goexplore/goexplore-linux-amd64 --endpoint-url "$R2_ENDPOINT"
|
|
||||||
aws s3 cp dist/goexplore-windows-installer.exe s3://apps/goexplore/goexplore-windows-installer.exe --endpoint-url "$R2_ENDPOINT"
|
|
||||||
|
|
||||||
- name: Clean up
|
|
||||||
run: sudo rm -rf dist build/bin/*
|
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
types: [closed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'v')
|
||||||
|
runs-on: build-htz-01
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Extract Version
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
# Remove 'v' prefix for some contexts if needed, but we'll use it raw
|
||||||
|
RAW_VERSION=${{ github.head_ref }}
|
||||||
|
CLEAN_VERSION=${RAW_VERSION#v}
|
||||||
|
echo "VERSION=${RAW_VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
echo "CLEAN_VERSION=${CLEAN_VERSION}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Set up QEMU
|
||||||
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
|
- name: Build Binaries
|
||||||
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
|
||||||
|
# Build Linux amd64 and Windows amd64 binaries using custom docker image
|
||||||
|
docker run --rm -v ${{ github.workspace }}:/workspace -w /workspace cr.jdbnet.co.uk/jdbnet/wails-builder:latest bash -c "
|
||||||
|
# Inject version into wails.json for NSIS & executable properties
|
||||||
|
sed -i 's/\"productVersion\": \".*\"/\"productVersion\": \"${{ steps.get_version.outputs.CLEAN_VERSION }}\"/' wails.json
|
||||||
|
|
||||||
|
# Install frontend dependencies
|
||||||
|
cd frontend && npm install && cd ..
|
||||||
|
|
||||||
|
# Linux amd64
|
||||||
|
wails build -platform linux/amd64 -tags webkit2_41 -clean -ldflags \"-X main.Version=${{ steps.get_version.outputs.VERSION }}\"
|
||||||
|
cp build/bin/goexplore dist/goexplore-linux-amd64
|
||||||
|
|
||||||
|
# Windows amd64
|
||||||
|
wails build -platform windows/amd64 -clean -nsis -ldflags \"-X main.Version=${{ steps.get_version.outputs.VERSION }}\"
|
||||||
|
cp build/bin/GoExplore-amd64-installer.exe dist/goexplore-windows-installer.exe
|
||||||
|
"
|
||||||
|
|
||||||
|
# - name: Generate Changelog
|
||||||
|
# id: changelog
|
||||||
|
# uses: https://github.com/metcalfc/changelog-generator@v4.6.2
|
||||||
|
# with:
|
||||||
|
# myToken: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create Gitea Release
|
||||||
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
name: GoExplore ${{ steps.get_version.outputs.VERSION }}
|
||||||
|
body: ${{ steps.changelog.outputs.changelog }}
|
||||||
|
draft: false
|
||||||
|
prerelease: false
|
||||||
|
files: |
|
||||||
|
dist/goexplore-linux-amd64
|
||||||
|
dist/goexplore-windows-installer.exe
|
||||||
|
|
||||||
|
- name: Upload to Cloudflare R2
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: auto
|
||||||
|
R2_ENDPOINT: ${{ secrets.R2_ENDPOINT_URL }}
|
||||||
|
run: |
|
||||||
|
aws s3 cp dist/goexplore-linux-amd64 s3://apps/goexplore/goexplore-linux-amd64 --endpoint-url "$R2_ENDPOINT"
|
||||||
|
aws s3 cp dist/goexplore-windows-installer.exe s3://apps/goexplore/goexplore-windows-installer.exe --endpoint-url "$R2_ENDPOINT"
|
||||||
|
|
||||||
|
- name: Clean up
|
||||||
|
run: sudo rm -rf dist build/bin/*
|
||||||
@@ -44,6 +44,10 @@ func (a *App) startup(ctx context.Context) {
|
|||||||
a.ctx = ctx
|
a.ctx = ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a *App) GetVersion() string {
|
||||||
|
return Version
|
||||||
|
}
|
||||||
|
|
||||||
func (a *App) GetConnections() []config.ConnectionConfig {
|
func (a *App) GetConnections() []config.ConnectionConfig {
|
||||||
if a.cfg == nil {
|
if a.cfg == nil {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
<div class="sidebar-header">
|
<div class="sidebar-header">
|
||||||
<img src="./src/assets/appicon.png" alt="Icon" style="width: 24px; height: 24px; margin-right: 0.5rem;"/>
|
<img src="./src/assets/appicon.png" alt="Icon" style="width: 24px; height: 24px; margin-right: 0.5rem;"/>
|
||||||
<span>GoExplore</span>
|
<span>GoExplore</span>
|
||||||
|
<span id="app-version" style="font-size: 0.7rem; color: var(--text-secondary); margin-left: 0.5rem; border: 1px solid var(--border); padding: 0.1rem 0.3rem; border-radius: 4px;"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="conn-list" id="conn-list">
|
<div class="conn-list" id="conn-list">
|
||||||
<!-- Connections will be populated here -->
|
<!-- Connections will be populated here -->
|
||||||
|
|||||||
+49
-41
@@ -1,4 +1,4 @@
|
|||||||
import { ListDir, GetConnections, SaveConnection, DeleteConnection, Delete, Rename, PromptUploadFiles, PromptUploadDirectory, PromptDownload, TransferItems, GetTransfers, ClearTransfers } from '../wailsjs/go/main/App.js';
|
import { GetVersion, ListDir, GetConnections, SaveConnection, DeleteConnection, Delete, Rename, PromptUploadFiles, PromptUploadDirectory, PromptDownload, TransferItems, GetTransfers, ClearTransfers } from '../wailsjs/go/main/App.js';
|
||||||
|
|
||||||
let currentConn = 'local';
|
let currentConn = 'local';
|
||||||
let currentPath = '';
|
let currentPath = '';
|
||||||
@@ -10,9 +10,9 @@ let sortField = 'name';
|
|||||||
let sortAsc = true;
|
let sortAsc = true;
|
||||||
|
|
||||||
function uuidv4() {
|
function uuidv4() {
|
||||||
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c =>
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, c =>
|
||||||
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
|
(c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
@@ -24,9 +24,17 @@ async function init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const version = await GetVersion();
|
||||||
|
const vSpan = document.getElementById('app-version');
|
||||||
|
if (vSpan && version) {
|
||||||
|
vSpan.innerText = version;
|
||||||
|
}
|
||||||
|
} catch (e) { }
|
||||||
|
|
||||||
await loadConnections();
|
await loadConnections();
|
||||||
await loadDirectory(currentConn, currentPath);
|
await loadDirectory(currentConn, currentPath);
|
||||||
|
|
||||||
document.getElementById('conn-form').addEventListener('submit', async (e) => {
|
document.getElementById('conn-form').addEventListener('submit', async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const conn = {
|
const conn = {
|
||||||
@@ -41,12 +49,12 @@ async function init() {
|
|||||||
username: document.getElementById('conn-username').value
|
username: document.getElementById('conn-username').value
|
||||||
};
|
};
|
||||||
const secret = document.getElementById('conn-secret').value;
|
const secret = document.getElementById('conn-secret').value;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await SaveConnection(conn, secret);
|
await SaveConnection(conn, secret);
|
||||||
closeConnModal();
|
closeConnModal();
|
||||||
loadConnections();
|
loadConnections();
|
||||||
} catch(err) {
|
} catch (err) {
|
||||||
alert("Failed to save connection: " + err);
|
alert("Failed to save connection: " + err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -57,7 +65,7 @@ async function loadConnections() {
|
|||||||
list.innerHTML = `<div class="conn-item ${currentConn === 'local' ? 'active' : ''}" onclick="switchConn('local')">
|
list.innerHTML = `<div class="conn-item ${currentConn === 'local' ? 'active' : ''}" onclick="switchConn('local')">
|
||||||
<span class="badge">OS</span> <span style="flex:1">Local Filesystem</span>
|
<span class="badge">OS</span> <span style="flex:1">Local Filesystem</span>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const conns = await GetConnections();
|
const conns = await GetConnections();
|
||||||
connectionsCache = conns || [];
|
connectionsCache = conns || [];
|
||||||
@@ -70,7 +78,7 @@ async function loadConnections() {
|
|||||||
list.appendChild(el);
|
list.appendChild(el);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,9 +103,9 @@ window.editConnection = (id) => {
|
|||||||
document.getElementById('conn-region').value = c.region || '';
|
document.getElementById('conn-region').value = c.region || '';
|
||||||
document.getElementById('conn-pathstyle').checked = c.path_style || false;
|
document.getElementById('conn-pathstyle').checked = c.path_style || false;
|
||||||
document.getElementById('conn-username').value = c.username || '';
|
document.getElementById('conn-username').value = c.username || '';
|
||||||
document.getElementById('conn-secret').value = '';
|
document.getElementById('conn-secret').value = '';
|
||||||
document.getElementById('conn-delete-btn').style.display = 'block';
|
document.getElementById('conn-delete-btn').style.display = 'block';
|
||||||
|
|
||||||
updateProtocolFields();
|
updateProtocolFields();
|
||||||
document.getElementById('conn-modal').style.display = 'flex';
|
document.getElementById('conn-modal').style.display = 'flex';
|
||||||
};
|
};
|
||||||
@@ -117,10 +125,10 @@ window.closeConnModal = () => {
|
|||||||
|
|
||||||
window.updateProtocolFields = () => {
|
window.updateProtocolFields = () => {
|
||||||
const protocol = document.getElementById('conn-protocol').value;
|
const protocol = document.getElementById('conn-protocol').value;
|
||||||
|
|
||||||
const showBucket = protocol === 's3' || protocol === 'smb';
|
const showBucket = protocol === 's3' || protocol === 'smb';
|
||||||
document.getElementById('bucket-fields').style.display = showBucket ? 'block' : 'none';
|
document.getElementById('bucket-fields').style.display = showBucket ? 'block' : 'none';
|
||||||
|
|
||||||
// Only show S3 specific fields when S3 is selected
|
// Only show S3 specific fields when S3 is selected
|
||||||
const showS3Specific = protocol === 's3';
|
const showS3Specific = protocol === 's3';
|
||||||
document.getElementById('region-group').style.display = showS3Specific ? 'flex' : 'none';
|
document.getElementById('region-group').style.display = showS3Specific ? 'flex' : 'none';
|
||||||
@@ -128,17 +136,17 @@ window.updateProtocolFields = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
window.deleteConnection = async () => {
|
window.deleteConnection = async () => {
|
||||||
if(!confirm("Are you sure you want to delete this connection?")) return;
|
if (!confirm("Are you sure you want to delete this connection?")) return;
|
||||||
const id = document.getElementById('conn-id').value;
|
const id = document.getElementById('conn-id').value;
|
||||||
try {
|
try {
|
||||||
await DeleteConnection(id);
|
await DeleteConnection(id);
|
||||||
closeConnModal();
|
closeConnModal();
|
||||||
if(currentConn === id) {
|
if (currentConn === id) {
|
||||||
switchConn('local');
|
switchConn('local');
|
||||||
} else {
|
} else {
|
||||||
loadConnections();
|
loadConnections();
|
||||||
}
|
}
|
||||||
} catch(err) {
|
} catch (err) {
|
||||||
alert("Failed to delete connection: " + err);
|
alert("Failed to delete connection: " + err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -147,13 +155,13 @@ async function loadDirectory(connId, path) {
|
|||||||
const tbody = document.getElementById('file-list');
|
const tbody = document.getElementById('file-list');
|
||||||
tbody.innerHTML = '<tr><td colspan="4">Loading...</td></tr>';
|
tbody.innerHTML = '<tr><td colspan="4">Loading...</td></tr>';
|
||||||
document.getElementById('breadcrumb').innerText = path || '/';
|
document.getElementById('breadcrumb').innerText = path || '/';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const files = await ListDir(connId, path);
|
const files = await ListDir(connId, path);
|
||||||
tbody.innerHTML = '';
|
tbody.innerHTML = '';
|
||||||
selectedItems = [];
|
selectedItems = [];
|
||||||
lastSelectedPath = null;
|
lastSelectedPath = null;
|
||||||
|
|
||||||
let displayFiles = files || [];
|
let displayFiles = files || [];
|
||||||
if (!showHiddenFiles) {
|
if (!showHiddenFiles) {
|
||||||
displayFiles = displayFiles.filter(f => !f.name.startsWith('.'));
|
displayFiles = displayFiles.filter(f => !f.name.startsWith('.'));
|
||||||
@@ -163,12 +171,12 @@ async function loadDirectory(connId, path) {
|
|||||||
tbody.innerHTML = '<tr><td colspan="4">Empty directory</td></tr>';
|
tbody.innerHTML = '<tr><td colspan="4">Empty directory</td></tr>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
displayFiles.sort((a, b) => {
|
displayFiles.sort((a, b) => {
|
||||||
if (a.is_dir !== b.is_dir) return a.is_dir ? -1 : 1;
|
if (a.is_dir !== b.is_dir) return a.is_dir ? -1 : 1;
|
||||||
|
|
||||||
let cmp = 0;
|
let cmp = 0;
|
||||||
switch(sortField) {
|
switch (sortField) {
|
||||||
case 'name':
|
case 'name':
|
||||||
cmp = a.name.localeCompare(b.name);
|
cmp = a.name.localeCompare(b.name);
|
||||||
break;
|
break;
|
||||||
@@ -203,7 +211,7 @@ async function loadDirectory(connId, path) {
|
|||||||
tr.onclick = (e) => {
|
tr.onclick = (e) => {
|
||||||
const path = f.path;
|
const path = f.path;
|
||||||
const isSelected = selectedItems.some(i => i.path === path);
|
const isSelected = selectedItems.some(i => i.path === path);
|
||||||
|
|
||||||
if (e.ctrlKey || e.metaKey) {
|
if (e.ctrlKey || e.metaKey) {
|
||||||
if (isSelected) {
|
if (isSelected) {
|
||||||
selectedItems = selectedItems.filter(i => i.path !== path);
|
selectedItems = selectedItems.filter(i => i.path !== path);
|
||||||
@@ -219,13 +227,13 @@ async function loadDirectory(connId, path) {
|
|||||||
const currIdx = allRows.findIndex(r => r.dataset.path === path);
|
const currIdx = allRows.findIndex(r => r.dataset.path === path);
|
||||||
const startIdx = Math.min(lastIdx, currIdx);
|
const startIdx = Math.min(lastIdx, currIdx);
|
||||||
const endIdx = Math.max(lastIdx, currIdx);
|
const endIdx = Math.max(lastIdx, currIdx);
|
||||||
|
|
||||||
selectedItems = [];
|
selectedItems = [];
|
||||||
allRows.forEach(r => r.classList.remove('selected'));
|
allRows.forEach(r => r.classList.remove('selected'));
|
||||||
|
|
||||||
for(let i=startIdx; i<=endIdx; i++) {
|
for (let i = startIdx; i <= endIdx; i++) {
|
||||||
const row = allRows[i];
|
const row = allRows[i];
|
||||||
if(row.dataset.path) {
|
if (row.dataset.path) {
|
||||||
row.classList.add('selected');
|
row.classList.add('selected');
|
||||||
selectedItems.push({
|
selectedItems.push({
|
||||||
path: row.dataset.path,
|
path: row.dataset.path,
|
||||||
@@ -251,7 +259,7 @@ async function loadDirectory(connId, path) {
|
|||||||
}
|
}
|
||||||
tbody.appendChild(tr);
|
tbody.appendChild(tr);
|
||||||
});
|
});
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
tbody.innerHTML = `<tr><td colspan="4" style="color: var(--error)">Error: ${e}</td></tr>`;
|
tbody.innerHTML = `<tr><td colspan="4" style="color: var(--error)">Error: ${e}</td></tr>`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,7 +287,7 @@ function formatDate(dateString) {
|
|||||||
if (!dateString) return '-';
|
if (!dateString) return '-';
|
||||||
const d = new Date(dateString);
|
const d = new Date(dateString);
|
||||||
if (isNaN(d.getTime())) return dateString;
|
if (isNaN(d.getTime())) return dateString;
|
||||||
return `${String(d.getDate()).padStart(2, '0')}/${String(d.getMonth()+1).padStart(2, '0')}/${d.getFullYear()} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
return `${String(d.getDate()).padStart(2, '0')}/${String(d.getMonth() + 1).padStart(2, '0')}/${d.getFullYear()} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.setSort = (field) => {
|
window.setSort = (field) => {
|
||||||
@@ -300,7 +308,7 @@ window.clearTransfers = async () => {
|
|||||||
try {
|
try {
|
||||||
await ClearTransfers();
|
await ClearTransfers();
|
||||||
pollTransfers();
|
pollTransfers();
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -311,7 +319,7 @@ async function pollTransfers() {
|
|||||||
const list = document.getElementById('transfer-list');
|
const list = document.getElementById('transfer-list');
|
||||||
const btn = document.getElementById('transfers-btn');
|
const btn = document.getElementById('transfers-btn');
|
||||||
btn.innerText = `Transfers (${transfers ? transfers.length : 0})`;
|
btn.innerText = `Transfers (${transfers ? transfers.length : 0})`;
|
||||||
|
|
||||||
if (!transfers || transfers.length === 0) {
|
if (!transfers || transfers.length === 0) {
|
||||||
list.innerHTML = '<div style="color: var(--text-secondary);">No active transfers</div>';
|
list.innerHTML = '<div style="color: var(--text-secondary);">No active transfers</div>';
|
||||||
return;
|
return;
|
||||||
@@ -323,7 +331,7 @@ async function pollTransfers() {
|
|||||||
const speed = t.status === 'active' ? `${t.speed_mbps.toFixed(2)} MB/s` : t.status;
|
const speed = t.status === 'active' ? `${t.speed_mbps.toFixed(2)} MB/s` : t.status;
|
||||||
const eta = t.status === 'active' ? `${t.eta_seconds}s remaining` : '';
|
const eta = t.status === 'active' ? `${t.eta_seconds}s remaining` : '';
|
||||||
const color = t.status === 'failed' ? 'var(--error)' : (t.status === 'complete' ? 'var(--success)' : 'var(--accent)');
|
const color = t.status === 'failed' ? 'var(--error)' : (t.status === 'complete' ? 'var(--success)' : 'var(--accent)');
|
||||||
|
|
||||||
html += `
|
html += `
|
||||||
<div class="transfer-item">
|
<div class="transfer-item">
|
||||||
<div style="width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85rem;" title="${t.filename}">${t.filename}</div>
|
<div style="width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85rem;" title="${t.filename}">${t.filename}</div>
|
||||||
@@ -338,7 +346,7 @@ async function pollTransfers() {
|
|||||||
</div>`;
|
</div>`;
|
||||||
});
|
});
|
||||||
list.innerHTML = html;
|
list.innerHTML = html;
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -359,7 +367,7 @@ document.addEventListener('contextmenu', (e) => {
|
|||||||
|
|
||||||
if (row && row.dataset.path && !row.closest('#transfer-dest-list')) {
|
if (row && row.dataset.path && !row.closest('#transfer-dest-list')) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
if (!selectedItems.some(i => i.path === row.dataset.path)) {
|
if (!selectedItems.some(i => i.path === row.dataset.path)) {
|
||||||
selectedItems = [{
|
selectedItems = [{
|
||||||
path: row.dataset.path,
|
path: row.dataset.path,
|
||||||
@@ -384,7 +392,7 @@ document.addEventListener('contextmenu', (e) => {
|
|||||||
menu.style.top = `${e.pageY}px`;
|
menu.style.top = `${e.pageY}px`;
|
||||||
} else if (isBrowserPane && !e.target.closest('#transfer-dest-list')) {
|
} else if (isBrowserPane && !e.target.closest('#transfer-dest-list')) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
document.getElementById('ctx-rename').style.display = 'none';
|
document.getElementById('ctx-rename').style.display = 'none';
|
||||||
document.getElementById('ctx-transfer').style.display = 'none';
|
document.getElementById('ctx-transfer').style.display = 'none';
|
||||||
document.getElementById('ctx-download').style.display = 'none';
|
document.getElementById('ctx-download').style.display = 'none';
|
||||||
@@ -421,7 +429,7 @@ window.handleContextMenu = async (action) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (selectedItems.length === 0) return;
|
if (selectedItems.length === 0) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (action === 'delete') {
|
if (action === 'delete') {
|
||||||
if (confirm(`Are you sure you want to delete ${selectedItems.length} items?`)) {
|
if (confirm(`Are you sure you want to delete ${selectedItems.length} items?`)) {
|
||||||
@@ -441,7 +449,7 @@ window.handleContextMenu = async (action) => {
|
|||||||
const pathParts = item.path.split('/');
|
const pathParts = item.path.split('/');
|
||||||
pathParts[pathParts.length - 1] = newName;
|
pathParts[pathParts.length - 1] = newName;
|
||||||
const newPath = pathParts.join('/');
|
const newPath = pathParts.join('/');
|
||||||
|
|
||||||
await Rename(currentConn, item.path, newPath);
|
await Rename(currentConn, item.path, newPath);
|
||||||
refreshCurrentDir();
|
refreshCurrentDir();
|
||||||
}
|
}
|
||||||
@@ -494,11 +502,11 @@ window.loadTransferDestDirectory = async (connId, path) => {
|
|||||||
const tbody = document.getElementById('transfer-dest-list');
|
const tbody = document.getElementById('transfer-dest-list');
|
||||||
tbody.innerHTML = '<tr><td colspan="4">Loading...</td></tr>';
|
tbody.innerHTML = '<tr><td colspan="4">Loading...</td></tr>';
|
||||||
document.getElementById('transfer-dest-breadcrumb').innerText = path || '/';
|
document.getElementById('transfer-dest-breadcrumb').innerText = path || '/';
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const files = await ListDir(connId, path);
|
const files = await ListDir(connId, path);
|
||||||
tbody.innerHTML = '';
|
tbody.innerHTML = '';
|
||||||
|
|
||||||
if (path && path !== '/') {
|
if (path && path !== '/') {
|
||||||
const tr = document.createElement('tr');
|
const tr = document.createElement('tr');
|
||||||
tr.innerHTML = `<td>📁 ..</td>`;
|
tr.innerHTML = `<td>📁 ..</td>`;
|
||||||
@@ -515,7 +523,7 @@ window.loadTransferDestDirectory = async (connId, path) => {
|
|||||||
tbody.innerHTML += '<tr><td>Empty directory</td></tr>';
|
tbody.innerHTML += '<tr><td>Empty directory</td></tr>';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
files.forEach(f => {
|
files.forEach(f => {
|
||||||
const tr = document.createElement('tr');
|
const tr = document.createElement('tr');
|
||||||
tr.style.cursor = 'pointer';
|
tr.style.cursor = 'pointer';
|
||||||
@@ -527,7 +535,7 @@ window.loadTransferDestDirectory = async (connId, path) => {
|
|||||||
}
|
}
|
||||||
tbody.appendChild(tr);
|
tbody.appendChild(tr);
|
||||||
});
|
});
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
tbody.innerHTML = `<tr><td style="color: var(--error)">Error: ${e}</td></tr>`;
|
tbody.innerHTML = `<tr><td style="color: var(--error)">Error: ${e}</td></tr>`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -540,7 +548,7 @@ window.executeTransfer = async () => {
|
|||||||
showTransfers();
|
showTransfers();
|
||||||
selectedItems = [];
|
selectedItems = [];
|
||||||
Array.from(document.querySelectorAll('#file-list tr')).forEach(r => r.classList.remove('selected'));
|
Array.from(document.querySelectorAll('#file-list tr')).forEach(r => r.classList.remove('selected'));
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
alert("Transfer failed: " + e);
|
alert("Transfer failed: " + e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Vendored
+2
@@ -15,6 +15,8 @@ export function GetConnections():Promise<Array<config.ConnectionConfig>>;
|
|||||||
|
|
||||||
export function GetTransfers():Promise<Array<transfer.Transfer>>;
|
export function GetTransfers():Promise<Array<transfer.Transfer>>;
|
||||||
|
|
||||||
|
export function GetVersion():Promise<string>;
|
||||||
|
|
||||||
export function ListDir(arg1:string,arg2:string):Promise<Array<explorer.FileEntry>>;
|
export function ListDir(arg1:string,arg2:string):Promise<Array<explorer.FileEntry>>;
|
||||||
|
|
||||||
export function MkDir(arg1:string,arg2:string):Promise<void>;
|
export function MkDir(arg1:string,arg2:string):Promise<void>;
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ export function GetTransfers() {
|
|||||||
return window['go']['main']['App']['GetTransfers']();
|
return window['go']['main']['App']['GetTransfers']();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function GetVersion() {
|
||||||
|
return window['go']['main']['App']['GetVersion']();
|
||||||
|
}
|
||||||
|
|
||||||
export function ListDir(arg1, arg2) {
|
export function ListDir(arg1, arg2) {
|
||||||
return window['go']['main']['App']['ListDir'](arg1, arg2);
|
return window['go']['main']['App']['ListDir'](arg1, arg2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ var assets embed.FS
|
|||||||
//go:embed build/appicon.png
|
//go:embed build/appicon.png
|
||||||
var icon []byte
|
var icon []byte
|
||||||
|
|
||||||
|
var Version string = "dev"
|
||||||
|
|
||||||
func installLinux() {
|
func installLinux() {
|
||||||
if runtime.GOOS != "linux" {
|
if runtime.GOOS != "linux" {
|
||||||
return
|
return
|
||||||
|
|||||||
+2
-1
@@ -11,6 +11,7 @@
|
|||||||
},
|
},
|
||||||
"info": {
|
"info": {
|
||||||
"companyName": "JDB-NET Limited",
|
"companyName": "JDB-NET Limited",
|
||||||
"productName": "GoExplore"
|
"productName": "GoExplore",
|
||||||
|
"productVersion": "0.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user