zhongrj
2025-11-25 b89962006164a462404b79a738bee8cbb6d7fe7e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import re
import json
 
from app.plugins import PluginBase, Menu, MountPoint, logger
 
from .globals import PROJECT_NAME
from .api_views import ShareTaskView, RefreshIonTaskView, ClearErrorsTaskView
from .app_views import HomeView, LoadButtonView
 
 
class Plugin(PluginBase):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.name = PROJECT_NAME
 
    def main_menu(self):
        return [Menu("Cesium Ion", self.public_url(""), "fa-cesium fa fa-fw")]
 
    def include_js_files(self):
        return ["load_buttons.js"]
 
    def include_css_files(self):
        return ["font.css", "build/TaskView.css"]
 
    def build_jsx_components(self):
        return ["TaskView.jsx"]
 
    def api_mount_points(self):
        return [
            MountPoint("task/(?P<pk>[^/.]+)/share", ShareTaskView.as_view()),
            MountPoint("task/(?P<pk>[^/.]+)/refresh", RefreshIonTaskView.as_view()),
            MountPoint("task/(?P<pk>[^/.]+)/clear", ClearErrorsTaskView.as_view()),
        ]
 
    def app_mount_points(self):
        return [
            MountPoint("$", HomeView(self)),
            MountPoint("load_buttons.js$", LoadButtonView(self)),
        ]