mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-09 03:27:39 +08:00
feat: ui to manaul trigger cron jobs
This commit is contained in:
@@ -46,6 +46,8 @@ class APIs {
|
||||
|
||||
static final tmdbImgBaseUrl = "$_baseUrl/api/v1/posters";
|
||||
|
||||
static final cronJobUrl = "$_baseUrl/api/v1/setting/cron/trigger";
|
||||
|
||||
static const tmdbApiKey = "tmdb_api_key";
|
||||
static const downloadDirKey = "download_dir";
|
||||
|
||||
@@ -100,4 +102,14 @@ class APIs {
|
||||
context.go('/login');
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> triggerCronJob(String name) async {
|
||||
var resp = await getDio().post(APIs.cronJobUrl, data: {"job_name": name});
|
||||
|
||||
var sp = ServerResponse.fromJson(resp.data);
|
||||
|
||||
if (sp.code != 0) {
|
||||
throw sp.message;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user