Skip to content

Commit a2623f7

Browse files
committed
v1.04b
1 parent 4dbf319 commit a2623f7

8 files changed

+146
-88
lines changed

res_html/1Ptug8zYS_SKggPNyC0ITw.woff2

20 KB
Binary file not shown.
16.9 KB
Binary file not shown.

res_html/google-fonts-raleway.css

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* latin-ext */
2+
@font-face {
3+
font-family: 'Raleway';
4+
font-style: normal;
5+
font-weight: 400;
6+
src: local('Raleway'), local('Raleway-Regular'), url(/1Ptug8zYS_SKggPNyCMIT5lu.woff2) format('woff2');
7+
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
8+
}
9+
/* latin */
10+
@font-face {
11+
font-family: 'Raleway';
12+
font-style: normal;
13+
font-weight: 400;
14+
src: local('Raleway'), local('Raleway-Regular'), url(/1Ptug8zYS_SKggPNyC0ITw.woff2) format('woff2');
15+
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
16+
}

res_html/index.html

+85-88
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77

88
<link rel="stylesheet" href="jquery.mobile-1.4.2.css" />
9-
<!--<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css" />
10-
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css" />
11-
<link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/demo/demo.css" /> -->
129
<link rel="stylesheet" href="w3.css">
13-
<!--<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> -->
10+
<link rel="stylesheet" href="google-fonts-raleway.css">
1411
<link rel="stylesheeet" href="fajs.min.css">
1512
<script src="fontawesome-all.min.js"></script>
1613
<script src="jquery-1.9.1.js"></script>
17-
<!--<script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script> -->
14+
1815
<script type="text/javascript" src="qwebchannel.js"></script>
1916
<script type="text/javascript" src="core.js"></script>
2017
<script type="text/javascript" src="sockets.js"></script>
@@ -39,11 +36,11 @@
3936
socket.onopen = function() {
4037
window.channel = new QWebChannel(socket, function(channel) {
4138
//connect to the changed signal of a property
42-
console.log("connected to " + window.channel);
39+
console.log("connected to " + window.channel);
4340
44-
channel.objects.clientInteraction.requireLogin.connect(function() {
45-
$('#loginDialog').show();
46-
});
41+
channel.objects.clientInteraction.requireLogin.connect(function() {
42+
$('#loginDialog').show();
43+
});
4744
});
4845
}
4946
}
@@ -108,42 +105,42 @@ <h1><b><i class="fa fa-dashboard"></i> <span id="dashboard_site_name"></span></b
108105
<div class="w3-row-padding w3-margin-bottom" >
109106
<div class="w3-quarter">
110107
<div class="w3-container w3-red w3-padding-16">
111-
<div class="w3-left"><i class="fa fa-comment w3-xxxlarge"></i></div>
112-
<div class="w3-right">
113-
<h3><span class="dashboard_comment_count"></span></h3>
114-
</div>
115-
<div class="w3-clear"></div>
108+
<div class="w3-left"><i class="fa fa-comment w3-xxxlarge"></i></div>
109+
<div class="w3-right">
110+
<h3><span id="dashboard_comment_count"></span></h3>
111+
</div>
112+
<div class="w3-clear"></div>
116113
<h4>Comments</h4>
117114
</div>
118115
</div>
119116
<div class="w3-quarter">
120117
<div class="w3-container w3-blue w3-padding-16">
121-
<div class="w3-left"><i class="fa fa-eye w3-xxxlarge"></i></div>
122-
<div class="w3-right">
123-
<h3>99</h3>
124-
</div>
125-
<div class="w3-clear"></div>
118+
<div class="w3-left"><i class="fa fa-eye w3-xxxlarge"></i></div>
119+
<div class="w3-right">
120+
<h3>99</h3>
121+
</div>
122+
<div class="w3-clear"></div>
126123
<h4>Posts</h4>
127124
</div>
128125
</div>
129126
<div class="w3-quarter">
130127
<div class="w3-container w3-teal w3-padding-16">
131-
<div class="w3-left"><i class="fa fa-share-alt w3-xxxlarge"></i></div>
132-
<div class="w3-right">
133-
<h3>23</h3>
134-
</div>
135-
<div class="w3-clear"></div>
128+
<div class="w3-left"><i class="fa fa-share-alt w3-xxxlarge"></i></div>
129+
<div class="w3-right">
130+
<h3>23</h3>
131+
</div>
132+
<div class="w3-clear"></div>
136133
<h4>Pages</h4>
137134
</div>
138135
</div>
139136
<div class="w3-quarter">
140137
<div class="w3-container w3-orange w3-text-white w3-padding-16">
141-
<div class="w3-left"><i class="fa fa-users w3-xxxlarge"></i></div>
142-
<div class="w3-right">
143-
<h3>50</h3>
144-
</div>
145-
<div class="w3-clear"></div>
146-
<h4>Users</h4>
138+
<div class="w3-left"><i class="fa fa-users w3-xxxlarge"></i></div>
139+
<div class="w3-right">
140+
<h3>50</h3>
141+
</div>
142+
<div class="w3-clear"></div>
143+
<h4>Users</h4>
147144
</div>
148145
</div>
149146
</div>
@@ -152,14 +149,14 @@ <h4>Users</h4>
152149
<div class="w3-row-padding" style="margin:0 -16px">
153150
<div class="w3-card-2" id="submodule-container">
154151
<h5>Additional Wordpress Tools</h5>
155-
<table class="w3-table w3-white w3-animate-opacity" id="submodule_selector" >
156-
<tr w3-repeat="submodules" class="w3-animate-left w3-hover-lightgray"><td><a href="javascript: set_submodule('{{name}}');" class="w3-button w3-padding-2"><i class="fas fa-project-diagram"></i>&nbsp;&nbsp;&nbsp;<span class="w3-large"> {{name}}</span></a></td><td><span class="w3-label">{{description}}</span></td></tr>
152+
<table class="w3-table w3-white w3-animate-opacity" id="submodule_selector" >
153+
<tr w3-repeat="submodules" class="w3-animate-left w3-hover-lightgray"><td><a href="javascript: set_submodule('{{name}}');" class="w3-button w3-padding-2"><i class="fas fa-project-diagram"></i>&nbsp;&nbsp;&nbsp;<span class="w3-large"> {{name}}</span></a></td><td><span class="w3-label">{{description}}</span></td></tr>
157154
</table>
158155
</div>
159156
<div class="w3-card-2 w3-animate-left" id="command-container">
160-
<h4><a class="w3-button" href="javascript: display_all_submodules()" ><span id="submodule_name">Previous Menu</span></a></h4>
161-
<table class="w3-table w3-striped w3-white w3-animate-left" id="command_selector" >
162-
<tr w3-repeat="commands" class="w3-animate-left"><td><a href="javascript: set_command('{{name}}');" class="w3-button w3-padding-2"><i class="fa fa-toolbox"></i>&nbsp; {{name}}</a></td><td>{{description}}</td></tr>
157+
<h4><a class="w3-button" href="javascript: display_all_submodules()" ><span id="submodule_name">Previous Menu</span></a></h4>
158+
<table class="w3-table w3-striped w3-white w3-animate-left" id="command_selector" >
159+
<tr w3-repeat="commands" class="w3-animate-left"><td><a href="javascript: set_command('{{name}}');" class="w3-button w3-padding-2"><i class="fa fa-toolbox"></i>&nbsp; {{name}}</a></td><td>{{description}}</td></tr>
163160
</table>
164161

165162
</div>
@@ -198,28 +195,28 @@ <h5>General Stats</h5>
198195
<h5>Countries</h5>
199196
<table class="w3-table w3-striped w3-bordered w3-border w3-hoverable w3-white">
200197
<tr>
201-
<td>United States</td>
202-
<td>65%</td>
198+
<td>United States</td>
199+
<td>65%</td>
203200
</tr>
204201
<tr>
205-
<td>UK</td>
206-
<td>15.7%</td>
202+
<td>UK</td>
203+
<td>15.7%</td>
207204
</tr>
208205
<tr>
209-
<td>Russia</td>
210-
<td>5.6%</td>
206+
<td>Russia</td>
207+
<td>5.6%</td>
211208
</tr>
212209
<tr>
213-
<td>Spain</td>
214-
<td>2.1%</td>
210+
<td>Spain</td>
211+
<td>2.1%</td>
215212
</tr>
216213
<tr>
217-
<td>India</td>
218-
<td>1.9%</td>
214+
<td>India</td>
215+
<td>1.9%</td>
219216
</tr>
220217
<tr>
221-
<td>France</td>
222-
<td>1.5%</td>
218+
<td>France</td>
219+
<td>1.5%</td>
223220
</tr>
224221
</table><br>
225222
<button class="w3-button w3-dark-grey">More Countries &nbsp;<i class="fa fa-arrow-right"></i></button>
@@ -229,16 +226,16 @@ <h5>Countries</h5>
229226
<h5>Recent Users</h5>
230227
<ul class="w3-ul w3-card-4 w3-white">
231228
<li class="w3-padding-16">
232-
<img src="/w3images/avatar2.png" class="w3-left w3-circle w3-margin-right" style="width:35px">
233-
<span class="w3-xlarge">Mike</span><br>
229+
<img src="/w3images/avatar2.png" class="w3-left w3-circle w3-margin-right" style="width:35px">
230+
<span class="w3-xlarge">Mike</span><br>
234231
</li>
235232
<li class="w3-padding-16">
236-
<img src="/w3images/avatar5.png" class="w3-left w3-circle w3-margin-right" style="width:35px">
237-
<span class="w3-xlarge">Jill</span><br>
233+
<img src="/w3images/avatar5.png" class="w3-left w3-circle w3-margin-right" style="width:35px">
234+
<span class="w3-xlarge">Jill</span><br>
238235
</li>
239236
<li class="w3-padding-16">
240-
<img src="/w3images/avatar6.png" class="w3-left w3-circle w3-margin-right" style="width:35px">
241-
<span class="w3-xlarge">Jane</span><br>
237+
<img src="/w3images/avatar6.png" class="w3-left w3-circle w3-margin-right" style="width:35px">
238+
<span class="w3-xlarge">Jane</span><br>
242239
</li>
243240
</ul>
244241
</div>
@@ -248,45 +245,45 @@ <h5>Recent Users</h5>
248245
<h5>Recent Comments</h5>
249246
<div class="w3-row">
250247
<div class="w3-col m2 text-center">
251-
<img class="w3-circle" src="/w3images/avatar3.png" style="width:96px;height:96px">
248+
<img class="w3-circle" src="/w3images/avatar3.png" style="width:96px;height:96px">
252249
</div>
253250
<div class="w3-col m10 w3-container">
254-
<h4>John <span class="w3-opacity w3-medium">Sep 29, 2014, 9:12 PM</span></h4>
255-
<p>Keep up the GREAT work! I am cheering for you!! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br>
251+
<h4>John <span class="w3-opacity w3-medium">Sep 29, 2014, 9:12 PM</span></h4>
252+
<p>Keep up the GREAT work! I am cheering for you!! Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br>
256253
</div>
257254
</div>
258255

259256
<div class="w3-row">
260257
<div class="w3-col m2 text-center">
261-
<img class="w3-circle" src="/w3images/avatar1.png" style="width:96px;height:96px">
258+
<img class="w3-circle" src="/w3images/avatar1.png" style="width:96px;height:96px">
262259
</div>
263260
<div class="w3-col m10 w3-container">
264-
<h4>Bo <span class="w3-opacity w3-medium">Sep 28, 2014, 10:15 PM</span></h4>
265-
<p>Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br>
261+
<h4>Bo <span class="w3-opacity w3-medium">Sep 28, 2014, 10:15 PM</span></h4>
262+
<p>Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p><br>
266263
</div>
267264
</div>
268265
</div>
269266
<br>
270267
<div class="w3-container w3-dark-grey w3-padding-32">
271268
<div class="w3-row">
272269
<div class="w3-container w3-third">
273-
<h5 class="w3-bottombar w3-border-green">Demographic</h5>
274-
<p>Language</p>
275-
<p>Country</p>
276-
<p>City</p>
270+
<h5 class="w3-bottombar w3-border-green">Demographic</h5>
271+
<p>Language</p>
272+
<p>Country</p>
273+
<p>City</p>
277274
</div>
278275
<div class="w3-container w3-third">
279-
<h5 class="w3-bottombar w3-border-red">System</h5>
280-
<p>Browser</p>
281-
<p>OS</p>
282-
<p>More</p>
276+
<h5 class="w3-bottombar w3-border-red">System</h5>
277+
<p>Browser</p>
278+
<p>OS</p>
279+
<p>More</p>
283280
</div>
284281
<div class="w3-container w3-third">
285-
<h5 class="w3-bottombar w3-border-orange">Target</h5>
286-
<p>Users</p>
287-
<p>Active</p>
288-
<p>Geo</p>
289-
<p>Interests</p>
282+
<h5 class="w3-bottombar w3-border-orange">Target</h5>
283+
<p>Users</p>
284+
<p>Active</p>
285+
<p>Geo</p>
286+
<p>Interests</p>
290287
</div>
291288
</div>
292289
</div>
@@ -309,26 +306,26 @@ <h4>FOOTER</h4>
309306
<div class="w3-modal-content w3-card-4 w3-animate-zoom" style="max-width:600px">
310307

311308
<div class="w3-center"><br>
312-
<span onclick="document.getElementById('loginDialog').style.display='none'" class="w3-button w3-xlarge w3-transparent w3-display-topright" title="Close Modal">×</span>
313-
<img src="img_avatar4.png" alt="Avatar" style="width:30%" class="w3-circle w3-margin-top">
309+
<span onclick="document.getElementById('loginDialog').style.display='none'" class="w3-button w3-xlarge w3-transparent w3-display-topright" title="Close Modal">?</span>
310+
<img src="img_avatar4.png" alt="Avatar" style="width:30%" class="w3-circle w3-margin-top">
314311
</div>
315312

316313
<form id="loginForm" class="w3-container" action="javascript:void(0)">
317-
<div class="w3-section">
318-
<label><b>Username</b></label>
319-
<input class="w3-input w3-border w3-margin-bottom" type="text" placeholder="Enter Username" name="login" id="loginname" required>
320-
<label><b>Password</b></label>
321-
<input class="w3-input w3-border" type="password" placeholder="Enter Password" name="password" id="loginpassword" required>
322-
<div style="text-align:center;padding:5px" id="loginError">
323-
324-
</div>
314+
<div class="w3-section">
315+
<label><b>Username</b></label>
316+
<input class="w3-input w3-border w3-margin-bottom" type="text" placeholder="Enter Username" name="login" id="loginname" required>
317+
<label><b>Password</b></label>
318+
<input class="w3-input w3-border" type="password" placeholder="Enter Password" name="password" id="loginpassword" required>
319+
<div style="text-align:center;padding:5px" id="loginError">
320+
321+
</div>
325322
<button class="w3-button w3-block w3-green w3-section w3-padding" type="submit">Login</button>
326-
<input class="w3-check w3-margin-top" type="checkbox" checked="checked"> Remember me
327-
</div>
323+
<input class="w3-check w3-margin-top" type="checkbox" checked="checked"> Remember me
324+
</div>
328325
</form>
329326
<div class="w3-container w3-border-top w3-padding-16 w3-light-grey">
330-
<button onclick="document.getElementById('loginDialog').style.display='none'" type="button" class="w3-button w3-red">Cancel</button>
331-
<span class="w3-right w3-padding w3-hide-small">Forgot <a href="#">password?</a></span>
327+
<button onclick="document.getElementById('loginDialog').style.display='none'" type="button" class="w3-button w3-red">Cancel</button>
328+
<span class="w3-right w3-padding w3-hide-small">Forgot <a href="#">password?</a></span>
332329
</div>
333330

334331
</div>
@@ -341,7 +338,7 @@ <h4>FOOTER</h4>
341338
<div class="w3-modal-content w3-card-4 w3-animate-zoom" style="max-width:600px">
342339

343340
<div class="w3-center"><br>
344-
<span onclick="document.getElementById('siteDialog').style.display='none'" class="w3-button w3-xlarge w3-transparent w3-display-topright" title="Close Modal">×</span>
341+
<span onclick="document.getElementById('siteDialog').style.display='none'" class="w3-button w3-xlarge w3-transparent w3-display-topright" title="Close Modal">?</span>
345342
<img src="img_avatar4.png" alt="Avatar" style="width:30%" class="w3-circle w3-margin-top">
346343
</div>
347344

@@ -373,7 +370,7 @@ <h4>FOOTER</h4>
373370
<div class="w3-modal-content w3-card-4 w3-animate-zoom" style="max-width:600px">
374371

375372
<div class="w3-center"><br>
376-
<span onclick="document.getElementById('resultDialog').style.display='none'" class="w3-button w3-xlarge w3-transparent w3-display-topright" title="Close Modal">×</span>
373+
<span onclick="document.getElementById('resultDialog').style.display='none'" class="w3-button w3-xlarge w3-transparent w3-display-topright" title="Close Modal">?</span>
377374
<img src="img_avatar4.png" alt="Avatar" style="width:30%" class="w3-circle w3-margin-top">
378375
</div>
379376

res_html/main.js

+9
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ function open_site_dashboard(i_site) {
147147
});
148148
document.querySelector("#no_site_selected_message").style.display = 'none'
149149
document.querySelector("#main_dashboard").style.display = 'block';
150+
console.log(get_comment_data());
150151
/* perform site dashboard load */
151152
} // clang-format on
152153

@@ -165,4 +166,12 @@ function executeCommand() {
165166
}
166167
channel.objects.clientInteraction.execute(function(args) { console.log(args); $("#resultBox").html(args); $("#resultDialog").show(); });
167168

169+
}
170+
function get_comment_data() {
171+
var commentCount = 0;
172+
173+
channel.objects.clientInteraction.get_comments(function(args) { console.log(args); var obj = JSON.parse(args); document.querySelector("#dashboard_comment_count").innerHTML = obj.length; });
174+
175+
176+
168177
}

resources.qrc

+3
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,8 @@
1818
<file>res_defaults/cert.pem</file>
1919
<file>res_defaults/key.pem</file>
2020
<file>res_defaults/wpdaemon.conf</file>
21+
<file>res_html/1Ptug8zYS_SKggPNyC0ITw.woff2</file>
22+
<file>res_html/1Ptug8zYS_SKggPNyCMIT5lu.woff2</file>
23+
<file>res_html/google-fonts-raleway.css</file>
2124
</qresource>
2225
</RCC>

src_interfaces/clientinteraction.cpp

+31
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,22 @@ QVariant ClientInteraction::execute()
262262
//return QVariant::fromValue(rv);
263263
}
264264

265+
QVariant ClientInteraction::execute(Submodule *i_submodule)
266+
{
267+
QString rv;
268+
if (i_submodule != nullptr) {
269+
rv.append(i_submodule->toString());
270+
}
271+
if (websiteController->currentWebsite == "./tmp") { return QVariant::fromValue(QString("Error. please select a website to execute command for")); }
272+
this->processLauncher = new ProcessLauncherThread("wp", (QStringList() << rv.split(" ", QString::SkipEmptyParts)), "internal");
273+
QByteArray output;
274+
output.append(processLauncher->run_internal_script("wp", (QStringList() << QString("--path=%1").arg(websiteController->currentWebsite) << rv.split(" ", QString::SkipEmptyParts))));
275+
276+
qDebug() << output;
277+
return QVariant::fromValue(output);
278+
279+
}
280+
265281
QVariant ClientInteraction::add_site(QString i_name, QString i_path)
266282
{
267283
if (loginController->loggedIn == true) {
@@ -340,3 +356,18 @@ bool ClientInteraction::set_current_site(QString sitename)
340356
}
341357
return false;
342358
}
359+
360+
QVariant ClientInteraction::get_comments()
361+
{
362+
QVariant rv;
363+
if (websiteController->currentWebsite != "./tmp") {
364+
Submodule* new_module;
365+
new_module = new Submodule(this);
366+
new_module->moduleName = "comment list --format=json";
367+
new_module->add_command("list", "", "");
368+
new_module->set_current_command("list");
369+
rv = execute(new_module);
370+
qDebug() << rv;
371+
}
372+
return rv;
373+
}

0 commit comments

Comments
 (0)