MCPcopy Index your code
hub / github.com/su-kaka/gcli2api / fetchAndDisplayVersion

Function fetchAndDisplayVersion

front/common.js:3091–3114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3089
3090// 获取并显示版本信息(不检查更新)
3091async function fetchAndDisplayVersion() {
3092 try {
3093 const response = await fetch('./version/info');
3094 const data = await response.json();
3095
3096 const versionText = document.getElementById('versionText');
3097
3098 if (data.success) {
3099 // 只显示版本号
3100 versionText.textContent = `v${data.version}`;
3101 versionText.title = `完整版本: ${data.full_hash}\n提交信息: ${data.message}\n提交时间: ${data.date}`;
3102 versionText.style.cursor = 'help';
3103 } else {
3104 versionText.textContent = '未知版本';
3105 versionText.title = data.error || '无法获取版本信息';
3106 }
3107 } catch (error) {
3108 console.error('获取版本信息失败:', error);
3109 const versionText = document.getElementById('versionText');
3110 if (versionText) {
3111 versionText.textContent = '版本信息获取失败';
3112 }
3113 }
3114}
3115
3116// 检查更新
3117async function checkForUpdates() {

Callers 1

common.jsFile · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected