mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-07-08 18:12:54 +08:00
显示 changelog
This commit is contained in:
parent
432c25b1e2
commit
ea53de2665
@ -454,7 +454,10 @@ window.showUb = {
|
|||||||
},
|
},
|
||||||
docs: function(path = '') {
|
docs: function(path = '') {
|
||||||
runUbrowser(docsRepoUrl + '/pt589p' + path)
|
runUbrowser(docsRepoUrl + '/pt589p' + path)
|
||||||
}
|
},
|
||||||
|
changelog: function(path = '') {
|
||||||
|
runUbrowser(docsRepoUrl + '/ucnd2o' + path)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
window.clipboardReadText = () => electron.clipboard.readText()
|
window.clipboardReadText = () => electron.clipboard.readText()
|
||||||
|
53
src/App.vue
53
src/App.vue
@ -37,13 +37,8 @@ export default defineComponent({
|
|||||||
init() {
|
init() {
|
||||||
window.utools = window.getuToolsLite();
|
window.utools = window.getuToolsLite();
|
||||||
if (!this.checkVer()) return;
|
if (!this.checkVer()) return;
|
||||||
|
this.showChangeLog();
|
||||||
this.startUp();
|
this.startUp();
|
||||||
this.utools.whole.onPluginEnter((enter) => {
|
|
||||||
this.enterPlugin(enter);
|
|
||||||
});
|
|
||||||
this.utools.whole.onPluginOut(() => {
|
|
||||||
this.outPlugin();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
checkVer() {
|
checkVer() {
|
||||||
const requiredVersion = "2.6.1";
|
const requiredVersion = "2.6.1";
|
||||||
@ -59,9 +54,18 @@ export default defineComponent({
|
|||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
startUp() {
|
startUp() {
|
||||||
// 处理旧版本数据
|
this.loadProfile();
|
||||||
this.v2DataHandler();
|
// 默认主题色
|
||||||
// 读取用户配置
|
this.setCssVar("primary", this.profile.primaryColor);
|
||||||
|
this.startUpOnce();
|
||||||
|
this.utools.whole.onPluginEnter((enter) => {
|
||||||
|
this.enterPlugin(enter);
|
||||||
|
});
|
||||||
|
this.utools.whole.onPluginOut(() => {
|
||||||
|
this.outPlugin();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
loadProfile() {
|
||||||
let commonProfile = this.utools.getDB("cfg_profile");
|
let commonProfile = this.utools.getDB("cfg_profile");
|
||||||
let nativeProfile = this.utools.getDB(
|
let nativeProfile = this.utools.getDB(
|
||||||
"cfg_" + utools.getNativeId() + "_profile"
|
"cfg_" + utools.getNativeId() + "_profile"
|
||||||
@ -71,9 +75,13 @@ export default defineComponent({
|
|||||||
_.cloneDeep(this.nativeProfile),
|
_.cloneDeep(this.nativeProfile),
|
||||||
nativeProfile
|
nativeProfile
|
||||||
);
|
);
|
||||||
// 默认主题色
|
},
|
||||||
this.setCssVar("primary", this.profile.primaryColor);
|
saveProfile() {
|
||||||
this.startUpOnce();
|
this.utools.putDB(_.cloneDeep(this.profile), "cfg_profile");
|
||||||
|
this.utools.putDB(
|
||||||
|
_.cloneDeep(this.nativeProfile),
|
||||||
|
"cfg_" + utools.getNativeId() + "_profile"
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 插件全生命周期只运行一次,主要针对多开的情况
|
// 插件全生命周期只运行一次,主要针对多开的情况
|
||||||
startUpOnce() {
|
startUpOnce() {
|
||||||
@ -99,11 +107,7 @@ export default defineComponent({
|
|||||||
outPlugin() {
|
outPlugin() {
|
||||||
this.$refs.view.$refs?.commandEditor?.saveCodeHistory();
|
this.$refs.view.$refs?.commandEditor?.saveCodeHistory();
|
||||||
this.$router.push("/");
|
this.$router.push("/");
|
||||||
this.utools.putDB(_.cloneDeep(this.profile), "cfg_profile");
|
this.saveProfile();
|
||||||
this.utools.putDB(
|
|
||||||
_.cloneDeep(this.nativeProfile),
|
|
||||||
"cfg_" + utools.getNativeId() + "_profile"
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
runCronTask(featureCode, cronExp) {
|
runCronTask(featureCode, cronExp) {
|
||||||
this.cronJobs[featureCode] = Cron(cronExp, () => {
|
this.cronJobs[featureCode] = Cron(cronExp, () => {
|
||||||
@ -149,13 +153,14 @@ export default defineComponent({
|
|||||||
second: dateString.getSeconds(),
|
second: dateString.getSeconds(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
v2DataHandler() {
|
showChangeLog() {
|
||||||
let v2DataHandled = this.utools.getStorage("st_v2DataHandled");
|
if (this.utools.getStorage("st_v300Inited")) return;
|
||||||
if (v2DataHandled) return;
|
window.showUb.changelog();
|
||||||
// 处理统计数据
|
// 处理统计数据
|
||||||
let statisticsData = this.utools.getDB("cfg_statisticsData");
|
let statisticsData = this.utools.getDB("cfg_statisticsData");
|
||||||
_.forIn(statisticsData, (data, year) => {
|
_.forIn(statisticsData, (data, year) => {
|
||||||
statisticsData[year] = data.map((x) => {
|
statisticsData[year] = data.map((x) => {
|
||||||
|
if (!x.command) return x;
|
||||||
let code =
|
let code =
|
||||||
x.command.code === "options" ? "configuration" : x.command.code;
|
x.command.code === "options" ? "configuration" : x.command.code;
|
||||||
return {
|
return {
|
||||||
@ -165,9 +170,11 @@ export default defineComponent({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.utools.putDB(statisticsData, "cfg_statisticsData");
|
this.utools.putDB(statisticsData, "cfg_statisticsData");
|
||||||
// 处理历史代码
|
// 删掉数据库内的默认命令
|
||||||
// ...
|
this.utools
|
||||||
this.utools.setStorage("st_v2DataHandled", true);
|
.getDocs("qc_default")
|
||||||
|
.forEach((x) => this.utools.delDB(x._id));
|
||||||
|
this.utools.setStorage("st_v300Inited", true);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
@ -289,10 +289,7 @@ export default {
|
|||||||
// 所有命令对应的标签
|
// 所有命令对应的标签
|
||||||
allQuickCommandTags() {
|
allQuickCommandTags() {
|
||||||
let allTags = _.union(
|
let allTags = _.union(
|
||||||
..._.concat(
|
...Object.values(this.allQuickCommands).map((x) => x.tags)
|
||||||
"默认",
|
|
||||||
Object.values(this.allQuickCommands).map((x) => x.tags)
|
|
||||||
)
|
|
||||||
).concat(["未分类", "来自分享"]);
|
).concat(["未分类", "来自分享"]);
|
||||||
if (this.commandSearchKeyword?.length > 1) allTags.push("搜索结果");
|
if (this.commandSearchKeyword?.length > 1) allTags.push("搜索结果");
|
||||||
return allTags;
|
return allTags;
|
||||||
@ -326,7 +323,10 @@ export default {
|
|||||||
setTimeout(this.getAllQuickCommands, 0);
|
setTimeout(this.getAllQuickCommands, 0);
|
||||||
},
|
},
|
||||||
importDefaultCommands() {
|
importDefaultCommands() {
|
||||||
Object.assign(this.allQuickCommands, defaultCommands);
|
this.allQuickCommands = Object.assign(
|
||||||
|
_.cloneDeep(defaultCommands),
|
||||||
|
this.allQuickCommands
|
||||||
|
);
|
||||||
},
|
},
|
||||||
// 获取所有已启用的命令的 features 以及面板名称
|
// 获取所有已启用的命令的 features 以及面板名称
|
||||||
getActivatedFeatures() {
|
getActivatedFeatures() {
|
||||||
@ -505,13 +505,11 @@ export default {
|
|||||||
.getDocs("qc_")
|
.getDocs("qc_")
|
||||||
.map((x) => x._id)
|
.map((x) => x._id)
|
||||||
.forEach((y) => this.$root.utools.delDB(y));
|
.forEach((y) => this.$root.utools.delDB(y));
|
||||||
this.importDefaultCommands();
|
|
||||||
this.resetQuickFeatures();
|
|
||||||
this.clearAllFeatures();
|
this.clearAllFeatures();
|
||||||
Object.keys(this.allQuickCommands).forEach((featureCode) => {
|
Object.keys(this.allQuickCommands).forEach((featureCode) => {
|
||||||
if (!featureCode.includes("default_"))
|
delete this.allQuickCommands[featureCode];
|
||||||
delete this.allQuickCommands[featureCode];
|
|
||||||
});
|
});
|
||||||
|
this.importDefaultCommands();
|
||||||
this.currentTag = "默认";
|
this.currentTag = "默认";
|
||||||
quickcommand.showMessageBox(
|
quickcommand.showMessageBox(
|
||||||
"清空完毕,为防止误操作,已将所有命令复制到剪贴板,可通过导入命令恢复"
|
"清空完毕,为防止误操作,已将所有命令复制到剪贴板,可通过导入命令恢复"
|
||||||
@ -521,15 +519,10 @@ export default {
|
|||||||
// 删除所有 features
|
// 删除所有 features
|
||||||
clearAllFeatures() {
|
clearAllFeatures() {
|
||||||
for (var feature of utools.getFeatures()) {
|
for (var feature of utools.getFeatures()) {
|
||||||
|
if (feature.code.slice(0, 8) === "feature_") continue;
|
||||||
this.$root.utools.whole.removeFeature(feature.code);
|
this.$root.utools.whole.removeFeature(feature.code);
|
||||||
}
|
}
|
||||||
},
|
this.activatedQuickCommandFeatureCodes = [];
|
||||||
resetQuickFeatures() {
|
|
||||||
Object.assign(
|
|
||||||
this.$root.profile.quickFeatures,
|
|
||||||
_.cloneDeep(defaultProfile.quickFeatures)
|
|
||||||
);
|
|
||||||
window.quickcommandHttpServer().stop();
|
|
||||||
},
|
},
|
||||||
// 搜索
|
// 搜索
|
||||||
updateSearch() {
|
updateSearch() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user