secubox-openwrt/package/secubox/luci-app-hexojs/htdocs/luci-static/resources/view/hexojs/preview.js
CyberMind-FR a4970edc6f feat(hexojs): Add Hexo CMS packages for OpenWrt
- secubox-app-hexojs: LXC-containerized Hexo service with Node.js
  - hexoctl control script for container/site management
  - Bundled CyberMind theme with dark/light mode
  - Theme presets (minimal, tech, portfolio)
  - Post/page scaffolds

- luci-app-hexojs: Full CMS dashboard
  - Overview with stats and quick actions
  - Post editor with Markdown toolbar and preview
  - Media library browser
  - Categories and tags management
  - Apps portfolio for CyberMind theme
  - Build and deploy to GitHub Pages
  - GitHub Sync wizard (clone, pull, push)
  - Theme configuration and presets
  - Site settings

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 18:58:57 +01:00

57 lines
1.4 KiB
JavaScript

'use strict';
'require view';
'require ui';
'require hexojs/api as api';
return view.extend({
title: _('Preview'),
load: function() {
return api.previewStatus();
},
render: function(data) {
var running = data.running;
var url = data.url;
var port = data.port || 4000;
return E('div', { 'class': 'hexo-dashboard' }, [
E('link', { 'rel': 'stylesheet', 'href': L.resource('hexojs/dashboard.css') }),
// Header
E('div', { 'class': 'hexo-header' }, [
E('div', { 'class': 'hexo-card-title' }, [
E('span', { 'class': 'hexo-card-title-icon' }, '\uD83D\uDC41'),
_('Site Preview')
]),
running ? E('a', {
'class': 'hexo-btn hexo-btn-primary',
'href': url,
'target': '_blank'
}, ['\uD83D\uDD17 ', _('Open in New Tab')]) : ''
]),
// Preview
E('div', { 'class': 'hexo-card' }, [
running ? E('div', {}, [
E('p', { 'style': 'margin-bottom: 16px; color: var(--hexo-text-muted);' },
_('Preview server running at: ') + url),
E('iframe', {
'class': 'hexo-preview-frame',
'src': url
})
]) : E('div', { 'class': 'hexo-empty' }, [
E('div', { 'class': 'hexo-empty-icon' }, '\uD83D\uDC41'),
E('p', {}, _('Preview server not running.')),
E('p', { 'style': 'font-size: 14px; color: var(--hexo-text-muted);' },
_('Start the Hexo service to enable preview.'))
])
])
]);
},
handleSaveApply: null,
handleSave: null,
handleReset: null
});