将用户配置分为通用和本机

This commit is contained in:
fofolee
2022-05-07 00:53:31 +08:00
parent 91c4e48888
commit f3a2ad4a62
12 changed files with 66 additions and 93 deletions

View File

@@ -320,7 +320,7 @@ export default {
return this.commandInfo.features.code;
},
cronExp() {
return this.$root.profile.crontabs[this.featureCode];
return this.$root.nativeProfile.crontabs[this.featureCode];
},
},
props: {
@@ -363,11 +363,11 @@ export default {
this.$emit("commandChanged", event);
},
addCrontab(cronExp) {
this.$root.profile.crontabs[this.featureCode] = cronExp;
this.$root.nativeProfile.crontabs[this.featureCode] = cronExp;
this.$root.runCronTask(this.featureCode, cronExp);
},
delCrontab() {
delete this.$root.profile.crontabs[this.featureCode];
delete this.$root.nativeProfile.crontabs[this.featureCode];
this.$root.cronJobs[this.featureCode].stop();
},
// 启用/禁用命令

View File

@@ -301,7 +301,7 @@ export default {
init() {
let quickCommandInfo =
this.action.type === "run"
? this.$root.utools.getDB(this.$root.utools.DBPRE.CFG + "codeHistory")
? this.$root.utools.getDB("cfg_codeHistory")
: this.action.data;
quickCommandInfo?.program &&
Object.assign(this.quickcommandInfo, _.cloneDeep(quickCommandInfo));
@@ -360,7 +360,7 @@ export default {
let newQuickcommandInfo = _.cloneDeep(this.quickcommandInfo);
this.$root.utools.putDB(
newQuickcommandInfo,
this.$root.utools.DBPRE.QC + this.quickcommandInfo.features.code
"qc_" + this.quickcommandInfo.features.code
);
this.$emit("editorEvent", {
type: "save",
@@ -380,10 +380,7 @@ export default {
if (this.action.type !== "run") return;
let command = _.cloneDeep(this.quickcommandInfo);
command.cursorPosition = this.$refs.editor.getCursorPosition();
this.$root.utools.putDB(
command,
this.$root.utools.DBPRE.CFG + "codeHistory"
);
this.$root.utools.putDB(command, "cfg_codeHistory");
},
monacoKeyStroke(event) {
switch (event) {

View File

@@ -457,7 +457,7 @@ export default {
this.$root.utools.whole.setFeature(_.cloneDeep(this.features[type]));
if (type === "apiServer" && !this.$root.profile.apiServerEnable) {
window.quickcommandHttpServer().stop();
this.$root.profile.quickFeatures.apiServer.serverStatus = false;
this.$root.nativeProfile.apiServerStatus = false;
}
},
},

View File

@@ -155,7 +155,7 @@ export default {
}
},
showHelp() {
window.showUb.help('#rWU2i')
window.showUb.help("#rWU2i");
},
joinRepo() {
quickcommand
@@ -167,13 +167,10 @@ export default {
});
},
loadYuQueInfo() {
return this.$root.utools.getDB(this.$root.utools.DBPRE.CFG + "extraInfo");
return this.$root.utools.getDB("cfg_extraInfo");
},
saveYuQueInfo() {
this.$root.utools.putDB(
_.cloneDeep(this.yuQueInfo),
this.$root.utools.DBPRE.CFG + "extraInfo"
);
this.$root.utools.putDB(_.cloneDeep(this.yuQueInfo), "cfg_extraInfo");
},
},
};

View File

@@ -170,9 +170,7 @@ export default {
methods: {
getUserInfo() {
Object.assign(this.userInfo, this.$root.utools.whole.getUser());
let statisticsData = this.$root.utools.getDB(
this.$root.utools.DBPRE.CFG + "statisticsData"
);
let statisticsData = this.$root.utools.getDB("cfg_statisticsData");
this.userInfo.exp = Object.values(statisticsData)
.map((x) => x.length)
.reduce((x, y) => x + y);

View File

@@ -51,7 +51,7 @@
flat
color="negative"
icon="stop"
v-if="$root.profile.quickFeatures.apiServer.serverStatus"
v-if="$root.nativeProfile.apiServerStatus"
@click="stopServer"
label="停止服务"
/>
@@ -97,14 +97,14 @@ export default {
"FBI WARNING"
)
.then(() => {
this.$root.profile.quickFeatures.apiServer.serverStatus = true;
this.$root.nativeProfile.apiServerStatus = true;
window.quickcommandHttpServer().run(this.$root.profile.apiServerPort);
quickcommand.showMessageBox("启动服务成功!");
});
},
stopServer() {
window.quickcommandHttpServer().stop();
this.$root.profile.quickFeatures.apiServer.serverStatus = false;
this.$root.nativeProfile.apiServerStatus = false;
quickcommand.showMessageBox("关闭服务成功!");
},
saveCode() {