Skip to content

Commit

Permalink
fix: 面板脚本日志顺序错乱和非运行状态日志显示等待
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Oct 22, 2021
1 parent bcb3960 commit 2c1fd8a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/apps/script/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class ScriptController {
public getScriptLog(scriptId: number, page?: Page): Promise<Log[]> {
return this.logModel.list(query => {
return query.where({ scriptId: scriptId, origin: "GM_log" });
});
}, page);
}

public clearLog(scriptId: number) {
Expand Down
12 changes: 6 additions & 6 deletions src/views/pages/Option/tabs/ScriptList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,11 @@
{{ log.level }} {{ formatTime(log.createtime) }} -
<div v-html="log.message" style="display: inline"></div>
</div>
<div class="d-flex justify-center" style="padding: 4px">
<div
v-if="logScript.runStatus == 'running'"
class="d-flex justify-center"
style="padding: 4px"
>
<div>
<v-progress-circular
indeterminate
Expand Down Expand Up @@ -771,11 +775,7 @@ export default class ScriptList extends Vue {
this.logScript = item;
this.logs = [];
this.showlog = true;
this.logs = await this.scriptController.getScriptLog(
item.id,
new Page(1, 20, "desc")
);
this.logs = this.logs.reverse();
this.logs = await this.scriptController.getScriptLog(item.id);
setTimeout(() => {
let el = document.querySelector("#log-show");
if (el) {
Expand Down

0 comments on commit 2c1fd8a

Please sign in to comment.