-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
201 lines (201 loc) · 10.1 KB
/
Copy pathindex.html
File metadata and controls
201 lines (201 loc) · 10.1 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<title data-i18n="title">Scheduler</title>
<link rel="stylesheet" href="styles.css?v=0.2.1">
<link rel="icon" type="image/svg+xml" href="favicon.svg" sizes="64x64">
</head>
<body>
<header class="app-header">
<h1 data-i18n="header">Scheduler</h1>
<div style="margin-left:auto;display:flex;align-items:center;gap:8px">
<button id="settingsToggle" class="theme-btn" title="Settings" aria-label="Settings">⚙</button>
<button id="themeToggle" class="theme-btn" title="Toggle theme">☾</button>
<label class="muted" for="langSelect" data-i18n="lang">Language</label>
<select id="langSelect">
<option value="en" selected>English</option>
<option value="zh">中文</option>
</select>
</div>
</header>
<main class="app-main">
<section class="content">
<div class="card">
<div class="list-header">
<h2 data-i18n="taskList">Task List</h2>
<div class="list-actions">
<button id="runAllBtn" data-i18n="runAll">Run All Once</button>
<button id="openCreateModalBtn" class="primary" data-i18n="newTask">New Task</button>
</div>
</div>
<div class="filter-bar">
<select id="filterCategory">
<option value="" data-i18n-opt="filterAll">All Categories</option>
</select>
<select id="filterTag">
<option value="" data-i18n-opt="filterAllTags">All Tags</option>
</select>
</div>
<table class="tasks-table">
<thead>
<tr>
<th data-i18n="colName">Name</th>
<th data-i18n="colCmd">Command</th>
<th data-i18n="colStatus">Status</th>
<th data-i18n="colNext">Next Run</th>
<th data-i18n="colLast">Last Result</th>
<th data-i18n="colActions">Actions</th>
</tr>
</thead>
<tbody id="taskTableBody"></tbody>
</table>
</div>
</section>
</main>
<div class="modal-overlay" id="createTaskModal">
<div class="modal">
<h3 data-i18n="createTitle">Create Task</h3>
<div class="modal-body">
<div class="form-row">
<label for="templateSelect" data-i18n="template">Start from Template</label>
<select id="templateSelect">
<option value="" data-i18n-opt="noTemplate">-- Blank Task --</option>
</select>
</div>
<div class="form-row">
<label for="taskNameInput" data-i18n="name">Task Name</label>
<input id="taskNameInput" type="text" placeholder="e.g., Daily Backup" data-i18n-ph="phName">
</div>
<div class="form-row">
<label for="commandInput" data-i18n="cmd">Command</label>
<textarea id="commandInput" rows="3" placeholder="e.g., bash /path/to/script.sh" data-i18n-ph="phCmd"></textarea>
</div>
<div class="form-row">
<label for="scheduleTypeSelect" data-i18n="plan">Schedule Type</label>
<select id="scheduleTypeSelect">
<option value="interval" data-i18n-opt="optInterval">Interval (minutes)</option>
<option value="cron" data-i18n-opt="optCron">Cron Expression</option>
</select>
</div>
<div class="form-row" id="rowInterval">
<label for="intervalInput" data-i18n="interval">Interval (minutes)</label>
<input id="intervalInput" type="number" min="1" step="1" placeholder="e.g., 60" data-i18n-ph="phInterval">
</div>
<div class="form-row hidden" id="rowCron">
<label for="cronInput" data-i18n="cron">Cron Expression</label>
<input id="cronInput" type="text" placeholder="e.g., */5 * * * *" data-i18n-ph="phCron">
<div id="cronFeedback" class="cron-feedback"></div>
</div>
<div class="form-row">
<label for="categoryInput" data-i18n="category">Category</label>
<input id="categoryInput" type="text" list="categoryList" placeholder="e.g., backup" data-i18n-ph="phCategory">
<datalist id="categoryList"></datalist>
</div>
<div class="form-row">
<label for="tagsInput" data-i18n="tags">Tags (comma-separated)</label>
<input id="tagsInput" type="text" placeholder="e.g., critical, daily" data-i18n-ph="phTags">
</div>
<div class="form-row">
<label for="priorityInput" data-i18n="priority">Priority (1-10)</label>
<input id="priorityInput" type="number" min="1" max="10" step="1" placeholder="5" data-i18n-ph="phPriority">
</div>
<details class="advanced-toggle">
<summary data-i18n="advancedOptions">Advanced Options</summary>
<div class="form-row">
<label for="timeoutInput" data-i18n="timeout">Timeout (seconds)</label>
<input id="timeoutInput" type="number" min="0" step="1" placeholder="120" data-i18n-ph="phTimeout">
</div>
<div class="form-row">
<label for="retryCountInput" data-i18n="retryCount">Retry Count</label>
<input id="retryCountInput" type="number" min="0" max="10" step="1" placeholder="0" data-i18n-ph="phRetryCount">
</div>
<div class="form-row">
<label for="retryDelayInput" data-i18n="retryDelay">Retry Delay (seconds)</label>
<input id="retryDelayInput" type="number" min="0" step="1" placeholder="10" data-i18n-ph="phRetryDelay">
</div>
<div class="form-row">
<label data-i18n="envVars">Environment Variables</label>
<div id="envContainer"></div>
<button type="button" id="addEnvBtn" data-i18n="addEnv">+ Add Variable</button>
</div>
<div class="form-row">
<label for="maxLogEntriesInput" data-i18n="maxLogEntries">Max Log Entries</label>
<input id="maxLogEntriesInput" type="number" min="1" max="10000" step="1" placeholder="100" data-i18n-ph="phMaxLogs">
</div>
<div class="form-row">
<label data-i18n="dependsOn">Depends On</label>
<select id="dependsOnSelect" multiple size="3"></select>
<div class="checkbox-row">
<label><input type="checkbox" id="allowParallelCheck"> <span data-i18n="allowParallel">Allow parallel execution</span></label>
</div>
</div>
<div class="form-row">
<label data-i18n="webhookLabel">Webhook Notification</label>
<input id="webhookUrlInput" type="url" placeholder="https://example.com/webhook" data-i18n-ph="phWebhookUrl">
<div class="checkbox-row">
<label><input type="checkbox" id="notifyOnSuccess"> <span data-i18n="onSuccess">On Success</span></label>
<label><input type="checkbox" id="notifyOnFailure" checked> <span data-i18n="onFailure">On Failure</span></label>
</div>
</div>
<div class="form-row">
<label data-i18n="emailLabel">Email Notification (SMTP)</label>
<input id="emailToInput" type="email" placeholder="recipient@example.com" data-i18n-ph="phEmailTo">
<div class="smtp-grid">
<input id="smtpHostInput" type="text" placeholder="smtp.gmail.com">
<input id="smtpPortInput" type="number" placeholder="587" min="1" max="65535">
</div>
<div class="smtp-grid">
<input id="smtpUserInput" type="text" placeholder="user@gmail.com">
<input id="smtpPassInput" type="password" placeholder="app password">
</div>
<div class="checkbox-row">
<label><input type="checkbox" id="emailOnSuccess"> <span data-i18n="onSuccess">On Success</span></label>
<label><input type="checkbox" id="emailOnFailure" checked> <span data-i18n="onFailure">On Failure</span></label>
</div>
</div>
</details>
</div>
<div class="modal-actions">
<button id="cancelCreateBtn" data-i18n="cancel">Cancel</button>
<button id="createTaskBtn" class="primary" data-i18n="create">Create</button>
</div>
</div>
</div>
<div class="modal-overlay" id="settingsModal">
<div class="modal">
<h3 data-i18n="settingsTitle">Settings</h3>
<div class="modal-body">
<p class="muted" style="font-size:12px;margin:0 0 12px" data-i18n="settingsDesc">Configure global notification settings. Telegram notifications apply to all tasks.</p>
<div class="form-row">
<label for="tgBotToken" data-i18n="tgBotToken">Telegram Bot Token</label>
<div class="input-masked-wrap">
<input id="tgBotToken" type="password" placeholder="123456:ABC-DEF..." autocomplete="off">
<button type="button" id="tgTokenReveal" class="reveal-btn" title="Show/hide">👁</button>
</div>
</div>
<div class="form-row">
<label for="tgChatId" data-i18n="tgChatId">Telegram Chat ID</label>
<input id="tgChatId" type="text" placeholder="-1001234567890">
</div>
<div class="form-row">
<div class="checkbox-row">
<label><input type="checkbox" id="tgNotifySuccess"> <span data-i18n="onSuccess">On Success</span></label>
<label><input type="checkbox" id="tgNotifyFailure" checked> <span data-i18n="onFailure">On Failure</span></label>
</div>
</div>
<div id="tgTestResult"></div>
</div>
<div class="modal-actions">
<button id="tgTestBtn" style="margin-right:auto" data-i18n="tgTest">Test</button>
<button id="settingsCancelBtn" data-i18n="cancel">Cancel</button>
<button id="settingsSaveBtn" class="primary" data-i18n="save">Save</button>
</div>
</div>
</div>
<script>window.API_BASE=''</script>
<script src="app.js?v=0.2.1"></script>
</body>
</html>