mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
♻️ Change Docker instance to singleton
This commit is contained in:
@@ -4,16 +4,13 @@ export default class DockerSingleton extends Docker {
|
|||||||
private static dockerInstance: DockerSingleton;
|
private static dockerInstance: DockerSingleton;
|
||||||
|
|
||||||
private constructor() {
|
private constructor() {
|
||||||
super({
|
super();
|
||||||
host: '192.168.1.56',
|
|
||||||
port: 2376,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getInstance(): DockerSingleton {
|
public static getInstance(): DockerSingleton {
|
||||||
if (!this.dockerInstance) {
|
if (!DockerSingleton.dockerInstance) {
|
||||||
this.dockerInstance = new this();
|
DockerSingleton.dockerInstance = new DockerSingleton();
|
||||||
}
|
}
|
||||||
return this.dockerInstance;
|
return DockerSingleton.dockerInstance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user