better extension ui
This commit is contained in:
23
app/assets/javascripts/app/frontend/models/app/extension.js
Normal file
23
app/assets/javascripts/app/frontend/models/app/extension.js
Normal file
@@ -0,0 +1,23 @@
|
||||
class Extension extends Item {
|
||||
constructor(json) {
|
||||
_.merge(this, json);
|
||||
|
||||
this.actions = this.actions.map(function(action){
|
||||
return new Action(action);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Action {
|
||||
constructor(json) {
|
||||
_.merge(this, json);
|
||||
|
||||
var comps = this.type.split(":");
|
||||
if(comps.length > 0) {
|
||||
this.repeatable = true;
|
||||
this.repeatType = comps[0]; // 'watch' or 'poll'
|
||||
this.repeatVerb = comps[1]; // http verb
|
||||
this.repeatFrequency = comps[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user