added messages to config editor
This commit is contained in:
parent
db52ff95ae
commit
1ca8e46461
1 changed files with 18 additions and 6 deletions
|
@ -63,22 +63,34 @@ class ConfigEditor extends Popup {
|
|||
this.addContent(span);
|
||||
|
||||
if(data.excludes) {
|
||||
const setEnabled=() =>
|
||||
const setEnabled=() => {
|
||||
input.disabled=
|
||||
data.excludes
|
||||
.some(key => config.getB(key))
|
||||
.some(key => config.getB(key));
|
||||
input.title=input.disabled?`Disable ${data.excludes.join(',')} to enable`:'';
|
||||
};
|
||||
|
||||
setEnabled();
|
||||
data.excludes.forEach(key => {
|
||||
let c=config.watchB(key, setEnabled);
|
||||
this.watchers.push([key, c]);
|
||||
});
|
||||
}
|
||||
if(data.parent) {
|
||||
} else if(data.parent) {
|
||||
const setEnabled=() => {
|
||||
input.disabled=!config.getB(data.parent);
|
||||
let c=config.watchB(data.parent, (k, v) => input.disabled=!v);
|
||||
input.title=input.disabled?`Enable ${data.parent} to enable`:'';
|
||||
};
|
||||
|
||||
setEnabled();
|
||||
let c=config.watchB(data.parent, setEnabled);
|
||||
this.watchers.push([data.parent, c]);
|
||||
}
|
||||
if(data.needsBackend) {
|
||||
if(window.serverless) {
|
||||
input.disabled=true;
|
||||
input.title="Needs backend";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue