Get plugin list from cdn

face-manager-integrated
Moe 2022-12-11 15:41:59 -08:00
parent f88092dd67
commit 87cd22e7bf
4 changed files with 19 additions and 5 deletions

View File

@ -1015,6 +1015,9 @@
"Control Triggered": "Control Triggered",
"Control Error": "Control Error",
"Timed": "Timed",
"Subdirectory for Module": "Subdirectory for Module",
"Download URL for Module": "Download URL for Module",
"Inside the downloaded package": "Inside the downloaded package",
"On Release": "On Release",
"Moving to Home Preset": "Moving to Home Preset",
"Database row does not exist": "Database row does not exist",

View File

@ -7,6 +7,19 @@ $(document).ready(function(){
var getModules = function(callback) {
$.get(superApiPrefix + $user.sessionKey + '/plugins/list',callback)
}
function getDownloadableModules(callback) {
return new Promise((resolve,reject) => {
const pluginListUrl = `https://cdn.shinobi.video/plugins/list.json`
$.getJSON(pluginListUrl,function(data){
var html = ''
$.each(data,function(n,plugin){
html += `<option value="${plugin.link}${plugin.dir ? `,${plugin.dir}` : ''}">${plugin.name}</option>`
})
quickSelect.html(html)
resolve(data)
})
})
}
var loadedBlocks = {}
var drawModuleBlock = function(module){
var humanName = module.properties.name ? module.properties.name : module.name
@ -355,4 +368,5 @@ $(document).ready(function(){
break;
}
})
getDownloadableModules()
})

View File

@ -3,10 +3,10 @@
<form class="card bg-dark grey mt-1" id="downloadNewPlugin">
<div class="card-body">
<div class="form-group">
<input type="text" placeholder="Download URL for Module" class="form-control" name="downloadUrl" />
<input type="text" placeholder="<%- lang['Download URL for Module'] %> (.zip)" class="form-control" name="downloadUrl" />
</div>
<div class="form-group">
<input type="text" placeholder="Subdirectory for Module (Inside the downloaded package)" class="form-control" name="packageRoot" />
<input type="text" placeholder="<%- lang['Subdirectory for Module'] %> (<%- lang['Inside the downloaded package'] %>)" class="form-control" name="packageRoot" />
</div>
<div><button type="submit" class="btn btn-round btn-block btn-default mb-0"><i class="fa fa-download"></i> <%- lang.Download %></button></div>
</div>

View File

@ -10,9 +10,6 @@
<i class="fa fa-retweet"></i> <%- lang['Update'] %>
</a>
<% } %>
<a href="#" class="btn btn-default" restart="cron">
<i class="fa fa-retweet"></i> <%- lang['Restart CRON'] %>
</a>
<a href="#" class="btn btn-default" restart="logs">
<i class="fa fa-retweet"></i> <%- lang['Flush PM2 Logs'] %>
</a>