mirror of
https://ghfast.top/https://github.com/discourse/docker_manager.git
synced 2026-05-25 00:24:02 +08:00
Update imports in `docker_manager` plugin to reflect new file structure, moving files to nested directories for better organization. These changes help improve code clarity and maintainability across controllers, models, routes, and templates. No functional behavior changes introduced.
35 lines
801 B
JavaScript
35 lines
801 B
JavaScript
import Route from "@ember/routing/route";
|
|
import { cancel } from "@ember/runloop";
|
|
import { bind } from "discourse/lib/decorators";
|
|
import discourseLater from "discourse/lib/later";
|
|
import ProcessList from "../../models/process-list";
|
|
|
|
const REFRESH_INTERVAL = 5000;
|
|
|
|
export default class UpgradeProcesses extends Route {
|
|
processes = null;
|
|
refreshTimer = null;
|
|
autoRefresh = false;
|
|
|
|
model() {
|
|
this.processes = new ProcessList();
|
|
this.autoRefresh = true;
|
|
this.refresh();
|
|
|
|
return this.processes;
|
|
}
|
|
|
|
deactivate() {
|
|
this.autoRefresh = false;
|
|
}
|
|
|
|
@bind
|
|
async refresh() {
|
|
if (this.autoRefresh) {
|
|
await this.processes.refresh();
|
|
this.refreshTimer = discourseLater(this.refresh, REFRESH_INTERVAL);
|
|
} else {
|
|
cancel(this.refreshTimer);
|
|
}
|
|
}
|
|
}
|