dizquetv/web/directives/cache-settings.js
Rafael Vieira Santos c97ff8f24e
File cache system (#242)
* Create a File Cache Service and Channels M3U Cache

* Create a Cache Image Service for external images

* Singleton, db configurations and repairs
2021-01-24 11:56:36 -04:00

23 lines
719 B
JavaScript

module.exports = function (dizquetv) {
return {
restrict: 'E',
templateUrl: 'templates/cache-settings.html',
replace: true,
scope: {
},
link: function (scope, element, attrs) {
dizquetv.getAllSettings().then((settings) => {
console.warn(settings);
scope.settings = settings;
scope.$apply();
});
scope.updateSetting = (setting) => {
const {key, value} = setting;
dizquetv.putSetting(key, !value).then((response) => {
scope.settings = response;
scope.$apply();
});
};
}
}
}